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 160916 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 2 -- make e_hostname a dynamically allocated string
0002-Make-e_hostname-a-dynamically-allocated-string.patch (text/plain), 4.89 KB, created by
Jeff Layton
on 2007-08-08 16:14:50 UTC
(
hide
)
Description:
patch 2 -- make e_hostname a dynamically allocated string
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-08-08 16:14:50 UTC
Size:
4.89 KB
patch
obsolete
>From b3a057676953340fe1563dfff44e94b3be6a311b Mon Sep 17 00:00:00 2001 >From: Jeff Layton <jlayton@redhat.com> >Date: Wed, 8 Aug 2007 09:52:22 -0400 >Subject: [PATCH] Make e_hostname a dynamically-allocated string > >--- > support/export/export.c | 6 ++++++ > support/export/rmtab.c | 4 +--- > support/export/xtab.c | 9 ++------- > support/include/nfslib.h | 2 +- > support/nfs/exports.c | 21 ++++++++------------- > 5 files changed, 18 insertions(+), 24 deletions(-) > >diff --git a/support/export/export.c b/support/export/export.c >index 74e1d1b..b2cfce5 100644 >--- a/support/export/export.c >+++ b/support/export/export.c >@@ -85,6 +85,8 @@ export_init(nfs_export *exp, nfs_client *clp, struct exportent *nep) > struct exportent *e = &exp->m_export; > > dupexportent(e, nep); >+ if (nep->e_hostname) >+ e->e_hostname = xstrdup(nep->e_hostname); > > exp->m_exported = 0; > exp->m_xtabent = 0; >@@ -109,6 +111,8 @@ export_dup(nfs_export *exp, struct hostent *hp) > new = (nfs_export *) xmalloc(sizeof(*new)); > memcpy(new, exp, sizeof(*new)); > dupexportent(&new->m_export, &exp->m_export); >+ if (exp->m_export.e_hostname) >+ new->m_export.e_hostname = xstrdup(exp->m_export.e_hostname); > clp = client_dup(exp->m_client, hp); > clp->m_count++; > new->m_client = clp; >@@ -244,6 +248,8 @@ export_freeall(void) > free(exp->m_export.e_mountpoint); > if (exp->m_export.e_fslocdata) > xfree(exp->m_export.e_fslocdata); >+ if (exp->m_export.e_hostname) >+ xfree(exp->m_export.e_hostname); > xfree(exp); > } > exportlist[i] = NULL; >diff --git a/support/export/rmtab.c b/support/export/rmtab.c >index 15aab15..2a882aa 100644 >--- a/support/export/rmtab.c >+++ b/support/export/rmtab.c >@@ -43,9 +43,7 @@ rmtab_read(void) > if (!exp2) { > struct exportent ee; > dupexportent(&ee, &exp->m_export); >- strncpy (ee.e_hostname, rep->r_client, >- sizeof (ee.e_hostname) - 1); >- ee.e_hostname[sizeof (ee.e_hostname) -1] = '\0'; >+ ee.e_hostname = rep->r_client; > exp2 = export_create(&ee, 0); > exp2->m_changed = exp->m_changed; > } >diff --git a/support/export/xtab.c b/support/export/xtab.c >index 292087b..990113e 100644 >--- a/support/export/xtab.c >+++ b/support/export/xtab.c >@@ -108,10 +108,7 @@ xtab_write(char *xtab, char *xtabtmp, int is_export) > > /* write out the export entry using the FQDN */ > xe = exp->m_export; >- strncpy(xe.e_hostname, >- exp->m_client->m_hostname, >- sizeof (xe.e_hostname) - 1); >- xe.e_hostname[sizeof (xe.e_hostname) - 1] = '\0'; >+ xe.e_hostname = exp->m_client->m_hostname; > putexportent(&xe); > } > } >@@ -146,9 +143,7 @@ xtab_append(nfs_export *exp) > return; > setexportent(_PATH_XTAB, "a"); > xe = exp->m_export; >- strncpy(xe.e_hostname, exp->m_client->m_hostname, >- sizeof (xe.e_hostname) - 1); >- xe.e_hostname[sizeof (xe.e_hostname) - 1] = '\0'; >+ xe.e_hostname = exp->m_client->m_hostname; > putexportent(&xe); > endexportent(); > xfunlock(lockid); >diff --git a/support/include/nfslib.h b/support/include/nfslib.h >index 5af9c30..2a09d3a 100644 >--- a/support/include/nfslib.h >+++ b/support/include/nfslib.h >@@ -65,7 +65,7 @@ struct sec_entry { > * allow overrides when using exportfs. > */ > struct exportent { >- char e_hostname[NFSCLNT_IDMAX+1]; >+ char *e_hostname; > char e_path[NFS_MAXPATHLEN+1]; > /* The mount path may be different from the exported path due > to submount. It may change for every mount. The idea is we >diff --git a/support/nfs/exports.c b/support/nfs/exports.c >index c82bb0e..1fc6152 100644 >--- a/support/nfs/exports.c >+++ b/support/nfs/exports.c >@@ -176,13 +176,9 @@ getexportent(int fromkernel, int fromexports) > if (!has_default_opts) > xlog(L_WARNING, "No options for %s %s: suggest %s(sync) to avoid warning", ee.e_path, exp, exp); > } >- if (strlen(hostname) >= sizeof(ee.e_hostname)) { >- syntaxerr("client name too long"); >- export_errno = EINVAL; >- return NULL; >- } >- strncpy(ee.e_hostname, hostname, sizeof (ee.e_hostname) - 1); >- ee.e_hostname[sizeof (ee.e_hostname) - 1] = '\0'; >+ if (ee.e_hostname) >+ free(ee.e_hostname); >+ ee.e_hostname = xstrdup(hostname); > > if (parseopts(opt, &ee, fromexports && !has_default_subtree_opts, NULL) < 0) > return NULL; >@@ -335,6 +331,7 @@ dupexportent(struct exportent *dst, struct exportent *src) > dst->e_mountpoint = strdup(src->e_mountpoint); > if (src->e_fslocdata) > dst->e_fslocdata = strdup(src->e_fslocdata); >+ dst->e_hostname = NULL; > } > > struct exportent * >@@ -355,12 +352,10 @@ mkexportent(char *hname, char *path, char *options) > ee.e_nsqgids = 0; > ee.e_uuid = NULL; > >- if (strlen(hname) >= sizeof(ee.e_hostname)) { >- xlog(L_WARNING, "client name %s too long", hname); >- return NULL; >- } >- strncpy(ee.e_hostname, hname, sizeof (ee.e_hostname) - 1); >- ee.e_hostname[sizeof (ee.e_hostname) - 1] = '\0'; >+ if (ee.e_hostname) >+ xfree(ee.e_hostname); >+ ee.e_hostname = xstrdup(hname); >+ > if (strlen(path) >= sizeof(ee.e_path)) { > xlog(L_WARNING, "path name %s too long", path); > return NULL; >-- >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