aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-11-01 15:37:04 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2013-11-01 15:43:57 +0100
commit782e09b9f829c46dcbcdb1afee5f892cd3b5e67c (patch)
tree1d283b7a87e95f7b071cc355587e9bf88f7cd14c /main
parentb20d58f4e643d155ed97a164ecc89b56444c9a8f (diff)
downloadaports-782e09b9f829c46dcbcdb1afee5f892cd3b5e67c.tar.bz2
aports-782e09b9f829c46dcbcdb1afee5f892cd3b5e67c.tar.xz
main/nfs-utils: add some patches
Diffstat (limited to 'main')
-rw-r--r--main/nfs-utils/0001-mountd-Fix-is_subdirectory-again.patch81
-rw-r--r--main/nfs-utils/0001-statd-exit-if-a-statd-is-already-running.patch126
-rw-r--r--main/nfs-utils/APKBUILD35
-rw-r--r--main/nfs-utils/nfs-utils-mtab-sym.patch12
-rw-r--r--main/nfs-utils/nfs-utils-no-exec.patch4
5 files changed, 237 insertions, 21 deletions
diff --git a/main/nfs-utils/0001-mountd-Fix-is_subdirectory-again.patch b/main/nfs-utils/0001-mountd-Fix-is_subdirectory-again.patch
new file mode 100644
index 0000000000..e6f372b758
--- /dev/null
+++ b/main/nfs-utils/0001-mountd-Fix-is_subdirectory-again.patch
@@ -0,0 +1,81 @@
+From 23d3980b6cfea4e9056d9b7b81e48b4fefc645e0 Mon Sep 17 00:00:00 2001
+From: NeilBrown <neilb@suse.de>
+Date: Tue, 7 May 2013 11:46:18 -0400
+Subject: [PATCH] mountd: Fix is_subdirectory again
+
+The problem was that is_subdirectory() would also succeed if the two
+directories were the same. This is needed for path_matches() which
+needs to see if the child is same-or-descendant.
+
+So this patch rearranges path_matches() to do the "are they the same"
+test itself and only bother with is_subdirectory() if it they are not
+the same.
+
+So now is_subdirectory() can be strict, and so can be usable for
+subexport(), which needs a strong 'in subdirectory - not the same' test.
+
+Acked-by: J. Bruce Fields <bfields@redhat.com>
+Signed-off-by: NeilBrown <neilb@suse.de>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ utils/mountd/cache.c | 24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c
+index 737927c..517aa62 100644
+--- a/utils/mountd/cache.c
++++ b/utils/mountd/cache.c
+@@ -347,20 +347,26 @@ static char *next_mnt(void **v, char *p)
+
+ static int is_subdirectory(char *child, char *parent)
+ {
++ /* Check is child is strictly a subdirectory of
++ * parent or a more distant descendant.
++ */
+ size_t l = strlen(parent);
+
+- if (strcmp(parent, "/") == 0)
++ if (strcmp(parent, "/") == 0 && child[1] != 0)
+ return 1;
+
+- return strcmp(child, parent) == 0
+- || (strncmp(child, parent, l) == 0 && child[l] == '/');
++ return (strncmp(child, parent, l) == 0 && child[l] == '/');
+ }
+
+ static int path_matches(nfs_export *exp, char *path)
+ {
+- if (exp->m_export.e_flags & NFSEXP_CROSSMOUNT)
+- return is_subdirectory(path, exp->m_export.e_path);
+- return strcmp(path, exp->m_export.e_path) == 0;
++ /* Does the path match the export? I.e. is it an
++ * exact match, or does the export have CROSSMOUNT, and path
++ * is a descendant?
++ */
++ return strcmp(path, exp->m_export.e_path) == 0
++ || ((exp->m_export.e_flags & NFSEXP_CROSSMOUNT)
++ && is_subdirectory(path, exp->m_export.e_path));
+ }
+
+ static int
+@@ -369,15 +375,13 @@ export_matches(nfs_export *exp, char *dom, char *path, struct addrinfo *ai)
+ return path_matches(exp, path) && client_matches(exp, dom, ai);
+ }
+
+-/* True iff e1 is a child of e2 and e2 has crossmnt set: */
++/* True iff e1 is a child of e2 (or descendant) and e2 has crossmnt set: */
+ static bool subexport(struct exportent *e1, struct exportent *e2)
+ {
+ char *p1 = e1->e_path, *p2 = e2->e_path;
+- size_t l2 = strlen(p2);
+
+ return e2->e_flags & NFSEXP_CROSSMOUNT
+- && strncmp(p1, p2, l2) == 0
+- && p1[l2] == '/';
++ && is_subdirectory(p1, p2);
+ }
+
+ struct parsed_fsid {
+--
+1.8.3.2
+
diff --git a/main/nfs-utils/0001-statd-exit-if-a-statd-is-already-running.patch b/main/nfs-utils/0001-statd-exit-if-a-statd-is-already-running.patch
new file mode 100644
index 0000000000..4e8be2fd43
--- /dev/null
+++ b/main/nfs-utils/0001-statd-exit-if-a-statd-is-already-running.patch
@@ -0,0 +1,126 @@
+From 342446a4a624d4ee8254af859bb7f1de6d268679 Mon Sep 17 00:00:00 2001
+From: Weston Andros Adamson <dros@netapp.com>
+Date: Tue, 7 May 2013 11:25:29 -0400
+Subject: [PATCH] statd: exit if a statd is already running
+
+Moves nfs_probe_statd from mount to nfs support lib to share with statd.
+
+Acked-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Weston Andros Adamson <dros@netapp.com>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+---
+ support/include/nfsrpc.h | 5 +++++
+ support/nfs/getport.c | 22 ++++++++++++++++++++++
+ utils/mount/network.c | 17 -----------------
+ utils/statd/statd.c | 7 +++++++
+ 4 files changed, 34 insertions(+), 17 deletions(-)
+
+diff --git a/support/include/nfsrpc.h b/support/include/nfsrpc.h
+index a0b80e1..1bfae7a 100644
+--- a/support/include/nfsrpc.h
++++ b/support/include/nfsrpc.h
+@@ -156,6 +156,11 @@ extern unsigned long nfs_pmap_getport(const struct sockaddr_in *,
+ const struct timeval *);
+
+ /*
++ * Use nfs_pmap_getport to see if statd is running locally
++ */
++extern int nfs_probe_statd(void);
++
++/*
+ * Contact a remote RPC service to discover whether it is responding
+ * to requests.
+ */
+diff --git a/support/nfs/getport.c b/support/nfs/getport.c
+index 3331ad4..081594c 100644
+--- a/support/nfs/getport.c
++++ b/support/nfs/getport.c
+@@ -1102,3 +1102,25 @@ unsigned long nfs_pmap_getport(const struct sockaddr_in *sin,
+
+ return port;
+ }
++
++static const char *nfs_ns_pgmtbl[] = {
++ "status",
++ NULL,
++};
++
++/*
++ * nfs_probe_statd - use nfs_pmap_getport to see if statd is running locally
++ *
++ * Returns non-zero if statd is running locally.
++ */
++int nfs_probe_statd(void)
++{
++ struct sockaddr_in addr = {
++ .sin_family = AF_INET,
++ .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
++ };
++ rpcprog_t program = nfs_getrpcbyname(NSMPROG, nfs_ns_pgmtbl);
++
++ return nfs_getport_ping((struct sockaddr *)(char *)&addr, sizeof(addr),
++ program, (rpcvers_t)1, IPPROTO_UDP);
++}
+diff --git a/utils/mount/network.c b/utils/mount/network.c
+index 4be48cd..e2cdcaf 100644
+--- a/utils/mount/network.c
++++ b/utils/mount/network.c
+@@ -65,11 +65,6 @@ extern int nfs_mount_data_version;
+ extern char *progname;
+ extern int verbose;
+
+-static const char *nfs_ns_pgmtbl[] = {
+- "status",
+- NULL,
+-};
+-
+ static const char *nfs_mnt_pgmtbl[] = {
+ "mount",
+ "mountd",
+@@ -761,18 +756,6 @@ int probe_bothports(clnt_addr_t *mnt_server, clnt_addr_t *nfs_server)
+ &nfs_server->pmap);
+ }
+
+-static int nfs_probe_statd(void)
+-{
+- struct sockaddr_in addr = {
+- .sin_family = AF_INET,
+- .sin_addr.s_addr = htonl(INADDR_LOOPBACK),
+- };
+- rpcprog_t program = nfs_getrpcbyname(NSMPROG, nfs_ns_pgmtbl);
+-
+- return nfs_getport_ping(SAFE_SOCKADDR(&addr), sizeof(addr),
+- program, (rpcvers_t)1, IPPROTO_UDP);
+-}
+-
+ /**
+ * start_statd - attempt to start rpc.statd
+ *
+diff --git a/utils/statd/statd.c b/utils/statd/statd.c
+index 652546c..8c51bcc 100644
+--- a/utils/statd/statd.c
++++ b/utils/statd/statd.c
+@@ -28,6 +28,7 @@
+
+ #include "statd.h"
+ #include "nfslib.h"
++#include "nfsrpc.h"
+ #include "nsm.h"
+
+ /* Socket operations */
+@@ -237,6 +238,12 @@ int main (int argc, char **argv)
+ /* Set hostname */
+ MY_NAME = NULL;
+
++ /* Refuse to start if another statd is running */
++ if (nfs_probe_statd()) {
++ fprintf(stderr, "Statd service already running!\n");
++ exit(1);
++ }
++
+ /* Process command line switches */
+ while ((arg = getopt_long(argc, argv, "h?vVFNH:dn:p:o:P:L", longopts, NULL)) != EOF) {
+ switch (arg) {
+--
+1.8.3.2
+
diff --git a/main/nfs-utils/APKBUILD b/main/nfs-utils/APKBUILD
index 300dfd25e1..189af42231 100644
--- a/main/nfs-utils/APKBUILD
+++ b/main/nfs-utils/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=nfs-utils
pkgver=1.2.8
-pkgrel=0
+pkgrel=1
pkgdesc="kernel-mode NFS"
url="http://nfs.sourceforge.net/"
arch="all"
@@ -25,14 +25,17 @@ source="http://downloads.sourceforge.net/nfs/$pkgname-$pkgver.tar.bz2
nfs.confd
nfs.exports
nfs-utils-mtab-sym.patch
- uclibc-getaddrinfo-canonname.patch"
+ uclibc-getaddrinfo-canonname.patch
+ 0001-mountd-Fix-is_subdirectory-again.patch
+ 0001-statd-exit-if-a-statd-is-already-running.patch
+ "
prepare() {
cd "$srcdir/$pkgname-$pkgver"
for i in $source; do
case $i in
*.patch) msg "Applying $i"
- patch -p0 -i "$srcdir"/$i || return 1;;
+ patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
# fix build on eglibc
@@ -64,7 +67,7 @@ build() {
--enable-uuid \
--enable-gss \
--enable-libmount-mount \
- --with-statedir=/var/lib/nfs \
+ --enable-mounting \
|| return 1
make || return 1
@@ -91,7 +94,7 @@ rpcgen() {
install -m755 -D tools/rpcgen/rpcgen "$subpkgdir"/usr/bin/rpcgen
}
-md5sums="6e7d97de51e428a0b8698c16ca23db77 nfs-utils-1.2.8.tar.bz2
+md5sums="fb48630b7c145fb9d6602a79c6eaab11 nfs-utils-1.2.8.tar.bz2
9e402e75f23b886fce2f53bec2c1d415 nfs.initd
d514fb87ce5de9909f43d99012352f09 nfsmount.initd
144b0e1f7d32265abe4c499a47af6154 rpc.gssd.initd
@@ -101,9 +104,11 @@ d514fb87ce5de9909f43d99012352f09 nfsmount.initd
20e71ab412555b2dc9b50f346f68e5c8 rpc.svcgssd.initd
09135438d6df50b868bbe5a2260f973c nfs.confd
4f1bb7b2412ce5952ecb5ec22d8ed99d nfs.exports
-a3a7338f8de3ac37c1ffc05bdcb77d16 nfs-utils-mtab-sym.patch
-37a82a3a81410b483790ca30d564f4ba uclibc-getaddrinfo-canonname.patch"
-sha256sums="1cc8f02a633eddbf0a1d93421f331479c4cdab4c5ab33b8bf8c7c369f9156ac6 nfs-utils-1.2.8.tar.bz2
+2b2d228f9947581c924a691a84664fa1 nfs-utils-mtab-sym.patch
+37a82a3a81410b483790ca30d564f4ba uclibc-getaddrinfo-canonname.patch
+ddcfdb1106395d071ed917d968067b3d 0001-mountd-Fix-is_subdirectory-again.patch
+f19d520262214146ad5cab0f219fd9ca 0001-statd-exit-if-a-statd-is-already-running.patch"
+sha256sums="62ec061e32283699646515f6383cb54d0d88fb223343cec940a2701560b8b404 nfs-utils-1.2.8.tar.bz2
81b546cb98be4678cd22f4da39927d2c79532717d927bfba055af447dbff26a5 nfs.initd
f2f5b54fef59f24a1fc6a8b814dfe2cfdeeb02fd0d5041cff31650e626fe4b75 nfsmount.initd
00d9c29280a83e8458c33139d04a9b38c6fdba9d7cb9b420ca83bf6b10e6435d rpc.gssd.initd
@@ -113,9 +118,11 @@ a727948ccf665b6bb1977ac3014b7086ff654173d1a2be1e2b38a43e97f84ca8 rpc.statd.init
f1c460d8b0e91e54a551397d755135d05a3728d81de596535bf8bda074455677 rpc.svcgssd.initd
9ca3b7dfbac5bedd818a3637805380f4e873ef8e809c21c26f410c86ac16e03e nfs.confd
f2aaf1c92e07172adeb65f7f2bc0140c533ae453a3477e99be677ef2e05f2d4b nfs.exports
-fb5d228d2e9362fcc9a4702499334ba4a9109ee814c93f2e56e19903f12ba6eb nfs-utils-mtab-sym.patch
-7c7451365001f1672abd6fd6dd53da03617a9baa4758ec515b3adf8b7bb7ad93 uclibc-getaddrinfo-canonname.patch"
-sha512sums="abe13f37dccb40258ac2f654143e540b9ac8c41ca10fe88f104ebb558334d41c0e31220dbae0122836e43236cac763fbcfc1d5bd708aca3b282152ac3ac7213b nfs-utils-1.2.8.tar.bz2
+5a1c6875f43ecc93d5db7bcf84b4ceda16c09b6109c28696eb55d05247511706 nfs-utils-mtab-sym.patch
+7c7451365001f1672abd6fd6dd53da03617a9baa4758ec515b3adf8b7bb7ad93 uclibc-getaddrinfo-canonname.patch
+1c1204dc5fc62debb8cc66ca299a741a3d8e515f480ff7aecb4ad72819658de7 0001-mountd-Fix-is_subdirectory-again.patch
+d3e402c73b204d4b5e161563005269318dad6e992792c902da76ff8368b872cb 0001-statd-exit-if-a-statd-is-already-running.patch"
+sha512sums="1b7269bca52b7c751976934a82bb5f2c3e171761c5009be803dc03d604f5f028fa3e17545a42bd0a1660546a6ff0b7287d9f7f6f2d262943d526d068c9c07bad nfs-utils-1.2.8.tar.bz2
98eeae4b30fe13d6fdeb62d47e05fd5bc577946d84a3fe84703dcc90c58768f0d1886a0aa9262ead3aac5c4bd6d7b1cc2b703fb9603baffad4ac2ead635294f3 nfs.initd
8e720417d7443c6bd4e3bda9e7bf4a61b073009fc1750ec0c7378fb01d726ee827a759c6bc10629606b4f2dbd7884807a9e0b8377382e4968f06ef8e938537ae nfsmount.initd
cd4f763c7cced0eecb03e2d4c8fb1d5fbbddd119a014dee4e9cb881d3750fb01a50daa4475700914785cb1313ceef638b7de4d8dddac90cbab63888cc81938f6 rpc.gssd.initd
@@ -125,5 +132,7 @@ cf0272e42310b1ff8d40ff37dc839df2dd4fba4cb408f8fa67ce445e2975b37cafbb35e6d41af2bb
844e8d41a6a8b632d98585724aca2e9ae596f72c67e17e4e8fb9eb81e6c58eed9e10cf8b2a96896dba8fd1efaa95d846954e712bdf3402a847ae17742dae2157 rpc.svcgssd.initd
1711803f848f73fef9fa74bd572fa7643c586f06eeedf62ed91bd2aa06ad59c7b1f1c585b6f7b7a8ce67ff7fd6b601d88dc99ca1000dd1d3f5991f420da9761b nfs.confd
70f96bb3a465ee0fa857a6e511051ca3ced9f5a5d1e6b8b32eec843a2067f2475d8979c724a3661de0a2b078eef143f55d75ed184d823841d9de5038da91fb91 nfs.exports
-4549895ffe6fc91e500ead31b8e0bc552f00af285b949b0d0fd72cfa512e156578b924c1631d8e670e803999563c17bc33ca0c09800b80c28870eed08376e7f0 nfs-utils-mtab-sym.patch
-b9f0820773d3ab82cfa9ba603c83f98a71ad2e7205418c1223344b5b3e1bdfbb6aa183ab830df25ded660a4950d0e54098485fa08a4f6b6363a62c0f6c713489 uclibc-getaddrinfo-canonname.patch"
+5fd9039a61a0cdaeb57b5332ea545034101e6f15be200b7cf8fc7d0a3d22836a6fc778e0560656c1825808a4dc09046d9923d81b4d1324a6e526b226c657d064 nfs-utils-mtab-sym.patch
+b9f0820773d3ab82cfa9ba603c83f98a71ad2e7205418c1223344b5b3e1bdfbb6aa183ab830df25ded660a4950d0e54098485fa08a4f6b6363a62c0f6c713489 uclibc-getaddrinfo-canonname.patch
+59a29c72096357fc35e805f0a1e443c7a6ee9b07c96ed85481b1101a6090311937b39f45aefa60325f968a5c7d2bc5550c2a43f2f54bd8522b615b84bdf71c86 0001-mountd-Fix-is_subdirectory-again.patch
+e04d451618d6f6197dc0692844cc115fec93575525cd0569d582f9278007e2dbec692ef46065c675de13d608e034161f39a60d46766873933d05d18b94633f6c 0001-statd-exit-if-a-statd-is-already-running.patch"
diff --git a/main/nfs-utils/nfs-utils-mtab-sym.patch b/main/nfs-utils/nfs-utils-mtab-sym.patch
index 1ebbd99b57..607e087ec9 100644
--- a/main/nfs-utils/nfs-utils-mtab-sym.patch
+++ b/main/nfs-utils/nfs-utils-mtab-sym.patch
@@ -1,5 +1,5 @@
---- utils/mount/fstab.c
-+++ utils/mount/fstab.c
+--- ./utils/mount/fstab.c
++++ ./utils/mount/fstab.c
@@ -57,7 +57,7 @@ mtab_does_not_exist(void) {
return var_mtab_does_not_exist;
}
@@ -9,8 +9,8 @@
mtab_is_a_symlink(void) {
get_mtab_info();
return var_mtab_is_a_symlink;
---- utils/mount/fstab.h
-+++ utils/mount/fstab.h
+--- ./utils/mount/fstab.h
++++ ./utils/mount/fstab.h
@@ -7,6 +7,7 @@
#define _PATH_FSTAB "/etc/fstab"
#endif
@@ -19,8 +19,8 @@
int mtab_is_writable(void);
int mtab_does_not_exist(void);
void reset_mtab_info(void);
---- utils/mount/mount.c
-+++ utils/mount/mount.c
+--- ./utils/mount/mount.c
++++ ./utils/mount/mount.c
@@ -230,6 +230,13 @@ create_mtab (void) {
int flags;
mntFILE *mfp;
diff --git a/main/nfs-utils/nfs-utils-no-exec.patch b/main/nfs-utils/nfs-utils-no-exec.patch
index 94a73d366f..a4fb06ee17 100644
--- a/main/nfs-utils/nfs-utils-no-exec.patch
+++ b/main/nfs-utils/nfs-utils-no-exec.patch
@@ -1,5 +1,5 @@
---- utils/mount/mount.c Wed Apr 8 09:25:26 2009
-+++ utils/mount/mount.c Wed Apr 8 09:25:26 2009
+--- ./utils/mount/mount.c Wed Apr 8 09:25:26 2009
++++ ./utils/mount/mount.c Wed Apr 8 09:25:26 2009
@@ -407,10 +407,6 @@
mount_error(NULL, mount_point, ENOTDIR);
return 1;