X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Frsh-security.c;h=04266ab6309896d44bf2644babb43e20909e1acc;hb=3f2539260c201b5e594bf8ce89b583ebde6a63d1;hp=4d14f3bdfaa3755a0d715794802b340213e360ef;hpb=afaa71b3866b46b082b6c895772e15b36d8865fe;p=debian%2Famanda diff --git a/common-src/rsh-security.c b/common-src/rsh-security.c index 4d14f3b..04266ab 100644 --- a/common-src/rsh-security.c +++ b/common-src/rsh-security.c @@ -37,11 +37,9 @@ #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" /* * Path to the rsh binary. This should be configurable. @@ -78,6 +76,7 @@ const security_driver_t rsh_security_driver = { "RSH", rsh_connect, sec_accept, + sec_get_authenticated_peer_name_hostname, sec_close, stream_sendpkt, stream_recvpkt, @@ -230,17 +229,18 @@ runrsh( return (0); } + /* drop root privs permanently */ + 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); if(!xclient_username || strlen(xclient_username) <= 1) xclient_username = CLIENT_LOGIN; execlp(RSH_PATH, RSH_PATH, "-l", xclient_username, - rc->hostname, xamandad_path, "-auth=rsh", "amdump", "amindexd", - "amidxtaped", (char *)NULL); + rc->hostname, xamandad_path, "-auth=rsh", (char *)NULL); error(_("error: couldn't exec %s: %s"), RSH_PATH, strerror(errno)); /* should never go here, shut up compiler warning */