diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2012-01-06 16:23:42 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-01-06 16:23:42 +0100 |
commit | 2e55404bcf76f05193803b3d35359c6024f2a5f8 (patch) | |
tree | e060f8523053d4eee81b228440f597fc2079c4f3 | |
parent | 6b64a269766ace40c56826738de446537add37de (diff) | |
download | busybox-w32-2e55404bcf76f05193803b3d35359c6024f2a5f8.tar.gz busybox-w32-2e55404bcf76f05193803b3d35359c6024f2a5f8.tar.bz2 busybox-w32-2e55404bcf76f05193803b3d35359c6024f2a5f8.zip |
libpwdgrp/pwd_grp.c: set opened /etc/{passwd,group,shadow} fds CLOEXEC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | libpwdgrp/pwd_grp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c index 2eb9d9dd1..23abdbec0 100644 --- a/libpwdgrp/pwd_grp.c +++ b/libpwdgrp/pwd_grp.c | |||
@@ -441,6 +441,7 @@ int getpwent_r(struct passwd *__restrict resultbuf, | |||
441 | rv = errno; | 441 | rv = errno; |
442 | goto ERR; | 442 | goto ERR; |
443 | } | 443 | } |
444 | close_on_exec_on(fileno(pwf)); | ||
444 | } | 445 | } |
445 | 446 | ||
446 | rv = bb__pgsreader(bb__parsepwent, resultbuf, buffer, buflen, pwf); | 447 | rv = bb__pgsreader(bb__parsepwent, resultbuf, buffer, buflen, pwf); |
@@ -488,6 +489,7 @@ int getgrent_r(struct group *__restrict resultbuf, | |||
488 | rv = errno; | 489 | rv = errno; |
489 | goto ERR; | 490 | goto ERR; |
490 | } | 491 | } |
492 | close_on_exec_on(fileno(grf)); | ||
491 | } | 493 | } |
492 | 494 | ||
493 | rv = bb__pgsreader(bb__parsegrent, resultbuf, buffer, buflen, grf); | 495 | rv = bb__pgsreader(bb__parsegrent, resultbuf, buffer, buflen, grf); |
@@ -536,6 +538,7 @@ int getspent_r(struct spwd *resultbuf, char *buffer, | |||
536 | rv = errno; | 538 | rv = errno; |
537 | goto ERR; | 539 | goto ERR; |
538 | } | 540 | } |
541 | close_on_exec_on(fileno(spf)); | ||
539 | } | 542 | } |
540 | 543 | ||
541 | rv = bb__pgsreader(bb__parsespent, resultbuf, buffer, buflen, spf); | 544 | rv = bb__pgsreader(bb__parsespent, resultbuf, buffer, buflen, spf); |