summaryrefslogtreecommitdiff
path: root/src/locale/localectl.c
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2013-05-17 15:38:12 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-23 00:28:04 -0400
commit546158bc6f46f8004cc11e81d19d223e0da56730 (patch)
treec9f9ebe8e7e62c5dbcd0b433de7506a715b0429d /src/locale/localectl.c
parenta057be1fcc61ca1fed96898db05dfe88f54ab2db (diff)
Fix --no-ask-password
POSIX_ME_HARDER mode is disabled for localectl. It doesn't make much sense in case of localectl, and there's little reason for localectl to behave specially.
Diffstat (limited to 'src/locale/localectl.c')
-rw-r--r--src/locale/localectl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 3096d06084..b5cd344397 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -223,7 +223,7 @@ static int show_status(DBusConnection *bus, char **args, unsigned n) {
static int set_locale(DBusConnection *bus, char **args, unsigned n) {
_cleanup_dbus_message_unref_ DBusMessage *m = NULL, *reply = NULL;
- dbus_bool_t interactive = true;
+ dbus_bool_t interactive = arg_ask_password;
DBusError error;
DBusMessageIter iter;
int r;
@@ -459,7 +459,7 @@ static int list_locales(DBusConnection *bus, char **args, unsigned n) {
static int set_vconsole_keymap(DBusConnection *bus, char **args, unsigned n) {
_cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
- dbus_bool_t interactive = true, b;
+ dbus_bool_t interactive = arg_ask_password, b;
const char *map, *toggle_map;
assert(bus);
@@ -565,7 +565,7 @@ static int list_vconsole_keymaps(DBusConnection *bus, char **args, unsigned n) {
static int set_x11_keymap(DBusConnection *bus, char **args, unsigned n) {
_cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
- dbus_bool_t interactive = true, b;
+ dbus_bool_t interactive = arg_ask_password, b;
const char *layout, *model, *variant, *options;
assert(bus);
@@ -758,7 +758,7 @@ static int parse_argv(int argc, char *argv[]) {
assert(argc >= 0);
assert(argv);
- while ((c = getopt_long(argc, argv, "has:H:P", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "hH:P", options, NULL)) >= 0) {
switch (c) {
@@ -788,6 +788,10 @@ static int parse_argv(int argc, char *argv[]) {
arg_no_pager = true;
break;
+ case ARG_NO_ASK_PASSWORD:
+ arg_ask_password = false;
+ break;
+
case '?':
return -EINVAL;