diff options
author | Andreas Schneider <asn@samba.org> | 2011-03-28 14:30:29 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-03-29 16:03:52 +0200 |
commit | 80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163 (patch) | |
tree | 0d61921f0f5190ab87e601bdb17a7585c514a47f /source3/printing | |
parent | a956c57cf939d0a4cdd5793b129e1fa87e63fffd (diff) | |
download | samba-80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163.tar.gz samba-80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163.tar.xz samba-80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163.zip |
s3-spoolssd: Fixed logfile creation.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/spoolssd.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/printing/spoolssd.c b/source3/printing/spoolssd.c index 6f55f0cdbf..9ddc3b5f82 100644 --- a/source3/printing/spoolssd.c +++ b/source3/printing/spoolssd.c @@ -37,13 +37,22 @@ static void spoolss_reopen_logs(void) char *lfile = lp_logfile(); int rc; - if (strstr(lfile, DAEMON_NAME) == NULL) { - rc = asprintf(&lfile, "%s.%s", lp_logfile(), DAEMON_NAME); + if (lfile == NULL || lfile[0] == '\0') { + rc = asprintf(&lfile, "%s/log.%s", get_dyn_LOGFILEBASE(), DAEMON_NAME); if (rc > 0) { lp_set_logfile(lfile); SAFE_FREE(lfile); } + } else { + if (strstr(lfile, DAEMON_NAME) == NULL) { + rc = asprintf(&lfile, "%s.%s", lp_logfile(), DAEMON_NAME); + if (rc > 0) { + lp_set_logfile(lfile); + SAFE_FREE(lfile); + } + } } + reopen_logs(); } |