public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] nss_getpwnam: ignore case when comparing domain names
@ 2011-11-12 15:21 Steve Dickson
  2011-11-14 21:16 ` Steve Dickson
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Dickson @ 2011-11-12 15:21 UTC (permalink / raw)
  To: Linux NFS Mailing List

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.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 nss.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/nss.c b/nss.c
index 04aff19..b2b1227 100644
--- a/nss.c
+++ b/nss.c
@@ -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;
 	}
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] nss_getpwnam: ignore case when comparing domain names
  2011-11-12 15:21 [PATCH 1/1] nss_getpwnam: ignore case when comparing domain names Steve Dickson
@ 2011-11-14 21:16 ` Steve Dickson
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2011-11-14 21:16 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Linux NFS Mailing List



On 11/12/2011 10:21 AM, Steve Dickson wrote:
> 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.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed...

steved.

> ---
>  nss.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/nss.c b/nss.c
> index 04aff19..b2b1227 100644
> --- a/nss.c
> +++ b/nss.c
> @@ -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;
>  	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-14 21:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-12 15:21 [PATCH 1/1] nss_getpwnam: ignore case when comparing domain names Steve Dickson
2011-11-14 21:16 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox