diff options
author | Scott Garman <scott.a.garman@intel.com> | 2010-08-12 21:02:58 -0700 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-08-20 16:20:09 +0100 |
commit | b5b3825ce6df45b16e1f3e15001da213bc8b0a55 (patch) | |
tree | b2577de0765074d6e2bdbbdf1862220b52e8d7c1 /meta/packages/unfs-server/unfs-server-2.2beta47/022-add-close-on-exec-descriptors.patch | |
parent | 735210556dc709b3c2367389fa6ea9c0109412b1 (diff) | |
download | openembedded-core-b5b3825ce6df45b16e1f3e15001da213bc8b0a55.tar.gz openembedded-core-b5b3825ce6df45b16e1f3e15001da213bc8b0a55.tar.bz2 openembedded-core-b5b3825ce6df45b16e1f3e15001da213bc8b0a55.tar.xz openembedded-core-b5b3825ce6df45b16e1f3e15001da213bc8b0a55.zip |
unfs-server: new userspace nfs recipe
This is a simple userspace NFS server, derived from one which was
previously used in openSUSE 10.x. Wind River contributed many of the
patches.
This package is not intended for target installations, only -native
and -nativesdk use.
Enabling nativesdk for readline, sqlite3, and pseudo was required, as
well as a few new autoconf siteconfig entries.
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'meta/packages/unfs-server/unfs-server-2.2beta47/022-add-close-on-exec-descriptors.patch')
-rw-r--r-- | meta/packages/unfs-server/unfs-server-2.2beta47/022-add-close-on-exec-descriptors.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/meta/packages/unfs-server/unfs-server-2.2beta47/022-add-close-on-exec-descriptors.patch b/meta/packages/unfs-server/unfs-server-2.2beta47/022-add-close-on-exec-descriptors.patch new file mode 100644 index 000000000..011ae74cd --- /dev/null +++ b/meta/packages/unfs-server/unfs-server-2.2beta47/022-add-close-on-exec-descriptors.patch @@ -0,0 +1,61 @@ +# Force socket fds to close on exec when used in conjunction with pseudo +# Patch origin: Wind River + +--- + nfsd.c | 8 ++++++++ + rpcmisc.c | 9 +++++++++ + ugidd.c | 8 ++++++++ + 3 files changed, 25 insertions(+) + +--- a/nfsd.c ++++ b/nfsd.c +@@ -630,6 +630,14 @@ nfsd_nfsproc_create_2(createargs *argp, + if (S_ISSOCK(argp->attributes.mode)) { + if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) + return(nfs_errno()); ++ /* if there is a pseudo exec mark the socket to be ++ * closed automatically ++ */ ++ { ++ long f_flags; ++ f_flags = fcntl(s, F_GETFD); ++ f_flags = fcntl(s, F_SETFD, f_flags | FD_CLOEXEC); ++ } + sa.sun_family = AF_UNIX; + strncpy(sa.sun_path, pathbuf, sizeof(sa.sun_path)); + sa.sun_path[sizeof(sa.sun_path)-1] = '\0'; +--- a/rpcmisc.c ++++ b/rpcmisc.c +@@ -197,6 +197,15 @@ makesock(int port, int proto, int socksz + Dprintf(L_FATAL, "Could not make a %s socket: %s\n", + prot_name, strerror(errno)); + ++ /* if there is a pseudo exec mark the socket to be ++ * closed automatically ++ */ ++ { ++ long f_flags; ++ f_flags = fcntl(s, F_GETFD); ++ f_flags = fcntl(s, F_SETFD, f_flags | FD_CLOEXEC); ++ } ++ fcntl(s, FD_CLOEXEC, 1); + memset((char *) &sin, 0, sizeof(sin)); + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; +--- a/ugidd.c ++++ b/ugidd.c +@@ -195,6 +195,14 @@ authenticate_1_svc(argp, rqstp) + destaddr.sin_port = htons(*argp); + if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) + goto bad; ++ /* if there is a pseudo exec mark the socket to be ++ * closed automatically ++ */ ++ { ++ long f_flags; ++ f_flags = fcntl(s, F_GETFD); ++ f_flags = fcntl(s, F_SETFD, f_flags | FD_CLOEXEC); ++ } + setsockopt(s, SOL_SOCKET, SO_LINGER, 0, 0); + bzero((char *) &sendaddr, sizeof sendaddr); + /* find a reserved port */ |