Blame SOURCES/libnfsidmap-0.25-nssgssprinc.patch

83af1d
nss_gss_princ_to_ids() and nss_gss_princ_to_grouplist() must strip the realm
83af1d
83af1d
nss_gss_princ_to_ids() and nss_gss_princ_to_grouplist() were hard-coded
83af1d
to call nss_getpwnam with the 'dostrip' arg set to 0, which is the
83af1d
opposite of what they should have had.  Note: there's no point making
83af1d
the decision to strip or not to strip configurable in these two
83af1d
functions.  Ideally both of these functions should be taking a
83af1d
gss_name_t instead of a char * for the principal, calling
83af1d
gss_localname() on that, and passing the result to nss_getpwnam... but
83af1d
that would require changes in both rpc.svcgssd and libgssglue (both of
83af1d
which have been deprecated for a while).
83af1d
83af1d
Fixes: 4db1bb1 (libnfsidmap: add options to aid id mapping in multi domain environments)
83af1d
Signed-off-by: Scott Mayhew <smayhew@redhat.com>
83af1d
---
83af1d
 nss.c | 4 ++--
83af1d
 1 file changed, 2 insertions(+), 2 deletions(-)
83af1d
83af1d
diff --git a/nss.c b/nss.c
83af1d
index 67e657a..82799ce 100644
83af1d
--- a/nss.c
83af1d
+++ b/nss.c
83af1d
@@ -415,7 +415,7 @@ static int nss_gss_princ_to_ids(char *secname, char *princ,
83af1d
 		return -ENOENT;
83af1d
 	}
83af1d
 	/* XXX: this should call something like getgssauthnam instead? */
83af1d
-	pw = nss_getpwnam(princ, NULL, &err, 0);
83af1d
+	pw = nss_getpwnam(princ, NULL, &err, 1);
83af1d
 	if (pw == NULL) {
83af1d
 		err = -ENOENT;
83af1d
 		goto out;
83af1d
@@ -438,7 +438,7 @@ int nss_gss_princ_to_grouplist(char *secname, char *princ,
83af1d
 		goto out;
83af1d
 	/* XXX: not quite right?  Need to know default realm? */
83af1d
 	/* XXX: this should call something like getgssauthnam instead? */
83af1d
-	pw = nss_getpwnam(princ, NULL, &ret, 0);
83af1d
+	pw = nss_getpwnam(princ, NULL, &ret, 1);
83af1d
 	if (pw == NULL) {
83af1d
 		ret = -ENOENT;
83af1d
 		goto out;