1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-10 05:18:17 +03:00

mount: use sd_bus_set_allow_interactive_authorization()

This commit is contained in:
Yu Watanabe 2024-08-16 19:58:45 +09:00
parent 335608593c
commit 04834552ed

View File

@ -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);