@ -141,24 +141,6 @@ static void recordExtensionInitPrivWorker(Oid objoid, Oid classoid, int objsubid
Acl * new_acl ) ;
Acl * new_acl ) ;
# ifdef ACLDEBUG
static void
dumpacl ( Acl * acl )
{
int i ;
AclItem * aip ;
elog ( DEBUG2 , " acl size = %d, # acls = %d " ,
ACL_SIZE ( acl ) , ACL_NUM ( acl ) ) ;
aip = ACL_DAT ( acl ) ;
for ( i = 0 ; i < ACL_NUM ( acl ) ; + + i )
elog ( DEBUG2 , " acl[%d]: %s " , i ,
DatumGetCString ( DirectFunctionCall1 ( aclitemout ,
PointerGetDatum ( aip + i ) ) ) ) ;
}
# endif /* ACLDEBUG */
/*
/*
* If is_grant is true , adds the given privileges for the list of
* If is_grant is true , adds the given privileges for the list of
* grantees to the existing old_acl . If is_grant is false , the
* grantees to the existing old_acl . If is_grant is false , the
@ -178,9 +160,6 @@ merge_acl_with_grant(Acl *old_acl, bool is_grant,
modechg = is_grant ? ACL_MODECHG_ADD : ACL_MODECHG_DEL ;
modechg = is_grant ? ACL_MODECHG_ADD : ACL_MODECHG_DEL ;
# ifdef ACLDEBUG
dumpacl ( old_acl ) ;
# endif
new_acl = old_acl ;
new_acl = old_acl ;
foreach ( j , grantees )
foreach ( j , grantees )
@ -219,10 +198,6 @@ merge_acl_with_grant(Acl *old_acl, bool is_grant,
/* avoid memory leak when there are many grantees */
/* avoid memory leak when there are many grantees */
pfree ( new_acl ) ;
pfree ( new_acl ) ;
new_acl = newer_acl ;
new_acl = newer_acl ;
# ifdef ACLDEBUG
dumpacl ( new_acl ) ;
# endif
}
}
return new_acl ;
return new_acl ;
@ -3861,21 +3836,13 @@ pg_class_aclmask(Oid table_oid, Oid roleid,
IsSystemClass ( table_oid , classForm ) & &
IsSystemClass ( table_oid , classForm ) & &
classForm - > relkind ! = RELKIND_VIEW & &
classForm - > relkind ! = RELKIND_VIEW & &
! superuser_arg ( roleid ) )
! superuser_arg ( roleid ) )
{
# ifdef ACLDEBUG
elog ( DEBUG2 , " permission denied for system catalog update " ) ;
# endif
mask & = ~ ( ACL_INSERT | ACL_UPDATE | ACL_DELETE | ACL_TRUNCATE | ACL_USAGE ) ;
mask & = ~ ( ACL_INSERT | ACL_UPDATE | ACL_DELETE | ACL_TRUNCATE | ACL_USAGE ) ;
}
/*
/*
* Otherwise , superusers bypass all permission - checking .
* Otherwise , superusers bypass all permission - checking .
*/
*/
if ( superuser_arg ( roleid ) )
if ( superuser_arg ( roleid ) )
{
{
# ifdef ACLDEBUG
elog ( DEBUG2 , " OID %u is superuser, home free " , roleid ) ;
# endif
ReleaseSysCache ( tuple ) ;
ReleaseSysCache ( tuple ) ;
return mask ;
return mask ;
}
}