From 164d3dc2be8cc563a7ceda3d2a42ca4516f792f6 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Mon, 18 Aug 2008 13:02:40 +0000 Subject: [PATCH] ebl Add patch to have a simplest backup process for catalog git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7495 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/patches/testing/bacula-dir-B.patch | 101 ++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 bacula/patches/testing/bacula-dir-B.patch diff --git a/bacula/patches/testing/bacula-dir-B.patch b/bacula/patches/testing/bacula-dir-B.patch new file mode 100644 index 0000000000..cee29bd936 --- /dev/null +++ b/bacula/patches/testing/bacula-dir-B.patch @@ -0,0 +1,101 @@ +Index: src/dird/dird.c +=================================================================== +--- src/dird/dird.c (revision 7482) ++++ src/dird/dird.c (working copy) +@@ -40,7 +40,7 @@ + /* Forward referenced subroutines */ + void terminate_dird(int sig); + static bool check_resources(); +-static bool check_catalog(); ++static bool check_catalog(bool printit=false); + static void dir_sql_query(JCR *jcr, const char *cmd); + + /* Exported subroutines */ +@@ -99,6 +99,7 @@ + " -r run now\n" + " -s no signals\n" + " -t test - read configuration and exit\n" ++" -B print catalog configuration and exit\n" + " -u userid\n" + " -v verbose user messages\n" + " -? print this message.\n" +@@ -124,6 +125,7 @@ + JCR *jcr; + bool no_signals = false; + bool test_config = false; ++ bool print_catalog = false; + char *uid = NULL; + char *gid = NULL; + +@@ -140,7 +142,7 @@ + + console_command = run_console_command; + +- while ((ch = getopt(argc, argv, "c:d:fg:r:stu:v?")) != -1) { ++ while ((ch = getopt(argc, argv, "c:d:fg:r:stu:vB?")) != -1) { + switch (ch) { + case 'c': /* specify config file */ + if (configfile != NULL) { +@@ -186,6 +188,11 @@ + test_config = true; + break; + ++ case 'B': /* print catalog config */ ++ test_config = true; ++ print_catalog = true; ++ break; ++ + case 'u': /* set uid */ + uid = optarg; + break; +@@ -249,7 +256,7 @@ + + drop(uid, gid); /* reduce privileges if requested */ + +- if (!check_catalog()) { ++ if (!check_catalog(print_catalog)) { + Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile); + } + +@@ -876,7 +883,7 @@ + return OK; + } + +-static bool check_catalog() ++static bool check_catalog(bool printit) + { + bool OK = true; + bool need_tls; +@@ -907,6 +914,18 @@ + continue; + } + ++ if (printit) { /* print catalog information for scripting purpose */ ++ fprintf(stdout, ++ "catalog=%s\ndb_type=%s\ndb_name=%s\ndb_driver=%s\ndb_user=%s\n" ++ "db_password=%s\ndb_address=%s\ndb_port=%i\n" ++ "db_socket=%s\n", ++ catalog->name(), db_get_type(), NPRTB(catalog->db_name), ++ NPRTB(catalog->db_driver), ++ NPRTB(catalog->db_user), NPRTB(catalog->db_password), ++ NPRTB(catalog->db_address), catalog->db_port, ++ NPRTB(catalog->db_socket)); ++ } ++ + /* Loop over all pools, defining/updating them in each database */ + POOL *pool; + foreach_res(pool, R_POOL) { +Index: src/baconfig.h +=================================================================== +--- src/baconfig.h (revision 7482) ++++ src/baconfig.h (working copy) +@@ -79,7 +79,8 @@ + + /* Allow printing of NULL pointers */ + #define NPRT(x) (x)?(x):_("*None*") +- ++#define NPRTB(x) (x)?(x):"" ++ + #if defined(HAVE_WIN32) + + #define WIN32_REPARSE_POINT 1 -- 2.39.5