Skip to contentSkip to conversation

nss_getpwnam: ignore case when comparing domain names

PATCH In review Steve Dickson 1 participant 2 messages Nov 12, 2011 – Nov 14, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nss_getpwnam: ignore case when comparing domain names

nss_getpwnam() fails to find the password entry when the DNS domain name has both upper and lower characters, which is wrong. Case need to be ignored when comparing domain names.

---
 nss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
nss.c +1 -1
index 04aff19..b2b1227 100644
@@ -141,7 +141,7 @@ static char *strip_domain(const char *name, const char *domain)
 	if (c == NULL && domain == NULL) {
 		len = strlen(name) + 1;
 	} else {
-		if (domain && strcmp(c + 1, domain) != 0)
+		if (domain && strcasecmp(c + 1, domain) != 0)
 			goto out;
 		len = c - name;
 	}
Signature · 1 line
1.7.7
#1 lore raw
Quoted 6 lines · Steve Dickson

nss_getpwnam() fails to find the password entry when the DNS domain name has both upper and lower characters, which is wrong. Case need to be ignored when comparing domain names.

Committed...

steved.

Quoted 17 lines
---
 nss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
nss.c +1 -1
index 04aff19..b2b1227 100644
@@ -141,7 +141,7 @@ static char *strip_domain(const char *name, const char *domain)
 	if (c == NULL && domain == NULL) {
 		len = strlen(name) + 1;
 	} else {
-		if (domain && strcmp(c + 1, domain) != 0)
+		if (domain && strcasecmp(c + 1, domain) != 0)
 			goto out;
 		len = c - name;
 	}