]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.2034: don't try to copy SMACK attribute, when none exist v9.0.2034
authorChristian Brabandt <cb@256bit.org>
Mon, 16 Oct 2023 08:17:13 +0000 (10:17 +0200)
committerChristian Brabandt <cb@256bit.org>
Mon, 16 Oct 2023 08:17:13 +0000 (10:17 +0200)
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 <cb@256bit.org>
src/os_unix.c
src/version.c

index 237171b4fae04f99a5ec98f0bf7e6097feb585c6..11448c5c62b7171185838b737f495b02136aaa8f 100644 (file)
@@ -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++)
     {
index 761cdd5e27e2689b11d27cd840b17b6dbee6545d..695b0cd56ef61ee183f8a8ef32761523e60e9382 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2034,
 /**/
     2033,
 /**/