diff options
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index fed0b8e..a3e2c70 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -763,37 +763,37 @@ nfs_mount_parse_from(struct vfsoptlist *opts, char **hostnamep, /* * This part comes from sbin/mount_nfs/mount_nfs.c:getnfsargs(). */ - if (*spec == '[' && (delimp = strchr(spec + 1, ']')) != NULL && - *(delimp + 1) == ':') { - hostp = spec + 1; - spec = delimp + 2; - have_bracket = 1; - } else if ((delimp = strrchr(spec, ':')) != NULL) { - hostp = spec; - spec = delimp + 1; - } else if ((delimp = strrchr(spec, '@')) != NULL) { - printf("%s: path@server syntax is deprecated, " + if (*spec == '[' && (delimp = strchr(spec + 1, ']')) != NULL && + *(delimp + 1) == ':') { + hostp = spec + 1; + spec = delimp + 2; + have_bracket = 1; + } else if ((delimp = strrchr(spec, ':')) != NULL) { + hostp = spec; + spec = delimp + 1; + } else if ((delimp = strrchr(spec, '@')) != NULL) { + printf("%s: path@server syntax is deprecated, " "use server:path\n", __func__); - hostp = delimp + 1; - } else { - printf("%s: no <host>:<dirpath> nfs-name\n", __func__); - return (EINVAL); - } - *delimp = '\0'; - - /* - * If there has been a trailing slash at mounttime it seems - * that some mountd implementations fail to remove the mount - * entries from their mountlist while unmounting. - */ - for (speclen = strlen(spec); - speclen > 1 && spec[speclen - 1] == '/'; - speclen--) - spec[speclen - 1] = '\0'; - if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { - printf("%s: %s:%s: name too long", __func__, hostp, spec); - return (EINVAL); - } + hostp = delimp + 1; + } else { + printf("%s: no <host>:<dirpath> nfs-name\n", __func__); + return (EINVAL); + } + *delimp = '\0'; + + /* + * If there has been a trailing slash at mounttime it seems + * that some mountd implementations fail to remove the mount + * entries from their mountlist while unmounting. + */ + for (speclen = strlen(spec); + speclen > 1 && spec[speclen - 1] == '/'; + speclen--) + spec[speclen - 1] = '\0'; + if (strlen(hostp) + strlen(spec) + 1 > MNAMELEN) { + printf("%s: %s:%s: name too long", __func__, hostp, spec); + return (EINVAL); + } /* Make both '@' and ':' notations equal */ if (*hostp != '\0') { len = strlen(hostp); |