X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fpasswd%2Fgetspnam_r.c;h=f4d7b35e18ce8f1c871051887a9fecc14733006e;hb=1a70198b3e5a7866bf4c62d090d8a8e28b12521a;hp=9f3378e96c8c4cc40330cec189d12f4616b9b341;hpb=0d4d94efd5dfe9348582c92a2de6923bb66492ac;p=musl diff --git a/src/passwd/getspnam_r.c b/src/passwd/getspnam_r.c index 9f3378e9..f4d7b35e 100644 --- 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; - 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; @@ -57,7 +57,7 @@ int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct return errno; } } else { - f = fopen("/etc/shadow", "rb"); + f = fopen("/etc/shadow", "rbe"); if (!f) return errno; }