X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fgssd%2Fsvcgssd_proc.c;h=7c58f7bf1b1c10709682fff269c46767404a1161;hb=247fbdbfa6d6282a891af4d9d2a48078df710eb3;hp=bf40bc98bbb03004e8d91dee33264fdcf8f0f227;hpb=28a7603b719f8d35bf22fd3018b610b489fec78f;p=nfs-utils.git diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c index bf40bc9..7c58f7b 100644 --- a/utils/gssd/svcgssd_proc.c +++ b/utils/gssd/svcgssd_proc.c @@ -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; @@ -124,8 +125,8 @@ send_response(FILE *f, gss_buffer_desc *in_handle, gss_buffer_desc *in_token, qword_addhex(&bp, &blen, in_handle->value, in_handle->length); qword_addhex(&bp, &blen, in_token->value, in_token->length); qword_addint(&bp, &blen, 0x7fffffff); /*XXX need a better timeout */ - qword_addint(&bp, &blen, maj_stat); - qword_addint(&bp, &blen, min_stat); + qword_adduint(&bp, &blen, maj_stat); + qword_adduint(&bp, &blen, min_stat); qword_addhex(&bp, &blen, out_handle->value, out_handle->length); qword_addhex(&bp, &blen, out_token->value, out_token->length); qword_addeol(&bp, &blen); @@ -224,10 +225,13 @@ 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 = 65534; /* XXX */ - cred->cr_gid = 65534; /* XXX */ + cred->cr_uid = -1; + cred->cr_gid = -1; cred->cr_ngroups = 0; res = 0; goto out_free;