From 1f744e1cf34a407a734347f6c15e8ed1bbc9f6f2 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Mon, 6 Jul 2009 13:10:11 +0000 Subject: [PATCH] When auth_mode=any, allow anybody in as admin. Because auth_mode=any does not store original username, the usual username based checks (admin_users/stats_users) do not work. --- src/admin.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/admin.c b/src/admin.c index ae15c76..25e0d47 100644 --- a/src/admin.c +++ b/src/admin.c @@ -1109,6 +1109,17 @@ bool admin_pre_login(PgSocket *client) } } + /* + * auth_mode=any does not keep original username around, + * so username based checks do not work. + */ + if (cf_auth_type == AUTH_ANY) { + if (cf_log_connections) + slog_info(client, "auth_mode=any: allowing anybody in as admin"); + client->admin_user = 1; + return true; + } + if (strlist_contains(cf_admin_users, username)) { client->admin_user = 1; return true; -- 2.40.0