Hi,

While sending out some very late holiday greetings, I encountered a problem with connecting to my postgresql address book database from libreoffice. After a bit more debugging than I would have liked, I found the problem. I'm posting this on the slim chance that it might help someone else, and also to force me to document what I did.

I've had an address book stored in a postgresql database for many years. In 2018 I updated my machine from CentOS 6 to 7, but I didn't try to use my database from libreoffice until now. When I tried to use it, I got this error:
'Ident authentication failed for user "galens"'.

Here are the relevant lines in /var/lib/pgsql/data/pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident

And my libreoffice database connection properties

Datasource URL:         jdbc:postgresql:abook
User name:              galens
JDBC driver class:      org.postgresql.Driver

Since I was getting ident errors, the connection was coming in over localhost. I found that there was no ident server running, so I installed authd. Unfortunately I still got ident errors. This was being caused by authd using encryption. Because this is a local-only connection, I disabled encryption by editing /usr/lib/systemd/system/[email protected] and removing the '-E' in the Service section.

[Service]
User=ident
#ExecStart=/usr/sbin/in.authd -t60 --xerror --os -E
ExecStart=/usr/sbin/in.authd -t60 --xerror --os
StandardInput=socket

After making this change, I was finally able to access my database, but this seemed like a lot more work than should be necessary. If I could connect over a unix socket rather than localhost, the ident server would not be necessary. After some more experimentation, I found that if I used the postgresql connector rather than JDBC, and if I omitted the 'localhost:5432' (host:port) portion of the datasource URL, the connection would be made using a unix socket. This allowed me to disable the authd/ident server.

Datasource URL:         postgresql:///abook
User name:              galens


I'm not sure why I initially chose to use JDBC. I suspect this was something I did a long time ago and never needed to revisit until now. Anyway, what are now our MLK Day greetings are in the mail.


galen
--
Galen Seitz
[email protected]
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to