1 Index: src/dird/dird_conf.c
2 ===================================================================
3 --- src/dird/dird_conf.c (révision 7525)
4 +++ src/dird/dird_conf.c (copie de travail)
9 +char *CAT::display(POOLMEM *dst) {
10 + Mmsg(dst,"catalog=%s\ndb_name=%s\ndb_driver=%s\ndb_user=%s\n"
11 + "db_password=%s\ndb_address=%s\ndb_port=%i\n"
13 + name(), NPRTB(db_name),
14 + NPRTB(db_driver), NPRTB(db_user), NPRTB(db_password),
15 + NPRTB(db_address), db_port, NPRTB(db_socket));
19 const char *level_to_str(int level)
22 Index: src/dird/dird_conf.h
23 ===================================================================
24 --- src/dird/dird_conf.h (révision 7525)
25 +++ src/dird/dird_conf.h (copie de travail)
30 + char *display(POOLMEM *dst); /* Get catalog information */
33 inline char *CAT::name() const { return hdr.name; }
35 ===================================================================
36 --- src/baconfig.h (révision 7525)
37 +++ src/baconfig.h (copie de travail)
40 /* Allow printing of NULL pointers */
41 #define NPRT(x) (x)?(x):_("*None*")
43 +#define NPRTB(x) (x)?(x):""
45 #if defined(HAVE_WIN32)
47 #define WIN32_REPARSE_POINT 1
48 Index: src/tools/dbcheck.c
49 ===================================================================
50 --- src/tools/dbcheck.c (révision 7525)
51 +++ src/tools/dbcheck.c (copie de travail)
53 static void do_interactive_mode();
54 static bool yes_no(const char *prompt);
60 -"Usage: dbcheck [-c config] [-C catalog name] [-d debug_level] <working-directory> <bacula-database> <user> <password> [<dbhost>] [<dbport>]\n"
61 +"Usage: dbcheck [-c config ] [-B] [-C catalog name] [-d debug_level] <working-directory> <bacula-database> <user> <password> [<dbhost>] [<dbport>]\n"
63 " -C catalog name in the director conf file\n"
64 " -c Director conf filename\n"
65 +" -B print catalog configuration and exit\n"
66 " -d <nn> set debug level to <nn>\n"
67 " -dt print timestamp in debug output\n"
68 " -f fix inconsistencies\n"
71 const char *user, *password, *db_name, *dbhost;
73 + bool print_catalog=false;
74 char *configfile = NULL;
75 char *catalogname = NULL;
78 memset(&name_list, 0, sizeof(name_list));
81 - while ((ch = getopt(argc, argv, "bc:C:d:fv?")) != -1) {
82 + while ((ch = getopt(argc, argv, "bc:C:d:fvB?")) != -1) {
85 + print_catalog = true; /* get catalog information from config */
94 set_working_directory(director->working_directory);
96 + /* Print catalog information and exit (-B) */
97 + if (print_catalog) {
98 + POOLMEM *buf = get_pool_memory(PM_MESSAGE);
99 + printf("%sdb_type=%s\nworking_dir=%s\n", catalog->display(buf),
100 + db_get_type(), working_directory);
101 + free_pool_memory(buf);
105 db_name = catalog->db_name;
106 user = catalog->db_user;
107 password = catalog->db_password;