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
c7558b3b
Commit
c7558b3b
authored
Jun 25, 2000
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Relaxed pickiness about user and group commands in transaction blocks.
parent
3fb8c9d1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
37 deletions
+5
-37
src/backend/commands/user.c
src/backend/commands/user.c
+5
-37
No files found.
src/backend/commands/user.c
View file @
c7558b3b
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.6
0 2000/06/12 03:40:29 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.6
1 2000/06/25 14:24:59 petere
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -201,15 +201,6 @@ CreateUser(CreateUserStmt *stmt)
if
(
!
superuser
())
elog
(
ERROR
,
"CREATE USER: permission denied"
);
/*
* The reason for the following is this: If you start a transaction
* block, create a user, then roll back the transaction, the pg_pwd
* won't get rolled back due to a bug in the Unix file system ( :}).
* Hence this is in the interest of security.
*/
if
(
IsTransactionBlock
())
elog
(
ERROR
,
"CREATE USER: may not be called in a transaction block"
);
/*
* Scan the pg_shadow relation to be certain the user or id doesn't
* already exist. Note we secure exclusive lock, because we also need
...
...
@@ -356,9 +347,9 @@ AlterUser(AlterUserStmt *stmt)
&&
stmt
->
password
&&
strcmp
(
GetPgUserName
(),
stmt
->
user
)
==
0
))
elog
(
ERROR
,
"ALTER USER: permission denied"
);
/*
see comments in create user
*/
if
(
IsTransactionBlock
())
elog
(
ERROR
,
"ALTER USER: may not be called in a transaction blo
ck"
);
/*
changes to the flat password file cannot be rolled back
*/
if
(
IsTransactionBlock
()
&&
stmt
->
password
)
elog
(
NOTICE
,
"ALTER USER: password changes cannot be rolled ba
ck"
);
/*
* Scan the pg_shadow relation to be certain the user exists. Note we
...
...
@@ -503,7 +494,7 @@ DropUser(DropUserStmt *stmt)
elog
(
ERROR
,
"DROP USER: permission denied"
);
if
(
IsTransactionBlock
())
elog
(
ERROR
,
"DROP USER: may not be called in a transaction block
"
);
elog
(
NOTICE
,
"DROP USER cannot be rolled back completely
"
);
/*
* Scan the pg_shadow relation to find the usesysid of the user to be
...
...
@@ -675,14 +666,6 @@ CreateGroup(CreateGroupStmt *stmt)
if
(
!
superuser
())
elog
(
ERROR
,
"CREATE GROUP: permission denied"
);
/*
* There is not real reason for this, but it makes it consistent with
* create user, and it seems like a good idea anyway.
*/
if
(
IsTransactionBlock
())
elog
(
ERROR
,
"CREATE GROUP: may not be called in a transaction block"
);
pg_group_rel
=
heap_openr
(
GroupRelationName
,
AccessExclusiveLock
);
pg_group_dsc
=
RelationGetDescr
(
pg_group_rel
);
...
...
@@ -816,14 +799,6 @@ AlterGroup(AlterGroupStmt *stmt, const char *tag)
if
(
!
superuser
())
elog
(
ERROR
,
"%s: permission denied"
,
tag
);
/*
* There is not real reason for this, but it makes it consistent with
* alter user, and it seems like a good idea anyway.
*/
if
(
IsTransactionBlock
())
elog
(
ERROR
,
"%s: may not be called in a transaction block"
,
tag
);
pg_group_rel
=
heap_openr
(
GroupRelationName
,
AccessExclusiveLock
);
pg_group_dsc
=
RelationGetDescr
(
pg_group_rel
);
...
...
@@ -1092,13 +1067,6 @@ DropGroup(DropGroupStmt *stmt)
if
(
!
superuser
())
elog
(
ERROR
,
"DROP GROUP: permission denied"
);
/*
* There is not real reason for this, but it makes it consistent with
* drop user, and it seems like a good idea anyway.
*/
if
(
IsTransactionBlock
())
elog
(
ERROR
,
"DROP GROUP: may not be called in a transaction block"
);
/*
* Scan the pg_group table and delete all matching groups.
*/
...
...
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