]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
importctl: fix flag checking against wrong variable
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Thu, 2 May 2024 09:53:18 +0000 (11:53 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 2 May 2024 11:58:20 +0000 (13:58 +0200)
Fixes 67c7ee11afb5ff703c3ca8e390c8360140298a0f

src/import/importctl.c

index 5f6f9261358c44c256f1a841db0fde4a96fd8c3d..15c517c2deb09e8a4bb780d51a17e4cf548760f0 100644 (file)
@@ -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);