Обсуждение: fix for acls with usernames that have " characters in them.

Поиск
Список
Период
Сортировка

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

От
"Christopher Kings-Lynne"
Дата:
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

Вложения

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

От
Tom Lane
Дата:
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

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

От
Tom Lane
Дата:
"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