From: J. Bruce Fields Date: Wed, 28 Nov 2012 14:11:29 +0000 (-0500) Subject: mountd: auth_unix_ip should downcall on error to prevent hangs X-Git-Tag: debian/1%1.2.8-1~11^2^2~54 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=cb3b81d6c4167ede8886115e271584a96ea55565;p=nfs-utils.git mountd: auth_unix_ip should downcall on error to prevent hangs Since bf6a4febaa78bf188896b7b5b02c46562dd08b70 "mountd: handle allocation failures in auth_unix_ip upcall", a failure to map the address of an incoming client to a name could result in a hang. We should be responding with an error in the case, not just skipping the downcall and leaving everybody hanging. Signed-off-by: J. Bruce Fields Signed-off-by: Steve Dickson --- diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index e950ec6..c13f305 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -109,12 +109,10 @@ static void auth_unix_ip(FILE *f) struct addrinfo *ai = NULL; ai = client_resolve(tmp->ai_addr); - if (ai == NULL) - goto out; - client = client_compose(ai); - freeaddrinfo(ai); - if (!client) - goto out; + if (ai) { + client = client_compose(ai); + freeaddrinfo(ai); + } } qword_print(f, "nfsd"); qword_print(f, ipaddr); @@ -127,7 +125,6 @@ static void auth_unix_ip(FILE *f) xlog(D_CALL, "auth_unix_ip: client %p '%s'", client, client?client: "DEFAULT"); free(client); -out: freeaddrinfo(tmp); }