From 820098d6adc302bfa920243bcbe6e8ff8c40c582 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 17 Apr 2015 10:07:49 +0300 Subject: disable xattrs on symlinks for now there's no nice syscall to manipulate xattrs with atfd and or open the symlink without dereferencing it (and having fd that we can do xattrs with) --- src/archive.c | 2 +- src/audit.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/archive.c b/src/archive.c index 63eb48f..dab9f4d 100644 --- a/src/archive.c +++ b/src/archive.c @@ -476,7 +476,7 @@ int apk_archive_entry_extract(int atfd, const struct apk_file_info *ae, } /* extract xattrs */ - if (ae->xattrs && ae->xattrs->num) { + if (!S_ISLNK(ae->mode) && ae->xattrs && ae->xattrs->num) { r = 0; fd = openat(atfd, fn, O_RDWR); if (fd >= 0) { diff --git a/src/audit.c b/src/audit.c index 6655cb3..0e57a61 100644 --- a/src/audit.c +++ b/src/audit.c @@ -110,7 +110,7 @@ static int audit_file(struct audit_ctx *actx, if (dbf->csum.type != APK_CHECKSUM_NONE && apk_checksum_compare(&fi.csum, &dbf->csum) != 0) rv = 'U'; - else if (!dbf->diri->pkg->ipkg->broken_xattr && + else if (!S_ISLNK(fi.mode) && !dbf->diri->pkg->ipkg->broken_xattr && apk_checksum_compare(&fi.xattr_csum, &dbf->acl->xattr_csum) != 0) rv = 'x'; else if (S_ISLNK(fi.mode) && dbf->csum.type == APK_CHECKSUM_NONE) -- cgit v1.2.3-60-g2f50