[Bucardo-general] Error when validating tables using ident authentication

Armin Resch reschab at gmail.com
Thu Jun 14 01:06:39 UTC 2012


Hi,

our source database is in the same cluster as the bucardo database.

Hence, I received an error when issuing

bucardo_ctl add table <blah> db=<yadda>

because the validate_goat function executes as whoever's running the
database, thus potentially conflicting with the user as specified in the
connection string as returned by bucardo.db_getconn.

What do you think of the following patch?

--- bucardo.schema.org 2012-06-11 16:35:23.000000000 -0500
+++ bucardo.schema     2012-06-13 19:19:59.000000000 -0500
@@ -850,6 +850,8 @@
 $row = $rv->{rows}[0]{apple};
 ($db{dsn},$db{user},$db{pass},$db{ssp}) = split /\n/ => $row;

+$db{user} = '' unless $db{dsn} =~ /host=/;
+
 elog(DEBUG, "Connecting in validate_goat as $db{dsn} user=$db{user} pid=$$
for table $schema.$table");

 $dbh = DBI->connect($db{dsn}, $db{user}, $db{pass},

It essentially removes the username in those cases is which the host name
is missing in the connection string which in turn implies utilization of
UNIX sockets. Thoughts?

Cheers,
-ar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.endcrypt.com/pipermail/bucardo-general/attachments/20120613/3cb17a9c/attachment.html>


More information about the Bucardo-general mailing list