]> granicus.if.org Git - pgbouncer/commitdiff
disable users before loading.
authorMarko Kreen <markokr@gmail.com>
Sun, 12 Aug 2007 22:33:55 +0000 (22:33 +0000)
committerMarko Kreen <markokr@gmail.com>
Sun, 12 Aug 2007 22:33:55 +0000 (22:33 +0000)
otherwise removing users wont work.

src/loader.c

index d394597de83b31237808b511f4268e7b8492a599..3dbfe73c3530e9610bf7a3b904d8a16fe055a212 100644 (file)
@@ -371,6 +371,17 @@ bool loader_users_check(void)
        return load_auth_file(cf_auth_file);
 }
 
+static void disable_users(void)
+{
+       PgUser *user;
+       List *item;
+
+       statlist_for_each(item, &user_list) {
+               user = container_of(item, PgUser, head);
+               user->passwd[0] = 0;
+       }
+}
+
 /* load list of users from pg_auth/pg_psw file */
 bool load_auth_file(const char *fn)
 {
@@ -383,6 +394,8 @@ bool load_auth_file(const char *fn)
                return false;
        }
 
+       disable_users();
+
        p = buf;
        while (*p) {
                /* skip whitespace and empty lines */