1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Fix for ACL length problem on different platforms.

This commit is contained in:
Bruce Momjian
1999-07-09 03:28:53 +00:00
parent 46db8ac712
commit 296efd8065
4 changed files with 33 additions and 17 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.36 1999/05/25 16:11:49 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.37 1999/07/09 03:28:51 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -20,6 +20,7 @@
#include "utils/syscache.h"
#include "catalog/catalog.h"
#include "catalog/pg_shadow.h"
#include "catalog/pg_type.h"
#include "miscadmin.h"
static char *getid(char *s, char *n);
@ -682,6 +683,9 @@ makeAclStmt(char *privileges, List *rel_list, char *grantee,
ChangeACLStmt *n = makeNode(ChangeACLStmt);
char str[MAX_PARSE_BUFFER];
/* see comment in pg_type.h */
Assert(ACLITEMSIZE == sizeof(AclItem));
n->aclitem = (AclItem *) palloc(sizeof(AclItem));
/* the grantee string is "G <group_name>", "U <user_name>", or "ALL" */

View File

@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_type.h,v 1.62 1999/05/25 16:13:48 momjian Exp $
* $Id: pg_type.h,v 1.63 1999/07/09 03:28:52 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@ -341,7 +341,12 @@ DATA(insert OID = 1024 ( _reltime PGUID -1 -1 f b t \054 0 703 array_in array
DATA(insert OID = 1025 ( _tinterval PGUID -1 -1 f b t \054 0 704 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1026 ( _filename PGUID -1 -1 f b t \054 0 605 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1027 ( _polygon PGUID -1 -1 f b t \054 0 604 array_in array_out array_in array_out d _null_ ));
/* Note: the size of an aclitem needs to match sizeof(AclItem) in acl.h */
/*
* Note: the size of aclitem needs to match sizeof(AclItem) in acl.h.
* Thanks to some padding, this will be 8 on all platforms.
* We also have an Assert to make sure.
*/
#define ACLITEMSIZE 8
DATA(insert OID = 1033 ( aclitem PGUID 8 -1 f b t \054 0 0 aclitemin aclitemout aclitemin aclitemout i _null_ ));
DESCR("access control list");
DATA(insert OID = 1034 ( _aclitem PGUID -1 -1 f b t \054 0 1033 array_in array_out array_in array_out i _null_ ));

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: acl.h,v 1.19 1999/02/13 23:22:14 momjian Exp $
* $Id: acl.h,v 1.20 1999/07/09 03:28:53 momjian Exp $
*
* NOTES
* For backward-compatability purposes we have to allow there
@ -74,6 +74,11 @@ typedef struct AclItem
AclId ai_id;
AclIdType ai_idtype;
AclMode ai_mode;
/*
* This is actually type 'aclitem', and we want a fixed size for
* for all platforms, so we pad this with dummies.
*/
char dummy1, dummy2;
} AclItem;
/* Note: if the size of AclItem changes,