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
df67b83a
Commit
df67b83a
authored
Feb 19, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Password fix. Now people have to do the REVOKE themselves.
parent
70ddf2df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
10 deletions
+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
No files found.
src/backend/commands/user.c
View file @
df67b83a
...
@@ -30,8 +30,11 @@
...
@@ -30,8 +30,11 @@
#include <tcop/tcopprot.h>
#include <tcop/tcopprot.h>
#include <utils/acl.h>
#include <utils/acl.h>
#include <utils/rel.h>
#include <utils/rel.h>
#include <utils/syscache.h>
#include <commands/user.h>
#include <commands/user.h>
static
void
CheckPgUserAclNotNull
(
void
);
/*---------------------------------------------------------------------
/*---------------------------------------------------------------------
* UpdatePgPwdFile
* UpdatePgPwdFile
*
*
...
@@ -93,6 +96,8 @@ void DefineUser(CreateUserStmt *stmt) {
...
@@ -93,6 +96,8 @@ void DefineUser(CreateUserStmt *stmt) {
inblock
;
inblock
;
int
max_id
=
-
1
;
int
max_id
=
-
1
;
if
(
stmt
->
password
)
CheckPgUserAclNotNull
();
if
(
!
(
inblock
=
IsTransactionBlock
()))
if
(
!
(
inblock
=
IsTransactionBlock
()))
BeginTransactionBlock
();
BeginTransactionBlock
();
...
@@ -204,6 +209,8 @@ extern void AlterUser(AlterUserStmt *stmt) {
...
@@ -204,6 +209,8 @@ extern void AlterUser(AlterUserStmt *stmt) {
n
,
n
,
inblock
;
inblock
;
if
(
stmt
->
password
)
CheckPgUserAclNotNull
();
if
(
!
(
inblock
=
IsTransactionBlock
()))
if
(
!
(
inblock
=
IsTransactionBlock
()))
BeginTransactionBlock
();
BeginTransactionBlock
();
...
@@ -420,3 +427,30 @@ extern void RemoveUser(char* user) {
...
@@ -420,3 +427,30 @@ extern void RemoveUser(char* user) {
if
(
IsTransactionBlock
()
&&
!
inblock
)
if
(
IsTransactionBlock
()
&&
!
inblock
)
EndTransactionBlock
();
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
View file @
df67b83a
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
#
#
#
#
# IDENTIFICATION
# 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"
...
@@ -351,10 +351,6 @@ echo "vacuuming template1"
echo
"vacuum"
| postgres
-F
-Q
-D
$PGDATA
template1 2>&1
>
/dev/null |
\
echo
"vacuum"
| postgres
-F
-Q
-D
$PGDATA
template1 2>&1
>
/dev/null |
\
grep
-v
"^DEBUG:"
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 |
\
echo
"COPY pg_user TO '
$PGDATA
/pg_pwd' USING DELIMITERS '
\\
t'"
| postgres
-F
-Q
-D
$PGDATA
template1 2>&1
>
/dev/null |
\
grep
-v
"'DEBUG:"
grep
-v
"'DEBUG:"
...
...
src/include/catalog/pg_user.h
View file @
df67b83a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
* Copyright (c) 1994, Regents of the University of California
* 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
* NOTES
* the genbki.sh script reads this file and generates .bki
* the genbki.sh script reads this file and generates .bki
...
@@ -58,7 +58,7 @@ typedef FormData_pg_user *Form_pg_user;
...
@@ -58,7 +58,7 @@ typedef FormData_pg_user *Form_pg_user;
#define Anum_pg_user_usetrace 4
#define Anum_pg_user_usetrace 4
#define Anum_pg_user_usesuper 5
#define Anum_pg_user_usesuper 5
#define Anum_pg_user_usecatupd 6
#define Anum_pg_user_usecatupd 6
#define Anum_pg_user_passwd 7
#define Anum_pg_user_passwd
7
#define Anum_pg_user_valuntil 8
#define Anum_pg_user_valuntil 8
/* ----------------
/* ----------------
...
...
src/interfaces/ecpg/include/Makefile
View file @
df67b83a
...
@@ -6,9 +6,9 @@ all clean::
...
@@ -6,9 +6,9 @@ all clean::
@
echo
Nothing to be
done
.
@
echo
Nothing to be
done
.
install
::
install
::
install
ecpglib.h
$(DESTDIR)$(HEADERDIR)
install
$(INSTLOPTS)
ecpglib.h
$(DESTDIR)$(HEADERDIR)
install
ecpgtype.h
$(DESTDIR)$(HEADERDIR)
install
$(INSTLOPTS)
ecpgtype.h
$(DESTDIR)$(HEADERDIR)
install
sqlca.h
$(DESTDIR)$(HEADERDIR)
install
$(INSTLOPTS)
sqlca.h
$(DESTDIR)$(HEADERDIR)
uninstall
::
uninstall
::
rm
-f
$(DESTDIR)$(HEADERDIR)
/ecpglib.h
rm
-f
$(DESTDIR)$(HEADERDIR)
/ecpglib.h
...
...
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