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; continue;
} }
if (!(flags & FLAG_NO_CHMOD) && !S_ISLNK(list->mode)) { if (!(flags & UNPACK_NO_CHMOD) && !S_ISLNK(list->mode)) {
if (fchmodat(dirfd, list->name, if (fchmodat(dirfd, list->name,
list->mode & 07777, 0)) { list->mode & 07777, 0)) {
fprintf(stderr, "%s: chmod: %s\n", list->name, 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, if (fchownat(dirfd, list->name, list->uid, list->gid,
AT_SYMLINK_NOFOLLOW)) { AT_SYMLINK_NOFOLLOW)) {
fprintf(stderr, "%s: chown: %s\n", list->name, fprintf(stderr, "%s: chown: %s\n", list->name,

View File

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

View File

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