]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
homectl: make sure we sent the full 8 bytes as flags
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 20 Feb 2024 21:38:42 +0000 (22:38 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 21 Feb 2024 10:14:51 +0000 (10:14 +0000)
Otherwise weird stuff happens on the other side:

[1217111.957263] testsuite-46.sh[61]: + homectl create test-user --disk-size=min --luks-discard=yes --image-path=/home/test-user.home --luks-pbkdf-type=pbkdf2 --luks-pbkdf-time-cost=1ms
[1217112.598219] homectl[66]: Operation on home test-user failed: Provided flags are unsupported (0ad2578000000000).

(taken from TEST-46-HOME run on armv7l)

Fixes issue mentioned in https://github.com/systemd/systemd/pull/31419#issuecomment-1955117397.

src/home/homectl.c

index 3a839c73eaad06b589f1c175d3914bbcd1dacb64..4afdff74c03a80c6f57c1d6085429a8b0ad38639 100644 (file)
@@ -1481,7 +1481,7 @@ static int create_home_common(JsonVariant *input) {
                 if (r < 0)
                         return bus_log_create_error(r);
 
-                r = sd_bus_message_append(m, "t", 0);
+                r = sd_bus_message_append(m, "t", UINT64_C(0));
                 if (r < 0)
                         return bus_log_create_error(r);
 
@@ -1777,7 +1777,7 @@ static int update_home(int argc, char *argv[], void *userdata) {
                 if (r < 0)
                         return bus_log_create_error(r);
 
-                r = sd_bus_message_append(m, "t", 0);
+                r = sd_bus_message_append(m, "t", UINT64_C(0));
                 if (r < 0)
                         return bus_log_create_error(r);