From b106d052383083b80c0dc41f1555d2661db00374 Mon Sep 17 00:00:00 2001 From: Petr Uzel Date: Tue, 8 Nov 2011 16:25:01 +0100 Subject: libmount: ignore tailing slash in netfs source paths Addresses: https://bugzilla.novell.com/show_bug.cgi?id=728480 Signed-off-by: Petr Uzel Signed-off-by: Karel Zak --- libmount/src/tab_parse.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libmount/src/tab_parse.c') diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c index 18a124345..4ee590889 100644 --- a/libmount/src/tab_parse.c +++ b/libmount/src/tab_parse.c @@ -14,6 +14,7 @@ #include "mangle.h" #include "mountP.h" #include "pathnames.h" +#include "strutils.h" static inline char *skip_spaces(char *s) { @@ -654,8 +655,14 @@ static struct libmnt_fs *mnt_table_merge_user_fs(struct libmnt_table *tb, struct if (fs->flags & MNT_FS_MERGED) continue; - if (s && t && r && !strcmp(t, target) && - !strcmp(s, src) && !strcmp(r, root)) + /* + * Note that kernel can add tailing slash to the network + * filesystem source path + */ + if (s && t && r && + strcmp(t, target) == 0 && + streq_except_trailing_slash(s, src) && + strcmp(r, root) == 0) break; } -- cgit v1.2.3-55-g7522