~mdw
/
become
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
13b985c
)
Set close-on-exec flag for UDP socket.
author
mdw
<mdw>
Fri, 19 Jun 1998 13:48:16 +0000
(13:48 +0000)
committer
mdw
<mdw>
Fri, 19 Jun 1998 13:48:16 +0000
(13:48 +0000)
src/check.c
patch
|
blob
|
blame
|
history
diff --git
a/src/check.c
b/src/check.c
index
f0a98b7
..
bc86de8
100644
(file)
--- a/
src/check.c
+++ b/
src/check.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: check.c,v 1.
8 1998/06/18 15:10:44
mdw Exp $
+ * $Id: check.c,v 1.
9 1998/06/19 13:48:16
mdw Exp $
*
* Check validity of requests
*
*
* Check validity of requests
*
@@
-29,6
+29,9
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: check.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: check.c,v $
+ * Revision 1.9 1998/06/19 13:48:16 mdw
+ * Set close-on-exec flag for UDP socket.
+ *
* Revision 1.8 1998/06/18 15:10:44 mdw
* SECURITY HOLE: the file descriptor for the secret key was left open and
* inherited by the target process. This is now fixed. Also set
* Revision 1.8 1998/06/18 15:10:44 mdw
* SECURITY HOLE: the file descriptor for the secret key was left open and
* inherited by the target process. This is now fixed. Also set
@@
-196,6
+199,8
@@
static int check__ask(request *rq, struct sockaddr_in *serv, size_t n_serv)
if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0)
die("couldn't create socket: %s", strerror(errno));
if ((fd = socket(PF_INET, SOCK_DGRAM, 0)) < 0)
die("couldn't create socket: %s", strerror(errno));
+ if (fcntl(fd, F_SETFD, 1) < 0)
+ die("couldn't set close-on-exec flag for socket: %s", strerror(errno));
/* --- Bind myself to some address --- */
/* --- Bind myself to some address --- */