From fb17510ede6fc815a16837d4209c16a89d29f4d4 Mon Sep 17 00:00:00 2001 From: Antonio Alvarez Feijoo Date: Thu, 2 May 2024 11:53:18 +0200 Subject: [PATCH] importctl: fix flag checking against wrong variable Fixes 67c7ee11afb5ff703c3ca8e390c8360140298a0f --- src/import/importctl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/import/importctl.c b/src/import/importctl.c index 5f6f9261358..15c517c2deb 100644 --- a/src/import/importctl.c +++ b/src/import/importctl.c @@ -298,7 +298,7 @@ static int import_tar(int argc, char *argv[], void *userdata) { return log_error_errno(errno, "Failed to open %s: %m", path); } - if (arg_image_class == IMAGE_MACHINE && (arg_image_class & ~(IMPORT_FORCE|IMPORT_READ_ONLY)) == 0) { + if (arg_image_class == IMAGE_MACHINE && (arg_import_flags & ~(IMPORT_FORCE|IMPORT_READ_ONLY)) == 0) { r = bus_message_new_method_call(bus, &m, bus_import_mgr, "ImportTar"); if (r < 0) return bus_log_create_error(r); @@ -377,7 +377,7 @@ static int import_raw(int argc, char *argv[], void *userdata) { return log_error_errno(errno, "Failed to open %s: %m", path); } - if (arg_image_class == IMAGE_MACHINE && (arg_image_class & ~(IMPORT_FORCE|IMPORT_READ_ONLY)) == 0) { + if (arg_image_class == IMAGE_MACHINE && (arg_import_flags & ~(IMPORT_FORCE|IMPORT_READ_ONLY)) == 0) { r = bus_message_new_method_call(bus, &m, bus_import_mgr, "ImportRaw"); if (r < 0) return bus_log_create_error(r); @@ -447,7 +447,7 @@ static int import_fs(int argc, char *argv[], void *userdata) { return log_error_errno(errno, "Failed to open directory '%s': %m", path); } - if (arg_image_class == IMAGE_MACHINE && (arg_image_class & ~(IMPORT_FORCE|IMPORT_READ_ONLY)) == 0) { + if (arg_image_class == IMAGE_MACHINE && (arg_import_flags & ~(IMPORT_FORCE|IMPORT_READ_ONLY)) == 0) { r = bus_message_new_method_call(bus, &m, bus_import_mgr, "ImportFileSystem"); if (r < 0) return bus_log_create_error(r); @@ -653,7 +653,7 @@ static int pull_tar(int argc, char *argv[], void *userdata) { local); } - if (arg_image_class == IMAGE_MACHINE && (arg_image_class & ~IMPORT_FORCE) == 0) { + if (arg_image_class == IMAGE_MACHINE && (arg_import_flags & ~IMPORT_FORCE) == 0) { r = bus_message_new_method_call(bus, &m, bus_import_mgr, "PullTar"); if (r < 0) return bus_log_create_error(r); @@ -726,7 +726,7 @@ static int pull_raw(int argc, char *argv[], void *userdata) { local); } - if (arg_image_class == IMAGE_MACHINE && (arg_image_class & ~IMPORT_FORCE) == 0) { + if (arg_image_class == IMAGE_MACHINE && (arg_import_flags & ~IMPORT_FORCE) == 0) { r = bus_message_new_method_call(bus, &m, bus_import_mgr, "PullRaw"); if (r < 0) return bus_log_create_error(r); -- 2.47.3