diff --git a/apache/CHANGELOG b/apache/CHANGELOG index 3a6b3e278..2931d5482 100644 --- a/apache/CHANGELOG +++ b/apache/CHANGELOG @@ -35,3 +35,5 @@ Changed all code to use ui-lib.pl functions, for better themeing. On Debian and Ubuntu systems, replaced the existing pages for selecting Apache modules with one that that configures the /etc/apache2/mods-enabled directory, for much simpler and more workable control over modules. ---- Changes since 1.360 ---- Available Apache modules are now fully automatically detected on all operating systems, which does away with the Re-Configure Known Modules page. +---- Changes since 1.400 ---- +Moved the SSL password option to the global settings level, to correspond with the way Apache expects it. diff --git a/apache/lang/en b/apache/lang/en index b57c115d6..2b9d4b9e7 100644 --- a/apache/lang/en +++ b/apache/lang/en @@ -897,7 +897,8 @@ mod_ssl_ecdepth=Certificate depth must be an integer mod_ssl_log=SSL log file mod_ssl_elog=Missing SSL log file mod_ssl_onlyssl=Allow SSL access only -mod_ssl_pass=Password for SSL key +mod_ssl_pass=Passwords for SSL keys +mod_ssl_passnone=Not set yet mod_ssl_passph=Fixed password $1 mod_ssl_builtin=Prompt at startup mod_ssl_passsc=Execute script $1 diff --git a/apache/mod_ssl.pl b/apache/mod_ssl.pl index 2e1c3a540..ac5c789e4 100644 --- a/apache/mod_ssl.pl +++ b/apache/mod_ssl.pl @@ -8,7 +8,7 @@ $rv = [ [ 'SSLEngine', 0, 14, 'virtual', undef, 10 ], [ 'SSLProtocol', 0, 14, 'virtual', undef, 10 ], [ 'SSLCertificateFile', 0, 14, 'virtual', undef, 9 ], [ 'SSLCertificateKeyFile', 0, 14, 'virtual', undef, 8 ], - [ 'SSLPassPhraseDialog', 0, 14, 'virtual', 2.0, 7.5 ], + [ 'SSLPassPhraseDialog', 1, 14, 'global', 2.0, 7.5 ], [ 'SSLVerifyClient', 0, 14, 'virtual directory htaccess', undef, 7 ], [ 'SSLVerifyDepth', 0, 14, 'virtual directory htaccess', undef, 6 ], [ 'SSLLog', 0, 14, 'virtual', undef, 5 ], @@ -120,70 +120,86 @@ return $in{'SSLRequireSSL'} ? ( [ "" ] ) : ( [ ] ); sub edit_SSLPassPhraseDialog { -local ($mode, $script, $pass, $file); -if ($_[0]->{'value'} eq 'builtin') { - $mode = 1; - } -elsif ($_[0]->{'value'} =~ /^exec:(.*)$/) { - $file = $1; - local $data = &read_file_contents($1); - if ($data =~ /^#!\/bin\/sh\necho\s(.*)\n$/) { - $pass = $1; - $mode = 2; +local $table = &ui_columns_start(); +local $i = 0; +foreach my $p (@{$_[0]}, { }) { + local ($mode, $script, $pass, $file); + if ($p->{'value'} eq 'builtin') { + $mode = 1; + } + elsif ($p->{'value'} =~ /^exec:(.*)$/) { + $file = $1; + local $data = &read_file_contents($1); + if ($data =~ /^#!\/bin\/sh\necho\s(.*)\n$/) { + $pass = $1; + $mode = 2; + } + else { + $script = $file; + $file = undef; + $mode = 3; + } + } + elsif ($p->{'value'}) { + $script = $p->{'value'}; + $mode = 1; } else { - $script = $file; - $file = undef; - $mode = 3; + $mode = 0; } + $table .= &ui_columns_row([ + &ui_radio("SSLPassPhraseDialog_$i", $mode, + [ [ 0, $text{'mod_ssl_passnone'}."
" ], + [ 1, $text{'mod_ssl_builtin'}."
" ], + [ 2, &text('mod_ssl_passph', + &ui_textbox("SSLPassPhraseDialog_pass_$i", + $pass, 20))."
" ], + [ 3, &text('mod_ssl_passsc', + &ui_textbox("SSLPassPhraseDialog_script_$i", + $script, 40)) ], + ])."\n". + &ui_hidden("SSLPassPhraseDialog_file_$i", $file) + ]); + $i++; } -elsif ($_[0]->{'value'}) { - $script = $_[0]->{'value'}; - $mode = 1; - } -else { - $mode = 0; - } -return (2, $text{'mod_ssl_pass'}, - &ui_radio("SSLPassPhraseDialog", $mode, - [ [ 0, $text{'default'} ], - [ 1, $text{'mod_ssl_builtin'}."
" ], - [ 2, &text('mod_ssl_passph', - &ui_textbox("SSLPassPhraseDialog_pass", $pass, 20))."
" ], - [ 3, &text('mod_ssl_passsc', - &ui_textbox("SSLPassPhraseDialog_script", $script, 40)) ], - ])."\n". - &ui_hidden("SSLPassPhraseDialog_file", $file)); +$table .= &ui_columns_end(); +return (2, $text{'mod_ssl_pass'}, $table); } sub save_SSLPassPhraseDialog { -if ($in{'SSLPassPhraseDialog'} == 0) { - return ( [ ] ); - } -elsif ($in{'SSLPassPhraseDialog'} == 1) { - return ( [ "builtin" ] ); - } -elsif ($in{'SSLPassPhraseDialog'} == 2) { - $in{'SSLPassPhraseDialog_pass'} =~ /\S/ || - &error($text{'mod_ssl_epassph'}); - local $file = $in{'SSLPassPhraseDialog_file'} || - "$config{'httpd_dir'}/passphrase.".time().".sh"; - &open_tempfile(PASS, ">$file"); - &print_tempfile(PASS, "#!/bin/sh\n"); - &print_tempfile(PASS, "echo ",$in{'SSLPassPhraseDialog_pass'},"\n"); - &close_tempfile(PASS); - &set_ownership_permissions(undef, undef, 0755, $file); - return ( [ "exec:$file" ] ); - } -elsif ($in{'SSLPassPhraseDialog'} == 3) { - if ($in{'SSLPassPhraseDialog_script'} =~ /^[a-z]+:/) { - return ( [ $in{'SSLPassPhraseDialog_script'} ] ); +local @rv; +local $mode; +for(my $i=0; defined($in{"SSLPassPhraseDialog_$i"}); $i++) { + if ($in{"SSLPassPhraseDialog_$i"} == 0) { + # Nothing to add } - else { - $in{'SSLPassPhraseDialog_script'} =~ /^\/\S/ || - &error($text{'mod_ssl_epasssc'}); - return ( [ "exec:".$in{'SSLPassPhraseDialog_script'} ] ); + elsif ($in{"SSLPassPhraseDialog_$i"} == 1) { + push(@rv, "builtin"); + } + elsif ($in{"SSLPassPhraseDialog_$i"} == 2) { + $in{"SSLPassPhraseDialog_pass_$i"} =~ /\S/ || + &error($text{'mod_ssl_epassph'}); + local $file = $in{"SSLPassPhraseDialog_file_$i"} || + "$config{'httpd_dir'}/passphrase.".time().".sh"; + &open_tempfile(PASS, ">$file"); + &print_tempfile(PASS, "#!/bin/sh\n"); + &print_tempfile(PASS, "echo ", + $in{"SSLPassPhraseDialog_pass_$i"},"\n"); + &close_tempfile(PASS); + &set_ownership_permissions(undef, undef, 0755, $file); + push(@rv, "exec:$file"); + } + elsif ($in{"SSLPassPhraseDialog_$i"} == 3) { + if ($in{"SSLPassPhraseDialog_script_$i"} =~ /^[a-z]+:/) { + push(@rv, $in{"SSLPassPhraseDialog_script_$i"}); + } + else { + $in{"SSLPassPhraseDialog_script_$i"} =~ /^\/\S/ || + &error($text{'mod_ssl_epasssc'}); + push(@rv, "exec:".$in{"SSLPassPhraseDialog_script_$i"}); + } } } +return ( \@rv ); }