Changeset View
Changeset View
Standalone View
Standalone View
sbin/dhclient/dhclient.c
Show First 20 Lines • Show All 2,450 Lines • ▼ Show 20 Lines | go_daemon(void) | ||||
state = 1; | state = 1; | ||||
/* Stop logging to stderr... */ | /* Stop logging to stderr... */ | ||||
log_perror = 0; | log_perror = 0; | ||||
if (daemonfd(-1, nullfd) == -1) | if (daemonfd(-1, nullfd) == -1) | ||||
error("daemon"); | error("daemon"); | ||||
cap_close_stdio(capsyslog); | |||||
oshogbo: I was thinking that syslog need to have those descriptors to log stuf. | |||||
jahAuthorUnsubmitted Done Inline ActionsOnly if LOG_PERROR is passed to openlog(). So it was never really an issue for dhclient, which doesn't use LOG_PERROR. jah: Only if LOG_PERROR is passed to openlog(). So it was never really an issue for dhclient… | |||||
oshogboUnsubmitted Not Done Inline ActionsSo maybe close the descriptors in the service if the LOG_PERROR is not passed? oshogbo: So maybe close the descriptors in the service if the LOG_PERROR is not passed? | |||||
jahAuthorUnsubmitted Done Inline ActionsThat would work here, but it would break other possible use cases:
jah: That would work here, but it would break other possible use cases:
1) any process that first… | |||||
cap_rights_init(&rights); | cap_rights_init(&rights); | ||||
if (pidfile != NULL) { | if (pidfile != NULL) { | ||||
pidfile_write(pidfile); | pidfile_write(pidfile); | ||||
if (caph_rights_limit(pidfile_fileno(pidfile), &rights) < 0) | if (caph_rights_limit(pidfile_fileno(pidfile), &rights) < 0) | ||||
error("can't limit pidfile descriptor: %m"); | error("can't limit pidfile descriptor: %m"); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 373 Lines • Show Last 20 Lines |
I was thinking that syslog need to have those descriptors to log stuf.