Merge branch 'upstream'
[debian/amanda] / server-src / dumper.c
index 18384c738394b4f117b9b4381fb5efe1b915b918..1c40d4be41fcfd9dc78315274db4d5852b3a6e76 100644 (file)
@@ -281,6 +281,8 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
+    malloc_size_1 = malloc_inuse(&malloc_hist_1);
+
     erroutput_type = (ERR_AMANDALOG|ERR_INTERACTIVE);
     set_logerror(logerror);
 
@@ -297,8 +299,22 @@ main(
 
     dbrename(config_name, DBG_SUBDIR_SERVER);
 
-    our_features = am_init_feature_set();
-    our_feature_string = am_feature_to_string(our_features);
+    report_bad_conf_arg();
+    /*
+     * Make our effective uid nonprivlidged, keeping save uid as root
+     * in case we need to get back (to bind privlidged ports, etc).
+     */
+    ruid = getuid();
+    if(geteuid() == 0) {
+       seteuid(ruid);
+       setgid(getgid());
+    }
+#if defined BSD_SECURITY && !defined SSH_SECURITY
+    else {
+       error("must be run setuid root to communicate correctly");
+       /*NOTREACHED*/
+    }
+#endif
 
     g_fprintf(stderr,
            _("%s: pid %ld executable %s version %s\n"),