cdown / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

Blame SOURCES/0040-libmount-improve-smb-2-3-support.patch

31b890
From 2cd5219da87274db251a7f836efe6ac724b70e53 Mon Sep 17 00:00:00 2001
31b890
From: Karel Zak <kzak@redhat.com>
31b890
Date: Wed, 11 Mar 2020 10:38:37 +0100
31b890
Subject: [PATCH 40/40] libmount: improve smb{2,3} support
31b890
31b890
It seems kernel can use smb3 as fstype in mountinfo.
31b890
31b890
Upstream: http://github.com/karelzak/util-linux/commit/36d80cb6c11b3064ed9fb29c7c8b101e3f266441
31b890
Upstream: http://github.com/karelzak/util-linux/commit/b7ff4134beea53688ab3c01484cf59b2ce2d9ce9
31b890
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1812118
31b890
Signed-off-by: Karel Zak <kzak@redhat.com>
31b890
---
31b890
 libmount/src/tab.c   | 5 ++++-
31b890
 libmount/src/utils.c | 1 +
31b890
 2 files changed, 5 insertions(+), 1 deletion(-)
31b890
31b890
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
31b890
index eb61dd33e..74d60df3d 100644
31b890
--- a/libmount/src/tab.c
31b890
+++ b/libmount/src/tab.c
31b890
@@ -1644,9 +1644,12 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
31b890
 		if (root) {
31b890
 			const char *fstype = mnt_fs_get_fstype(fs);
31b890
 
31b890
-			if (fstype && strcmp(fstype, "cifs") == 0) {
31b890
+			if (fstype && (strcmp(fstype, "cifs") == 0
31b890
+				       || strcmp(fstype, "smb3") == 0)) {
31b890
+
31b890
 				const char *unc_subdir = get_cifs_unc_subdir_path(src);
31b890
 				const char *path_on_fs = mnt_fs_get_root(fs);
31b890
+
31b890
 				if (!unc_subdir || !path_on_fs || !streq_paths(unc_subdir, path_on_fs))
31b890
 					continue;
31b890
 			} else {
31b890
diff --git a/libmount/src/utils.c b/libmount/src/utils.c
31b890
index 04e79f53f..e43588831 100644
31b890
--- a/libmount/src/utils.c
31b890
+++ b/libmount/src/utils.c
31b890
@@ -315,6 +315,7 @@ int mnt_fstype_is_pseudofs(const char *type)
31b890
 int mnt_fstype_is_netfs(const char *type)
31b890
 {
31b890
 	if (strcmp(type, "cifs")   == 0 ||
31b890
+	    strcmp(type, "smb3")   == 0 ||
31b890
 	    strcmp(type, "smbfs")  == 0 ||
31b890
 	    strncmp(type,"nfs", 3) == 0 ||
31b890
 	    strcmp(type, "afs")    == 0 ||
31b890
-- 
31b890
2.25.4
31b890