Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 161172 Details for
Bug 251368
rpc.mountd crashes with particular netgroup setup
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch 4 -- add "use_ipaddr" command line option
0006-Add-use_ipaddr-flag-to-make-it-use-dotted-quad-addre.patch (text/plain), 6.57 KB, created by
Jeff Layton
on 2007-08-13 14:02:30 UTC
(
hide
)
Description:
patch 4 -- add "use_ipaddr" command line option
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-08-13 14:02:30 UTC
Size:
6.57 KB
patch
obsolete
>From 6d77964518a8e976bf697993a967d0b28124f1a4 Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Fri, 10 Aug 2007 12:24:02 -0400 >Subject: [PATCH] Add use_ipaddr flag to make it use dotted quad address as cache key rather >than comma separated string. For now, just have this as a command-line >option (-i). >--- > utils/mountd/auth.c | 34 ++++++++++++++++++++++------------ > utils/mountd/cache.c | 45 +++++++++++++++++++++++++++++++++++++-------- > utils/mountd/mountd.c | 6 +++++- > 3 files changed, 64 insertions(+), 21 deletions(-) > >diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c >index 408c990..8061471 100644 >--- a/utils/mountd/auth.c >+++ b/utils/mountd/auth.c >@@ -37,6 +37,7 @@ static nfs_export my_exp; > static nfs_client my_client; > > extern int new_cache; >+extern int use_ipaddr; > > void > auth_init(char *exports) >@@ -88,29 +89,38 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller, > int i; > /* return static nfs_export with details filled in */ > char *n; >- my_client.m_addrlist[0] = caller->sin_addr; >- n = client_compose(hp); >- *error = unknown_host; >- if (!n) >- return NULL; >- if (my_client.m_hostname != NULL) >+ if (my_client.m_hostname != NULL) { > free(my_client.m_hostname); >- if (*n) { >- my_client.m_hostname = n; >+ my_client.m_hostname = NULL; >+ } >+ if (use_ipaddr) { >+ my_client.m_hostname = >+ xstrdup(inet_ntoa(caller->sin_addr)); > } else { >- free(n); >- my_client.m_hostname = xstrdup("DEFAULT"); >+ n = client_compose(hp); >+ *error = unknown_host; >+ if (!n) >+ return NULL; >+ if (*n) { >+ my_client.m_hostname = n; >+ } else { >+ free(n); >+ my_client.m_hostname = xstrdup("DEFAULT"); >+ } > } > my_client.m_naddr = 1; >+ my_client.m_addrlist[0] = caller->sin_addr; > my_exp.m_client = &my_client; > > exp = NULL; > for (i = 0; !exp && i < MCL_MAXTYPES; i++) > for (exp = exportlist[i]; exp; exp = exp->m_next) { >- if (!client_member(my_client.m_hostname, exp->m_client->m_hostname)) >- continue; > if (strcmp(path, exp->m_export.e_path)) > continue; >+ if (!use_ipaddr && !client_member(my_client.m_hostname, exp->m_client->m_hostname)) >+ continue; >+ if (use_ipaddr && !client_check(exp->m_client, hp)) >+ continue; > break; > } > *error = not_exported; >diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c >index b6b0473..25248b8 100644 >--- a/utils/mountd/cache.c >+++ b/utils/mountd/cache.c >@@ -61,6 +61,7 @@ int cache_export_ent(char *domain, struct exportent *exp, char *p); > > char *lbuf = NULL; > int lbuflen = 0; >+extern int use_ipaddr; > > void auth_unix_ip(FILE *f) > { >@@ -74,9 +75,9 @@ void auth_unix_ip(FILE *f) > char *cp; > char class[20]; > char ipaddr[20]; >- char *client; >+ char *client = NULL; > struct in_addr addr; >- struct hostent *he; >+ struct hostent *he = NULL; > if (readline(fileno(f), &lbuf, &lbuflen) != 1) > return; > >@@ -95,14 +96,17 @@ void auth_unix_ip(FILE *f) > auth_reload(); > > /* addr is a valid, interesting address, find the domain name... */ >- he = client_resolve(addr); >- client = client_compose(he); >- >+ if (!use_ipaddr) { >+ he = client_resolve(addr); >+ client = client_compose(he); >+ } > > qword_print(f, "nfsd"); > qword_print(f, ipaddr); > qword_printint(f, time(0)+30*60); >- if (client) >+ if (use_ipaddr) >+ qword_print(f, ipaddr); >+ else if (client) > qword_print(f, *client?client:"DEFAULT"); > qword_eol(f); > >@@ -267,6 +271,8 @@ void nfsd_fh(FILE *f) > unsigned int fsidnum=0; > char fsid[32]; > struct exportent *found = NULL; >+ struct hostent *he = NULL; >+ struct in_addr addr; > char *found_path = NULL; > nfs_export *exp; > int i; >@@ -392,7 +398,7 @@ void nfsd_fh(FILE *f) > next_exp = exp->m_next; > } > >- if (!client_member(dom, exp->m_client->m_hostname)) >+ if (!use_ipaddr && !client_member(dom, exp->m_client->m_hostname)) > continue; > if (exp->m_export.e_mountpoint && > !is_mountpoint(exp->m_export.e_mountpoint[0]? >@@ -444,6 +450,15 @@ void nfsd_fh(FILE *f) > continue; > #endif > } >+ if (use_ipaddr) { >+ if (he == NULL) { >+ if (!inet_aton(dom, &addr)) >+ goto out; >+ he = client_resolve(addr); >+ } >+ if (!client_check(exp->m_client, he)) >+ continue; >+ } > /* It's a match !! */ > if (!found) { > found = &exp->m_export; >@@ -495,6 +510,8 @@ void nfsd_fh(FILE *f) > qword_print(f, found->e_path); > qword_eol(f); > out: >+ if (he) >+ free(he); > free(dom); > return; > } >@@ -582,6 +599,8 @@ void nfsd_export(FILE *f) > char *dom, *path; > nfs_export *exp, *found = NULL; > int found_type = 0; >+ struct in_addr addr; >+ struct hostent *he = NULL; > > > if (readline(fileno(f), &lbuf, &lbuflen) != 1) >@@ -604,7 +623,7 @@ void nfsd_export(FILE *f) > /* now find flags for this export point in this domain */ > for (i=0 ; i < MCL_MAXTYPES; i++) { > for (exp = exportlist[i]; exp; exp = exp->m_next) { >- if (!client_member(dom, exp->m_client->m_hostname)) >+ if (!use_ipaddr && !client_member(dom, exp->m_client->m_hostname)) > continue; > if (exp->m_export.e_flags & NFSEXP_CROSSMOUNT) { > /* if path is a mountpoint below e_path, then OK */ >@@ -618,6 +637,15 @@ void nfsd_export(FILE *f) > continue; > } else if (strcmp(path, exp->m_export.e_path) != 0) > continue; >+ if (use_ipaddr) { >+ if (he == NULL) { >+ if (!inet_aton(dom, &addr)) >+ goto out; >+ he = client_resolve(addr); >+ } >+ if (!client_check(exp->m_client, he)) >+ continue; >+ } > if (!found) { > found = exp; > found_type = i; >@@ -659,6 +687,7 @@ void nfsd_export(FILE *f) > out: > if (dom) free(dom); > if (path) free(path); >+ if (he) free(he); > } > > >diff --git a/utils/mountd/mountd.c b/utils/mountd/mountd.c >index 999f035..06a3471 100644 >--- a/utils/mountd/mountd.c >+++ b/utils/mountd/mountd.c >@@ -40,6 +40,7 @@ static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, mountstat3 *, > int reverse_resolve = 0; > int new_cache = 0; > int manage_gids; >+int use_ipaddr = 0; > > /* PRC: a high-availability callout program can be specified with -H > * When this is done, the program will receive callouts whenever clients >@@ -569,7 +570,7 @@ main(int argc, char **argv) > > /* Parse the command line options and arguments. */ > opterr = 0; >- while ((c = getopt_long(argc, argv, "o:nFd:f:p:P:hH:N:V:vrs:t:g", longopts, NULL)) != EOF) >+ while ((c = getopt_long(argc, argv, "o:nFd:f:ip:P:hH:N:V:vrs:t:g", longopts, NULL)) != EOF) > switch (c) { > case 'g': > manage_gids = 1; >@@ -597,6 +598,9 @@ main(int argc, char **argv) > case 'h': > usage(argv [0], 0); > break; >+ case 'i': >+ use_ipaddr = 1; >+ break; > case 'P': /* XXX for nfs-server compatibility */ > case 'p': > port = atoi(optarg); >-- >1.5.2.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 251368
:
160915
|
160916
|
160917
|
161172
|
161874