2 ===================================================================
3 --- src/dird/dird.c (révision 7482)
4 +++ src/dird/dird.c (copie de travail)
6 /* Forward referenced subroutines */
7 void terminate_dird(int sig);
8 static bool check_resources();
9 -static bool check_catalog();
10 +static bool check_catalog(bool printit=false);
11 static void dir_sql_query(JCR *jcr, const char *cmd);
13 /* Exported subroutines */
15 " -r <job> run <job> now\n"
17 " -t test - read configuration and exit\n"
18 +" -B print catalog configuration and exit\n"
20 " -v verbose user messages\n"
21 " -? print this message.\n"
24 bool no_signals = false;
25 bool test_config = false;
26 + bool print_catalog = false;
32 console_command = run_console_command;
34 - while ((ch = getopt(argc, argv, "c:d:fg:r:stu:v?")) != -1) {
35 + while ((ch = getopt(argc, argv, "c:d:fg:r:stu:vB?")) != -1) {
37 case 'c': /* specify config file */
38 if (configfile != NULL) {
43 + case 'B': /* print catalog config */
45 + print_catalog = true;
48 case 'u': /* set uid */
53 drop(uid, gid); /* reduce privileges if requested */
55 - if (!check_catalog()) {
56 + if (!check_catalog(print_catalog)) {
57 Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile);
64 -static bool check_catalog()
65 +static bool check_catalog(bool printit)
73 + if (printit) { /* print catalog information for scripting purpose */
75 + "catalog=%s\ndb_type=%s\ndb_name=%s\ndb_driver=%s\ndb_user=%s\n"
76 + "db_password=%s\ndb_address=%s\ndb_port=%i\n"
78 + catalog->name(), db_get_type(), NPRTB(catalog->db_name),
79 + NPRTB(catalog->db_driver),
80 + NPRTB(catalog->db_user), NPRTB(catalog->db_password),
81 + NPRTB(catalog->db_address), catalog->db_port,
82 + NPRTB(catalog->db_socket));
85 /* Loop over all pools, defining/updating them in each database */
87 foreach_res(pool, R_POOL) {
88 Index: src/cats/sqlite.c
89 ===================================================================
90 --- src/cats/sqlite.c (révision 7482)
91 +++ src/cats/sqlite.c (copie de travail)
94 int QueryDB(const char *file, int line, JCR *jcr, B_DB *db, char *select_cmd);
98 * Retrieve database type
111 Index: src/baconfig.h
112 ===================================================================
113 --- src/baconfig.h (révision 7482)
114 +++ src/baconfig.h (copie de travail)
117 /* Allow printing of NULL pointers */
118 #define NPRT(x) (x)?(x):_("*None*")
120 +#define NPRTB(x) (x)?(x):""
122 #if defined(HAVE_WIN32)
124 #define WIN32_REPARSE_POINT 1