]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/gssd/svcgssd_proc.c
Error check messages sent to the kernel.
[nfs-utils.git] / utils / gssd / svcgssd_proc.c
index 4ab4b2e48a261c01f797ae7687559963e5ce3c10..4037159b2ede2f737d0229728c15425ff9acdbd3 100644 (file)
@@ -72,6 +72,7 @@ do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred,
        FILE *f;
        int i;
        char *fname = NULL;
+       int err;
 
        printerr(1, "doing downcall\n");
        if ((fname = mech2file(mech)) == NULL)
@@ -93,9 +94,9 @@ do_svc_downcall(gss_buffer_desc *out_handle, struct svc_cred *cred,
                qword_printint(f, cred->cr_groups[i]);
        qword_print(f, fname);
        qword_printhex(f, context_token->value, context_token->length);
-       qword_eol(f);
+       err = qword_eol(f);
        fclose(f);
-       return 0;
+       return err;
 out_err:
        printerr(0, "WARNING: downcall failed\n");
        return -1;
@@ -224,12 +225,14 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred)
                 * -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;
                }