Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44763a2

Browse files
committed
Make usecatupd disabled for normal users, and allow normal users to
update temp tables with this setting.
1 parent04578a9 commit44763a2

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

‎src/backend/catalog/aclchk.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.26 1999/07/17 20:16:47 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.27 1999/07/30 18:09:44 momjian Exp $
1111
*
1212
* NOTES
1313
* See acl.h.
@@ -392,6 +392,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
392392
*/
393393
if (((mode&ACL_WR)|| (mode&ACL_AP))&&
394394
!allowSystemTableMods&&IsSystemRelationName(relname)&&
395+
strncmp(relname,"pg_temp.",strlen("pg_temp."))!=0&&
395396
!((Form_pg_shadow)GETSTRUCT(tuple))->usecatupd)
396397
{
397398
elog(DEBUG,"pg_aclcheck: catalog update to \"%s\": permission denied",

‎src/backend/commands/user.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright (c) 1994, Regents of the University of California
77
*
8-
* $Id: user.c,v 1.32 1999/07/17 20:16:54 momjian Exp $
8+
* $Id: user.c,v 1.33 1999/07/30 18:09:47 momjian Exp $
99
*
1010
*-------------------------------------------------------------------------
1111
*/
@@ -169,7 +169,7 @@ DefineUser(CreateUserStmt *stmt, CommandDest dest)
169169
snprintf(sql,SQL_LENGTH,
170170
"insert into %s (usename,usesysid,usecreatedb,usetrace,"
171171
"usesuper,usecatupd,passwd,valuntil) "
172-
"values('%s',%d,'%c','t','%c','t',%s%s%s,%s%s%s)",
172+
"values('%s',%d,'%c','f','%c','f',%s%s%s,%s%s%s)",
173173
ShadowRelationName,
174174
stmt->user,
175175
max_id+1,

‎src/bin/createuser/createuser.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
#
1010
# IDENTIFICATION
11-
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.11 1999/01/31 05:04:25 scrappy Exp $
11+
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.12 1999/07/30 18:09:49 momjian Exp $
1212
#
1313
# Note - this should NOT be setuid.
1414
#
@@ -218,7 +218,7 @@ fi
218218
QUERY="insert into pg_shadow\
219219
(usename, usesysid, usecreatedb, usetrace, usesuper, usecatupd)\
220220
values\
221-
('$NEWUSER',$SYSID, '$CANCREATE', 't', '$CANADDUSER','t')"
221+
('$NEWUSER',$SYSID, '$CANCREATE', 'f', '$CANADDUSER','f')"
222222

223223
RES=`$PSQL -c"$QUERY" template1`
224224

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp