diff options
Diffstat (limited to 'meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/022-add-close-on-exec-descriptors.patch')
| -rw-r--r-- | meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/022-add-close-on-exec-descriptors.patch | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/022-add-close-on-exec-descriptors.patch b/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/022-add-close-on-exec-descriptors.patch deleted file mode 100644 index c35bb7caf0..0000000000 --- a/meta/recipes-devtools/unfs-server/unfs-server-2.1+2.2beta47/022-add-close-on-exec-descriptors.patch +++ /dev/null | |||
| @@ -1,66 +0,0 @@ | |||
| 1 | Upstream-Status: Inappropriate [other] | ||
| 2 | Upstream is not making further releases of this software. | ||
| 3 | |||
| 4 | Signed-off-by: Scott Garman <scott.a.garman@intel.com> | ||
| 5 | |||
| 6 | # Force socket fds to close on exec when used in conjunction with pseudo | ||
| 7 | # Patch origin: Wind River | ||
| 8 | |||
| 9 | --- | ||
| 10 | nfsd.c | 8 ++++++++ | ||
| 11 | rpcmisc.c | 9 +++++++++ | ||
| 12 | ugidd.c | 8 ++++++++ | ||
| 13 | 3 files changed, 25 insertions(+) | ||
| 14 | |||
| 15 | --- a/nfsd.c | ||
| 16 | +++ b/nfsd.c | ||
| 17 | @@ -630,6 +630,14 @@ nfsd_nfsproc_create_2(createargs *argp, | ||
| 18 | if (S_ISSOCK(argp->attributes.mode)) { | ||
| 19 | if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) | ||
| 20 | return(nfs_errno()); | ||
| 21 | + /* if there is a pseudo exec mark the socket to be | ||
| 22 | + * closed automatically | ||
| 23 | + */ | ||
| 24 | + { | ||
| 25 | + long f_flags; | ||
| 26 | + f_flags = fcntl(s, F_GETFD); | ||
| 27 | + f_flags = fcntl(s, F_SETFD, f_flags | FD_CLOEXEC); | ||
| 28 | + } | ||
| 29 | sa.sun_family = AF_UNIX; | ||
| 30 | strncpy(sa.sun_path, pathbuf, sizeof(sa.sun_path)); | ||
| 31 | sa.sun_path[sizeof(sa.sun_path)-1] = '\0'; | ||
| 32 | --- a/rpcmisc.c | ||
| 33 | +++ b/rpcmisc.c | ||
| 34 | @@ -197,6 +197,15 @@ makesock(int port, int proto, int socksz | ||
| 35 | Dprintf(L_FATAL, "Could not make a %s socket: %s\n", | ||
| 36 | prot_name, strerror(errno)); | ||
| 37 | |||
| 38 | + /* if there is a pseudo exec mark the socket to be | ||
| 39 | + * closed automatically | ||
| 40 | + */ | ||
| 41 | + { | ||
| 42 | + long f_flags; | ||
| 43 | + f_flags = fcntl(s, F_GETFD); | ||
| 44 | + f_flags = fcntl(s, F_SETFD, f_flags | FD_CLOEXEC); | ||
| 45 | + } | ||
| 46 | + fcntl(s, FD_CLOEXEC, 1); | ||
| 47 | memset((char *) &sin, 0, sizeof(sin)); | ||
| 48 | sin.sin_family = AF_INET; | ||
| 49 | sin.sin_addr.s_addr = INADDR_ANY; | ||
| 50 | --- a/ugidd.c | ||
| 51 | +++ b/ugidd.c | ||
| 52 | @@ -195,6 +195,14 @@ authenticate_1_svc(argp, rqstp) | ||
| 53 | destaddr.sin_port = htons(*argp); | ||
| 54 | if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) | ||
| 55 | goto bad; | ||
| 56 | + /* if there is a pseudo exec mark the socket to be | ||
| 57 | + * closed automatically | ||
| 58 | + */ | ||
| 59 | + { | ||
| 60 | + long f_flags; | ||
| 61 | + f_flags = fcntl(s, F_GETFD); | ||
| 62 | + f_flags = fcntl(s, F_SETFD, f_flags | FD_CLOEXEC); | ||
| 63 | + } | ||
| 64 | setsockopt(s, SOL_SOCKET, SO_LINGER, 0, 0); | ||
| 65 | bzero((char *) &sendaddr, sizeof sendaddr); | ||
| 66 | /* find a reserved port */ | ||
