Imported Upstream version 3.2.0
[debian/amanda] / common-src / local-security.c
index 7e2d1d81845c9fe4bef1a2c8b23729f296c18f93..24016e7ed1efb7bc87780d0be09bcacdd866d357 100644 (file)
  */
 
 #include "amanda.h"
+#include "match.h"
 #include "util.h"
 #include "event.h"
 #include "packet.h"
-#include "queue.h"
 #include "security.h"
 #include "security-util.h"
 #include "stream.h"
-#include "version.h"
 
 /*
  * Number of seconds amandad has to start up
@@ -62,6 +61,7 @@ const security_driver_t local_security_driver = {
     "LOCAL",
     local_connect,
     sec_accept,
+    sec_get_authenticated_peer_name_localhost,
     sec_close,
     stream_sendpkt,
     stream_recvpkt,
@@ -111,7 +111,7 @@ local_connect(
 
     auth_debug(1, _("local: local_connect: %s\n"), hostname);
 
-    rh = alloc(SIZEOF(*rh));
+    rh = g_new0(struct sec_handle, 1);
     security_handleinit(&rh->sech, &local_security_driver);
     rh->hostname = NULL;
     rh->rs = NULL;
@@ -243,11 +243,13 @@ runlocal(
        return (0);
     }
 
+    /* drop root privs for good */
+    set_root_privs(-1);
+
     safe_fd(-1, 0);
 
     if(!xamandad_path || strlen(xamandad_path) <= 1) 
-       xamandad_path = vstralloc(amlibexecdir, "/", "amandad",
-                                versionsuffix(), NULL);
+       xamandad_path = vstralloc(amlibexecdir, "/", "amandad", NULL);
 
 #ifndef SINGLE_USERID
     if (uid != 0)