[csw-devel] SF.net SVN: gar:[12126] csw/mgar/gar/v2/lib/sh/db_privileges.sh

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Dec 29 21:10:15 CET 2010


Revision: 12126
          http://gar.svn.sourceforge.net/gar/?rev=12126&view=rev
Author:   wahwah
Date:     2010-12-29 20:10:15 +0000 (Wed, 29 Dec 2010)

Log Message:
-----------
Database permissions script update

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/sh/db_privileges.sh

Modified: csw/mgar/gar/v2/lib/sh/db_privileges.sh
===================================================================
--- csw/mgar/gar/v2/lib/sh/db_privileges.sh	2010-12-29 20:09:44 UTC (rev 12125)
+++ csw/mgar/gar/v2/lib/sh/db_privileges.sh	2010-12-29 20:10:15 UTC (rev 12126)
@@ -17,8 +17,9 @@
   exit 1
 fi
 
-# Example site_configh.sh:
+# Example site_config.sh:
 #
+# DATABASE="..."
 # DEFAULT_HOST="192.168.0.%"
 # DBA_USER=dba_user
 # RELMGR_USER=relmgr_user
@@ -57,7 +58,7 @@
 }
 
 function print_grants {
-  local dbname=$1
+  local dbname="${DATABASE}"
   local admin_user="${DBA_USER}"
   local relmgr_user="${RELMGR_USER}"
   local maintainer_user="${MAINTAINER_USER}"
@@ -65,11 +66,13 @@
   echo "GRANT ALL PRIVILEGES ON ${dbname}.* TO '${admin_user}'@'localhost';"
   echo "GRANT SELECT ON ${dbname}.* TO '${relmgr_user}'@'${host}';"
   echo "GRANT SELECT ON ${dbname}.* TO '${maintainer_user}'@'${host}';"
+  # Release manager's tables
   for tbl in "${TABLES_REL_MGR[@]}" \
              "${TABLES_REGULAR[@]}"
   do
     print_table_grant "${tbl}" "${dbname}" "${relmgr_user}" "${host}"
   done
+  # Package maintainer's tables
   for tbl in "${TABLES_REGULAR[@]}"
   do
     print_table_grant "${tbl}" "${dbname}" "${maintainer_user}" "${host}"
@@ -88,7 +91,7 @@
 }
 
 function main {
-  print_grants "$1"
+  print_grants
 }
 
 main "$@"


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list