- if (!(s = strchr(hostdir, ':'))) {
- nfs_error(_("%s: directory to mount not in host:dir format"),
+ dev = xstrdup(spec);
+
+ if (!(pathname = strchr(dev, ':'))) {
+ nfs_error(_("%s: remote share not in 'host:dir' format"),
+ progname);
+ goto out;
+ }
+ *pathname = '\0';
+ pathname++;
+
+ /*
+ * We don't need a copy of the pathname, but let's
+ * sanity check it anyway.
+ */
+ if (strlen(pathname) > NFS_MAXPATHNAME) {
+ nfs_error(_("%s: export pathname is too long"),