aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/acl.c
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1998-02-24 03:31:50 +0000
committerMarc G. Fournier <scrappy@hub.org>1998-02-24 03:31:50 +0000
commit5cf1964fc6ba29db4119157410217ca98c5cc6ba (patch)
tree095201822ce71c59cdbfb3bb0621ba964e0a96f6 /src/backend/utils/adt/acl.c
parent751ebd20a04ea38ae3412b5c2a1fec5efd36ef8d (diff)
downloadpostgresql-5cf1964fc6ba29db4119157410217ca98c5cc6ba.tar.gz
postgresql-5cf1964fc6ba29db4119157410217ca98c5cc6ba.zip
From: Jan Wieck <jwieck@debis.com>
So if the relname is given to acldefault() in utils/adt/acl.c, it can do a IsSystemRelationName() on it and return ACL_RD instead of ACL_WORLD_DEFAULT.
Diffstat (limited to 'src/backend/utils/adt/acl.c')
-rw-r--r--src/backend/utils/adt/acl.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/backend/utils/adt/acl.c b/src/backend/utils/adt/acl.c
index 5ca72ed0174..afc4075de04 100644
--- a/src/backend/utils/adt/acl.c
+++ b/src/backend/utils/adt/acl.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.24 1998/02/11 19:12:03 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.25 1998/02/24 03:31:47 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -18,6 +18,7 @@
#include <utils/memutils.h>
#include "utils/acl.h"
#include "utils/syscache.h"
+#include "catalog/catalog.h"
#include "catalog/pg_user.h"
#include "miscadmin.h"
@@ -342,7 +343,7 @@ aclitemgt(AclItem *a1, AclItem *a2)
}
Acl *
-aclownerdefault(AclId ownerid)
+aclownerdefault(char *relname, AclId ownerid)
{
Acl *acl;
AclItem *aip;
@@ -351,7 +352,7 @@ aclownerdefault(AclId ownerid)
aip = ACL_DAT(acl);
aip[0].ai_idtype = ACL_IDTYPE_WORLD;
aip[0].ai_id = ACL_ID_WORLD;
- aip[0].ai_mode = ACL_WORLD_DEFAULT;
+ aip[0].ai_mode = IsSystemRelationName(relname) ? ACL_RD : ACL_WORLD_DEFAULT;
aip[1].ai_idtype = ACL_IDTYPE_UID;
aip[1].ai_id = ownerid;
aip[1].ai_mode = ACL_OWNER_DEFAULT;
@@ -359,7 +360,7 @@ aclownerdefault(AclId ownerid)
}
Acl *
-acldefault(void)
+acldefault(char *relname)
{
Acl *acl;
AclItem *aip;
@@ -368,7 +369,7 @@ acldefault(void)
aip = ACL_DAT(acl);
aip[0].ai_idtype = ACL_IDTYPE_WORLD;
aip[0].ai_id = ACL_ID_WORLD;
- aip[0].ai_mode = ACL_WORLD_DEFAULT;
+ aip[0].ai_mode = IsSystemRelationName(relname) ? ACL_RD : ACL_WORLD_DEFAULT;
return (acl);
}