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 160917 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]
patch3 -- make a client_resolve function and have client_compose take a hostent
0003-Create-client_resolve-and-change-client_compose-to-t.patch (text/plain), 4.09 KB, created by
Jeff Layton
on 2007-08-08 16:16:51 UTC
(
hide
)
Description:
patch3 -- make a client_resolve function and have client_compose take a hostent
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-08-08 16:16:51 UTC
Size:
4.09 KB
patch
obsolete
>From b1b5b7f804e2f626f67ac9a41f0a1f76dae0641c Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Wed, 8 Aug 2007 10:37:00 -0400 >Subject: [PATCH] Create client_resolve and change client_compose to take a hostent arg > >This lets us avoid the extra hostname resolution in auth_authenticate >codepath. >--- > support/export/client.c | 22 ++++++++++++++-------- > support/include/exportfs.h | 3 ++- > utils/mountd/auth.c | 8 ++------ > utils/mountd/cache.c | 5 ++++- > 4 files changed, 22 insertions(+), 16 deletions(-) > >diff --git a/support/export/client.c b/support/export/client.c >index d1369f8..33c5432 100644 >--- a/support/export/client.c >+++ b/support/export/client.c >@@ -235,6 +235,19 @@ client_find(struct hostent *hp) > return NULL; > } > >+struct hostent * >+client_resolve(struct in_addr addr) >+{ >+ struct hostent *he = NULL; >+ >+ if (clientlist[MCL_WILDCARD] || clientlist[MCL_NETGROUP]) >+ he = get_reliable_hostbyaddr((const char*)&addr, sizeof(addr), AF_INET); >+ if (he == NULL) >+ he = get_hostent((const char*)&addr, sizeof(addr), AF_INET); >+ >+ return he; >+} >+ > /* > * Find client name given an IP address > * This is found by gathering all known names that match that IP address, >@@ -244,17 +257,11 @@ client_find(struct hostent *hp) > static char *add_name(char *old, char *add); > > char * >-client_compose(struct in_addr addr) >+client_compose(struct hostent *he) > { >- struct hostent *he = NULL; > char *name = NULL; > int i; > >- if (clientlist[MCL_WILDCARD] || clientlist[MCL_NETGROUP]) >- he = get_reliable_hostbyaddr((const char*)&addr, sizeof(addr), AF_INET); >- if (he == NULL) >- he = get_hostent((const char*)&addr, sizeof(addr), AF_INET); >- > for (i = 0 ; i < MCL_MAXTYPES; i++) { > nfs_client *clp; > for (clp = clientlist[i]; clp ; clp = clp->m_next) { >@@ -263,7 +270,6 @@ client_compose(struct in_addr addr) > name = add_name(name, clp->m_hostname); > } > } >- free(he); > return name; > } > >diff --git a/support/include/exportfs.h b/support/include/exportfs.h >index b903825..21804d7 100644 >--- a/support/include/exportfs.h >+++ b/support/include/exportfs.h >@@ -64,7 +64,8 @@ int client_check(nfs_client *, struct hostent *); > int client_match(nfs_client *, char *hname); > void client_release(nfs_client *); > void client_freeall(void); >-char * client_compose(struct in_addr addr); >+char * client_compose(struct hostent *he); >+struct hostent * client_resolve(struct in_addr addr); > int client_member(char *client, char *name); > > int export_read(char *fname); >diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c >index c452a16..408c990 100644 >--- a/utils/mountd/auth.c >+++ b/utils/mountd/auth.c >@@ -89,7 +89,7 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller, > /* return static nfs_export with details filled in */ > char *n; > my_client.m_addrlist[0] = caller->sin_addr; >- n = client_compose(caller->sin_addr); >+ n = client_compose(hp); > *error = unknown_host; > if (!n) > return NULL; >@@ -161,11 +161,7 @@ auth_authenticate(char *what, struct sockaddr_in *caller, char *path) > epath[sizeof (epath) - 1] = '\0'; > auth_fixpath(epath); /* strip duplicate '/' etc */ > >- hp = get_reliable_hostbyaddr((const char*)&caller->sin_addr, sizeof(struct in_addr), >- AF_INET); >- if (!hp) >- hp = get_hostent((const char*)&caller->sin_addr, sizeof(struct in_addr), >- AF_INET); >+ hp = client_resolve(caller->sin_addr); > if (!hp) > return exp; > >diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c >index 15100d4..b6b0473 100644 >--- a/utils/mountd/cache.c >+++ b/utils/mountd/cache.c >@@ -76,6 +76,7 @@ void auth_unix_ip(FILE *f) > char ipaddr[20]; > char *client; > struct in_addr addr; >+ struct hostent *he; > if (readline(fileno(f), &lbuf, &lbuflen) != 1) > return; > >@@ -94,7 +95,8 @@ void auth_unix_ip(FILE *f) > auth_reload(); > > /* addr is a valid, interesting address, find the domain name... */ >- client = client_compose(addr); >+ he = client_resolve(addr); >+ client = client_compose(he); > > > qword_print(f, "nfsd"); >@@ -105,6 +107,7 @@ void auth_unix_ip(FILE *f) > qword_eol(f); > > if (client) free(client); >+ if (he) free(he); > > } > >-- >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