]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Modify catalog scripts to have an easier packaging integration,
authorEric Bollengier <eric@eb.homelinux.org>
Thu, 28 Aug 2008 11:26:11 +0000 (11:26 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Thu, 28 Aug 2008 11:26:11 +0000 (11:26 +0000)
     using default variables.
     Make difference between SQLite3 and SQLite in db_get_type()

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.4@7515 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/grant_mysql_privileges.in
bacula/src/cats/grant_postgresql_privileges.in
bacula/src/cats/make_mysql_tables.in
bacula/src/cats/make_postgresql_tables.in
bacula/src/cats/sqlite.c
bacula/technotes-2.4

index bf89fe060ad3a567daad37078498bb1209bfb4c2..bb53b46a94e8baa90c6ed996cf8442e6d78bb9bf 100644 (file)
@@ -2,19 +2,19 @@
 #
 # shell script to grant privileges to the bacula database
 #
-USER=@db_user@
+db_user=${db_user-@db_user@}
 bindir=@SQL_BINDIR@
-db_name=@db_name@
+db_name=${db_name-@db_name@}
 
 if $bindir/mysql $* -u root -f <<END-OF-DATA
 use mysql
-grant all privileges on ${db_name}.* to ${USER}@localhost;
-grant all privileges on ${db_name}.* to ${USER}@"%";
+grant all privileges on ${db_name}.* to ${db_user}@localhost;
+grant all privileges on ${db_name}.* to ${db_user}@"%";
 select * from user;
 flush privileges;
 END-OF-DATA
 then
-   echo "Privileges for ${USER} granted on ${db_name}."
+   echo "Privileges for ${db_user} granted on ${db_name}."
    exit 0
 else
    echo "Error creating privileges."
index ab582e859f1929a88dc0cc143027079b01c6cf82..0595dfbd79b0845beb8d677ad3490246714a0001 100644 (file)
@@ -2,59 +2,59 @@
 #
 # shell script to grant privileges to the bacula database
 #
-USER=@db_user@
+db_user=${db_user-@db_user@}
 bindir=@SQL_BINDIR@
-db_name=@db_name@
+db_name=${db_name-@db_name@}
 
 if $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 
-create user ${USER};
+create user ${db_user};
 
 -- for tables
-grant all on unsavedfiles to ${USER};
-grant all on basefiles   to ${USER};
-grant all on jobmedia    to ${USER};
-grant all on file        to ${USER};
-grant all on job         to ${USER};
-grant all on media       to ${USER};
-grant all on client      to ${USER};
-grant all on pool        to ${USER};
-grant all on fileset     to ${USER};
-grant all on path        to ${USER};
-grant all on filename    to ${USER};
-grant all on counters    to ${USER};
-grant all on version     to ${USER};
-grant all on cdimages    to ${USER};
-grant all on mediatype   to ${USER};
-grant all on storage     to ${USER};
-grant all on device      to ${USER};
-grant all on status      to ${USER};
-grant all on location    to ${USER};
-grant all on locationlog  to ${USER};
-grant all on log         to ${USER};
+grant all on unsavedfiles to ${db_user};
+grant all on basefiles   to ${db_user};
+grant all on jobmedia    to ${db_user};
+grant all on file        to ${db_user};
+grant all on job         to ${db_user};
+grant all on media       to ${db_user};
+grant all on client      to ${db_user};
+grant all on pool        to ${db_user};
+grant all on fileset     to ${db_user};
+grant all on path        to ${db_user};
+grant all on filename    to ${db_user};
+grant all on counters    to ${db_user};
+grant all on version     to ${db_user};
+grant all on cdimages    to ${db_user};
+grant all on mediatype   to ${db_user};
+grant all on storage     to ${db_user};
+grant all on device      to ${db_user};
+grant all on status      to ${db_user};
+grant all on location    to ${db_user};
+grant all on locationlog  to ${db_user};
+grant all on log         to ${db_user};
 
 -- for sequences on those tables
 
-grant select, update on filename_filenameid_seq    to ${USER};
-grant select, update on path_pathid_seq           to ${USER};
-grant select, update on fileset_filesetid_seq     to ${USER};
-grant select, update on pool_poolid_seq           to ${USER};
-grant select, update on client_clientid_seq       to ${USER};
-grant select, update on media_mediaid_seq         to ${USER};
-grant select, update on job_jobid_seq             to ${USER};
-grant select, update on file_fileid_seq           to ${USER};
-grant select, update on jobmedia_jobmediaid_seq    to ${USER};
-grant select, update on basefiles_baseid_seq      to ${USER};
-grant select, update on storage_storageid_seq     to ${USER};
-grant select, update on mediatype_mediatypeid_seq  to ${USER};
-grant select, update on device_deviceid_seq       to ${USER};
-grant select, update on location_locationid_seq    to ${USER};
-grant select, update on locationlog_loclogid_seq   to ${USER};
-grant select, update on log_logid_seq             to ${USER};
+grant select, update on filename_filenameid_seq    to ${db_user};
+grant select, update on path_pathid_seq           to ${db_user};
+grant select, update on fileset_filesetid_seq     to ${db_user};
+grant select, update on pool_poolid_seq           to ${db_user};
+grant select, update on client_clientid_seq       to ${db_user};
+grant select, update on media_mediaid_seq         to ${db_user};
+grant select, update on job_jobid_seq             to ${db_user};
+grant select, update on file_fileid_seq           to ${db_user};
+grant select, update on jobmedia_jobmediaid_seq    to ${db_user};
+grant select, update on basefiles_baseid_seq      to ${db_user};
+grant select, update on storage_storageid_seq     to ${db_user};
+grant select, update on mediatype_mediatypeid_seq  to ${db_user};
+grant select, update on device_deviceid_seq       to ${db_user};
+grant select, update on location_locationid_seq    to ${db_user};
+grant select, update on locationlog_loclogid_seq   to ${db_user};
+grant select, update on log_logid_seq             to ${db_user};
 
 END-OF-DATA
 then
-   echo "Privileges for ${USER} granted on ${db_name}."
+   echo "Privileges for ${db_user} granted on ${db_name}."
    exit 0
 else
    echo "Error creating privileges."
index 7a075dd5d755555e12d795c0d7f716ed930fbb11..bc807c81f0992cf21a753d55f8e532e0177ed1b5 100644 (file)
@@ -3,7 +3,7 @@
 # shell script to create Bacula MySQL tables
 #
 bindir=@SQL_BINDIR@
-db_name=@db_name@
+db_name=${db_name-@db_name@}
 
 if $bindir/mysql $* -f <<END-OF-DATA
 USE ${db_name};
index 70aee44084cb5e2f9fc10a175242d2f74e00bb61..08a223fbd0ff2138d944bd0ee7e8beb301e1fe07 100644 (file)
@@ -3,7 +3,7 @@
 # shell script to create Bacula PostgreSQL tables
 #
 bindir=@SQL_BINDIR@
-db_name=@db_name@
+db_name=${db_name-@db_name@}
 
 $bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
 
index b4331dd81595fb578632c25c250b8b8a51d1e566..c183362a6c4a627ed6256963644523af2ff5c4f9 100644 (file)
@@ -59,14 +59,17 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 
 int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
 
-
 /*
  * Retrieve database type
  */
 const char *
 db_get_type(void)
 {
+#ifdef HAVE_SQLITE3
+   return "SQLite3";
+#else
    return "SQLite";
+#endif
 }
 
 /*
index 03bc56b15fae81f06e34a1cc2e55374521ffd69f..a5b487c98e74cf22975e11ecfb18d2e6d64a3a6f 100644 (file)
@@ -1,6 +1,10 @@
               Technical notes on version 2.4
 
 General:
+28Aug08
+ebl  Modify catalog scripts to have an easier packaging integration,
+     using default variables.
+     Make difference between SQLite3 and SQLite in db_get_type()
 26Aug08
 kes  Attempt to fix bug #1128 InChanger flag cleared during Migration
      job when reading from one autochanger and writing to another.