From: Steve Dickson <SteveD@redhat.com>
To: Linux NFS Mailing list <linux-nfs@vger.kernel.org>
Subject: [PATCH] mountd: Check host alias with netgroups
Date: Fri, 24 Apr 2009 14:28:08 -0400 [thread overview]
Message-ID: <49F204B8.30003@RedHat.com> (raw)
exportfs and mountd needs check host aliases when checking
for hosts in net groups.
See https://bugzilla.redhat.com/show_bug.cgi?id=478952 for details
Signed-off-by: Steve Dickson <steved@redhat.com>
---------------------------
diff --git a/support/export/client.c b/support/export/client.c
index 1cb242f..5fcf355 100644
--- a/support/export/client.c
+++ b/support/export/client.c
@@ -371,7 +371,7 @@ client_check(nfs_client *clp, struct hostent *hp)
#ifdef HAVE_INNETGR
{
char *dot;
- int match;
+ int match, i;
struct hostent *nhp = NULL;
struct sockaddr_in addr;
@@ -380,6 +380,12 @@ client_check(nfs_client *clp, struct hostent *hp)
if (innetgr(cname+1, hname, NULL, NULL))
return 1;
+ /* try the aliases as well */
+ for (i = 0; hp->h_aliases[i]; i++) {
+ if (innetgr(cname+1, hp->h_aliases[i], NULL, NULL))
+ return 1;
+ }
+
/* If hname is ip address convert to FQDN */
if (inet_aton(hname, &addr.sin_addr) &&
(nhp = gethostbyaddr((const char *)&(addr.sin_addr),
reply other threads:[~2009-04-24 18:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49F204B8.30003@RedHat.com \
--to=steved@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox