shadow/libmisc
Alejandro Colomar 5da8388fc6 ttytype(): Fix race
The intention of the code is just to not report an error message when
'typefile' doesn't exist.  If we call access(2) and then fopen(2),
there's a race.  It's not a huge problem, and the worst thing that can
happen is reporting an error when the file has been removed after
access(2).  It's not a problem, but we can fix the race and at the same
time clarify the intention of not warning about ENOENT and also remove
one syscall.  Seems like a win-win.

Suggested-by: Christian Göttsche <cgzones@googlemail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
2023-02-09 10:03:03 -06:00
..
.indent.pro
addgrps.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
age.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
agetpass.c Use freezero(3) where suitable 2023-02-02 12:04:28 +01:00
audit_help.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
basename.c
bit.c Add bit manipulation functions 2023-01-30 18:24:15 +01:00
btrfs.c
chkname.c shadow: use relaxed usernames 2022-09-02 20:27:14 -05:00
chkname.h
chowndir.c
chowntty.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
cleanup_group.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
cleanup_user.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
cleanup.c Update licensing info 2021-12-23 19:36:50 -06:00
console.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
copydir.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
csrand.c Unoptimize the higher part of the domain of csrand_uniform() 2023-01-30 18:24:15 +01:00
date_to_str.c Use strlcpy(3) instead of its pattern 2022-12-22 18:03:39 -06:00
entry.c Call NULL by its name 2023-02-02 13:08:30 -06:00
env.c Call NULL by its name 2023-02-02 13:08:30 -06:00
failure.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
failure.h Disable utmpx permanently 2022-12-22 10:31:43 +01:00
find_new_gid.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
find_new_sub_gids.c Don't redefine errno(3) 2022-12-22 11:43:29 +01:00
find_new_sub_uids.c Don't redefine errno(3) 2022-12-22 11:43:29 +01:00
find_new_uid.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
getdate.h
getdate.y
getgr_nam_gid.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
getrange.c
gettime.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
hushed.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
idmapping.c Use WIDTHOF() instead of its expansion 2023-01-27 21:48:37 -06:00
idmapping.h
isexpired.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
limits.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
list.c Call NULL by its name 2023-02-02 13:08:30 -06:00
log.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
loginprompt.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
mail.c
Makefile.am Add bit manipulation functions 2023-01-30 18:24:15 +01:00
motd.c
myname.c
obscure.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
pam_pass_non_interactive.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
pam_pass.c Don't redefine errno(3) 2022-12-22 11:43:29 +01:00
prefix_flag.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
pwd2spwd.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
pwd_init.c Assume SIGTTOU is defined 2022-12-15 16:22:05 -06:00
pwdcheck.c Call NULL by its name 2023-02-02 13:08:30 -06:00
remove_tree.c Avoid races in remove_tree() 2022-08-17 12:34:01 -05:00
rlogin.c Assume B[0-9]* macros are defined 2022-12-15 16:22:05 -06:00
root_flag.c
salt.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
setugid.c
setupenv.c
shell.c Call NULL by its name 2023-02-02 13:08:30 -06:00
strtoday.c strtoday.c: remove unused defines.h inclusion 2022-12-22 10:39:45 -06:00
sub.c
sulog.c Call NULL by its name 2023-02-02 13:08:30 -06:00
ttytype.c ttytype(): Fix race 2023-02-09 10:03:03 -06:00
tz.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
ulimit.c Remove comments that survived the Helicoprion 2022-12-15 16:22:05 -06:00
user_busy.c Disable utmpx permanently 2022-12-22 10:31:43 +01:00
utmp.c Remove superfluous casts 2023-02-09 10:03:03 -06:00
valid.c
xgetgrgid.c Assume getgrgid_r(3) exists 2022-12-15 16:22:05 -06:00
xgetgrnam.c libmisc: fix grammar 2023-01-26 22:44:39 -06:00
xgetpwnam.c libmisc: fix grammar 2023-01-26 22:44:39 -06:00
xgetpwuid.c Assume getpwuid_r(3) exists 2022-12-15 16:22:05 -06:00
xgetspnam.c libmisc: fix grammar 2023-01-26 22:44:39 -06:00
xgetXXbyYY.c libmisc: fix grammar 2023-01-26 22:44:39 -06:00
xmalloc.c Don't test for NULL before calling free(3) 2022-09-29 16:03:53 +02:00
yesno.c Remove superfluous casts 2023-02-09 10:03:03 -06:00