Allow dashes in usernames for install magic
authorGreg Sabino Mullane <greg@endpoint.com>
Wed, 18 Jun 2014 13:28:58 +0000 (09:28 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Wed, 18 Jun 2014 13:28:58 +0000 (09:28 -0400)
bucardo

diff --git a/bucardo b/bucardo
index c788c9fb54612b99dc073784666ca9f9300c38ff..2685f6eaf5ce2cf193d0b3f06ca3621740aa9d6c 100755 (executable)
--- a/bucardo
+++ b/bucardo
@@ -8399,7 +8399,7 @@ sub install {
     ## Check for some common errors
     if ($res =~ /role "(.+)" does not exist/) {
         my $baduser = $1;
-        if ($baduser eq 'postgres' and exists $ENV{USER} and $ENV{USER} =~ /^\w+$/) {
+        if ($baduser eq 'postgres' and exists $ENV{USER} and $ENV{USER} =~ /^[\w-]+$/) {
             $user = $ENV{USER};
             if (!$QUIET and !$bcargs->{batch}) {
                 print "Failed to connect as user 'postgres', will try '$user'\n";