diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2024-03-23 16:30:02 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2024-03-23 16:30:02 +0000 |
commit | 22b742bc9f984c3363b5544be71604b45607c24f (patch) | |
tree | 7d8c86dab3a7adb33c3753548c1e0edc5e04401a /lib/libskey/skeylogin.c | |
parent | 1084835213a8f58f581f7d9f6c26a2661035888d (diff) |
readdir_r(3) was never necessary and has been deprecated by POSIX.
Document that in the manpage and stop using it internally.
ok deraadt@ millert@ jmc@
Diffstat (limited to 'lib/libskey/skeylogin.c')
-rw-r--r-- | lib/libskey/skeylogin.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libskey/skeylogin.c b/lib/libskey/skeylogin.c index 0b7352983c0..78f1d8b01e9 100644 --- a/lib/libskey/skeylogin.c +++ b/lib/libskey/skeylogin.c @@ -10,7 +10,7 @@ * * S/Key verification check, lookups, and authentication. * - * $OpenBSD: skeylogin.c,v 1.64 2023/03/15 17:01:35 millert Exp $ + * $OpenBSD: skeylogin.c,v 1.65 2024/03/23 16:30:01 guenther Exp $ */ #ifdef QUOTA @@ -207,7 +207,7 @@ skeylookup(struct skey *mp, char *name) int skeygetnext(struct skey *mp) { - struct dirent entry, *dp; + struct dirent *dp; int rval; if (mp->keyfile != NULL) { @@ -220,10 +220,10 @@ skeygetnext(struct skey *mp) return (-1); rval = 1; - while ((readdir_r(mp->keydir, &entry, &dp)) == 0 && dp == &entry) { + while ((dp = readdir(mp->keydir)) != NULL) { /* Skip dot files and zero-length files. */ - if (entry.d_name[0] != '.' && - (rval = skeygetent(-1, mp, entry.d_name)) != 1) + if (dp->d_name[0] != '.' && + (rval = skeygetent(-1, mp, dp->d_name)) != 1) break; } |