projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9db81b8
)
halt getspnam[_r] search on error accessing TCB shadow
author
Rich Felker
<dalias@aerifal.cx>
Fri, 28 Dec 2018 21:54:13 +0000
(16:54 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 28 Dec 2018 21:54:13 +0000
(16:54 -0500)
fallback to /etc/shadow should happen only when the entry is not found
in the TCB shadow. otherwise transient errors or permission errors can
cause inconsistent results.
src/passwd/getspnam_r.c
patch
|
blob
|
history
diff --git
a/src/passwd/getspnam_r.c
b/src/passwd/getspnam_r.c
index
1b95dbb
..
541e853
100644
(file)
--- a/
src/passwd/getspnam_r.c
+++ b/
src/passwd/getspnam_r.c
@@
-94,6
+94,8
@@
int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct
return errno;
}
} else {
+ if (errno != ENOENT && errno != ENOTDIR)
+ return errno;
f = fopen("/etc/shadow", "rbe");
if (!f) {
if (errno != ENOENT && errno != ENOTDIR)