X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmountd%2Fv4root.c;h=81f813bde067777d4b357c86a2ea30a7d1bf0eee;hp=7fd6af3dd4592462addb005c3986031d8f5020ad;hb=cd4f4d13848bd64f98290ef67ef8572d998d3041;hpb=e0819debc9d1d322e06ca4047a125a4fd8176d13 diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c index 7fd6af3..81f813b 100644 --- a/utils/mountd/v4root.c +++ b/utils/mountd/v4root.c @@ -83,7 +83,7 @@ v4root_create(char *path, nfs_export *export) struct exportent *curexp = &export->m_export; dupexportent(&eep, &pseudo_root.m_export); - eep.e_hostname = strdup(curexp->e_hostname); + eep.e_hostname = curexp->e_hostname; strncpy(eep.e_path, path, sizeof(eep.e_path)); if (strcmp(path, "/") != 0) eep.e_flags &= ~NFSEXP_FSID; @@ -144,8 +144,11 @@ static int v4root_add_parents(nfs_export *exp) char *ptr; path = strdup(exp->m_export.e_path); - if (!path) + if (!path) { + xlog(L_WARNING, "v4root_add_parents: Unable to create " + "pseudo export for '%s'", exp->m_export.e_path); return -ENOMEM; + } for (ptr = path + 1; ptr; ptr = strchr(ptr, '/')) { int ret; char saved; @@ -173,7 +176,7 @@ void v4root_set() { nfs_export *exp; - int i, ret; + int i; if (!v4root_needed) return; @@ -189,7 +192,7 @@ v4root_set() */ continue; - ret = v4root_add_parents(exp); + v4root_add_parents(exp); /* XXX: error handling! */ } }