diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2012-12-04 09:56:14 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2012-12-04 10:00:28 +0000 |
commit | 95e73982d6b68780a74a677f0fada23e6392e2fc (patch) | |
tree | 3fcf878c8e9e9837095ef9f063552da15ef6beae | |
parent | b8994564b91778ded46368553691ba6728d9c17f (diff) | |
download | aports-95e73982d6b68780a74a677f0fada23e6392e2fc.tar.bz2 aports-95e73982d6b68780a74a677f0fada23e6392e2fc.tar.xz |
main/nfs-utils: fix for wrong getaddrinfo assumptions
The nfs-utils assumes getaddrinfo(AI_NUMERICHOST) never fills in
ai_canonname, but it appears to do on uclibc. It also assumes that if it
filled in, it will be allocated separately and that freeaddrinfo() will
free it. This is not what uclibc does.
This patch should fix a potensial memleak on nfs server and probably it
will fix nfs server on x86_64
ref #1486
-rw-r--r-- | main/nfs-utils/APKBUILD | 5 | ||||
-rw-r--r-- | main/nfs-utils/uclibc-getaddrinfo-canonname.patch | 28 |
2 files changed, 31 insertions, 2 deletions
diff --git a/main/nfs-utils/APKBUILD b/main/nfs-utils/APKBUILD index 514467caad..3e553177b1 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.6 -pkgrel=0 +pkgrel=1 pkgdesc="kernel-mode NFS" url="http://nfs.sourceforge.net/" arch="all" @@ -23,6 +23,7 @@ source="http://downloads.sourceforge.net/nfs/$pkgname-$pkgver.tar.bz2 nfs.confd nfs.exports nfs-utils-mtab-sym.patch + uclibc-getaddrinfo-canonname.patch osd_login.patch" prepare() { @@ -52,7 +53,6 @@ build() { --enable-uuid \ --disable-gss \ --enable-mount \ - --enable-nfsv3 \ --with-statedir=/var/lib/nfs make || return 1 @@ -90,4 +90,5 @@ d514fb87ce5de9909f43d99012352f09 nfsmount.initd 09135438d6df50b868bbe5a2260f973c nfs.confd 4f1bb7b2412ce5952ecb5ec22d8ed99d nfs.exports a3a7338f8de3ac37c1ffc05bdcb77d16 nfs-utils-mtab-sym.patch +8d4de0a448ef4d228646570cfc17fd7f uclibc-getaddrinfo-canonname.patch 3a1e3ff3de39a211f6d4d3ecb16b37aa osd_login.patch" diff --git a/main/nfs-utils/uclibc-getaddrinfo-canonname.patch b/main/nfs-utils/uclibc-getaddrinfo-canonname.patch new file mode 100644 index 0000000000..0811958333 --- /dev/null +++ b/main/nfs-utils/uclibc-getaddrinfo-canonname.patch @@ -0,0 +1,28 @@ +--- ./support/export/hostname.c.orig ++++ ./support/export/hostname.c +@@ -101,6 +101,7 @@ + .ai_protocol = (int)IPPROTO_UDP, + .ai_flags = AI_NUMERICHOST, + .ai_family = AF_UNSPEC, ++ .ai_socktype = 0, + }; + struct sockaddr_in sin; + int error, inet4; +@@ -382,7 +383,9 @@ + + /* + * getaddrinfo(AI_NUMERICHOST) never fills in ai_canonname ++ * ...well, it does on uclibc. + */ ++#ifndef __UCLIBC__ + if (ai != NULL) { + ai->ai_canonname = strdup(buf); + if (ai->ai_canonname == NULL) { +@@ -390,6 +393,7 @@ + ai = NULL; + } + } ++#endif + + return ai; + } |