[Tickets #5839] Horde_history does not work where horde DB (Postgres) user does not have CREATE permissions.

bugs at bugs.horde.org bugs at bugs.horde.org
Sun Oct 28 14:27:56 UTC 2007


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/?id=5839
-----------------------------------------------------------------------
 Ticket             | 5839
 Created By         | szymon at juraszczyk.com
 Summary            | Horde_history does not work where horde DB (Postgres) user does not have
                    | CREATE permissions.
 Queue              | Horde Base
 Version            | 3.1.5
 Type               | Bug
 State              | Unconfirmed
 Priority           | 1. Low
 Owners             | 
-----------------------------------------------------------------------


szymon at juraszczyk.com (2007-10-28 07:27) wrote:

I've recently upgraded old Horde/IMP/Turba installation (from ancient
before-H3 versions) and I've noticed a mysterious error in horde log file
which appeared, when users were replying to messages. The errors looked
like this:

Oct 26 17:44:59 HORDE [error] [imp] Could not log message details to
Horde_History. Error returned:  DB Error: invalid n
umber [on line 67 of "/home/httpd/horde/html/poczta/imp/lib/Maillog.php"]

After extensive debugging I found that the values that
Horde_History::log() generates history_id value by calling
$this->_db->nextId('horde_histories'), which implicitly creates sequence
horde_histories_seq, provided that the horde DB user has CREATE permission.
Indeed by default in PostgreSQL everyone can create tables in any databases
it can connect to. Not everyone likes that though and if CREATE permission
is revoked from PUBLIC, PEAR is not able to create this sequence, which in
turn generates this rather irrelevant error message.

Please note that create.pgsql.sql does not indicate that horde user should
have CREATE permission to the database. I don't think it really has to have
one. And if someone tightens horde database security as I did (in my case
it actually uses a schema in another database) it may be difficult to sort
out the problem I experienced (not that I am so bright to have done that
;-) ). Maybe I was the first one to experience this problem, at least after
a quick google search I was none the wiser.

My suggestion is that create.pgsql.sql could also create
horde_histories_seq sequence and any other sequences it possibly needs. It
could look like this:

CREATE SEQUENCE horde_histories_seq;
GRANT SELECT, UPDATE ON horde_histories_seq TO horde;




More information about the bugs mailing list