git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for bug #4781: allow cleaning of /etc/mtab by canonicalizing mountpoint.
[samba.git]
/
source
/
client
/
umount.cifs.c
diff --git
a/source/client/umount.cifs.c
b/source/client/umount.cifs.c
index d1195755ca1581584d3ef24d9e7c9180f7b25492..ab94a20c60c19abd62fb3f6d32dbda70fcd1e635 100644
(file)
--- a/
source/client/umount.cifs.c
+++ b/
source/client/umount.cifs.c
@@
-341,6
+341,13
@@
int main(int argc, char ** argv)
/* fixup path if needed */
/* 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);
/* make sure that this is a cifs filesystem */
rc = statfs(mountpoint, &statbuf);