const unsigned short protocol,
                                const struct timeval *timeout);
 
+/* create AUTH_SYS handle with no supplemental groups */
+extern AUTH *                   nfs_authsys_create(void);
+
 #endif /* !__NFS_UTILS_NFSRPC_H */
 
 
        return program;
 }
+
+/*
+ * AUTH_SYS doesn't allow more than 16 gids in the supplemental group list.
+ * If there are more than that, trying to determine which ones to include
+ * in the list is problematic. This function creates an auth handle that
+ * only has the primary gid in the supplemental gids list. It's intended to
+ * be used for protocols where credentials really don't matter much (the MNT
+ * protocol, for instance).
+ */
+AUTH *
+nfs_authsys_create(void)
+{
+       char machname[MAXHOSTNAMELEN + 1];
+       uid_t   uid = geteuid();
+       gid_t   gid = getegid();
+
+       if (gethostname(machname, sizeof(machname)) == -1)
+               return NULL;
+
+       return authsys_create(machname, uid, gid, 1, &gid);
+}
 
                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,
        }
        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;
 }
 
        }
 
        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;