aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/account.c
diff options
context:
space:
mode:
authorDennis Kaarsemaker <dennis@kaarsemaker.net>2016-02-22 21:04:10 +0100
committerDennis Kaarsemaker <dennis@kaarsemaker.net>2016-03-23 07:44:13 +0100
commit3ac6d9fe93279d74d36a6bf2b6e2ba182ed3bf34 (patch)
tree681d3c36caa3f2680ca5b810c09f3d1f54a868cd /protocols/account.c
parentd701547347b15bd76f19fcf667cbf8e5c1219cbb (diff)
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".
Diffstat (limited to 'protocols/account.c')
-rw-r--r--protocols/account.c4
1 files changed, 2 insertions, 2 deletions
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. */