Date: Tue, 3 Apr 2018 17:07:21 +0000 From: Brooks Davis <brooks@freebsd.org> To: freebsd-hackers@freebsd.org Cc: Ali Mashtizadeh <ali@mashtizadeh.com> Subject: getlogin caching and setlogin issues Message-ID: <20180403170721.GC8598@spindle.one-eyed-alien.net>
next in thread | raw e-mail | index | archive | help
--0lnxQi9hkpPO77W3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline [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 --0lnxQi9hkpPO77W3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJaw7TJAAoJEKzQXbSebgfA15QIAJnsY3P/nd+neY81bWVkAgO1 qUe02VlNXzYughKlT+nqFZ0JsztXN/BprvemrPiJ+lYZNlw3tHzNIZTFxAEDWtMK malwWwY52AphcWt/wRbJVkqSXd8VStEHc9ozql7TIIKLmQzPvfUbDiKxDmeniQMC VaVGF6NtVMsHL7j2x+aU209gbYMP8mDnh3cEn9d5tzo9ZmeGrJj5R3m5DhP6+5nw s94vorII3naIceP4//thQV9B5mZlI5ro9OX8/lPu5nfoWym5aMFHlKgswaXnjbVY UvbxUzwmXnuJKb+hEZupwvKoBi8kIDPoQal1yjmvBFKuMgRvbOz/uKErc5hOTDY= =crVp -----END PGP SIGNATURE----- --0lnxQi9hkpPO77W3--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180403170721.GC8598>