]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/gssd/svcgssd_proc.c
Imported Debian patch 1.0.8+1.0.9pre1-1
[nfs-utils.git] / utils / gssd / svcgssd_proc.c
index b3a6ae8cda53d351e2a236867094564e9df89b33..79f5f50d3c5a603bcdfa1475d055a112df19dd84 100644 (file)
@@ -220,8 +220,21 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred)
        nfs4_init_name_mapping(NULL); /* XXX: should only do this once */
        res = nfs4_gss_princ_to_ids(secname, sname, &uid, &gid);
        if (res < 0) {
-               printerr(0, "WARNING: get_ids: unable to map "
-                       "name '%s' to a uid\n", sname);
+               printerr(0, "WARNING: get_ids: failed to map name '%s' "
+                       "to uid/gid: %s\n", sname, strerror(-res));
+               /*
+                * -ENOENT means there was no mapping, any other error
+                * value means there was an error trying to do the
+                * mapping.
+                */
+               if (res == -ENOENT) {
+                       cred->cr_uid = 65534;      /* XXX */
+                       cred->cr_gid = 65534;      /* XXX */
+                       cred->cr_groups[0] = 65534;/* XXX */
+                       cred->cr_ngroups = 1;
+                       res = 0;
+                       goto out_free;
+               }
                goto out_free;
        }
        cred->cr_uid = uid;