Thread: Fwd: Bug#224716: postgresql-client: createuser fails

Fwd: Bug#224716: postgresql-client: createuser fails

From
Martin Pitt
Date:
Hi PostgreSQL developers!

I'm comaintainer of the Debian package of postgresql (CC to its
maintainer) and just fixed the bug report below (see
http://bugs.debian.org/224716 for the whole thread):

----- Forwarded message from simon raven <simon@nuit.ca> -----

Subject: Bug#224716: postgresql-client: createuser fails
Reply-To: simon raven <simon@nuit.ca>, 224716@bugs.debian.org
From: simon raven <simon@nuit.ca>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Date: Sun, 21 Dec 2003 13:17:01 +0000
X-Spam-Status: No, hits=-4.9 required=3.0 tests=BAYES_00 autolearn=ham
    version=2.61

Package: postgresql-client
Version: 7.3.4-9
Severity: important
Tags: sid


(#:~)- createuser -E -U postgres -W nagios
Shall the new user be allowed to create databases? (y/n) n
Shall the new user be allowed to create more new users? (y/n) n
Password:
ERROR:  parser: parse error at or near "NOCREATEDB" at character 61
createuser: creation of user "nagios" failed

it fails if i include the -E (encrypt password) option, otherwise it
works as expected, if i do not include the -E option.

----- End forwarded message -----

The problem is that createuser.c builds a wrong SQL string if just the
'-E' option without '-P' is given. This results in an SQL string like

    CREATE USER ... ENCRYPTED NOCREATEDB

although it should read '... ENCRYPTED PASSWORD 'blabla' NOCREATEDB'

The attached patch fixes this by just ignoring -E when -P is not
given. The patch should work against your current CVS; it is already
included in the Debian package CVS.

Thanks and have a nice day!

Martin
--
Martin Pitt                 Debian GNU/Linux Developer
martin@piware.de                      mpitt@debian.org
http://www.piware.de             http://www.debian.org

Attachment

Re: Fwd: Bug#224716: postgresql-client: createuser fails

From
Tom Lane
Date:
Martin Pitt <martin@piware.de> writes:
> I'm comaintainer of the Debian package of postgresql (CC to its
> maintainer) and just fixed the bug report below (see
> http://bugs.debian.org/224716 for the whole thread):

Patch applied --- many thanks!

            regards, tom lane