getlogin caching and setlogin issues
Brooks Davis
brooks at freebsd.org
Tue Apr 3 17:07:23 UTC 2018
[Ali found this issue while looking at pulling syscalls out of libc.]
getlogin() is a wrapper around _getlogin() which caches the value
returned and sets a and internal _logname_valid flag. Some
implementations of setlogin() clear that flag on return, the arm, mips,
and riscv ones use the default assembly and do not. This leaves me two
questions:
1) Does this cache make sense? Sure login rarely changes, but is
getlogin called frequently in real software?
2) If the cache makes sense, does clearing the cache belong in
__sys_setlogin() or should it be done in a C wrapper in setlogin() or
_setlogin()? I think it should likely be pulled up to _setlogin().
3) If yes to 1 and no to 2, do we need to fix arm, mips, and riscv?
-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20180403/2d20cbc5/attachment.sig>
More information about the freebsd-hackers
mailing list