projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add getifaddrs
[musl]
/
src
/
passwd
/
getspnam_r.c
diff --git
a/src/passwd/getspnam_r.c
b/src/passwd/getspnam_r.c
index
9f3378e
..
f4d7b35
100644
(file)
--- a/
src/passwd/getspnam_r.c
+++ b/
src/passwd/getspnam_r.c
@@
-46,7
+46,7
@@
int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct
if (snprintf(path, sizeof path, "/etc/tcb/%s/shadow", name) >= sizeof path)
return EINVAL;
if (snprintf(path, sizeof path, "/etc/tcb/%s/shadow", name) >= sizeof path)
return EINVAL;
- fd = open(path, O_RDONLY|O_NOFOLLOW|O_NONBLOCK);
+ fd = open(path, O_RDONLY|O_NOFOLLOW|O_NONBLOCK
|O_CLOEXEC
);
if (fd >= 0) {
struct stat st = { 0 };
errno = EINVAL;
if (fd >= 0) {
struct stat st = { 0 };
errno = EINVAL;
@@
-57,7
+57,7
@@
int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct
return errno;
}
} else {
return errno;
}
} else {
- f = fopen("/etc/shadow", "rb");
+ f = fopen("/etc/shadow", "rb
e
");
if (!f) return errno;
}
if (!f) return errno;
}