summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-04-21 02:50:29 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-04-21 02:50:29 -0500
commit8c98c47f9b147a77bfca7cc75b97cc0e98e4551e (patch)
treef673860dfc01e448fee588377cfe4ab75bf995be /user
parent6b93a26bbafbfe94f22b895c0677f3e532393fcb (diff)
downloadpackages-8c98c47f9b147a77bfca7cc75b97cc0e98e4551e.tar.gz
packages-8c98c47f9b147a77bfca7cc75b97cc0e98e4551e.tar.bz2
packages-8c98c47f9b147a77bfca7cc75b97cc0e98e4551e.tar.xz
packages-8c98c47f9b147a77bfca7cc75b97cc0e98e4551e.zip
user/nfs-utils: fix freeaddrinfo(3) usage
Diffstat (limited to 'user')
-rw-r--r--user/nfs-utils/APKBUILD4
-rw-r--r--user/nfs-utils/freeaddrinfo-properly.patch126
2 files changed, 129 insertions, 1 deletions
diff --git a/user/nfs-utils/APKBUILD b/user/nfs-utils/APKBUILD
index 5c2c06c70..6ca30bbad 100644
--- a/user/nfs-utils/APKBUILD
+++ b/user/nfs-utils/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=nfs-utils
pkgver=2.3.3
-pkgrel=0
+pkgrel=1
pkgdesc="NFS file sharing client and server"
url="http://nfs.sourceforge.net/"
arch="all"
@@ -13,6 +13,7 @@ makedepends="keyutils-dev krb5-dev libevent-dev libtirpc-dev lvm2-dev
rpcsvc-proto sqlite-dev util-linux-dev"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://downloads.sourceforge.net/nfs/nfs-utils-$pkgver.tar.xz
+ freeaddrinfo-properly.patch
nfs-utils-1.1.4-mtab-sym.patch
posixish.patch
undef-def.patch
@@ -63,6 +64,7 @@ package() {
}
sha512sums="5025ccd7699ac1a0fdbd8b18ed8b33ea89230158320d809ec51e73f831100db75dceaddde481d911eeca9059caa521d155c2d14d014d75f091f432aad92a9716 nfs-utils-2.3.3.tar.xz
+7e1472989374cf8a8dbd4944bbd5deaa5520f12ea3627709be037fb78febec531b373c6e05004f27046d1e3842f5cc7ce024f4db65cf656864bda85db529b451 freeaddrinfo-properly.patch
1cd916028a8515772f05ef63832d73a09e9720055aedc9e2e4ce3a08ce1820948700a4f00ca9c4ee684880f18e67aca888dd857fc7931d923021ba50964be998 nfs-utils-1.1.4-mtab-sym.patch
f0b87ff4229d96a46e3f0c17f87dcd3ce5c51651ee036d935c1481b421cd7e5b6a048a082b4f8115a969fe6e85cc871df7658bf5d80c480095b69f29fd6b085d posixish.patch
2e54efa2cac0522f549e8bed45147676d10b299b5060eda305da8767feb55d37627259196d89c295e8d5f4fbbb7c9e791a53dddd579187600f1717968049aa6a undef-def.patch
diff --git a/user/nfs-utils/freeaddrinfo-properly.patch b/user/nfs-utils/freeaddrinfo-properly.patch
new file mode 100644
index 000000000..7ddcde004
--- /dev/null
+++ b/user/nfs-utils/freeaddrinfo-properly.patch
@@ -0,0 +1,126 @@
+diff -Naur nfs-utils-2.3.3-orig/support/export/client.c nfs-utils-2.3.3/support/export/client.c
+--- nfs-utils-2.3.3-orig/support/export/client.c 2018-09-06 13:09:08.000000000 -0500
++++ nfs-utils-2.3.3/support/export/client.c 2019-04-21 02:48:45.676838188 -0500
+@@ -309,7 +309,8 @@
+ init_addrlist(clp, ai);
+
+ out:
+- freeaddrinfo(ai);
++ if (ai != NULL)
++ freeaddrinfo(ai);
+ return clp;
+ }
+
+diff -Naur nfs-utils-2.3.3-orig/tests/nsm_client/nsm_client.c nfs-utils-2.3.3/tests/nsm_client/nsm_client.c
+--- nfs-utils-2.3.3-orig/tests/nsm_client/nsm_client.c 2018-09-06 13:09:08.000000000 -0500
++++ nfs-utils-2.3.3/tests/nsm_client/nsm_client.c 2019-04-21 02:35:53.139552780 -0500
+@@ -243,7 +243,8 @@
+ printf("RPC client creation failed\n");
+ }
+ out:
+- freeaddrinfo(ai);
++ if (ai != NULL)
++ freeaddrinfo(ai);
+ return client;
+ }
+
+diff -Naur nfs-utils-2.3.3-orig/utils/exportfs/exportfs.c nfs-utils-2.3.3/utils/exportfs/exportfs.c
+--- nfs-utils-2.3.3-orig/utils/exportfs/exportfs.c 2018-09-06 13:09:08.000000000 -0500
++++ nfs-utils-2.3.3/utils/exportfs/exportfs.c 2019-04-21 02:40:07.432327005 -0500
+@@ -282,7 +282,8 @@
+ validate_export(exp);
+
+ out:
+- freeaddrinfo(ai);
++ if (ai != NULL)
++ freeaddrinfo(ai);
+ }
+
+ static int exportfs_generic(char *arg, char *options, int verbose)
+@@ -395,7 +396,8 @@
+ if (!success)
+ xlog(L_ERROR, "Could not find '%s:%s' to unexport.", hname, path);
+
+- freeaddrinfo(ai);
++ if (ai != NULL)
++ freeaddrinfo(ai);
+ }
+
+ static int unexportfs_generic(char *arg, int verbose)
+@@ -639,8 +641,10 @@
+ }
+
+ out:
+- freeaddrinfo(results1);
+- freeaddrinfo(results2);
++ if (results1 != NULL)
++ freeaddrinfo(results1);
++ if (results2 != NULL)
++ freeaddrinfo(results2);
+ return result;
+ }
+
+diff -Naur nfs-utils-2.3.3-orig/utils/mount/stropts.c nfs-utils-2.3.3/utils/mount/stropts.c
+--- nfs-utils-2.3.3-orig/utils/mount/stropts.c 2018-09-06 13:09:08.000000000 -0500
++++ nfs-utils-2.3.3/utils/mount/stropts.c 2019-04-21 02:43:18.451874403 -0500
+@@ -1263,7 +1263,8 @@
+ } else
+ nfs_error(_("%s: internal option parsing error"), progname);
+
+- freeaddrinfo(mi.address);
++ if (mi.address != NULL)
++ freeaddrinfo(mi.address);
+ free(mi.hostname);
+ return retval;
+ }
+diff -Naur nfs-utils-2.3.3-orig/utils/mountd/cache.c nfs-utils-2.3.3/utils/mountd/cache.c
+--- nfs-utils-2.3.3-orig/utils/mountd/cache.c 2019-04-21 02:33:43.603417171 -0500
++++ nfs-utils-2.3.3/utils/mountd/cache.c 2019-04-21 02:45:11.289792765 -0500
+@@ -834,7 +834,8 @@
+ out:
+ if (found_path)
+ free(found_path);
+- freeaddrinfo(ai);
++ if (ai != NULL)
++ freeaddrinfo(ai);
+ free(dom);
+ xlog(D_CALL, "nfsd_fh: found %p path %s", found, found ? found->e_path : NULL);
+ }
+@@ -1355,7 +1356,7 @@
+ xlog(D_CALL, "nfsd_export: found %p path %s", found, path ? path : NULL);
+ if (dom) free(dom);
+ if (path) free(path);
+- freeaddrinfo(ai);
++ if (ai) freeaddrinfo(ai);
+ }
+
+
+diff -Naur nfs-utils-2.3.3-orig/utils/mountd/mountd.c nfs-utils-2.3.3/utils/mountd/mountd.c
+--- nfs-utils-2.3.3-orig/utils/mountd/mountd.c 2018-09-06 13:09:08.000000000 -0500
++++ nfs-utils-2.3.3/utils/mountd/mountd.c 2019-04-21 02:45:41.796526387 -0500
+@@ -581,7 +581,8 @@
+ freeaddrinfo(ai);
+ continue;
+ }
+- freeaddrinfo(ai);
++ if (ai != NULL)
++ freeaddrinfo(ai);
+ }
+ cp = &(c->gr_next);
+ }
+diff -Naur nfs-utils-2.3.3-orig/utils/statd/hostname.c nfs-utils-2.3.3/utils/statd/hostname.c
+--- nfs-utils-2.3.3-orig/utils/statd/hostname.c 2018-09-06 13:09:08.000000000 -0500
++++ nfs-utils-2.3.3/utils/statd/hostname.c 2019-04-21 02:41:39.712446505 -0500
+@@ -308,8 +308,10 @@
+ }
+
+ out:
+- freeaddrinfo(results2);
+- freeaddrinfo(results1);
++ if (results2 != NULL)
++ freeaddrinfo(results2);
++ if (results1 != NULL)
++ freeaddrinfo(results1);
+
+ xlog(D_CALL, "%s: hostnames %s and %s %s", __func__,
+ hostname1, hostname2,