Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
1f12abbc
Commit
1f12abbc
authored
Apr 07, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Push superuser check farther down in the if() statements to fix startup
crash with debug in log_statement patch.
parent
0bb21d39
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+17
-17
No files found.
src/backend/utils/misc/guc.c
View file @
1f12abbc
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.19
8 2004/04/07 05:05:50
momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.19
9 2004/04/07 18:52:26
momjian Exp $
*
*
*--------------------------------------------------------------------
*--------------------------------------------------------------------
*/
*/
...
@@ -2730,13 +2730,12 @@ set_config_option(const char *name, const char *value,
...
@@ -2730,13 +2730,12 @@ set_config_option(const char *name, const char *value,
name
)));
name
)));
return
false
;
return
false
;
}
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
if
(
record
->
context
==
PGC_USERLIMIT
)
IsUnderPostmaster
&&
!
superuser
())
{
{
if
(
newval
<
conf
->
reset_val
)
if
(
newval
<
conf
->
reset_val
)
{
{
/* Limit non-superuser changes */
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
{
ereport
(
elevel
,
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
@@ -2750,7 +2749,8 @@ set_config_option(const char *name, const char *value,
...
@@ -2750,7 +2749,8 @@ set_config_option(const char *name, const char *value,
{
{
/* Allow change if admin should override */
/* Allow change if admin should override */
if
(
source
<
PGC_S_UNPRIVILEGED
&&
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
changeValOrig
;
changeVal
=
changeValOrig
;
}
}
}
}
...
@@ -2830,8 +2830,7 @@ set_config_option(const char *name, const char *value,
...
@@ -2830,8 +2830,7 @@ set_config_option(const char *name, const char *value,
newval
,
name
,
conf
->
min
,
conf
->
max
)));
newval
,
name
,
conf
->
min
,
conf
->
max
)));
return
false
;
return
false
;
}
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
if
(
record
->
context
==
PGC_USERLIMIT
)
IsUnderPostmaster
&&
!
superuser
())
{
{
/* handle log_min_duration_statement, -1=disable */
/* handle log_min_duration_statement, -1=disable */
if
((
newval
!=
-
1
&&
conf
->
reset_val
!=
-
1
&&
if
((
newval
!=
-
1
&&
conf
->
reset_val
!=
-
1
&&
...
@@ -2839,7 +2838,7 @@ set_config_option(const char *name, const char *value,
...
@@ -2839,7 +2838,7 @@ set_config_option(const char *name, const char *value,
(
newval
==
-
1
&&
conf
->
reset_val
!=
-
1
))
/* turn off */
(
newval
==
-
1
&&
conf
->
reset_val
!=
-
1
))
/* turn off */
{
{
/* Limit non-superuser changes */
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
{
ereport
(
elevel
,
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
@@ -2855,7 +2854,8 @@ set_config_option(const char *name, const char *value,
...
@@ -2855,7 +2854,8 @@ set_config_option(const char *name, const char *value,
(
newval
!=
-
1
&&
*
conf
->
variable
==
-
1
))
/* turn on */
(
newval
!=
-
1
&&
*
conf
->
variable
==
-
1
))
/* turn on */
{
{
if
(
source
<
PGC_S_UNPRIVILEGED
&&
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
changeValOrig
;
changeVal
=
changeValOrig
;
}
}
}
}
...
@@ -2935,12 +2935,11 @@ set_config_option(const char *name, const char *value,
...
@@ -2935,12 +2935,11 @@ set_config_option(const char *name, const char *value,
newval
,
name
,
conf
->
min
,
conf
->
max
)));
newval
,
name
,
conf
->
min
,
conf
->
max
)));
return
false
;
return
false
;
}
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
if
(
record
->
context
==
PGC_USERLIMIT
)
IsUnderPostmaster
&&
!
superuser
())
/* No REAL PGC_USERLIMIT */
/* No REAL PGC_USERLIMIT */
{
{
/* Limit non-superuser changes */
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
{
ereport
(
elevel
,
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
@@ -2951,7 +2950,8 @@ set_config_option(const char *name, const char *value,
...
@@ -2951,7 +2950,8 @@ set_config_option(const char *name, const char *value,
}
}
/* Allow change if admin should override */
/* Allow change if admin should override */
if
(
source
<
PGC_S_UNPRIVILEGED
&&
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
false
;
changeVal
=
false
;
}
}
}
}
...
@@ -3023,8 +3023,7 @@ set_config_option(const char *name, const char *value,
...
@@ -3023,8 +3023,7 @@ set_config_option(const char *name, const char *value,
return
false
;
return
false
;
}
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
if
(
record
->
context
==
PGC_USERLIMIT
)
IsUnderPostmaster
&&
!
superuser
())
{
{
int
var_value
,
reset_value
,
new_value
;
int
var_value
,
reset_value
,
new_value
;
const
char
*
(
*
var_hook
)
(
int
*
var
,
const
char
*
newval
,
const
char
*
(
*
var_hook
)
(
int
*
var
,
const
char
*
newval
,
...
@@ -3045,7 +3044,7 @@ set_config_option(const char *name, const char *value,
...
@@ -3045,7 +3044,7 @@ set_config_option(const char *name, const char *value,
if
(
new_value
>
reset_value
)
if
(
new_value
>
reset_value
)
{
{
/* Limit non-superuser changes */
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
{
ereport
(
elevel
,
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
@@ -3060,7 +3059,8 @@ set_config_option(const char *name, const char *value,
...
@@ -3060,7 +3059,8 @@ set_config_option(const char *name, const char *value,
if
(
new_value
<
var_value
)
if
(
new_value
<
var_value
)
{
{
if
(
source
<
PGC_S_UNPRIVILEGED
&&
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
changeValOrig
;
changeVal
=
changeValOrig
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment