diff options
author | Christian Brabandt <cb@256bit.org> | 2023-10-16 10:17:13 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-10-16 10:17:13 +0200 |
commit | 5a679b2263f597950f99c60a99d4d1a192e9f639 (patch) | |
tree | 2670962d2c88e29d90ea866195d74d2f74dd82ef /src | |
parent | 215c3261a25f7a99e8711a3b3c6158119c6aea9e (diff) |
patch 9.0.2034: don't try to copy SMACK attribute, when none existv9.0.2034
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/os_unix.c | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 0 deletions
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 @@ -705,6 +705,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 2034, +/**/ 2033, /**/ 2032, |