]> source.dussan.org Git - rspamd.git/commitdiff
* Handle password correctly in rspamc
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 18 Aug 2009 15:54:52 +0000 (19:54 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 18 Aug 2009 15:54:52 +0000 (19:54 +0400)
rspamc.pl.in

index 4185039de20d4024087a194dedcb35de542481ef..af2ea7a7e2397865f9133dd4dcdcb29bcd8f4d48 100755 (executable)
@@ -25,7 +25,7 @@ $main::VERSION = '@RSPAMD_VERSION@';
 
 sub HELP_MESSAGE {
     print <<EOD;
-Usage: rspamc.pl [-h host] [-p port] [-P] [-c conf_file] [-s statfile] [command]
+Usage: rspamc.pl [-h host] [-p port] [-P password] [-c conf_file] [-s statfile] [command]
 -h         host to connect or unix socket path
 -p         port to connect (not used with unix sockets)
 -P         ask for control password
@@ -222,7 +222,7 @@ sub do_control_command {
 }
 
 my %args;
-getopt('c:h:p:Ps:', \%args);
+getopt('c:h:p:P:s:', \%args);
 my $cmd = shift;
 my $do_parse_config = 1;
 
@@ -259,6 +259,9 @@ if (defined ($args{h})) {
 if (defined ($args{p})) {
     $cfg{'port'} = $args{p};
 }
+if (defined ($args{P})) {
+    $cfg{'password'} = $args{P};
+}
 
 if ($cmd =~ /(SYMBOLS|SCAN|PROCESS|CHECK|REPORT_IFSPAM|REPORT|URLS|EMAILS)/i) {
     $cfg{'command'} = $1;