diff options
author | kwc@citi.umich.edu <kwc@citi.umich.edu> | 2006-07-03 18:34:43 -0400 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-07-04 10:27:15 +1000 |
commit | acae444246635ec2ca8990d53e685c9062d73091 (patch) | |
tree | 7161731fc0e02303ddf62a1cfd02f4b8d3f59778 | |
parent | 1f1b05a65ef3dc6597c7bc1e2a38f38ae95bf230 (diff) | |
download | nfs-utils-acae444246635ec2ca8990d53e685c9062d73091.tar.gz nfs-utils-acae444246635ec2ca8990d53e685c9062d73091.tar.xz nfs-utils-acae444246635ec2ca8990d53e685c9062d73091.zip |
Handle mapping failure from get_ids.
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Temporary patch to do default mapping if we get an error while trying to
map a gss principal to the appropriate uid/gid. This currently returns
hardcoded values. This may be correct, or we may need to try and figure
out the correct values to match the anonuid/anongid for the export.
-rw-r--r-- | utils/gssd/svcgssd_proc.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c index 2251d9a..4ab4b2e 100644 --- a/utils/gssd/svcgssd_proc.c +++ b/utils/gssd/svcgssd_proc.c @@ -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); + /* + * -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 = -2; /* XXX */ + cred->cr_gid = -2; /* XXX */ + cred->cr_groups[0] = -2;/* XXX */ + cred->cr_ngroups = 1; + res = 0; + goto out_free; + } + printerr(0, "WARNING: get_ids: failed to map name '%s' " + "to uid/gid: %s\n", sname, strerror(-res)); goto out_free; } cred->cr_uid = uid; |