mirror of
https://github.com/samba-team/samba.git
synced 2025-08-29 13:49:30 +03:00
Fix for bug #4781: allow cleaning of /etc/mtab by canonicalizing mountpoint.
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 commit is contained in:
@ -341,6 +341,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);
|
||||
|
||||
|
Reference in New Issue
Block a user