summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2012-03-29 11:15:45 (GMT)
committerR David Murray <rdmurray@bitdance.com>2012-03-29 11:15:45 (GMT)
commiteac0939ddd56f60664de9cb85aa32910d7b22c78 (patch)
treece4e4ac1e2c1924b7174f732bfc3d5d1e56566fd /Modules
parent8c696321eb44f84134bf9e60e5c0bf49bc793dde (diff)
downloadcpython-eac0939ddd56f60664de9cb85aa32910d7b22c78.zip
cpython-eac0939ddd56f60664de9cb85aa32910d7b22c78.tar.gz
cpython-eac0939ddd56f60664de9cb85aa32910d7b22c78.tar.bz2
#14416: conditionally add LOG_AUTHPRIV facility and LOG_ODELAY to syslog.
Unlike the other facilities, we don't use a fallback for AUTHPRIV if it doesn't exist. Because it is intended for logging sensitive log messages, it is better that a program trying to log such messages fail than that it log them insecurely. Initial patch by Federico Reghenzani.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/syslogmodule.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/syslogmodule.c b/Modules/syslogmodule.c
index c7a2487..8b877cf 100644
--- a/Modules/syslogmodule.c
+++ b/Modules/syslogmodule.c
@@ -291,6 +291,9 @@ PyInit_syslog(void)
PyModule_AddIntConstant(m, "LOG_PID", LOG_PID);
PyModule_AddIntConstant(m, "LOG_CONS", LOG_CONS);
PyModule_AddIntConstant(m, "LOG_NDELAY", LOG_NDELAY);
+#ifdef LOG_ODELAY
+ PyModule_AddIntConstant(m, "LOG_ODELAY", LOG_ODELAY);
+#endif
#ifdef LOG_NOWAIT
PyModule_AddIntConstant(m, "LOG_NOWAIT", LOG_NOWAIT);
#endif
@@ -331,5 +334,10 @@ PyInit_syslog(void)
PyModule_AddIntConstant(m, "LOG_CRON", LOG_CRON);
PyModule_AddIntConstant(m, "LOG_UUCP", LOG_UUCP);
PyModule_AddIntConstant(m, "LOG_NEWS", LOG_NEWS);
+
+#ifdef LOG_AUTHPRIV
+ PyModule_AddIntConstant(m, "LOG_AUTHPRIV", LOG_AUTHPRIV);
+#endif
+
return m;
}