[Midnightbsd-cvs] src [10498] trunk/lib/libutil/login_auth.c: use O_CLOEXEC

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jun 6 21:39:08 EDT 2018


Revision: 10498
          http://svnweb.midnightbsd.org/src/?rev=10498
Author:   laffer1
Date:     2018-06-06 21:39:07 -0400 (Wed, 06 Jun 2018)
Log Message:
-----------
use O_CLOEXEC

Modified Paths:
--------------
    trunk/lib/libutil/login_auth.c

Modified: trunk/lib/libutil/login_auth.c
===================================================================
--- trunk/lib/libutil/login_auth.c	2018-06-07 01:37:45 UTC (rev 10497)
+++ trunk/lib/libutil/login_auth.c	2018-06-07 01:39:07 UTC (rev 10498)
@@ -98,7 +98,7 @@
   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);



More information about the Midnightbsd-cvs mailing list