summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-03-28 14:30:29 +0200
committerGünther Deschner <gd@samba.org>2011-03-29 16:03:52 +0200
commit80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163 (patch)
tree0d61921f0f5190ab87e601bdb17a7585c514a47f /source3
parenta956c57cf939d0a4cdd5793b129e1fa87e63fffd (diff)
downloadsamba-80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163.tar.gz
samba-80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163.tar.bz2
samba-80fe8fa8d0d2ec787e4d70a3553c1d4e066f4163.zip
s3-spoolssd: Fixed logfile creation.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/spoolssd.c13
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();
}