unpack: rename flags

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-01-30 13:08:14 +01:00
parent 35fabedb49
commit b052a12beb
3 changed files with 6 additions and 6 deletions

View File

@ -122,7 +122,7 @@ static int change_permissions(int dirfd, image_entry_t *list, int flags)
continue;
}
if (!(flags & FLAG_NO_CHMOD) && !S_ISLNK(list->mode)) {
if (!(flags & UNPACK_NO_CHMOD) && !S_ISLNK(list->mode)) {
if (fchmodat(dirfd, list->name,
list->mode & 07777, 0)) {
fprintf(stderr, "%s: chmod: %s\n", list->name,
@ -131,7 +131,7 @@ static int change_permissions(int dirfd, image_entry_t *list, int flags)
}
}
if (!(flags & FLAG_NO_CHOWN)) {
if (!(flags & UNPACK_NO_CHOWN)) {
if (fchownat(dirfd, list->name, list->uid, list->gid,
AT_SYMLINK_NOFOLLOW)) {
fprintf(stderr, "%s: chown: %s\n", list->name,

View File

@ -26,10 +26,10 @@ static int cmd_unpack(int argc, char **argv)
root = optarg;
break;
case 'o':
flags |= FLAG_NO_CHOWN;
flags |= UNPACK_NO_CHOWN;
break;
case 'm':
flags |= FLAG_NO_CHMOD;
flags |= UNPACK_NO_CHMOD;
break;
default:
tell_read_help(argv[0]);

View File

@ -18,8 +18,8 @@
#include "util.h"
enum {
FLAG_NO_CHOWN = 0x01,
FLAG_NO_CHMOD = 0x02,
UNPACK_NO_CHOWN = 0x01,
UNPACK_NO_CHMOD = 0x02,
};
int mkdir_p(const char *path);