Fix for bug #4781: allow cleaning of /etc/mtab by canonicalizing mountpoint.
[samba.git] / source / client / umount.cifs.c
index 3869e3439fce544ac8dc7177881e9fd3880b3de8..47ddd1e92eef8b80688c5975abcd8009fa32690a 100644 (file)
@@ -342,6 +342,13 @@ int main(int argc, char ** argv)
 
        /* fixup path if needed */
 
+       /* Trim any trailing slashes */
+       while ((strlen(mountpoint) > 1) &&
+               (mountpoint[strlen(mountpoint)-1] == '/'))
+       {
+               mountpoint[strlen(mountpoint)-1] = '\0';
+       }
+
        /* make sure that this is a cifs filesystem */
        rc = statfs(mountpoint, &statbuf);