diff options
| author | Bruce Momjian | 2003-09-04 05:11:20 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2003-09-04 05:11:20 +0000 |
| commit | 6d239ee4b4137ae3ca9a1d56715cf1b6b4459625 (patch) | |
| tree | 57558dd1d29c8e77649f98dc1dd3458794b1c1b6 /src | |
| parent | b8245766abe7071a078795c1417ae2a3fa145164 (diff) | |
Allow non-super users to set log_duration to true, then false, when the
administrator has not turned it on, and fix other PGC_USERLIMIT
variables.
Diffstat (limited to 'src')
| -rw-r--r-- | src/backend/utils/misc/guc.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index f7571151175..2129042ed25 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut <peter_e@gmx.net>. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.154 2003/09/03 22:05:08 petere Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.155 2003/09/04 05:11:20 momjian Exp $ * *-------------------------------------------------------------------- */ @@ -2556,7 +2556,7 @@ set_config_option(const char *name, const char *value, /* Limit non-superuser changes */ if (record->context == PGC_USERLIMIT && source > PGC_S_UNPRIVILEGED && - newval < conf->session_val && + newval < conf->reset_val && !superuser()) { ereport(elevel, @@ -2569,8 +2569,8 @@ set_config_option(const char *name, const char *value, /* Allow admin to override non-superuser setting */ if (record->context == PGC_USERLIMIT && source < PGC_S_UNPRIVILEGED && - record->session_source > PGC_S_UNPRIVILEGED && - newval > conf->session_val && + record->reset_source > PGC_S_UNPRIVILEGED && + newval > conf->reset_val && !superuser()) changeVal = changeVal_orig; } @@ -2652,8 +2652,8 @@ set_config_option(const char *name, const char *value, /* Limit non-superuser changes */ if (record->context == PGC_USERLIMIT && source > PGC_S_UNPRIVILEGED && - conf->session_val != 0 && - (newval > conf->session_val || newval == 0) && + conf->reset_val != 0 && + (newval > conf->reset_val || newval == 0) && !superuser()) { ereport(elevel, @@ -2666,8 +2666,8 @@ set_config_option(const char *name, const char *value, /* Allow admin to override non-superuser setting */ if (record->context == PGC_USERLIMIT && source < PGC_S_UNPRIVILEGED && - record->session_source > PGC_S_UNPRIVILEGED && - newval < conf->session_val && + record->reset_source > PGC_S_UNPRIVILEGED && + newval < conf->reset_val && !superuser()) changeVal = changeVal_orig; } @@ -2749,7 +2749,7 @@ set_config_option(const char *name, const char *value, /* Limit non-superuser changes */ if (record->context == PGC_USERLIMIT && source > PGC_S_UNPRIVILEGED && - newval > conf->session_val && + newval > conf->reset_val && !superuser()) { ereport(elevel, @@ -2762,8 +2762,8 @@ set_config_option(const char *name, const char *value, /* Allow admin to override non-superuser setting */ if (record->context == PGC_USERLIMIT && source < PGC_S_UNPRIVILEGED && - record->session_source > PGC_S_UNPRIVILEGED && - newval < conf->session_val && + record->reset_source > PGC_S_UNPRIVILEGED && + newval < conf->reset_val && !superuser()) changeVal = changeVal_orig; } @@ -2860,8 +2860,8 @@ set_config_option(const char *name, const char *value, } /* Allow admin to override non-superuser setting */ if (source < PGC_S_UNPRIVILEGED && - record->session_source > PGC_S_UNPRIVILEGED && - newval < conf->session_val && + record->reset_source > PGC_S_UNPRIVILEGED && + newval < conf->reset_val && !superuser()) changeVal = changeVal_orig; } |
