Lines 34-40
Link Here
|
34 |
* xload - display system load average in a window |
34 |
* xload - display system load average in a window |
35 |
*/ |
35 |
*/ |
36 |
|
36 |
|
37 |
|
37 |
#include <errno.h> |
38 |
#include <stdio.h> |
38 |
#include <stdio.h> |
39 |
#include <stdlib.h> |
39 |
#include <stdlib.h> |
40 |
#include <unistd.h> |
40 |
#include <unistd.h> |
Lines 162-169
Link Here
|
162 |
/* For security reasons, we reset our uid/gid after doing the necessary |
162 |
/* For security reasons, we reset our uid/gid after doing the necessary |
163 |
system initialization and before calling any X routines. */ |
163 |
system initialization and before calling any X routines. */ |
164 |
InitLoadPoint(); |
164 |
InitLoadPoint(); |
165 |
setgid(getgid()); /* reset gid first while still (maybe) root */ |
165 |
/* reset gid first while still (maybe) root */ |
166 |
setuid(getuid()); |
166 |
if (setgid(getgid()) == -1) { |
|
|
167 |
fprintf(stderr, "%s: setgid failed: %s\n", |
168 |
ProgramName, strerror(errno)); |
169 |
exit(1); |
170 |
} |
171 |
if (setuid(getuid()) == -1) { |
172 |
fprintf(stderr, "%s: setuid failed: %s\n", |
173 |
ProgramName, strerror(errno)); |
174 |
exit(1); |
175 |
} |
167 |
|
176 |
|
168 |
XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); |
177 |
XtSetLanguageProc(NULL, (XtLanguageProc) NULL, NULL); |
169 |
|
178 |
|