Canonicalize mountpoint by trimming trailing slashes before unmounting.
This allows for correct cleanup of /etc/mtab after unmounting.
Thanks to Steve Langasek <vorlon@debian.org>.
Michael
(This used to be commit
118fd6213d5f6419f654e9226a41d527c04346f7)
/* 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);