diff options
author | Peter Wagner <tripolar@gmx.at> | 2019-02-20 10:59:50 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2019-02-27 11:48:29 -0500 |
commit | ed06fade6dc46df0a38caab2e465dfaabfc76f46 (patch) | |
tree | 051195f58419394fdd45cd5bab74cd2be45ff239 /support/export | |
parent | 8f459a072f93458fc2198ce1962b279164aa9059 (diff) | |
download | nfs-utils-ed06fade6dc46df0a38caab2e465dfaabfc76f46.tar.gz |
nfs-utils: fix addrinfo usage with musl-1.1.21
Afer the update to musl 1.1.21 freeaddrinfo is broken in some places in
the nfs-utils code because glibc seems to ignore when freeaddrinfo is
called with a NULL pointer which seems to be not defined in the spec.
See: https://www.openwall.com/lists/musl/2019/02/03/4
The free in support/export/hostname.c is removed too
See: https://www.openwall.com/lists/musl/2019/02/17/2
Define and use wrapper function nfs_freeaddrinfo to handle
freeaddrinfo versions that don't tolerate NULL pointers
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Peter Wagner <tripolar@gmx.at>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support/export')
-rw-r--r-- | support/export/client.c | 6 | ||||
-rw-r--r-- | support/export/hostname.c | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/support/export/client.c b/support/export/client.c index baf59c8..a1fba01 100644 --- a/support/export/client.c +++ b/support/export/client.c @@ -210,7 +210,7 @@ init_subnetwork(nfs_client *clp) set_addrlist(clp, 0, ai->ai_addr); family = ai->ai_addr->sa_family; - freeaddrinfo(ai); + nfs_freeaddrinfo(ai); switch (family) { case AF_INET: @@ -309,7 +309,7 @@ client_lookup(char *hname, int canonical) init_addrlist(clp, ai); out: - freeaddrinfo(ai); + nfs_freeaddrinfo(ai); return clp; } @@ -674,7 +674,7 @@ check_netgroup(const nfs_client *clp, const struct addrinfo *ai) tmp = host_pton(hname); if (tmp != NULL) { char *cname = host_canonname(tmp->ai_addr); - freeaddrinfo(tmp); + nfs_freeaddrinfo(tmp); /* The resulting FQDN may be in our netgroup. */ if (cname != NULL) { diff --git a/support/export/hostname.c b/support/export/hostname.c index 96c5449..be4d7f6 100644 --- a/support/export/hostname.c +++ b/support/export/hostname.c @@ -130,7 +130,7 @@ host_pton(const char *paddr) if (!inet4 && ai->ai_addr->sa_family == AF_INET) { xlog(D_GENERAL, "%s: failed to convert %s", __func__, paddr); - freeaddrinfo(ai); + nfs_freeaddrinfo(ai); break; } return ai; @@ -292,7 +292,7 @@ host_reliable_addrinfo(const struct sockaddr *sap) if (nfs_compare_sockaddr(a->ai_addr, sap)) break; - freeaddrinfo(ai); + nfs_freeaddrinfo(ai); ai = NULL; if (!a) goto out; |