diff options
author | Michael S. Fischer <mfischer@zendesk.com> | 2015-06-02 16:29:57 -0700 |
---|---|---|
committer | Phillip Lougher <phillip@squashfs.org.uk> | 2017-07-31 19:10:24 +0100 |
commit | ecc20cd3b4b79698fbd1caa2329d320757e00e3e (patch) | |
tree | 50df4a3c0e0f692ccfac997d85e4407f4c4f8838 | |
parent | c1d1ca267668eeb347bf8376768a5631beeb0b2c (diff) | |
download | squashfs-tools-ecc20cd3b4b79698fbd1caa2329d320757e00e3e.tar.gz |
unsquashfs: modify xattrs after other changes
Fixes a bug in which security capabilities were not properly set on
written files. chown(2) resets all capabilities so it should be run
before setting xattrs instead of afterwards.
-rw-r--r-- | squashfs-tools/unsquashfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/squashfs-tools/unsquashfs.c b/squashfs-tools/unsquashfs.c index 1323dd6..a5f0117 100644 --- a/squashfs-tools/unsquashfs.c +++ b/squashfs-tools/unsquashfs.c @@ -821,8 +821,6 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time, { struct utimbuf times = { time, time }; - write_xattr(pathname, xattr); - if(utime(pathname, ×) == -1) { ERROR("set_attributes: failed to set time on %s, because %s\n", pathname, strerror(errno)); @@ -845,6 +843,8 @@ int set_attributes(char *pathname, int mode, uid_t uid, gid_t guid, time_t time, return FALSE; } + write_xattr(pathname, xattr); + return TRUE; } |