fix for acls with usernames that have " characters in them.

Started by Christopher Kings-Lynnealmost 23 years ago4 messagespatches
Jump to latest
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au

This patch seems to address all the problems with usernames with double
quotes in them. The only thing I'm worried about is what happens when you
run pg_dump now against old versions of postgres that don't use the new
quoting rules...

I've done lots of dumping and loading with usernames like [\,"- _ *<> '\,\
\" \' = \" -%,*&^% and I haven't managed to break it yet. However, whomever
commits this patch should check my logic carefully, and especially check
that I have allowed properly for malloc() space for the extra characters and
stuff.

Cheers,

Chris

Attachments:

acl.txttext/plain; name=acl.txtDownload+32-23
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: fix for acls with usernames that have " characters in them.

"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:

This patch seems to address all the problems with usernames with double
quotes in them.

Applied, thanks.

The only thing I'm worried about is what happens when you
run pg_dump now against old versions of postgres that don't use the new
quoting rules...

AFAICS the patch would only change behavior if a username in an ACL list
contains adjacent double quotes, which seems pretty unlikely considering
the other problems a DBA would find with double quotes in user names in
older versions. So I'm not too worried.

regards, tom lane

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Tom Lane (#2)
Re: fix for acls with usernames that have " characters in

AFAICS the patch would only change behavior if a username in an ACL list
contains adjacent double quotes, which seems pretty unlikely considering
the other problems a DBA would find with double quotes in user names in
older versions. So I'm not too worried.

Is there a place for regression tests for utils/adt? Is there some docs
somewhere that need to be updated?

Chris

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#3)
Re: fix for acls with usernames that have " characters in them.

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:

Is there a place for regression tests for utils/adt? Is there some docs
somewhere that need to be updated?

We don't really have any regression tests for pg_dump, which is not a
good situation. But I wouldn't worry about this patch in particular.

As for docs, I think now it's working the way one would expect ...
if you can find anyplace that describes the old behavior, it would
need to be changed, but I don't recall that there is.

regards, tom lane