]> git.ipfire.org Git - thirdparty/glibc.git/commit
getlogin_r: return early when linux sentinel value is set
authorJesse Hathaway <jesse@mbuki-mvuki.org>
Thu, 17 May 2018 11:56:33 +0000 (13:56 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 17 May 2018 11:56:33 +0000 (13:56 +0200)
commit1f7c4748d611445065f911ced519b7fb49f82ad5
tree0512fd94085f3626af5a0834b12c3e8f7ab3ba17
parent7e7a5f0bcd28c6fc5285474f05080ac6ed5e55b9
getlogin_r: return early when linux sentinel value is set

When there is no login uid Linux sets /proc/self/loginid to the sentinel
value of, (uid_t) -1. If this is set we can return early and avoid
needlessly looking up the sentinel value in any configured nss
databases.

Checked on aarch64-linux-gnu.

* sysdeps/unix/sysv/linux/getlogin_r.c (__getlogin_r_loginuid): Return
early when linux sentinel value is set.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
(cherry picked from commit cc8a1620eb97ccddd337d157263c13c57b39ab71)
ChangeLog
NEWS
sysdeps/unix/sysv/linux/getlogin_r.c