mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
#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.
This commit is contained in:
parent
8c696321eb
commit
eac0939ddd
4 changed files with 18 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue