diff options
author | jilles <jilles@FreeBSD.org> | 2013-08-28 21:10:37 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2013-08-28 21:10:37 +0000 |
commit | baaacfdc28bae3ef25b6e173c058f66a64c7f18d (patch) | |
tree | 8dda6bdc0191b6bd5008300355e35de43cca06e6 /lib/libutil/login_auth.c | |
parent | 609f43ab7f3c398c0c3a4d8f093fe380c9e04b82 (diff) | |
download | FreeBSD-src-baaacfdc28bae3ef25b6e173c058f66a64c7f18d.zip FreeBSD-src-baaacfdc28bae3ef25b6e173c058f66a64c7f18d.tar.gz |
libutil: Use O_CLOEXEC for internal file descriptors from open().
Diffstat (limited to 'lib/libutil/login_auth.c')
-rw-r--r-- | lib/libutil/login_auth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libutil/login_auth.c b/lib/libutil/login_auth.c index ce9a2e4..1fc7e73 100644 --- a/lib/libutil/login_auth.c +++ b/lib/libutil/login_auth.c @@ -98,7 +98,7 @@ auth_cat(const char *file) int fd, count; char buf[BUFSIZ]; - if ((fd = open(file, O_RDONLY)) < 0) + if ((fd = open(file, O_RDONLY | O_CLOEXEC)) < 0) return 0; while ((count = read(fd, buf, sizeof(buf))) > 0) (void)write(fileno(stdout), buf, count); |