summaryrefslogtreecommitdiff
path: root/utils/showmount
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/showmount
parent9c8c2cd50d3cf0316c2a1bdf6cb9efc7e1a20be9 (diff)
downloadnfs-utils-409b89cc7106154780400c6b2bdce46bc9d5db4b.tar.gz
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/showmount')
-rw-r--r--utils/showmount/showmount.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c
index f567093..394f528 100644
--- a/utils/showmount/showmount.c
+++ b/utils/showmount/showmount.c
@@ -194,7 +194,13 @@ int main(int argc, char **argv)
}
mclient = nfs_get_mount_client(hostname, mount_vers_tbl[vers]);
- mclient->cl_auth = authunix_create_default();
+ mclient->cl_auth = nfs_authsys_create();
+ if (mclient->cl_auth == NULL) {
+ fprintf(stderr, "%s: unable to create RPC auth handle.\n",
+ program_name);
+ clnt_destroy(mclient);
+ exit(1);
+ }
total_timeout.tv_sec = TOTAL_TIMEOUT;
total_timeout.tv_usec = 0;