Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
1f12abbc
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1f12abbc
编写于
4月 07, 2004
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Push superuser check farther down in the if() statements to fix startup
crash with debug in log_statement patch.
上级
0bb21d39
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
17 deletion
+17
-17
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+17
-17
未找到文件。
src/backend/utils/misc/guc.c
浏览文件 @
1f12abbc
...
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
* 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,
name
)));
return
false
;
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
IsUnderPostmaster
&&
!
superuser
())
if
(
record
->
context
==
PGC_USERLIMIT
)
{
if
(
newval
<
conf
->
reset_val
)
{
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
...
@@ -2750,7 +2749,8 @@ set_config_option(const char *name, const char *value,
{
/* Allow change if admin should override */
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
changeValOrig
;
}
}
...
...
@@ -2830,8 +2830,7 @@ set_config_option(const char *name, const char *value,
newval
,
name
,
conf
->
min
,
conf
->
max
)));
return
false
;
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
IsUnderPostmaster
&&
!
superuser
())
if
(
record
->
context
==
PGC_USERLIMIT
)
{
/* handle log_min_duration_statement, -1=disable */
if
((
newval
!=
-
1
&&
conf
->
reset_val
!=
-
1
&&
...
...
@@ -2839,7 +2838,7 @@ set_config_option(const char *name, const char *value,
(
newval
==
-
1
&&
conf
->
reset_val
!=
-
1
))
/* turn off */
{
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
...
@@ -2855,7 +2854,8 @@ set_config_option(const char *name, const char *value,
(
newval
!=
-
1
&&
*
conf
->
variable
==
-
1
))
/* turn on */
{
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
changeValOrig
;
}
}
...
...
@@ -2935,12 +2935,11 @@ set_config_option(const char *name, const char *value,
newval
,
name
,
conf
->
min
,
conf
->
max
)));
return
false
;
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
IsUnderPostmaster
&&
!
superuser
())
if
(
record
->
context
==
PGC_USERLIMIT
)
/* No REAL PGC_USERLIMIT */
{
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
...
@@ -2951,7 +2950,8 @@ set_config_option(const char *name, const char *value,
}
/* Allow change if admin should override */
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
false
;
}
}
...
...
@@ -3023,8 +3023,7 @@ set_config_option(const char *name, const char *value,
return
false
;
}
if
(
record
->
context
==
PGC_USERLIMIT
&&
IsUnderPostmaster
&&
!
superuser
())
if
(
record
->
context
==
PGC_USERLIMIT
)
{
int
var_value
,
reset_value
,
new_value
;
const
char
*
(
*
var_hook
)
(
int
*
var
,
const
char
*
newval
,
...
...
@@ -3045,7 +3044,7 @@ set_config_option(const char *name, const char *value,
if
(
new_value
>
reset_value
)
{
/* Limit non-superuser changes */
if
(
source
>
PGC_S_UNPRIVILEGED
)
if
(
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
()
)
{
ereport
(
elevel
,
(
errcode
(
ERRCODE_INSUFFICIENT_PRIVILEGE
),
...
...
@@ -3060,7 +3059,8 @@ set_config_option(const char *name, const char *value,
if
(
new_value
<
var_value
)
{
if
(
source
<
PGC_S_UNPRIVILEGED
&&
record
->
source
>
PGC_S_UNPRIVILEGED
)
record
->
source
>
PGC_S_UNPRIVILEGED
&&
!
superuser
())
changeVal
=
changeValOrig
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录