Skip to content

vlogger.8: fix incorrect default -t tag documentation - #137

Open
chrisdebian wants to merge 2 commits into
void-linux:masterfrom
chrisdebian:fix/84-vlogger-tag-default
Open

vlogger.8: fix incorrect default -t tag documentation#137
chrisdebian wants to merge 2 commits into
void-linux:masterfrom
chrisdebian:fix/84-vlogger-tag-default

Conversation

@chrisdebian

Copy link
Copy Markdown

Fixes #84.

The -t tag option's man page entry claims the default tag is the LOGNAME
environment variable. That's incorrect — vlogger.c never calls getenv()
anywhere. Tracing the actual behaviour when -t isn't given:

  • if /etc/vlogger is used, the tag arg passed to it defaults to an empty
    string (tag ? tag : "")
  • if syslog(3) is used directly, the tag defaults to the result of
    getlogin(3) (tag ? tag : getlogin())

Neither is LOGNAME. Corrected the description to match.

(The -p pri option's documented default of user.notice is correct as-is —
facility = LOG_USER; level = LOG_NOTICE; are the literal initial values in
main() — so left that section untouched.)

Verified with groff -mandoc -Tascii -z (clean) and checked the rendered
output.

The -t tag option's man page entry claimed the default tag is the
LOGNAME environment variable. That's incorrect - vlogger.c never
calls getenv() anywhere. The actual default when -t isn't given:

- if /etc/vlogger is used, the tag arg passed to it defaults to an
  empty string (tag ? tag : "")
- if syslog(3) is used directly, the tag defaults to the result of
  getlogin(3) (tag ? tag : getlogin())

Neither is LOGNAME. Corrected the description to match.

The -p pri option's documented default of user.notice is correct as
written (facility = LOG_USER; level = LOG_NOTICE; are the literal
initial values in main()), so left that section untouched.
@classabbyamp

Copy link
Copy Markdown
Member

getlogin() returns the value of $LOGNAME on musl and NULL unconditionally on glibc.

classabbyamp pointed out (PR void-linux#137) that getlogin(3) returns $LOGNAME
on musl but NULL unconditionally on glibc. The previous wording
correctly traced the C code (tag ? tag : getlogin()) but didn't tell
the reader the practical outcome differs by libc — on glibc, the
default is effectively no tag at all, same as the /etc/vlogger case.

Verified with groff -mandoc -Tascii -z (clean) and checked the
rendered output.
@chrisdebian

Copy link
Copy Markdown
Author

Good catch, thanks — pushed a follow-up commit. The previous wording correctly traced the C code (tag ? tag : getlogin()) but didn't convey that the practical outcome differs by libc. Now reads:

If not given, the default is an empty string when /etc/vlogger is used. When syslog(3) is used directly, the default is the result of getlogin(3), which on glibc always returns NULL (no tag) and on musl returns the value of the LOGNAME environment variable.

Re-verified with groff -mandoc -Tascii -z (clean).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

man vlogger: incorrect documentation regarding the default tag and facility

2 participants