mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Make usecatupd disabled for normal users, and allow normal users to
update temp tables with this setting.
This commit is contained in:
parent
04578a9180
commit
44763a2b23
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.26 1999/07/17 20:16:47 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.27 1999/07/30 18:09:44 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* See acl.h.
|
* See acl.h.
|
||||||
@ -392,6 +392,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
|
|||||||
*/
|
*/
|
||||||
if (((mode & ACL_WR) || (mode & ACL_AP)) &&
|
if (((mode & ACL_WR) || (mode & ACL_AP)) &&
|
||||||
!allowSystemTableMods && IsSystemRelationName(relname) &&
|
!allowSystemTableMods && IsSystemRelationName(relname) &&
|
||||||
|
strncmp(relname,"pg_temp.", strlen("pg_temp.")) != 0 &&
|
||||||
!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)
|
!((Form_pg_shadow) GETSTRUCT(tuple))->usecatupd)
|
||||||
{
|
{
|
||||||
elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied",
|
elog(DEBUG, "pg_aclcheck: catalog update to \"%s\": permission denied",
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: user.c,v 1.32 1999/07/17 20:16:54 momjian Exp $
|
* $Id: user.c,v 1.33 1999/07/30 18:09:47 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -169,7 +169,7 @@ DefineUser(CreateUserStmt *stmt, CommandDest dest)
|
|||||||
snprintf(sql, SQL_LENGTH,
|
snprintf(sql, SQL_LENGTH,
|
||||||
"insert into %s (usename,usesysid,usecreatedb,usetrace,"
|
"insert into %s (usename,usesysid,usecreatedb,usetrace,"
|
||||||
"usesuper,usecatupd,passwd,valuntil) "
|
"usesuper,usecatupd,passwd,valuntil) "
|
||||||
"values('%s',%d,'%c','t','%c','t',%s%s%s,%s%s%s)",
|
"values('%s',%d,'%c','f','%c','f',%s%s%s,%s%s%s)",
|
||||||
ShadowRelationName,
|
ShadowRelationName,
|
||||||
stmt->user,
|
stmt->user,
|
||||||
max_id + 1,
|
max_id + 1,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.11 1999/01/31 05:04:25 scrappy Exp $
|
# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.12 1999/07/30 18:09:49 momjian Exp $
|
||||||
#
|
#
|
||||||
# Note - this should NOT be setuid.
|
# Note - this should NOT be setuid.
|
||||||
#
|
#
|
||||||
@ -218,7 +218,7 @@ fi
|
|||||||
QUERY="insert into pg_shadow \
|
QUERY="insert into pg_shadow \
|
||||||
(usename, usesysid, usecreatedb, usetrace, usesuper, usecatupd) \
|
(usename, usesysid, usecreatedb, usetrace, usesuper, usecatupd) \
|
||||||
values \
|
values \
|
||||||
('$NEWUSER', $SYSID, '$CANCREATE', 't', '$CANADDUSER','t')"
|
('$NEWUSER', $SYSID, '$CANCREATE', 'f', '$CANADDUSER','f')"
|
||||||
|
|
||||||
RES=`$PSQL -c "$QUERY" template1`
|
RES=`$PSQL -c "$QUERY" template1`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user