Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
df67b83a
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,发现更多精彩内容 >>
提交
df67b83a
编写于
2月 19, 1998
作者:
B
Bruce Momjian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Password fix. Now people have to do the REVOKE themselves.
上级
70ddf2df
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
40 addition
and
10 deletion
+40
-10
src/backend/commands/user.c
src/backend/commands/user.c
+34
-0
src/bin/initdb/initdb.sh
src/bin/initdb/initdb.sh
+1
-5
src/include/catalog/pg_user.h
src/include/catalog/pg_user.h
+2
-2
src/interfaces/ecpg/include/Makefile
src/interfaces/ecpg/include/Makefile
+3
-3
未找到文件。
src/backend/commands/user.c
浏览文件 @
df67b83a
...
...
@@ -30,8 +30,11 @@
#include <tcop/tcopprot.h>
#include <utils/acl.h>
#include <utils/rel.h>
#include <utils/syscache.h>
#include <commands/user.h>
static
void
CheckPgUserAclNotNull
(
void
);
/*---------------------------------------------------------------------
* UpdatePgPwdFile
*
...
...
@@ -93,6 +96,8 @@ void DefineUser(CreateUserStmt *stmt) {
inblock
;
int
max_id
=
-
1
;
if
(
stmt
->
password
)
CheckPgUserAclNotNull
();
if
(
!
(
inblock
=
IsTransactionBlock
()))
BeginTransactionBlock
();
...
...
@@ -204,6 +209,8 @@ extern void AlterUser(AlterUserStmt *stmt) {
n
,
inblock
;
if
(
stmt
->
password
)
CheckPgUserAclNotNull
();
if
(
!
(
inblock
=
IsTransactionBlock
()))
BeginTransactionBlock
();
...
...
@@ -420,3 +427,30 @@ extern void RemoveUser(char* user) {
if
(
IsTransactionBlock
()
&&
!
inblock
)
EndTransactionBlock
();
}
/*
* CheckPgUserAclNotNull
*
* check to see if there is an ACL on pg_user
*/
static
void
CheckPgUserAclNotNull
()
{
HeapTuple
htp
;
htp
=
SearchSysCacheTuple
(
RELNAME
,
PointerGetDatum
(
UserRelationName
),
0
,
0
,
0
);
if
(
!
HeapTupleIsValid
(
htp
))
{
elog
(
ERROR
,
"IsPgUserAclNull: class
\"
%s
\"
not found"
,
UserRelationName
);
}
if
(
heap_attisnull
(
htp
,
Anum_pg_class_relacl
))
{
elog
(
NOTICE
,
"To use passwords, you have to revoke permissions on pg_user"
);
elog
(
NOTICE
,
"so normal users can not read the passwords."
);
elog
(
ERROR
,
"Try 'REVOKE ALL ON pg_user FROM PUBLIC'"
);
}
return
;
}
src/bin/initdb/initdb.sh
浏览文件 @
df67b83a
...
...
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.3
1 1997/12/30 02:26:43 scrappy
Exp $
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.3
2 1998/02/19 17:19:45 momjian
Exp $
#
#-------------------------------------------------------------------------
...
...
@@ -351,10 +351,6 @@ echo "vacuuming template1"
echo
"vacuum"
| postgres
-F
-Q
-D
$PGDATA
template1 2>&1
>
/dev/null |
\
grep
-v
"^DEBUG:"
echo
"Altering pg_user acl"
echo
"REVOKE ALL ON pg_user FROM public"
| postgres
-F
-Q
-D
$PGDATA
template1 2>&1
>
/dev/null |
\
grep
-v
"'DEBUG:"
echo
"COPY pg_user TO '
$PGDATA
/pg_pwd' USING DELIMITERS '
\\
t'"
| postgres
-F
-Q
-D
$PGDATA
template1 2>&1
>
/dev/null |
\
grep
-v
"'DEBUG:"
...
...
src/include/catalog/pg_user.h
浏览文件 @
df67b83a
...
...
@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_user.h,v 1.
8 1997/12/12 16:26:36
momjian Exp $
* $Id: pg_user.h,v 1.
9 1998/02/19 17:19:51
momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
...
...
@@ -58,7 +58,7 @@ typedef FormData_pg_user *Form_pg_user;
#define Anum_pg_user_usetrace 4
#define Anum_pg_user_usesuper 5
#define Anum_pg_user_usecatupd 6
#define Anum_pg_user_passwd 7
#define Anum_pg_user_passwd
7
#define Anum_pg_user_valuntil 8
/* ----------------
...
...
src/interfaces/ecpg/include/Makefile
浏览文件 @
df67b83a
...
...
@@ -6,9 +6,9 @@ all clean::
@
echo
Nothing to be
done
.
install
::
install
ecpglib.h
$(DESTDIR)$(HEADERDIR)
install
ecpgtype.h
$(DESTDIR)$(HEADERDIR)
install
sqlca.h
$(DESTDIR)$(HEADERDIR)
install
$(INSTLOPTS)
ecpglib.h
$(DESTDIR)$(HEADERDIR)
install
$(INSTLOPTS)
ecpgtype.h
$(DESTDIR)$(HEADERDIR)
install
$(INSTLOPTS)
sqlca.h
$(DESTDIR)$(HEADERDIR)
uninstall
::
rm
-f
$(DESTDIR)$(HEADERDIR)
/ecpglib.h
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录