Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed perms on rsyncd log file
[rsync/rsync.git]
/
log.c
diff --git
a/log.c
b/log.c
index
d09094c
..
c494805
100644
(file)
--- a/
log.c
+++ b/
log.c
@@
-69,9
+69,18
@@
void log_open(void)
if (initialised) return;
initialised = 1;
if (initialised) return;
initialised = 1;
+ /* this looks pointless, but it is needed in order for the
+ C library on some systems to fetch the timezone info
+ before the chroot */
+ t = time(NULL);
+ localtime(&t);
+
+ /* optionally use a log file instead of syslog */
logf = lp_log_file();
if (logf && *logf) {
logf = lp_log_file();
if (logf && *logf) {
+ int old_umask = umask(077);
logfile = fopen(logf, "a");
logfile = fopen(logf, "a");
+ umask(old_umask);
return;
}
return;
}
@@
-88,12
+97,6
@@
void log_open(void)
#ifndef LOG_NDELAY
logit(LOG_INFO,"rsyncd started\n");
#endif
#ifndef LOG_NDELAY
logit(LOG_INFO,"rsyncd started\n");
#endif
-
- /* this looks pointless, but it is needed in order for the
- C library on some systems to fetch the timezone info
- before the chroot */
- t = time(NULL);
- localtime(&t);
}
}