[Rt-commit] rt branch, 3.8-trunk, updated. rt-3.8.6-93-g68425c3

Kevin Falcone falcone at bestpractical.com
Thu Nov 19 12:11:13 EST 2009


The branch, 3.8-trunk has been updated
       via  68425c35ff842f8ef0d31d5db8480f42012747c8 (commit)
      from  06bb6f547b1c7c804b6e8f09482ad6af6e402887 (commit)

Summary of changes:
 etc/acl.Pg |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 68425c35ff842f8ef0d31d5db8480f42012747c8
Author: Dominic Hargreaves <dom at earth.li>
Date:   Thu Nov 19 11:36:45 2009 -0500

    Fix Postgres ACL script to work with usernames that need quoting
    (inspired by patch to RTFM)

diff --git a/etc/acl.Pg b/etc/acl.Pg
index a139b50..8a0d4f2 100755
--- a/etc/acl.Pg
+++ b/etc/acl.Pg
@@ -54,7 +54,7 @@ sub acl {
     # if there's already an rt_user, use it.
     my @row = $dbh->selectrow_array( "SELECT usename FROM pg_user WHERE usename = '$db_user'" );
     unless ( $row[0] ) {
-	 push @acls, "CREATE USER $db_user WITH PASSWORD '$db_pass' NOCREATEDB NOCREATEUSER;";
+	 push @acls, "CREATE USER \"$db_user\" WITH PASSWORD '$db_pass' NOCREATEDB NOCREATEUSER;";
     }
 
     my $sequence_right
@@ -64,10 +64,10 @@ sub acl {
     foreach my $table (@tables) {
         if ( $table =~ /^[a-z]/ && $table ne 'sessions' ) {
 # table like objectcustomfields_id_s
-            push @acls, "GRANT $sequence_right ON $table TO $db_user;"
+            push @acls, "GRANT $sequence_right ON $table TO \"$db_user\";"
         }
         else {
-            push @acls, "GRANT SELECT, INSERT, UPDATE, DELETE ON $table TO $db_user;"
+            push @acls, "GRANT SELECT, INSERT, UPDATE, DELETE ON $table TO \"$db_user\";"
         }
     }
     return (@acls);

-----------------------------------------------------------------------


More information about the Rt-commit mailing list