1
0
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:
Michael Adam
2007-11-16 22:26:26 +01:00
parent d2c7417393
commit 118fd6213d

View File

@ -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);