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 160915 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 1 -- make m_hostname a dynamically allocated string
0001-Change-m_hostname-to-be-a-dynamically-allocated-stri.patch (text/plain), 2.54 KB, created by
Jeff Layton
on 2007-08-08 16:13:04 UTC
(
hide
)
Description:
patch 1 -- make m_hostname a dynamically allocated string
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-08-08 16:13:04 UTC
Size:
2.54 KB
patch
obsolete
>From 7f77eb2225fcbfe58744772cd460aa7f5837a4c6 Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Wed, 8 Aug 2007 09:48:09 -0400 >Subject: [PATCH] Change m_hostname to be a dynamically-allocated string > >--- > support/export/client.c | 17 +++++++++-------- > support/include/exportfs.h | 2 +- > utils/mountd/auth.c | 10 ++++++++-- > 3 files changed, 18 insertions(+), 11 deletions(-) > >diff --git a/support/export/client.c b/support/export/client.c >index 19b53aa..d1369f8 100644 >--- a/support/export/client.c >+++ b/support/export/client.c >@@ -118,6 +118,7 @@ client_dup(nfs_client *clp, struct hostent *hp) > new = (nfs_client *) xmalloc(sizeof(*new)); > memcpy(new, clp, sizeof(*new)); > new->m_type = MCL_FQDN; >+ new->m_hostname = NULL; > > client_init(new, (char *) hp->h_name, hp); > client_add(new); >@@ -127,14 +128,12 @@ client_dup(nfs_client *clp, struct hostent *hp) > static void > client_init(nfs_client *clp, const char *hname, struct hostent *hp) > { >- if (hp) { >- strncpy(clp->m_hostname, hp->h_name, >- sizeof (clp->m_hostname) - 1); >- } else { >- strncpy(clp->m_hostname, hname, >- sizeof (clp->m_hostname) - 1); >- } >- clp->m_hostname[sizeof (clp->m_hostname) - 1] = '\0'; >+ if (clp->m_hostname) >+ xfree(clp->m_hostname); >+ if (hp) >+ clp->m_hostname = xstrdup(hp->h_name); >+ else >+ clp->m_hostname = xstrdup(hname); > > clp->m_exported = 0; > clp->m_count = 0; >@@ -207,6 +206,8 @@ client_freeall(void) > head = clientlist + i; > while (*head) { > *head = (clp = *head)->m_next; >+ if (clp->m_hostname != NULL) >+ xfree(clp->m_hostname); > xfree(clp); > } > } >diff --git a/support/include/exportfs.h b/support/include/exportfs.h >index 431b5ce..b903825 100644 >--- a/support/include/exportfs.h >+++ b/support/include/exportfs.h >@@ -32,7 +32,7 @@ enum { > > typedef struct mclient { > struct mclient * m_next; >- char m_hostname[NFSCLNT_IDMAX+1]; >+ char *m_hostname; > int m_type; > int m_naddr; > struct in_addr m_addrlist[NFSCLNT_ADDRMAX]; >diff --git a/utils/mountd/auth.c b/utils/mountd/auth.c >index f7fe23d..c452a16 100644 >--- a/utils/mountd/auth.c >+++ b/utils/mountd/auth.c >@@ -93,8 +93,14 @@ auth_authenticate_internal(char *what, struct sockaddr_in *caller, > *error = unknown_host; > if (!n) > return NULL; >- strcpy(my_client.m_hostname, *n?n:"DEFAULT"); >- free(n); >+ if (my_client.m_hostname != NULL) >+ free(my_client.m_hostname); >+ if (*n) { >+ my_client.m_hostname = n; >+ } else { >+ free(n); >+ my_client.m_hostname = xstrdup("DEFAULT"); >+ } > my_client.m_naddr = 1; > my_exp.m_client = &my_client; > >-- >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