|
Lines 179-186
static void drop_privs(void)
Link Here
|
| 179 |
struct stat st; |
179 |
struct stat st; |
| 180 |
|
180 |
|
| 181 |
if (stat(SM_DIR, &st) == -1 && |
181 |
if (stat(SM_DIR, &st) == -1 && |
| 182 |
stat(DIR_BASE, &st) == -1) |
182 |
stat(DIR_BASE, &st) == -1) { |
| 183 |
st.st_uid = 0; |
183 |
st.st_uid = 0; |
|
|
184 |
st.st_gid = 0; |
| 185 |
} |
| 184 |
|
186 |
|
| 185 |
if (st.st_uid == 0) { |
187 |
if (st.st_uid == 0) { |
| 186 |
note(N_WARNING, "statd running as root. chown %s to choose different user\n", |
188 |
note(N_WARNING, "statd running as root. chown %s to choose different user\n", |
|
Lines 399-404
int main (int argc, char **argv)
Link Here
|
| 399 |
signal (SIGTERM, killer); |
401 |
signal (SIGTERM, killer); |
| 400 |
/* WARNING: the following works on Linux and SysV, but not BSD! */ |
402 |
/* WARNING: the following works on Linux and SysV, but not BSD! */ |
| 401 |
signal(SIGCHLD, SIG_IGN); |
403 |
signal(SIGCHLD, SIG_IGN); |
|
|
404 |
/* |
| 405 |
* Ignore SIGPIPE to avoid statd dying when peers close their |
| 406 |
* TCP connection while we're trying to reply to them. |
| 407 |
*/ |
| 408 |
signal(SIGPIPE, SIG_IGN); |
| 402 |
|
409 |
|
| 403 |
/* initialize out_port */ |
410 |
/* initialize out_port */ |
| 404 |
statd_get_socket(out_port); |
411 |
statd_get_socket(out_port); |