7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.6 1998/02/24 03:31:45 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.7 1998/02/25 13:05:57 scrappy Exp $
11
11
*
12
12
* NOTES
13
13
* See acl.h.
32
32
#include "catalog/pg_aggregate.h"
33
33
#include "catalog/pg_proc.h"
34
34
#include "catalog/pg_type.h"
35
- #include "catalog/pg_user .h"
35
+ #include "catalog/pg_shadow .h"
36
36
#include "parser/parse_agg.h"
37
37
#include "parser/parse_func.h"
38
38
#include "utils/syscache.h"
@@ -396,14 +396,14 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
396
396
if (!HeapTupleIsValid (htp ))
397
397
elog (ERROR , "pg_aclcheck: user \"%s\" not found" ,
398
398
usename );
399
- id = (AclId ) ((Form_pg_user ) GETSTRUCT (htp ))-> usesysid ;
399
+ id = (AclId ) ((Form_pg_shadow ) GETSTRUCT (htp ))-> usesysid ;
400
400
401
401
/*
402
402
* for the 'pg_database' relation, check the usecreatedb field before
403
403
* checking normal permissions
404
404
*/
405
405
if (strcmp (DatabaseRelationName , relname ) == 0 &&
406
- (((Form_pg_user ) GETSTRUCT (htp ))-> usecreatedb ))
406
+ (((Form_pg_shadow ) GETSTRUCT (htp ))-> usecreatedb ))
407
407
{
408
408
409
409
/*
@@ -417,12 +417,12 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
417
417
418
418
/*
419
419
* Deny anyone permission to update a system catalog unless
420
- * pg_user .usecatupd is set. (This is to let superusers protect
420
+ * pg_shadow .usecatupd is set. (This is to let superusers protect
421
421
* themselves from themselves.)
422
422
*/
423
423
if (((mode & ACL_WR ) || (mode & ACL_AP )) &&
424
424
IsSystemRelationName (relname ) &&
425
- !((Form_pg_user ) GETSTRUCT (htp ))-> usecatupd )
425
+ !((Form_pg_shadow ) GETSTRUCT (htp ))-> usecatupd )
426
426
{
427
427
elog (DEBUG , "pg_aclcheck: catalog update to \"%s\": permission denied" ,
428
428
relname );
@@ -432,7 +432,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
432
432
/*
433
433
* Otherwise, superusers bypass all permission-checking.
434
434
*/
435
- if (((Form_pg_user ) GETSTRUCT (htp ))-> usesuper )
435
+ if (((Form_pg_shadow ) GETSTRUCT (htp ))-> usesuper )
436
436
{
437
437
#ifdef ACLDEBUG_TRACE
438
438
elog (DEBUG , "pg_aclcheck: \"%s\" is superuser" ,
@@ -531,12 +531,12 @@ pg_ownercheck(char *usename,
531
531
if (!HeapTupleIsValid (htp ))
532
532
elog (ERROR , "pg_ownercheck: user \"%s\" not found" ,
533
533
usename );
534
- user_id = (AclId ) ((Form_pg_user ) GETSTRUCT (htp ))-> usesysid ;
534
+ user_id = (AclId ) ((Form_pg_shadow ) GETSTRUCT (htp ))-> usesysid ;
535
535
536
536
/*
537
537
* Superusers bypass all permission-checking.
538
538
*/
539
- if (((Form_pg_user ) GETSTRUCT (htp ))-> usesuper )
539
+ if (((Form_pg_shadow ) GETSTRUCT (htp ))-> usesuper )
540
540
{
541
541
#ifdef ACLDEBUG_TRACE
542
542
elog (DEBUG , "pg_ownercheck: user \"%s\" is superuser" ,
@@ -597,12 +597,12 @@ pg_func_ownercheck(char *usename,
597
597
if (!HeapTupleIsValid (htp ))
598
598
elog (ERROR , "pg_func_ownercheck: user \"%s\" not found" ,
599
599
usename );
600
- user_id = (AclId ) ((Form_pg_user ) GETSTRUCT (htp ))-> usesysid ;
600
+ user_id = (AclId ) ((Form_pg_shadow ) GETSTRUCT (htp ))-> usesysid ;
601
601
602
602
/*
603
603
* Superusers bypass all permission-checking.
604
604
*/
605
- if (((Form_pg_user ) GETSTRUCT (htp ))-> usesuper )
605
+ if (((Form_pg_shadow ) GETSTRUCT (htp ))-> usesuper )
606
606
{
607
607
#ifdef ACLDEBUG_TRACE
608
608
elog (DEBUG , "pg_ownercheck: user \"%s\" is superuser" ,
@@ -638,12 +638,12 @@ pg_aggr_ownercheck(char *usename,
638
638
if (!HeapTupleIsValid (htp ))
639
639
elog (ERROR , "pg_aggr_ownercheck: user \"%s\" not found" ,
640
640
usename );
641
- user_id = (AclId ) ((Form_pg_user ) GETSTRUCT (htp ))-> usesysid ;
641
+ user_id = (AclId ) ((Form_pg_shadow ) GETSTRUCT (htp ))-> usesysid ;
642
642
643
643
/*
644
644
* Superusers bypass all permission-checking.
645
645
*/
646
- if (((Form_pg_user ) GETSTRUCT (htp ))-> usesuper )
646
+ if (((Form_pg_shadow ) GETSTRUCT (htp ))-> usesuper )
647
647
{
648
648
#ifdef ACLDEBUG_TRACE
649
649
elog (DEBUG , "pg_aggr_ownercheck: user \"%s\" is superuser" ,
0 commit comments