aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2023-03-16 23:03:31 -0700
committerAndres Freund <andres@anarazel.de>2023-03-16 23:17:17 -0700
commitce29cea17fb323b67a6772e9acd1ec63e5c9a4b7 (patch)
treefbc31635770057cbbf2a3bddcf943c425d910de2
parent371e3daaa53d09f1f265865dc9bf0dbff57c46ab (diff)
downloadpostgresql-ce29cea17fb323b67a6772e9acd1ec63e5c9a4b7.tar.gz
postgresql-ce29cea17fb323b67a6772e9acd1ec63e5c9a4b7.zip
tests: Prevent syslog activity by slapd, take 2
Unfortunately it turns out that the logfile-only option added in b9f8d1cbad7 is only available in openldap starting in 2.6. Luckily the option to control the log level (loglevel/-s) have been around for much longer. As it turns out loglevel/-s only control what goes into syslog, not what ends up in the file specified with 'logfile' and stderr. While we currently are specifying 'logfile', nothing ends up in it, as the option only controls debug messages, and we didn't set a debug level. The debug level can only be configured on the commandline and also prevents forking. That'd require larger changes, so this commit doesn't tackle that issue. Specify the syslog level when starting slapd using -s, as that allows to prevent all syslog messages if one uses '0' instead of 'none', while loglevel doesn't prevent the first message. Discussion: https://postgr.es/m/20230311233708.3yjdbjkly2q4gq2j@awork3.anarazel.de Backpatch: 11-
-rw-r--r--src/test/ldap/t/001_auth.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ldap/t/001_auth.pl b/src/test/ldap/t/001_auth.pl
index f2f8f27c3a5..2a7435ed453 100644
--- a/src/test/ldap/t/001_auth.pl
+++ b/src/test/ldap/t/001_auth.pl
@@ -90,7 +90,6 @@ include $ldap_schema_dir/inetorgperson.schema
pidfile $slapd_pidfile
logfile $slapd_logfile
-logfile-only on
access to *
by * read
@@ -126,7 +125,8 @@ system_or_bail "openssl", "x509", "-req", "-in", "$slapd_certs/server.csr",
"-CA", "$slapd_certs/ca.crt", "-CAkey", "$slapd_certs/ca.key",
"-CAcreateserial", "-out", "$slapd_certs/server.crt";
-system_or_bail $slapd, '-f', $slapd_conf, '-h', "$ldap_url $ldaps_url";
+# -s0 prevents log messages ending up in syslog
+system_or_bail $slapd, '-f', $slapd_conf,'-s0', '-h', "$ldap_url $ldaps_url";
END
{