X-Git-Url: http://www.dolda2000.com/gitweb/?a=blobdiff_plain;f=src%2Faccesslog.c;h=3a978e052fed76b6e5be8b4d010e611034d7e422;hb=e9817feefe4f2ed35ded74f0ec2323ed3d0c09e4;hp=5aa25743964af97bb4d462af00ed405f05115ce3;hpb=e51483a1b5ecc3b5e486f1d951d044d5bd34bce7;p=ashd.git diff --git a/src/accesslog.c b/src/accesslog.c index 5aa2574..3a978e0 100644 --- a/src/accesslog.c +++ b/src/accesslog.c @@ -255,6 +255,7 @@ static void reopenlog(void) flog(LOG_WARNING, "accesslog: could not reopen log file `%s' on SIGHUP: %s", outname, strerror(errno)); return; } + fcntl(fileno(new), F_SETFD, FD_CLOEXEC); if(locklog) { if(lockfile(new)) { if((errno == EAGAIN) || (errno == EACCES)) { @@ -326,11 +327,13 @@ int main(int argc, char **argv) outname = argv[optind]; if(outname == NULL) { out = stdout; + locklog = 0; } else { if((out = fopen(argv[optind], "a")) == NULL) { flog(LOG_ERR, "accesslog: could not open %s for logging: %s", argv[optind], strerror(errno)); exit(1); } + fcntl(fileno(out), F_SETFD, FD_CLOEXEC); } if(locklog) { if(lockfile(out)) {