]> mj.ucw.cz Git - pciids.git/commitdiff
Do not put password on a command line
authorMichal Vaner <vorner@ucw.cz>
Tue, 26 Aug 2008 15:32:04 +0000 (17:32 +0200)
committerMichal Vaner <vorner@ucw.cz>
Tue, 26 Aug 2008 15:32:04 +0000 (17:32 +0200)
Pass it in the pipe

PciIds/Xmpp.pm
config

index ba444b09e8234bade6f42e1191d2918d4b623a4d..63497ef9899f7150dfa5083d630283e52de232df 100644 (file)
@@ -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/&/&amp;/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 52a8760817f75210c4e50a537277bb83c7370b2b..0b103179d0d809afe29d1a525ccda091b0ac7600 100644 (file)
--- 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