Skip to content

LOG_AUTH vs LOG_AUTHPRIV #1367

@alejandro-colomar

Description

@alejandro-colomar

shadow/lib/defines.h

Lines 87 to 90 in ce66b8d

/* LOG_AUTH is deprecated, use LOG_AUTHPRIV instead */
#ifndef LOG_AUTHPRIV
#define LOG_AUTHPRIV LOG_AUTH
#endif

This comment seems contrary to the definition below it. It says LOG_AUTH is deprecated, and recommends using LOG_AUTHPRIV instead, but then turns LOG_AUTHPRIV into an alias of the former, which is (supposedly) deprecated, so forces us to use the deprecated one, even where we're using the (supposedly) non-deprecated one.

Also, POSIX defines the latter, but not the former.

I suspect the comment is backwards, and that the deprecated one would be LOG_AUTHPRIV, which is not in POSIX. But I don't know.

However, glibc's source code seems to say the same thing as our source-code comment. It says that LOG_AUTH is deprecated (misc/sys/syslog.h:134). Although, there's line 124, which doesn't have the DEPRECATED comment; maybe that comment is about the "security" string?

alx@devuan:~/src/gnu/glibc/master$ grep -rn LOG_AUTH
misc/sys/syslog.h:97:#define	LOG_AUTH	(4<<3)	/* security/authorization messages */
misc/sys/syslog.h:103:#define	LOG_AUTHPRIV	(10<<3)	/* security/authorization messages (private) */
misc/sys/syslog.h:124:    { "auth", LOG_AUTH },
misc/sys/syslog.h:125:    { "authpriv", LOG_AUTHPRIV },
misc/sys/syslog.h:134:    { "security", LOG_AUTH },		/* DEPRECATED */
misc/tst-syslog.c:41:    LOG_AUTH,
misc/tst-syslog.c:47:    LOG_AUTHPRIV,
conform/data/syslog.h-data:14:constant LOG_AUTH
ChangeLog.old/ChangeLog.18:22598:	(LOG_AUTH): Remove.
manual/syslog.texi:345:@item LOG_AUTH
manual/syslog.texi:357:@item LOG_AUTHPRIV

What should we do about it?

Cc: @fweimer-rh , @ikerexxe

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions