summaryrefslogtreecommitdiffstats
path: root/utils/mount/network.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-03-01 08:07:34 -0500
committerSteve Dickson <steved@redhat.com>2010-03-01 08:07:34 -0500
commit409b89cc7106154780400c6b2bdce46bc9d5db4b (patch)
tree885dcd25423f99f588ffa7b042033f0d9b2fa362 /utils/mount/network.c
parent9c8c2cd50d3cf0316c2a1bdf6cb9efc7e1a20be9 (diff)
downloadnfs-utils-409b89cc7106154780400c6b2bdce46bc9d5db4b.tar.gz
nfs-utils-409b89cc7106154780400c6b2bdce46bc9d5db4b.tar.xz
nfs-utils-409b89cc7106154780400c6b2bdce46bc9d5db4b.zip
nfs-utils: add and use nfs_authsys_create
The current mount, umount and showmount code uses authunix_create_default to get an auth handle. The one provided by glibc returned a truncated list of groups when there were more than 16 groups. libtirpc however currently does an abort() in this case, which causes the program to crash and dump core. nfs-utils just uses these auth handles for the MNT protocol, so the group list doesn't make a lot of difference here. Add a new function that creates an auth handle with a supplemental gids list that consists only of the primary gid. Have nfs-utils use that function anywhere that it currently uses authunix_create_default. Also, have the caller properly check for a NULL return from that function. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/network.c')
-rw-r--r--utils/mount/network.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c
index 8dc183a..c541257 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -857,7 +857,14 @@ int nfs_advise_umount(const struct sockaddr *sap, const socklen_t salen,
return 0;
}
- client->cl_auth = authunix_create_default();
+ client->cl_auth = nfs_authsys_create();
+ if (client->cl_auth == NULL) {
+ if (verbose)
+ nfs_error(_("%s: Failed to create RPC auth handle"),
+ progname);
+ CLNT_DESTROY(client);
+ return 0;
+ }
res = CLNT_CALL(client, MOUNTPROC_UMNT,
(xdrproc_t)xdr_dirpath, (caddr_t)argp,
@@ -957,8 +964,10 @@ CLIENT *mnt_openclnt(clnt_addr_t *mnt_server, int *msock)
}
if (clnt) {
/* try to mount hostname:dirname */
- clnt->cl_auth = authunix_create_default();
- return clnt;
+ clnt->cl_auth = nfs_authsys_create();
+ if (clnt->cl_auth)
+ return clnt;
+ CLNT_DESTROY(clnt);
}
return NULL;
}