]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/gssd/svcgssd_proc.c
Imported Debian patch 1.0.10-2
[nfs-utils.git] / utils / gssd / svcgssd_proc.c
index 3d67dc678b7f45fc8bdd63b328f28a7eddc3dafa..79813990c518c2dca579aaceded088e15ee08106 100644 (file)
@@ -140,7 +140,7 @@ send_response(FILE *f, gss_buffer_desc *in_handle, gss_buffer_desc *in_token,
                return -1;
        }
        *bp = '\0';
-       printerr(1, "writing message: %s", buf);
+       printerr(3, "writing message: %s", buf);
        if (write(g, buf, bp - buf) == -1) {
                printerr(0, "WARNING: failed to write message\n");
                close(g);
@@ -220,18 +220,18 @@ 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);
                /*
                 * -ENOENT means there was no mapping, any other error
                 * value means there was an error trying to do the
                 * mapping.
+                * If there was no mapping, we send down the value -1
+                * to indicate that the anonuid/anongid for the export
+                * should be used.
                 */
                if (res == -ENOENT) {
-                       cred->cr_uid = -2;      /* XXX */
-                       cred->cr_gid = -2;      /* XXX */
-                       cred->cr_groups[0] = -2;/* XXX */
-                       cred->cr_ngroups = 1;
+                       cred->cr_uid = -1;
+                       cred->cr_gid = -1;
+                       cred->cr_ngroups = 0;
                        res = 0;
                        goto out_free;
                }