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

From: Martin Pitt <martin(at)piware(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Cc: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Subject: Fwd: Bug#224716: postgresql-client: createuser fails
Date: 2004-01-05 23:20:55
Message-ID: 20040105232054.GA13048@donald.balu5
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)nuit(dot)ca> -----

Subject: Bug#224716: postgresql-client: createuser fails
Reply-To: simon raven <simon(at)nuit(dot)ca>, 224716(at)bugs(dot)debian(dot)org
From: simon raven <simon(at)nuit(dot)ca>
To: Debian Bug Tracking System <submit(at)bugs(dot)debian(dot)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(at)piware(dot)de mpitt(at)debian(dot)org
http://www.piware.de http://www.debian.org

Attachment Content-Type Size
08createuser text/plain 813 bytes

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PostgreSQL Bugs List 2004-01-06 11:08:29 BUG #1042: runtime error
Previous Message Steven Vajdic 2004-01-05 22:47:58 UNSUBSCRIBE