projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb84694
)
daemon reopen flag change ownership of logfile to -u uid YAZ-819
author
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 2 Feb 2015 10:19:20 +0000
(11:19 +0100)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Mon, 2 Feb 2015 10:19:20 +0000
(11:19 +0100)
src/daemon.c
patch
|
blob
|
history
diff --git
a/src/daemon.c
b/src/daemon.c
index
4448e1d
..
27e97db
100644
(file)
--- a/
src/daemon.c
+++ b/
src/daemon.c
@@
-261,6
+261,15
@@
int yaz_daemon(const char *progname,
yaz_log(YLOG_FATAL, "%s: Unknown user", uid);
exit(1);
}
+ if (flags & YAZ_DAEMON_LOG_REOPEN)
+ {
+ FILE *f = yaz_log_file();
+ if (f)
+ {
+ if (fchown(fileno(f), pw->pw_uid, -1))
+ yaz_log(YLOG_WARN|YLOG_ERRNO, "fchown logfile");
+ }
+ }
if (setuid(pw->pw_uid) < 0)
{
yaz_log(YLOG_FATAL|YLOG_ERRNO, "setuid");