calcsize needs to be setuid root or it complains and fails
[debian/amanda] / server-src / amtrmidx.c
index f5be82679e0cee99acbb0f1e1d301e6f624c25d3..9f9176bbbb568c1fc177325fc44f43fc5ea65d37 100644 (file)
@@ -93,10 +93,10 @@ main(
 
     cfg_ovr = extract_commandline_config_overwrites(&argc, &argv);
 
-    if (my_argc > 1 && strcmp(my_argv[1], "-t") == 0) {
+    if (argc > 1 && strcmp(argv[1], "-t") == 0) {
        amtrmidx_debug = 1;
-       my_argc--;
-       my_argv++;
+       argc--;
+       argv++;
     }
 
     if (argc < 2) {
@@ -104,21 +104,24 @@ main(
        return 1;
     }
 
-    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_FATAL | CONFIG_INIT_USE_CWD,
-       argv[1]);
+    config_init(CONFIG_INIT_EXPLICIT_NAME | CONFIG_INIT_USE_CWD, argv[1]);
     apply_config_overwrites(cfg_ovr);
 
-    check_running_as(RUNNING_AS_DUMPUSER);
-
-    dbrename(config_name, DBG_SUBDIR_SERVER);
-
     conf_diskfile = config_dir_relative(getconf_str(CNF_DISKFILE));
-    if (read_diskfile(conf_diskfile, &diskl) < 0) {
-       error(_("could not load disklist \"%s\""), conf_diskfile);
-       /*NOTREACHED*/
-    }
+    read_diskfile(conf_diskfile, &diskl);
     amfree(conf_diskfile);
 
+    if (config_errors(NULL) >= CFGERR_WARNINGS) {
+       config_print_errors();
+       if (config_errors(NULL) >= CFGERR_ERRORS) {
+           g_critical(_("errors processing config file"));
+       }
+    }
+
+    check_running_as(RUNNING_AS_DUMPUSER);
+
+    dbrename(get_config_name(), DBG_SUBDIR_SERVER);
+
     conf_tapelist = config_dir_relative(getconf_str(CNF_TAPELIST));
     if(read_tapelist(conf_tapelist)) {
        error(_("could not load tapelist \"%s\""), conf_tapelist);