Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
c7558b3b
Commit
c7558b3b
authored
25 years ago
by
Peter Eisentraut
Browse files
Options
Downloads
Patches
Plain Diff
Relaxed pickiness about user and group commands in transaction blocks.
parent
3fb8c9d1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backend/commands/user.c
+5
-37
5 additions, 37 deletions
src/backend/commands/user.c
with
5 additions
and
37 deletions
src/backend/commands/user.c
+
5
−
37
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
ca
lled
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 can
not be
ro
lled
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
ca
lled
in a transaction block
"
);
elog
(
NOTICE
,
"DROP USER
can
not be
ro
lled
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.
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment