Skip to contentSkip to conversation

mount.cifs: remove support for "NFS syntax"

PATCH In review Jeff Layton 2 participants 2 messages Mar 22, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mount.cifs: remove support for "NFS syntax"

...as promised for version 6.0.

Cc Scott Lovenberg <[email protected]>
---
 mount.cifs.c | 38 ++++++++++----------------------------
 1 file changed, 10 insertions(+), 28 deletions(-)
mount.cifs.c +10 -28
index 40b77e9..496a2c8 100644
@@ -1232,36 +1232,18 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info
 		return EX_USAGE;
 	}
 
-	/* Set up "host" and "share" pointers based on UNC format. */
-	/* TODO: Remove support for NFS syntax as of cifs-utils-6.0. */
 	if (strncmp(unc_name, "//", 2) && strncmp(unc_name, "\\\\", 2)) {
-		/*
-		 * check for nfs syntax (server:/share/prepath)
-		 *
-		 * FIXME: IPv6 addresses?
-		 */
-		host = unc_name;
-		share = strchr(host, ':');
-		if (!share) {
-			fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
-			return EX_USAGE;
-		}
-		hostlen = share - host;
-		share++;
-		if (*share == '/')
-			++share;
-		fprintf(stderr, "WARNING: using NFS syntax for mounting CIFS "
-			"shares is deprecated and will be removed in cifs-utils"
-			"-6.0. Please migrate to UNC syntax.\n");
-	} else {
-		host = unc_name + 2;
-		hostlen = strcspn(host, "/\\");
-		if (!hostlen) {
-			fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
-			return EX_USAGE;
-		}
-		share = host + hostlen + 1;
+		fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
+		return EX_USAGE;
+	}
+
+	host = unc_name + 2;
+	hostlen = strcspn(host, "/\\");
+	if (!hostlen) {
+		fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
+		return EX_USAGE;
 	}
+	share = host + hostlen + 1;
 
 	if (hostlen + 1 > sizeof(parsed_info->host)) {
 		fprintf(stderr, "mount.cifs: host portion of UNC too long\n");
Signature · 1 line
1.7.11.7

A message that is not in the archive (sent off-list or not yet received): 1363949407-6327-1-git-send-email-jlayton-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org

#2 lore raw
Quoted 61 lines · Jeff Layton

...as promised for version 6.0.

Cc Scott Lovenberg <[email protected]>
---
 mount.cifs.c | 38 ++++++++++----------------------------
 1 file changed, 10 insertions(+), 28 deletions(-)
mount.cifs.c +10 -29
index 40b77e9..496a2c8 100644
@@ -1232,36 +1232,18 @@ static int parse_unc(const char *unc_name, struct parsed_mount_info *parsed_info
                return EX_USAGE;
        }
 
-       /* Set up "host" and "share" pointers based on UNC format. */
-       /* TODO: Remove support for NFS syntax as of cifs-utils-6.0. */
        if (strncmp(unc_name, "//", 2) && strncmp(unc_name, "\\\\", 2)) {
-               /*
-                * check for nfs syntax (server:/share/prepath)
-                *
-                * FIXME: IPv6 addresses?
-                */
-               host = unc_name;
-               share = strchr(host, ':');
-               if (!share) {
-                       fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
-                       return EX_USAGE;
-               }
-               hostlen = share - host;
-               share++;
-               if (*share == '/')
-                       ++share;
-               fprintf(stderr, "WARNING: using NFS syntax for mounting CIFS "
-                       "shares is deprecated and will be removed in cifs-utils"
-                       "-6.0. Please migrate to UNC syntax.\n");
-       } else {
-               host = unc_name + 2;
-               hostlen = strcspn(host, "/\\");
-               if (!hostlen) {
-                       fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
-                       return EX_USAGE;
-               }
-               share = host + hostlen + 1;
+               fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
+               return EX_USAGE;
+       }
+
+       host = unc_name + 2;
+       hostlen = strcspn(host, "/\\");
+       if (!hostlen) {
+               fprintf(stderr, "mount.cifs: bad UNC (%s)\n", unc_name);
+               return EX_USAGE;
        }
+       share = host + hostlen + 1;
 
        if (hostlen + 1 > sizeof(parsed_info->host)) {
                fprintf(stderr, "mount.cifs: host portion of UNC too long\n");
--
Quoted 2 lines

1.7.11.7

+1. Looks good to me.

--
Peace and Blessings,
-Scott.