diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-08-16 12:58:45 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-08-19 04:36:32 +0200 |
commit | 04834552edbe807ede4c54f1764dd7fefb884f24 (patch) | |
tree | 6d4444c168c37d141a4cff89c38091919cc48532 /src/mount | |
parent | timedatectl: drop unnecessary temporal variables (diff) | |
download | systemd-04834552edbe807ede4c54f1764dd7fefb884f24.tar.xz systemd-04834552edbe807ede4c54f1764dd7fefb884f24.zip |
mount: use sd_bus_set_allow_interactive_authorization()
Diffstat (limited to 'src/mount')
-rw-r--r-- | src/mount/mount-tool.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c index fb9e3b3a14..278890dd69 100644 --- a/src/mount/mount-tool.c +++ b/src/mount/mount-tool.c @@ -638,10 +638,6 @@ static int start_transient_mount( if (r < 0) return bus_log_create_error(r); - r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); - if (r < 0) - return bus_log_create_error(r); - /* Name and mode */ r = sd_bus_message_append(m, "ss", mount_unit, "fail"); if (r < 0) @@ -719,10 +715,6 @@ static int start_transient_automount( if (r < 0) return bus_log_create_error(r); - r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); - if (r < 0) - return bus_log_create_error(r); - /* Name and mode */ r = sd_bus_message_append(m, "ss", automount_unit, "fail"); if (r < 0) @@ -923,10 +915,6 @@ static int stop_mount( if (r < 0) return bus_log_create_error(r); - r = sd_bus_message_set_allow_interactive_authorization(m, arg_ask_password); - if (r < 0) - return bus_log_create_error(r); - /* Name and mode */ r = sd_bus_message_append(m, "ss", mount_unit, "fail"); if (r < 0) @@ -1527,6 +1515,8 @@ static int run(int argc, char* argv[]) { if (r < 0) return bus_log_connect_error(r, arg_transport); + (void) sd_bus_set_allow_interactive_authorization(bus, arg_ask_password); + if (arg_action == ACTION_UMOUNT) return action_umount(bus, argc, argv); |