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
85f1950a
Commit
85f1950a
authored
Oct 16, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove NO_SECURITY define.
parent
17e3e470
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
24 additions
and
81 deletions
+24
-81
src/backend/commands/analyze.c
src/backend/commands/analyze.c
+1
-3
src/backend/commands/command.c
src/backend/commands/command.c
+14
-16
src/backend/commands/comment.c
src/backend/commands/comment.c
+0
-4
src/backend/commands/remove.c
src/backend/commands/remove.c
+1
-9
src/backend/commands/rename.c
src/backend/commands/rename.c
+1
-3
src/backend/commands/sequence.c
src/backend/commands/sequence.c
+1
-7
src/backend/commands/trigger.c
src/backend/commands/trigger.c
+1
-5
src/backend/commands/vacuum.c
src/backend/commands/vacuum.c
+1
-3
src/backend/executor/execMain.c
src/backend/executor/execMain.c
+1
-3
src/backend/tcop/utility.c
src/backend/tcop/utility.c
+1
-23
src/backend/utils/adt/acl.c
src/backend/utils/adt/acl.c
+1
-3
src/include/config.h.in
src/include/config.h.in
+1
-2
No files found.
src/backend/commands/analyze.c
View file @
85f1950a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.
7 2000/10/05 19:48:22
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/analyze.c,v 1.
8 2000/10/16 17:08:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
...
@@ -98,7 +98,6 @@ analyze_rel(Oid relid, List *anal_cols2, int MESSAGE_LEVEL)
...
@@ -98,7 +98,6 @@ analyze_rel(Oid relid, List *anal_cols2, int MESSAGE_LEVEL)
onerel
=
heap_open
(
relid
,
AccessShareLock
);
onerel
=
heap_open
(
relid
,
AccessShareLock
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
RelationGetRelationName
(
onerel
),
if
(
!
pg_ownercheck
(
GetUserId
(),
RelationGetRelationName
(
onerel
),
RELNAME
))
RELNAME
))
{
{
...
@@ -110,7 +109,6 @@ analyze_rel(Oid relid, List *anal_cols2, int MESSAGE_LEVEL)
...
@@ -110,7 +109,6 @@ analyze_rel(Oid relid, List *anal_cols2, int MESSAGE_LEVEL)
CommitTransactionCommand
();
CommitTransactionCommand
();
return
;
return
;
}
}
#endif
elog
(
MESSAGE_LEVEL
,
"Analyzing..."
);
elog
(
MESSAGE_LEVEL
,
"Analyzing..."
);
...
...
src/backend/commands/command.c
View file @
85f1950a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.10
6 2000/10/10 17:13:30
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.10
7 2000/10/16 17:08:05
momjian Exp $
*
*
* NOTES
* NOTES
* The PerformAddAttribute() code, like most of the relation
* The PerformAddAttribute() code, like most of the relation
...
@@ -311,10 +311,8 @@ AlterTableAddColumn(const char *relationName,
...
@@ -311,10 +311,8 @@ AlterTableAddColumn(const char *relationName,
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relationName
))
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relationName
))
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
is a system catalog"
,
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
is a system catalog"
,
relationName
);
relationName
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relationName
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relationName
,
RELNAME
))
elog
(
ERROR
,
"ALTER TABLE: permission denied"
);
elog
(
ERROR
,
"ALTER TABLE: permission denied"
);
#endif
/*
/*
* Grab an exclusive lock on the target table, which we will NOT
* Grab an exclusive lock on the target table, which we will NOT
...
@@ -1149,7 +1147,7 @@ AlterTableAddConstraint(char *relationName,
...
@@ -1149,7 +1147,7 @@ AlterTableAddConstraint(char *relationName,
scan
=
heap_beginscan
(
rel
,
false
,
SnapshotNow
,
0
,
NULL
);
scan
=
heap_beginscan
(
rel
,
false
,
SnapshotNow
,
0
,
NULL
);
AssertState
(
scan
!=
NULL
);
AssertState
(
scan
!=
NULL
);
/*
/*
* We need to make a parse state and range table to allow
* We need to make a parse state and range table to allow
* us to transformExpr and fix_opids to get a version of
* us to transformExpr and fix_opids to get a version of
* the expression we can pass to ExecQual
* the expression we can pass to ExecQual
...
@@ -1195,7 +1193,7 @@ AlterTableAddConstraint(char *relationName,
...
@@ -1195,7 +1193,7 @@ AlterTableAddConstraint(char *relationName,
rte
->
eref
->
relname
=
relationName
;
rte
->
eref
->
relname
=
relationName
;
rtlist
=
makeList1
(
rte
);
rtlist
=
makeList1
(
rte
);
/*
/*
* Scan through the rows now, making the necessary things
* Scan through the rows now, making the necessary things
* for ExecQual, and then call it to evaluate the
* for ExecQual, and then call it to evaluate the
* expression.
* expression.
...
@@ -1224,13 +1222,13 @@ AlterTableAddConstraint(char *relationName,
...
@@ -1224,13 +1222,13 @@ AlterTableAddConstraint(char *relationName,
pfree
(
rte
);
pfree
(
rte
);
heap_endscan
(
scan
);
heap_endscan
(
scan
);
heap_close
(
rel
,
NoLock
);
heap_close
(
rel
,
NoLock
);
if
(
!
successful
)
if
(
!
successful
)
{
{
elog
(
ERROR
,
"AlterTableAddConstraint: rejected due to CHECK constraint %s"
,
name
);
elog
(
ERROR
,
"AlterTableAddConstraint: rejected due to CHECK constraint %s"
,
name
);
}
}
/*
/*
* Call AddRelationRawConstraints to do the real adding --
* Call AddRelationRawConstraints to do the real adding --
* It duplicates some of the above, but does not check the
* It duplicates some of the above, but does not check the
* validity of the constraint against tuples already in
* validity of the constraint against tuples already in
...
@@ -1274,7 +1272,7 @@ AlterTableAddConstraint(char *relationName,
...
@@ -1274,7 +1272,7 @@ AlterTableAddConstraint(char *relationName,
pkrel
=
heap_openr
(
fkconstraint
->
pktable_name
,
AccessExclusiveLock
);
pkrel
=
heap_openr
(
fkconstraint
->
pktable_name
,
AccessExclusiveLock
);
if
(
pkrel
->
rd_rel
->
relkind
!=
RELKIND_RELATION
)
if
(
pkrel
->
rd_rel
->
relkind
!=
RELKIND_RELATION
)
elog
(
ERROR
,
"referenced table
\"
%s
\"
not a relation"
,
elog
(
ERROR
,
"referenced table
\"
%s
\"
not a relation"
,
fkconstraint
->
pktable_name
);
fkconstraint
->
pktable_name
);
/*
/*
...
@@ -1328,7 +1326,7 @@ AlterTableAddConstraint(char *relationName,
...
@@ -1328,7 +1326,7 @@ AlterTableAddConstraint(char *relationName,
}
}
}
}
if
(
found
)
if
(
found
)
break
;
break
;
indexStruct
=
NULL
;
indexStruct
=
NULL
;
}
}
if
(
!
found
)
if
(
!
found
)
...
@@ -1591,7 +1589,7 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
...
@@ -1591,7 +1589,7 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
if
(((
Form_pg_class
)
GETSTRUCT
(
reltup
))
->
reltoastrelid
!=
InvalidOid
)
if
(((
Form_pg_class
)
GETSTRUCT
(
reltup
))
->
reltoastrelid
!=
InvalidOid
)
{
{
if
(
silent
)
if
(
silent
)
{
{
heap_close
(
rel
,
NoLock
);
heap_close
(
rel
,
NoLock
);
heap_close
(
class_rel
,
NoLock
);
heap_close
(
class_rel
,
NoLock
);
...
@@ -1601,14 +1599,14 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
...
@@ -1601,14 +1599,14 @@ AlterTableCreateToastTable(const char *relationName, bool silent)
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
already has a toast table"
,
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
already has a toast table"
,
relationName
);
relationName
);
}
}
/*
/*
* Check to see whether the table actually needs a TOAST table.
* Check to see whether the table actually needs a TOAST table.
*/
*/
if
(
!
needs_toast_table
(
rel
))
if
(
!
needs_toast_table
(
rel
))
{
{
if
(
silent
)
if
(
silent
)
{
{
heap_close
(
rel
,
NoLock
);
heap_close
(
rel
,
NoLock
);
heap_close
(
class_rel
,
NoLock
);
heap_close
(
class_rel
,
NoLock
);
...
@@ -1784,7 +1782,7 @@ LockTableCommand(LockStmt *lockstmt)
...
@@ -1784,7 +1782,7 @@ LockTableCommand(LockStmt *lockstmt)
if
(
rel
->
rd_rel
->
relkind
!=
RELKIND_RELATION
)
if
(
rel
->
rd_rel
->
relkind
!=
RELKIND_RELATION
)
elog
(
ERROR
,
"LOCK TABLE: %s is not a table"
,
lockstmt
->
relname
);
elog
(
ERROR
,
"LOCK TABLE: %s is not a table"
,
lockstmt
->
relname
);
if
(
is_view
(
rel
))
if
(
is_view
(
rel
))
elog
(
ERROR
,
"LOCK TABLE: cannot lock a view"
);
elog
(
ERROR
,
"LOCK TABLE: cannot lock a view"
);
if
(
lockstmt
->
mode
==
AccessShareLock
)
if
(
lockstmt
->
mode
==
AccessShareLock
)
...
@@ -1842,7 +1840,7 @@ is_view(Relation rel)
...
@@ -1842,7 +1840,7 @@ is_view(Relation rel)
while
(
HeapTupleIsValid
(
tuple
=
heap_getnext
(
scanDesc
,
0
)))
while
(
HeapTupleIsValid
(
tuple
=
heap_getnext
(
scanDesc
,
0
)))
{
{
if
(
tuple
->
t_data
!=
NULL
)
if
(
tuple
->
t_data
!=
NULL
)
{
{
data
=
(
Form_pg_rewrite
)
GETSTRUCT
(
tuple
);
data
=
(
Form_pg_rewrite
)
GETSTRUCT
(
tuple
);
if
(
data
->
ev_type
==
'1'
)
if
(
data
->
ev_type
==
'1'
)
...
@@ -1856,6 +1854,6 @@ is_view(Relation rel)
...
@@ -1856,6 +1854,6 @@ is_view(Relation rel)
heap_endscan
(
scanDesc
);
heap_endscan
(
scanDesc
);
heap_close
(
RewriteRelation
,
RowExclusiveLock
);
heap_close
(
RewriteRelation
,
RowExclusiveLock
);
return
retval
;
return
retval
;
}
}
src/backend/commands/comment.c
View file @
85f1950a
...
@@ -283,10 +283,8 @@ CommentRelation(int reltype, char *relname, char *comment)
...
@@ -283,10 +283,8 @@ CommentRelation(int reltype, char *relname, char *comment)
/*** First, check object security ***/
/*** First, check object security ***/
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"you are not permitted to comment on class '%s'"
,
relname
);
elog
(
ERROR
,
"you are not permitted to comment on class '%s'"
,
relname
);
#endif
/*** Now, attempt to find the oid in the cached version of pg_class ***/
/*** Now, attempt to find the oid in the cached version of pg_class ***/
...
@@ -349,10 +347,8 @@ CommentAttribute(char *relname, char *attrname, char *comment)
...
@@ -349,10 +347,8 @@ CommentAttribute(char *relname, char *attrname, char *comment)
/*** First, check object security ***/
/*** First, check object security ***/
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"you are not permitted to comment on class '%s
\'
"
,
relname
);
elog
(
ERROR
,
"you are not permitted to comment on class '%s
\'
"
,
relname
);
#endif
/*** Now, fetch the attribute oid from the system cache ***/
/*** Now, fetch the attribute oid from the system cache ***/
...
...
src/backend/commands/remove.c
View file @
85f1950a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.5
3 2000/10/07 00:58:16 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.5
4 2000/10/16 17:08:05 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -81,13 +81,11 @@ RemoveOperator(char *operatorName, /* operator name */
...
@@ -81,13 +81,11 @@ RemoveOperator(char *operatorName, /* operator name */
if
(
HeapTupleIsValid
(
tup
))
if
(
HeapTupleIsValid
(
tup
))
{
{
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
if
(
!
pg_ownercheck
(
GetUserId
(),
(
char
*
)
ObjectIdGetDatum
(
tup
->
t_data
->
t_oid
),
(
char
*
)
ObjectIdGetDatum
(
tup
->
t_data
->
t_oid
),
OPEROID
))
OPEROID
))
elog
(
ERROR
,
"RemoveOperator: operator '%s': permission denied"
,
elog
(
ERROR
,
"RemoveOperator: operator '%s': permission denied"
,
operatorName
);
operatorName
);
#endif
/*** Delete any comments associated with this operator ***/
/*** Delete any comments associated with this operator ***/
...
@@ -250,11 +248,9 @@ RemoveType(char *typeName) /* type name to be removed */
...
@@ -250,11 +248,9 @@ RemoveType(char *typeName) /* type name to be removed */
Oid
typeOid
;
Oid
typeOid
;
char
*
shadow_type
;
char
*
shadow_type
;
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
typeName
,
TYPENAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
typeName
,
TYPENAME
))
elog
(
ERROR
,
"RemoveType: type '%s': permission denied"
,
elog
(
ERROR
,
"RemoveType: type '%s': permission denied"
,
typeName
);
typeName
);
#endif
relation
=
heap_openr
(
TypeRelationName
,
RowExclusiveLock
);
relation
=
heap_openr
(
TypeRelationName
,
RowExclusiveLock
);
...
@@ -334,13 +330,11 @@ RemoveFunction(char *functionName, /* function name to be removed */
...
@@ -334,13 +330,11 @@ RemoveFunction(char *functionName, /* function name to be removed */
}
}
}
}
#ifndef NO_SECURITY
if
(
!
pg_func_ownercheck
(
GetUserId
(),
functionName
,
nargs
,
argList
))
if
(
!
pg_func_ownercheck
(
GetUserId
(),
functionName
,
nargs
,
argList
))
{
{
elog
(
ERROR
,
"RemoveFunction: function '%s': permission denied"
,
elog
(
ERROR
,
"RemoveFunction: function '%s': permission denied"
,
functionName
);
functionName
);
}
}
#endif
relation
=
heap_openr
(
ProcedureRelationName
,
RowExclusiveLock
);
relation
=
heap_openr
(
ProcedureRelationName
,
RowExclusiveLock
);
tup
=
SearchSysCacheTuple
(
PROCNAME
,
tup
=
SearchSysCacheTuple
(
PROCNAME
,
...
@@ -396,7 +390,6 @@ RemoveAggregate(char *aggName, char *aggType)
...
@@ -396,7 +390,6 @@ RemoveAggregate(char *aggName, char *aggType)
else
else
basetypeID
=
0
;
basetypeID
=
0
;
#ifndef NO_SECURITY
if
(
!
pg_aggr_ownercheck
(
GetUserId
(),
aggName
,
basetypeID
))
if
(
!
pg_aggr_ownercheck
(
GetUserId
(),
aggName
,
basetypeID
))
{
{
if
(
aggType
)
if
(
aggType
)
...
@@ -410,7 +403,6 @@ RemoveAggregate(char *aggName, char *aggType)
...
@@ -410,7 +403,6 @@ RemoveAggregate(char *aggName, char *aggType)
aggName
);
aggName
);
}
}
}
}
#endif
relation
=
heap_openr
(
AggregateRelationName
,
RowExclusiveLock
);
relation
=
heap_openr
(
AggregateRelationName
,
RowExclusiveLock
);
tup
=
SearchSysCacheTuple
(
AGGNAME
,
tup
=
SearchSysCacheTuple
(
AGGNAME
,
...
...
src/backend/commands/rename.c
View file @
85f1950a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.4
8 2000/10/16 14:52:03 vadim
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.4
9 2000/10/16 17:08:05 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -71,12 +71,10 @@ renameatt(char *relname,
...
@@ -71,12 +71,10 @@ renameatt(char *relname,
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relname
))
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relname
))
elog
(
ERROR
,
"renameatt: class
\"
%s
\"
is a system catalog"
,
elog
(
ERROR
,
"renameatt: class
\"
%s
\"
is a system catalog"
,
relname
);
relname
);
#ifndef NO_SECURITY
if
(
!
IsBootstrapProcessingMode
()
&&
if
(
!
IsBootstrapProcessingMode
()
&&
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"renameatt: you do not own class
\"
%s
\"
"
,
elog
(
ERROR
,
"renameatt: you do not own class
\"
%s
\"
"
,
relname
);
relname
);
#endif
/*
/*
* Grab an exclusive lock on the target table, which we will NOT
* Grab an exclusive lock on the target table, which we will NOT
...
...
src/backend/commands/sequence.c
View file @
85f1950a
...
@@ -201,11 +201,9 @@ nextval(PG_FUNCTION_ARGS)
...
@@ -201,11 +201,9 @@ nextval(PG_FUNCTION_ARGS)
next
,
next
,
rescnt
=
0
;
rescnt
=
0
;
#ifndef NO_SECURITY
if
(
pg_aclcheck
(
seqname
,
GetUserId
(),
ACL_WR
)
!=
ACLCHECK_OK
)
if
(
pg_aclcheck
(
seqname
,
GetUserId
(),
ACL_WR
)
!=
ACLCHECK_OK
)
elog
(
ERROR
,
"%s.nextval: you don't have permissions to set sequence %s"
,
elog
(
ERROR
,
"%s.nextval: you don't have permissions to set sequence %s"
,
seqname
,
seqname
);
seqname
,
seqname
);
#endif
/* open and AccessShareLock sequence */
/* open and AccessShareLock sequence */
elm
=
init_sequence
(
"nextval"
,
seqname
);
elm
=
init_sequence
(
"nextval"
,
seqname
);
...
@@ -298,11 +296,9 @@ currval(PG_FUNCTION_ARGS)
...
@@ -298,11 +296,9 @@ currval(PG_FUNCTION_ARGS)
SeqTable
elm
;
SeqTable
elm
;
int32
result
;
int32
result
;
#ifndef NO_SECURITY
if
(
pg_aclcheck
(
seqname
,
GetUserId
(),
ACL_RD
)
!=
ACLCHECK_OK
)
if
(
pg_aclcheck
(
seqname
,
GetUserId
(),
ACL_RD
)
!=
ACLCHECK_OK
)
elog
(
ERROR
,
"%s.currval: you don't have permissions to read sequence %s"
,
elog
(
ERROR
,
"%s.currval: you don't have permissions to read sequence %s"
,
seqname
,
seqname
);
seqname
,
seqname
);
#endif
/* open and AccessShareLock sequence */
/* open and AccessShareLock sequence */
elm
=
init_sequence
(
"currval"
,
seqname
);
elm
=
init_sequence
(
"currval"
,
seqname
);
...
@@ -318,18 +314,16 @@ currval(PG_FUNCTION_ARGS)
...
@@ -318,18 +314,16 @@ currval(PG_FUNCTION_ARGS)
PG_RETURN_INT32
(
result
);
PG_RETURN_INT32
(
result
);
}
}
static
void
static
void
do_setval
(
char
*
seqname
,
int32
next
,
bool
iscalled
)
do_setval
(
char
*
seqname
,
int32
next
,
bool
iscalled
)
{
{
SeqTable
elm
;
SeqTable
elm
;
Buffer
buf
;
Buffer
buf
;
Form_pg_sequence
seq
;
Form_pg_sequence
seq
;
#ifndef NO_SECURITY
if
(
pg_aclcheck
(
seqname
,
GetUserId
(),
ACL_WR
)
!=
ACLCHECK_OK
)
if
(
pg_aclcheck
(
seqname
,
GetUserId
(),
ACL_WR
)
!=
ACLCHECK_OK
)
elog
(
ERROR
,
"%s.setval: you don't have permissions to set sequence %s"
,
elog
(
ERROR
,
"%s.setval: you don't have permissions to set sequence %s"
,
seqname
,
seqname
);
seqname
,
seqname
);
#endif
/* open and AccessShareLock sequence */
/* open and AccessShareLock sequence */
elm
=
init_sequence
(
"setval"
,
seqname
);
elm
=
init_sequence
(
"setval"
,
seqname
);
...
...
src/backend/commands/trigger.c
View file @
85f1950a
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.7
7 2000/09/06 14:15:16 petere
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.7
8 2000/10/16 17:08:05 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -68,10 +68,8 @@ CreateTrigger(CreateTrigStmt *stmt)
...
@@ -68,10 +68,8 @@ CreateTrigger(CreateTrigStmt *stmt)
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
stmt
->
relname
))
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
stmt
->
relname
))
elog
(
ERROR
,
"CreateTrigger: can't create trigger for system relation %s"
,
stmt
->
relname
);
elog
(
ERROR
,
"CreateTrigger: can't create trigger for system relation %s"
,
stmt
->
relname
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
stmt
->
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
stmt
->
relname
,
RELNAME
))
elog
(
ERROR
,
"%s: %s"
,
stmt
->
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
elog
(
ERROR
,
"%s: %s"
,
stmt
->
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
#endif
/* ----------
/* ----------
* If trigger is a constraint, user trigger name as constraint
* If trigger is a constraint, user trigger name as constraint
...
@@ -308,10 +306,8 @@ DropTrigger(DropTrigStmt *stmt)
...
@@ -308,10 +306,8 @@ DropTrigger(DropTrigStmt *stmt)
int
found
=
0
;
int
found
=
0
;
int
tgfound
=
0
;
int
tgfound
=
0
;
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
stmt
->
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
stmt
->
relname
,
RELNAME
))
elog
(
ERROR
,
"%s: %s"
,
stmt
->
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
elog
(
ERROR
,
"%s: %s"
,
stmt
->
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
#endif
rel
=
heap_openr
(
stmt
->
relname
,
AccessExclusiveLock
);
rel
=
heap_openr
(
stmt
->
relname
,
AccessExclusiveLock
);
...
...
src/backend/commands/vacuum.c
View file @
85f1950a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.16
7 2000/10/05 19:48:22
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.16
8 2000/10/16 17:08:05
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
...
@@ -397,7 +397,6 @@ vacuum_rel(Oid relid, bool analyze, bool is_toastrel)
...
@@ -397,7 +397,6 @@ vacuum_rel(Oid relid, bool analyze, bool is_toastrel)
*/
*/
onerel
=
heap_open
(
relid
,
AccessExclusiveLock
);
onerel
=
heap_open
(
relid
,
AccessExclusiveLock
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
RelationGetRelationName
(
onerel
),
if
(
!
pg_ownercheck
(
GetUserId
(),
RelationGetRelationName
(
onerel
),
RELNAME
))
RELNAME
))
{
{
...
@@ -408,7 +407,6 @@ vacuum_rel(Oid relid, bool analyze, bool is_toastrel)
...
@@ -408,7 +407,6 @@ vacuum_rel(Oid relid, bool analyze, bool is_toastrel)
CommitTransactionCommand
();
CommitTransactionCommand
();
return
;
return
;
}
}
#endif
/*
/*
* Remember the relation'ss TOAST relation for later
* Remember the relation'ss TOAST relation for later
...
...
src/backend/executor/execMain.c
View file @
85f1950a
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.1
29 2000/10/05 19:11:26 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execMain.c,v 1.1
30 2000/10/16 17:08:06 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -619,9 +619,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
...
@@ -619,9 +619,7 @@ InitPlan(CmdType operation, Query *parseTree, Plan *plan, EState *estate)
/*
/*
* Do permissions checks.
* Do permissions checks.
*/
*/
#ifndef NO_SECURITY
ExecCheckQueryPerms
(
operation
,
parseTree
,
plan
);
ExecCheckQueryPerms
(
operation
,
parseTree
,
plan
);
#endif
/*
/*
* get information from query descriptor
* get information from query descriptor
...
...
src/backend/tcop/utility.c
View file @
85f1950a
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.9
5 2000/10/07 00:58:18 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.9
6 2000/10/16 17:08:07 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -174,11 +174,9 @@ ProcessUtility(Node *parsetree,
...
@@ -174,11 +174,9 @@ ProcessUtility(Node *parsetree,
relname
);
relname
);
/* close rel, but keep lock until end of xact */
/* close rel, but keep lock until end of xact */
heap_close
(
rel
,
NoLock
);
heap_close
(
rel
,
NoLock
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"you do not own class
\"
%s
\"
"
,
elog
(
ERROR
,
"you do not own class
\"
%s
\"
"
,
relname
);
relname
);
#endif
}
}
/* OK, terminate 'em all */
/* OK, terminate 'em all */
foreach
(
arg
,
args
)
foreach
(
arg
,
args
)
...
@@ -210,10 +208,8 @@ ProcessUtility(Node *parsetree,
...
@@ -210,10 +208,8 @@ ProcessUtility(Node *parsetree,
relname
);
relname
);
heap_close
(
rel
,
NoLock
);
heap_close
(
rel
,
NoLock
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"you do not own class
\"
%s
\"
"
,
relname
);
elog
(
ERROR
,
"you do not own class
\"
%s
\"
"
,
relname
);
#endif
TruncateRelation
(
relname
);
TruncateRelation
(
relname
);
}
}
break
;
break
;
...
@@ -270,10 +266,8 @@ ProcessUtility(Node *parsetree,
...
@@ -270,10 +266,8 @@ ProcessUtility(Node *parsetree,
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relname
))
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relname
))
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
is a system catalog"
,
elog
(
ERROR
,
"ALTER TABLE: relation
\"
%s
\"
is a system catalog"
,
relname
);
relname
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"permission denied"
);
elog
(
ERROR
,
"permission denied"
);
#endif
/* ----------------
/* ----------------
* XXX using len == 3 to tell the difference
* XXX using len == 3 to tell the difference
...
@@ -430,12 +424,10 @@ ProcessUtility(Node *parsetree,
...
@@ -430,12 +424,10 @@ ProcessUtility(Node *parsetree,
RuleStmt
*
stmt
=
(
RuleStmt
*
)
parsetree
;
RuleStmt
*
stmt
=
(
RuleStmt
*
)
parsetree
;
int
aclcheck_result
;
int
aclcheck_result
;
#ifndef NO_SECURITY
relname
=
stmt
->
object
->
relname
;
relname
=
stmt
->
object
->
relname
;
aclcheck_result
=
pg_aclcheck
(
relname
,
GetUserId
(),
ACL_RU
);
aclcheck_result
=
pg_aclcheck
(
relname
,
GetUserId
(),
ACL_RU
);
if
(
aclcheck_result
!=
ACLCHECK_OK
)
if
(
aclcheck_result
!=
ACLCHECK_OK
)
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
aclcheck_result
]);
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
aclcheck_result
]);
#endif
set_ps_display
(
commandTag
=
"CREATE"
);
set_ps_display
(
commandTag
=
"CREATE"
);
DefineQueryRewrite
(
stmt
);
DefineQueryRewrite
(
stmt
);
...
@@ -473,10 +465,8 @@ ProcessUtility(Node *parsetree,
...
@@ -473,10 +465,8 @@ ProcessUtility(Node *parsetree,
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relname
))
if
(
!
allowSystemTableMods
&&
IsSystemRelationName
(
relname
))
elog
(
ERROR
,
"class
\"
%s
\"
is a system catalog index"
,
elog
(
ERROR
,
"class
\"
%s
\"
is a system catalog index"
,
relname
);
relname
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
#endif
RemoveIndex
(
relname
);
RemoveIndex
(
relname
);
break
;
break
;
case
RULE
:
case
RULE
:
...
@@ -484,20 +474,15 @@ ProcessUtility(Node *parsetree,
...
@@ -484,20 +474,15 @@ ProcessUtility(Node *parsetree,
char
*
rulename
=
stmt
->
name
;
char
*
rulename
=
stmt
->
name
;
int
aclcheck_result
;
int
aclcheck_result
;
#ifndef NO_SECURITY
relationName
=
RewriteGetRuleEventRel
(
rulename
);
relationName
=
RewriteGetRuleEventRel
(
rulename
);
aclcheck_result
=
pg_aclcheck
(
relationName
,
GetUserId
(),
ACL_RU
);
aclcheck_result
=
pg_aclcheck
(
relationName
,
GetUserId
(),
ACL_RU
);
if
(
aclcheck_result
!=
ACLCHECK_OK
)
if
(
aclcheck_result
!=
ACLCHECK_OK
)
elog
(
ERROR
,
"%s: %s"
,
relationName
,
aclcheck_error_strings
[
aclcheck_result
]);
elog
(
ERROR
,
"%s: %s"
,
relationName
,
aclcheck_error_strings
[
aclcheck_result
]);
#endif
RemoveRewriteRule
(
rulename
);
RemoveRewriteRule
(
rulename
);
}
}
break
;
break
;
case
TYPE_P
:
case
TYPE_P
:
#ifndef NO_SECURITY
/* XXX moved to remove.c */
/* XXX moved to remove.c */
#endif
RemoveType
(
stmt
->
name
);
RemoveType
(
stmt
->
name
);
break
;
break
;
case
VIEW
:
case
VIEW
:
...
@@ -505,14 +490,11 @@ ProcessUtility(Node *parsetree,
...
@@ -505,14 +490,11 @@ ProcessUtility(Node *parsetree,
char
*
viewName
=
stmt
->
name
;
char
*
viewName
=
stmt
->
name
;
char
*
ruleName
;
char
*
ruleName
;
#ifndef NO_SECURITY
ruleName
=
MakeRetrieveViewRuleName
(
viewName
);
ruleName
=
MakeRetrieveViewRuleName
(
viewName
);
relationName
=
RewriteGetRuleEventRel
(
ruleName
);
relationName
=
RewriteGetRuleEventRel
(
ruleName
);
if
(
!
pg_ownercheck
(
GetUserId
(),
relationName
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relationName
,
RELNAME
))
elog
(
ERROR
,
"%s: %s"
,
relationName
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
elog
(
ERROR
,
"%s: %s"
,
relationName
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
pfree
(
ruleName
);
pfree
(
ruleName
);
#endif
RemoveView
(
viewName
);
RemoveView
(
viewName
);
}
}
break
;
break
;
...
@@ -810,10 +792,8 @@ ProcessUtility(Node *parsetree,
...
@@ -810,10 +792,8 @@ ProcessUtility(Node *parsetree,
elog
(
ERROR
,
"
\"
%s
\"
is a system index. call REINDEX under standalone postgres with -P -O options"
,
elog
(
ERROR
,
"
\"
%s
\"
is a system index. call REINDEX under standalone postgres with -P -O options"
,
relname
);
relname
);
}
}
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
#endif
ReindexIndex
(
relname
,
stmt
->
force
);
ReindexIndex
(
relname
,
stmt
->
force
);
break
;
break
;
case
TABLE
:
case
TABLE
:
...
@@ -828,10 +808,8 @@ ProcessUtility(Node *parsetree,
...
@@ -828,10 +808,8 @@ ProcessUtility(Node *parsetree,
relname
);
relname
);
}
}
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
elog
(
ERROR
,
"%s: %s"
,
relname
,
aclcheck_error_strings
[
ACLCHECK_NOT_OWNER
]);
#endif
ReindexTable
(
relname
,
stmt
->
force
);
ReindexTable
(
relname
,
stmt
->
force
);
break
;
break
;
case
DATABASE
:
case
DATABASE
:
...
...
src/backend/utils/adt/acl.c
View file @
85f1950a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.5
0 2000/10/07 00:58:19 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.5
1 2000/10/16 17:08:08 momjian
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -589,11 +589,9 @@ ExecuteChangeACLStmt(ChangeACLStmt *stmt)
...
@@ -589,11 +589,9 @@ ExecuteChangeACLStmt(ChangeACLStmt *stmt)
if
(
rel
&&
rel
->
rd_rel
->
relkind
==
RELKIND_INDEX
)
if
(
rel
&&
rel
->
rd_rel
->
relkind
==
RELKIND_INDEX
)
elog
(
ERROR
,
"
\"
%s
\"
is an index relation"
,
elog
(
ERROR
,
"
\"
%s
\"
is an index relation"
,
relname
);
relname
);
#ifndef NO_SECURITY
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
if
(
!
pg_ownercheck
(
GetUserId
(),
relname
,
RELNAME
))
elog
(
ERROR
,
"you do not own class
\"
%s
\"
"
,
elog
(
ERROR
,
"you do not own class
\"
%s
\"
"
,
relname
);
relname
);
#endif
ChangeAcl
(
relname
,
&
aclitem
,
modechg
);
ChangeAcl
(
relname
,
&
aclitem
,
modechg
);
/* close rel, but keep lock until end of xact */
/* close rel, but keep lock until end of xact */
heap_close
(
rel
,
NoLock
);
heap_close
(
rel
,
NoLock
);
...
...
src/include/config.h.in
View file @
85f1950a
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* or in config.h afterwards. Of course, if you edit config.h, then your
* or in config.h afterwards. Of course, if you edit config.h, then your
* changes will be overwritten the next time you run configure.
* changes will be overwritten the next time you run configure.
*
*
* $Id: config.h.in,v 1.14
2 2000/10/14 23:56:58
momjian Exp $
* $Id: config.h.in,v 1.14
3 2000/10/16 17:08:11
momjian Exp $
*/
*/
#ifndef CONFIG_H
#ifndef CONFIG_H
...
@@ -276,7 +276,6 @@
...
@@ -276,7 +276,6 @@
/* #define RTDEBUG */
/* #define RTDEBUG */
/* #define GISTDEBUG */
/* #define GISTDEBUG */
/* #define OMIT_PARTIAL_INDEX */
/* #define OMIT_PARTIAL_INDEX */
/* #define NO_SECURITY */
/* #define LOCK_DEBUG */
/* #define LOCK_DEBUG */
/*
/*
...
...
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