]> granicus.if.org Git - pgbouncer/commitdiff
console: Fill auth_user when auth_type=any.
authorMarko Kreen <markokr@gmail.com>
Mon, 31 Aug 2015 16:31:28 +0000 (19:31 +0300)
committerMarko Kreen <markokr@gmail.com>
Mon, 31 Aug 2015 16:31:28 +0000 (19:31 +0300)
Otherwise logging can crash (#67).

src/admin.c

index bc389db4c4d79384753958e275dc5db137be93eb..d23d24b9e7637bcda111158e628ff9b7a6f34d48 100644 (file)
@@ -1368,9 +1368,11 @@ bool admin_pre_login(PgSocket *client, const char *username)
         */
        if (cf_auth_type == AUTH_ANY) {
                if (strlist_contains(cf_admin_users, username)) {
+                       client->auth_user = admin_pool->db->forced_user;
                        client->admin_user = 1;
                        return true;
                } else if (strlist_contains(cf_stats_users, username)) {
+                       client->auth_user = admin_pool->db->forced_user;
                        return true;
                }
        }