diff options
author | Phillip Lougher <phillip@squashfs.org.uk> | 2014-09-10 22:27:48 +0100 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-02-23 12:36:46 -0800 |
commit | 35236e2e4dfcc6d2731c89af78d314e9958f6592 (patch) | |
tree | 610a372944dca013dda8f9050a005f8909ea00c3 | |
parent | 9145bf97a0dc0b053805686efec7e0f6034c827c (diff) | |
download | squashfs-tools-35236e2e4dfcc6d2731c89af78d314e9958f6592.tar.gz |
action: chmod: fix mode setting if octal value specified for mode
The set code incorrectly did (st_mode & ~S_IFMT) | mode, which is the
exact inverse of what it should have been, i.e. (st_mode & S_IFMT) | mode
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
-rw-r--r-- | squashfs-tools/action.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/squashfs-tools/action.c b/squashfs-tools/action.c index 4e64a33..b70cd26 100644 --- a/squashfs-tools/action.c +++ b/squashfs-tools/action.c @@ -1432,7 +1432,7 @@ static int mode_execute(struct mode_data *mode_data, int st_mode) switch(mode_data->operation) { case ACTION_MODE_OCT: - st_mode = (st_mode & ~S_IFMT) | mode; + st_mode = (st_mode & S_IFMT) | mode; break; case ACTION_MODE_SET: st_mode = (st_mode & ~mode_data->mask) | mode; |