getlogin caching and setlogin issues
Ali Mashtizadeh
mashtizadeh at gmail.com
Tue Apr 3 21:17:44 UTC 2018
In addition, I couldn't find a reason for sigreturn() to be custom assembly
in i386/amd64/arm/aarch64.
Best,
Ali
On Tue, Apr 3, 2018 at 1:07 PM, Brooks Davis <brooks at freebsd.org> wrote:
> [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
More information about the freebsd-hackers
mailing list