From: Michal Vaner Date: Tue, 26 Aug 2008 15:32:04 +0000 (+0200) Subject: Do not put password on a command line X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=949fed01fedabef7607aef083fdbc0cd38c3ba96;p=pciids.git Do not put password on a command line Pass it in the pipe --- diff --git a/PciIds/Xmpp.pm b/PciIds/Xmpp.pm index ba444b0..63497ef 100644 --- a/PciIds/Xmpp.pm +++ b/PciIds/Xmpp.pm @@ -15,7 +15,8 @@ sub sendXmpp( $$$ ) { sub flushXmpp() { return unless @pending; - open JELNET, "|$config{xmpp_pipe} > /dev/null" or die "Could not start XMPP sender\n"; + open JELNET, "|$config{jelnet} --silent-passwd \"$config{xmpp_name}\" > /dev/null" or die "Could not start XMPP sender\n"; + print JELNET $config{"xmpp_passwd"}."\n"; foreach( @pending ) { my( $to, $subject, $body ) = @{$_}; $subject =~ s/&/&/g; @@ -29,6 +30,6 @@ sub flushXmpp() { close JELNET; } -checkConf( [ "xmpp_pipe" ] ); +checkConf( [ "xmpp_name", "xmpp_passwd", "jelnet" ] ); 1; diff --git a/config b/config index 52a8760..0b10317 100644 --- a/config +++ b/config @@ -8,4 +8,6 @@ from_addr = vorner+pciids@ucw.cz sendmail = /home/vorner/bin/sendmail-apache logfile = /home/vorner/prog/pciids/pciids.log hostname = localhost -xmpp_pipe = /home/vorner/bin/xmpp_pipe +jelnet = /home/vorner/bin/jelnet +xmpp_passwd = 1234 +xmpp_name = none