X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Ftimedate%2Ftimedatectl.c;h=6e0bc3cf831eb55241c8c9ae863830763b45921f;hp=7ce9a824ece1944190c8d17090a622c431bdf2c6;hb=4f8f66cb4236783cd3cbee97fefc9aaa8469ac08;hpb=eb9da376d76b48585b3b63b4f91903b54f7abd36;ds=sidebyside diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c index 7ce9a824e..6e0bc3cf8 100644 --- a/src/timedate/timedatectl.c +++ b/src/timedate/timedatectl.c @@ -58,6 +58,9 @@ static void polkit_agent_open_if_enabled(void) { if (!arg_ask_password) return; + if (arg_transport != BUS_TRANSPORT_LOCAL) + return; + polkit_agent_open(); } @@ -191,7 +194,6 @@ static void print_status_info(const StatusInfo *i) { } static int show_status(sd_bus *bus, char **args, unsigned n) { - _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL; StatusInfo info = {}; static const struct bus_properties_map map[] = { { "Timezone", "s", NULL, offsetof(StatusInfo, timezone) }, @@ -408,21 +410,20 @@ static int help(void) { printf("%s [OPTIONS...] COMMAND ...\n\n" "Query or change system time and date settings.\n\n" - " -h --help Show this help\n" - " --version Show package version\n" - " --adjust-system-clock\n" - " Adjust system clock when changing local RTC mode\n" - " --no-pager Do not pipe output into a pager\n" - " --no-ask-password Do not prompt for password\n" - " -H --host=[USER@]HOST Operate on remote host\n" - " -M --machine=CONTAINER Operate on local container\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --no-pager Do not pipe output into a pager\n" + " --no-ask-password Do not prompt for password\n" + " -H --host=[USER@]HOST Operate on remote host\n" + " -M --machine=CONTAINER Operate on local container\n" + " --adjust-system-clock Adjust system clock when changing local RTC mode\n\n" "Commands:\n" - " status Show current time settings\n" - " set-time TIME Set system time\n" - " set-timezone ZONE Set system timezone\n" - " list-timezones Show known timezones\n" - " set-local-rtc BOOL Control whether RTC is in local time\n" - " set-ntp BOOL Control whether NTP is enabled\n", + " status Show current time settings\n" + " set-time TIME Set system time\n" + " set-timezone ZONE Set system timezone\n" + " list-timezones Show known timezones\n" + " set-local-rtc BOOL Control whether RTC is in local time\n" + " set-ntp BOOL Control whether NTP is enabled\n", program_invocation_short_name); return 0;