if (ok <= 0)
return NULL;
- strncpy (def_ee.m_path, def_ee.e_path, sizeof (def_ee.m_path) - 1);
- def_ee.m_path [sizeof (def_ee.m_path) - 1] = '\0';
ok = getexport(exp, sizeof(exp));
}
if (ok < 0) {
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';
+ xfree(ee.e_hostname);
+ ee.e_hostname = xstrdup(hostname);
if (parseopts(opt, &ee, fromexports && !has_default_subtree_opts, NULL) < 0)
return NULL;
rpath[sizeof (rpath) - 1] = '\0';
strncpy(ee.e_path, rpath, sizeof (ee.e_path) - 1);
ee.e_path[sizeof (ee.e_path) - 1] = '\0';
- strncpy (ee.m_path, ee.e_path, sizeof (ee.m_path) - 1);
- ee.m_path [sizeof (ee.m_path) - 1] = '\0';
}
return ⅇ
dst->e_mountpoint = strdup(src->e_mountpoint);
if (src->e_fslocdata)
dst->e_fslocdata = strdup(src->e_fslocdata);
+ dst->e_hostname = NULL;
}
struct exportent *
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';
+ 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;
}
strncpy(ee.e_path, path, sizeof (ee.e_path));
ee.e_path[sizeof (ee.e_path) - 1] = '\0';
- strncpy (ee.m_path, ee.e_path, sizeof (ee.m_path) - 1);
- ee.m_path [sizeof (ee.m_path) - 1] = '\0';
if (parseopts(options, &ee, 0, NULL) < 0)
return NULL;
return ⅇ
if (opt[5]!='\0' && *oe == '\0')
ep->e_flags |= NFSEXP_FSID;
else if (valid_uuid(opt+5))
- ep->e_uuid = strdup(opt+7);
+ ep->e_uuid = strdup(opt+5);
else {
xlog(L_ERROR, "%s: %d: bad fsid \"%s\"\n",
flname, flline, opt);
while (isblank(*cp))
cp++;
}
+ /*
+ * Turn on nohide which will allow this export to cross over
+ * the 'mount --bind' mount point.
+ */
+ if (ep->e_fslocdata)
+ ep->e_flags |= NFSEXP_NOHIDE;
for (p = ep->e_secinfo; p->flav; p++)
p->flags |= ep->e_flags & ~NFSEXP_SECINFO_FLAGS;