]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10143 only slapd should use the logfile
authorHoward Chu <hyc@openldap.org>
Mon, 11 Dec 2023 17:56:51 +0000 (17:56 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 16 Jan 2024 19:19:24 +0000 (19:19 +0000)
doc/man/man5/slapd-config.5
doc/man/man5/slapd.conf.5
servers/slapd/logging.c

index dd105db32f7fc060b0e048f4ed152767b3bb4ccb..c1fa9c4eb10d496599658dd0775b6183ed66f232 100644 (file)
@@ -564,12 +564,13 @@ see
 option description.  The default is 71.
 .TP
 .B olcLogFile: <filename>
-Specify a file for recording slapd debug messages. By default these messages
-only go to stderr, are not recorded anywhere else, and are unrelated to
-messages exposed by the
+Specify a file for recording slapd debug messages. These messages are
+unrelated to messages exposed by the
 .B olcLogLevel
-configuration parameter. Specifying a logfile copies messages to both stderr
-and the logfile.
+configuration parameter. This setting only affects the slapd daemon and has
+no effect on the command line tools. By default these messages
+only go to stderr and are not recorded anywhere else.
+Specifying a logfile copies messages to both stderr and the logfile.
 .TP
 .B olcLogFileFormat: debug | syslog-utc | syslog-localtime
 Specify the prefix format for messages written to the logfile. The debug
index c7344b234e61001cb3c28096da228a0334dff774..36622d5b67050e43ae81feb96a804bdacb5ce502 100644 (file)
@@ -618,12 +618,13 @@ see
 option description.  The default is 71.
 .TP
 .B logfile <filename>
-Specify a file for recording slapd debug messages. By default these messages
-only go to stderr, are not recorded anywhere else, and are unrelated to
-messages exposed by the
+Specify a file for recording slapd debug messages. These messages are
+unrelated to messages exposed by the
 .B loglevel
-configuration parameter. Specifying a logfile copies messages to both stderr
-and the logfile.
+configuration parameter. This setting only affects the slapd daemon and has
+no effect on the command line tools. By default these messages
+only go to stderr and are not recorded anywhere else.
+Specifying a logfile copies messages to both stderr and the logfile.
 .TP
 .B logfile-format debug | syslog-utc | syslog-localtime
 Specify the prefix format for messages written to the logfile. The debug
index 7dc33bde3fc24993809ae973d614057dccd637c6..95f7ff2500233d2b31097448181d486db56787c2 100644 (file)
@@ -201,6 +201,10 @@ logfile_open( const char *path )
        struct stat st;
        int fd, saved_errno;
 
+       /* the logfile is for slapd only, not tools */
+       if ( !( slapMode & SLAP_SERVER_MODE ))
+               return 0;
+
        fd = open( path, O_CREAT|O_WRONLY, 0640 );
        if ( fd < 0 ) {
                saved_errno = errno;