From 5a679b2263f597950f99c60a99d4d1a192e9f639 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Mon, 16 Oct 2023 10:17:13 +0200 Subject: [PATCH] patch 9.0.2034: don't try to copy SMACK attribute, when none exist Problem: don't try to copy SMACK attribute, when none exist Solution: return early if SMACK extended attributes do not exist or if they are not supported closes: #1711 closes: #13348 Signed-off-by: Christian Brabandt --- src/os_unix.c | 5 +++++ src/version.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/os_unix.c b/src/os_unix.c index 237171b4fa..11448c5c62 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3047,6 +3047,11 @@ mch_copy_sec(char_u *from_file, char_u *to_file) if (from_file == NULL) return; + size = listxattr((char *)from_file, NULL, 0); + // not supported or no attributes to copy + if (errno == ENOTSUP || size == 0) + return; + for (index = 0 ; index < (int)(sizeof(smack_copied_attributes) / sizeof(smack_copied_attributes)[0]) ; index++) { diff --git a/src/version.c b/src/version.c index 761cdd5e27..695b0cd56e 100644 --- a/src/version.c +++ b/src/version.c @@ -704,6 +704,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 2034, /**/ 2033, /**/