Blame SOURCES/libnfsidmap-0.25-nssgssprinc.patch

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