Re: getting confused parsing ACLITEMS...

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: getting confused parsing ACLITEMS...
Date: 2003-08-14 21:56:06
Message-ID: 200308142156.h7ELu6Q12930@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I believe Tom just applied this. Thanks.

---------------------------------------------------------------------------

Christopher Kings-Lynne wrote:
> The situation seems to be a bug that this patch would address. It seems to
> me that when a username is considered unsafe due to containing double
> quotes, the double quotes should be escaped (and the backslashes)!
>
> Does this look alright?
>
> Chris
>
> Index: src/backend/utils/adt/acl.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/adt/acl.c,v
> retrieving revision 1.94
> diff -c -r1.94 acl.c
> *** src/backend/utils/adt/acl.c 4 Aug 2003 02:40:04 -0000 1.94
> --- src/backend/utils/adt/acl.c 8 Aug 2003 09:03:19 -0000
> ***************
> *** 124,131 ****
> }
> if (!safe)
> *p++ = '"';
> ! for (src = s; *src; src++)
> *p++ = *src;
> if (!safe)
> *p++ = '"';
> *p = '\0';
> --- 124,134 ----
> }
> if (!safe)
> *p++ = '"';
> ! for (src = s; *src; src++) {
> ! if (!safe && (*src == '"' || *src == '\\'))
> ! *p++ = '\\';
> *p++ = *src;
> + }
> if (!safe)
> *p++ = '"';
> *p = '\0';
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2003-08-14 22:13:05 Re: [GENERAL] 7.4Beta
Previous Message Larry Rosenman 2003-08-14 21:26:45 Re: UPDATED UnixWare Threads Patch.