]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
auth: db-oauth2 - Do not allow empty active_value or active_attribute, when other...
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 5 Nov 2020 11:25:19 +0000 (13:25 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 5 Nov 2020 11:25:19 +0000 (13:25 +0200)
src/auth/db-oauth2.c

index 463e4555c8872caafbf48fc510ec608a27ae0180..f926d272f24904ee1f233be2aa74c4cb8bbcdc12 100644 (file)
@@ -258,6 +258,13 @@ struct db_oauth2 *db_oauth2_init(const char *config_path)
        db->oauth2_set.use_grant_password = db->set.use_grant_password;
        db->oauth2_set.scope = db->set.scope;
 
+       if (*db->set.active_attribute != '\0' &&
+           *db->set.active_value == '\0')
+               i_fatal("oauth2: Cannot have empty active_value if active_attribute is set");
+       if (*db->set.active_attribute == '\0' &&
+           *db->set.active_value != '\0')
+               i_fatal("oauth2: Cannot have empty active_attribute is active_value is set");
+
        if (*db->set.introspection_mode == '\0' ||
            strcmp(db->set.introspection_mode, "auth") == 0) {
                db->oauth2_set.introspection_mode = INTROSPECTION_MODE_GET_AUTH;