getting confused parsing ACLITEMS... - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject getting confused parsing ACLITEMS...
Date
Msg-id 145b01c35d87$67184dc0$2800a8c0@mars
Whole thread Raw
List pgsql-hackers
This is the situation, I create a user called "

test=# create user """";
CREATE USER
test=# drop user """";
DROP USER
test=# create user """";
CREATE USER
test=# create table temp(a int4);
CREATE TABLE
test=# grant select on temp to """";
GRANT
test=# \dp temp               Access privileges for database "test"Schema | Table |                  Access privileges
--------+-------+-----------------------------------------------------public | temp  |
{chriskl=a*r*w*d*R*x*t*/chriskl,"\"\"\"=r/chriskl"}
(1 row)

OK, so the second aclitem is:
"\"\"\"=r/chriskl"

So how on earth does that quoting work????

If I remove the first and last quote (assuming the whole thing is quoted),
unescape it, then I get this:

"""=r/chriskl

Which I cannot parse, as """ doens't mean anything!  I think that the second
aclitem should appear like this;
"\"\\\"\"=r/chriskl"

Which will (after removing string quotes and unescaping), reduce to this:

"\""=r/chriskl

I notice that it doesn't confuse postgres itself though:

test=# revoke select on temp from """";
REVOKE
test=# \dp temp      Access privileges for database "test"Schema | Table |        Access privileges
--------+-------+----------------------------------public | temp  | {chriskl=a*r*w*d*R*x*t*/chriskl}
(1 row)

So is there a bug here?

Chris



pgsql-hackers by date:

Previous
From: Weiping He
Date:
Subject: Re: [GENERAL] compile error of 7.4 beta1 on AIX 4.3.3
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: getting confused parsing ACLITEMS...