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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Jan 31 10:08:08 CET 2011


Revision: 13148
          http://gar.svn.sourceforge.net/gar/?rev=13148&view=rev
Author:   wahwah
Date:     2011-01-31 09:08:08 +0000 (Mon, 31 Jan 2011)

Log Message:
-----------
checkpkg: Allow the maintainer user to INSERT

This is the use case of a new package maintainer.  When a new maintainer
builds a package, they need a row in the maintainer table, with the right
e-mail address.  This change lets a package maintainer insert a row into that
table, but not update or delete.

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	2011-01-31 08:31:47 UTC (rev 13147)
+++ csw/mgar/gar/v2/lib/sh/db_privileges.sh	2011-01-31 09:08:08 UTC (rev 13148)
@@ -53,8 +53,13 @@
   local dbname=$2
   local user=$3
   local host=$4
-  echo -n "GRANT SELECT, INSERT, UPDATE, DELETE"
-  echo " ON ${dbname}.${tbl} TO '${user}'@'${host}';"
+  local operations=${5:-}
+  if [[ -z "${operations}" ]]
+  then
+    operations="SELECT, INSERT, UPDATE, DELETE"
+  fi
+  echo -n "GRANT ${operations}"
+  echo " ON ${dbname}.${table} TO '${user}'@'${host}';"
 }
 
 function print_grants {
@@ -77,6 +82,7 @@
   do
     print_table_grant "${tbl}" "${dbname}" "${maintainer_user}" "${host}"
   done
+  print_table_grant maintainer "${dbname}" "${maintainer_user}" "${host}" "SELECT, INSERT"
   echo "CREATE USER '${admin_user}'@'localhost' IDENTIFIED BY '<fill-me-in>';"
   echo "CREATE USER '${admin_user}'@'${host}' IDENTIFIED BY '<fill-me-in>';"
   echo "CREATE USER '${relmgr_user}'@'${host}' IDENTIFIED BY '<fill-me-in>';"


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