From 3ac6d9fe93279d74d36a6bf2b6e2ba182ed3bf34 Mon Sep 17 00:00:00 2001 From: Dennis Kaarsemaker Date: Mon, 22 Feb 2016 21:04:10 +0100 Subject: Support for locked-down accounts In certain situations, e.g. when working with pregenerated configurations, it is useful to be able lock down accounts so they cannot be deleted and authentication information (user, password, server) cannot be changed. We mark such sensitive settings with ACC_SET_LOCKABLE and will refuse to change them if the account is locked by setting the ACC_FLAG_LOCKED flag. This flag is stored in the xml files as account attribute locked="true". --- protocols/account.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'protocols/account.c') diff --git a/protocols/account.c b/protocols/account.c index fcafe215..e25e40c7 100644 --- a/protocols/account.c +++ b/protocols/account.c @@ -66,13 +66,13 @@ account_t *account_add(bee_t *bee, struct prpl *prpl, char *user, char *pass) s->flags |= SET_NOSAVE; /* Just for bw compatibility! */ s = set_add(&a->set, "password", NULL, set_eval_account, a); - s->flags |= SET_NOSAVE | SET_NULL_OK | SET_PASSWORD; + s->flags |= SET_NOSAVE | SET_NULL_OK | SET_PASSWORD | ACC_SET_LOCKABLE; s = set_add(&a->set, "tag", NULL, set_eval_account, a); s->flags |= SET_NOSAVE; s = set_add(&a->set, "username", NULL, set_eval_account, a); - s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY; + s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY | ACC_SET_LOCKABLE; set_setstr(&a->set, "username", user); /* Hardcode some more clever tag guesses. */ -- cgit v1.2.3