|
|
* xload - display system load average in a window | * xload - display system load average in a window |
*/ | */ |
| |
|
#include <errno.h> |
#include <stdio.h> | #include <stdio.h> |
#include <stdlib.h> | #include <stdlib.h> |
#include <unistd.h> | #include <unistd.h> |
|
|
/* For security reasons, we reset our uid/gid after doing the necessary | /* For security reasons, we reset our uid/gid after doing the necessary |
system initialization and before calling any X routines. */ | system initialization and before calling any X routines. */ |
InitLoadPoint(); | InitLoadPoint(); |
setgid(getgid()); /* reset gid first while still (maybe) root */ |
/* reset gid first while still (maybe) root */ |
setuid(getuid()); |
if (setgid(getgid()) == -1) { |
|
fprintf(stderr, "%s: setgid failed: %s\n", |
|
ProgramName, strerror(errno)); |
|
exit(1); |
|
} |
|
if (setuid(getuid()) == -1) { |
|
fprintf(stderr, "%s: setuid failed: %s\n", |
|
ProgramName, strerror(errno)); |
|
exit(1); |
|
} |
| |
XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); | XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); |
| |