|
6 | 6 | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc |
7 | 7 | * Portions Copyright (c) 1994, Regents of the University of California |
8 | 8 | * |
9 | | - * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.60 2000/06/12 03:40:29 momjian Exp $ |
| 9 | + * $Header: /cvsroot/pgsql/src/backend/commands/user.c,v 1.61 2000/06/25 14:24:59 petere Exp $ |
10 | 10 | * |
11 | 11 | *------------------------------------------------------------------------- |
12 | 12 | */ |
@@ -201,15 +201,6 @@ CreateUser(CreateUserStmt *stmt) |
201 | 201 | if (!superuser()) |
202 | 202 | elog(ERROR,"CREATE USER: permission denied"); |
203 | 203 |
|
204 | | -/* |
205 | | - * The reason for the following is this: If you start a transaction |
206 | | - * block, create a user, then roll back the transaction, the pg_pwd |
207 | | - * won't get rolled back due to a bug in the Unix file system ( :}). |
208 | | - * Hence this is in the interest of security. |
209 | | - */ |
210 | | -if (IsTransactionBlock()) |
211 | | -elog(ERROR,"CREATE USER: may not be called in a transaction block"); |
212 | | - |
213 | 204 | /* |
214 | 205 | * Scan the pg_shadow relation to be certain the user or id doesn't |
215 | 206 | * already exist. Note we secure exclusive lock, because we also need |
@@ -356,9 +347,9 @@ AlterUser(AlterUserStmt *stmt) |
356 | 347 | &&stmt->password&&strcmp(GetPgUserName(),stmt->user)==0)) |
357 | 348 | elog(ERROR,"ALTER USER: permission denied"); |
358 | 349 |
|
359 | | -/*see comments in create user */ |
360 | | -if (IsTransactionBlock()) |
361 | | -elog(ERROR,"ALTER USER:may notbecalled in a transaction block"); |
| 350 | +/*changes to the flat password file cannot be rolled back */ |
| 351 | +if (IsTransactionBlock()&&stmt->password) |
| 352 | +elog(NOTICE,"ALTER USER:password changes cannotberolled back"); |
362 | 353 |
|
363 | 354 | /* |
364 | 355 | * Scan the pg_shadow relation to be certain the user exists. Note we |
@@ -503,7 +494,7 @@ DropUser(DropUserStmt *stmt) |
503 | 494 | elog(ERROR,"DROP USER: permission denied"); |
504 | 495 |
|
505 | 496 | if (IsTransactionBlock()) |
506 | | -elog(ERROR,"DROP USER: may notbecalled in a transaction block"); |
| 497 | +elog(NOTICE,"DROP USER cannotberolled back completely"); |
507 | 498 |
|
508 | 499 | /* |
509 | 500 | * Scan the pg_shadow relation to find the usesysid of the user to be |
@@ -675,14 +666,6 @@ CreateGroup(CreateGroupStmt *stmt) |
675 | 666 | if (!superuser()) |
676 | 667 | elog(ERROR,"CREATE GROUP: permission denied"); |
677 | 668 |
|
678 | | -/* |
679 | | - * There is not real reason for this, but it makes it consistent with |
680 | | - * create user, and it seems like a good idea anyway. |
681 | | - */ |
682 | | -if (IsTransactionBlock()) |
683 | | -elog(ERROR,"CREATE GROUP: may not be called in a transaction block"); |
684 | | - |
685 | | - |
686 | 669 | pg_group_rel=heap_openr(GroupRelationName,AccessExclusiveLock); |
687 | 670 | pg_group_dsc=RelationGetDescr(pg_group_rel); |
688 | 671 |
|
@@ -816,14 +799,6 @@ AlterGroup(AlterGroupStmt *stmt, const char *tag) |
816 | 799 | if (!superuser()) |
817 | 800 | elog(ERROR,"%s: permission denied",tag); |
818 | 801 |
|
819 | | -/* |
820 | | - * There is not real reason for this, but it makes it consistent with |
821 | | - * alter user, and it seems like a good idea anyway. |
822 | | - */ |
823 | | -if (IsTransactionBlock()) |
824 | | -elog(ERROR,"%s: may not be called in a transaction block",tag); |
825 | | - |
826 | | - |
827 | 802 | pg_group_rel=heap_openr(GroupRelationName,AccessExclusiveLock); |
828 | 803 | pg_group_dsc=RelationGetDescr(pg_group_rel); |
829 | 804 |
|
@@ -1092,13 +1067,6 @@ DropGroup(DropGroupStmt *stmt) |
1092 | 1067 | if (!superuser()) |
1093 | 1068 | elog(ERROR,"DROP GROUP: permission denied"); |
1094 | 1069 |
|
1095 | | -/* |
1096 | | - * There is not real reason for this, but it makes it consistent with |
1097 | | - * drop user, and it seems like a good idea anyway. |
1098 | | - */ |
1099 | | -if (IsTransactionBlock()) |
1100 | | -elog(ERROR,"DROP GROUP: may not be called in a transaction block"); |
1101 | | - |
1102 | 1070 | /* |
1103 | 1071 | * Scan the pg_group table and delete all matching groups. |
1104 | 1072 | */ |
|