Subject: ACL patch (was: 4.2 regression test)

From: [email-masked] (Tom R.Hageman)
Date: Fri, 2 Sep 94 17:44:01 +0200

[email-masked] (Paul M. Aoki) writes:
> [email-masked] (Tom R.Hageman) writes:
> > 	replace pg_class (relacl="{}")
> > 		where pg_class.relname !~ "pg_*"::text
> > As far as I understand it, this revokes all access privileges for all
> > user-created classes.
> 

> actually, the effect should be the same as setting it to NULL.  look 

> at src/backend/tcop/aclchk.c ..

Here is a patch that seems to solve my acl problem:
(turns out to be due to an out-of-bounds array reference -- empty arrays
 don't have dimensions.  Oh well...)

===================================================================
RCS file: /usr/local/sources/CVS/postgres/src/backend/tmp/acl.h,v
retrieving revision 1.1.1.3
diff -c -2 -r1.1.1.3 acl.h
*** 1.1.1.3	1994/08/04 11:46:33
--- acl.h	1994/09/01 19:10:06
***************
*** 76,81 ****
   * always have a lower-bound of 0, this is the same as the number of
   * elements in the array.
!  */
! #define	ARR_DIM0(a) (((unsigned *) (((char *) a) + sizeof(ArrayType)))[0])

  /*
--- 76,82 ----
   * always have a lower-bound of 0, this is the same as the number of
   * elements in the array.
!  * XXX [TRH  1-Sep-94] handle empty arrays correctly. 

   */
! #define	ARR_DIM0(a) ((a)->ndim > 0 ? ((unsigned *) (((char *) a) +  
sizeof(ArrayType)))[0] : 0)

  /*
--
__/__/__/__/  Tom Hageman   <[email-masked]>   [NeXTMail accepted]
  __/ __/_/
 __/__/__/          "...to baldly go where no one has gone before."
__/  _/_/                                             -- star trek TNG

==============================================================================
   To add/remove yourself to/from the POSTGRES mailing list: send mail with 
   the subject line ADD or DEL to "[email-masked]"

   If this fails, send mail to "[email-masked]" and
   a human will deal with it.  DO NOT post to the "postgres" mailing list.
==============================================================================