char ipaddr[INET6_ADDRSTRLEN];
char *client = NULL;
struct addrinfo *tmp = NULL;
- struct addrinfo *ai = NULL;
if (readline(fileno(f), &lbuf, &lbuflen) != 1)
return;
/* addr is a valid, interesting address, find the domain name... */
if (!use_ipaddr) {
+ 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;
}
- freeaddrinfo(tmp);
-
qword_print(f, "nfsd");
qword_print(f, ipaddr);
qword_printuint(f, time(0) + DEFAULT_TTL);
xlog(D_CALL, "auth_unix_ip: client %p '%s'", client, client?client: "DEFAULT");
free(client);
+out:
+ freeaddrinfo(tmp);
+
}
static void auth_unix_gid(FILE *f)