1
0
forked from aniani/vim

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 <cb@256bit.org>
This commit is contained in:
Christian Brabandt 2023-10-16 10:17:13 +02:00
parent 215c3261a2
commit 5a679b2263
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 7 additions and 0 deletions

View 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++)
{

View File

@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2034,
/**/
2033,
/**/