webmin/ 0000775 0005671 0000012 00000000000 11140375506 012023 5 ustar jcameron wheel webmin/change_access.cgi 0000775 0005671 0000012 00000002427 11140375505 015264 0 ustar jcameron wheel #!/usr/local/bin/perl # change_access.cgi # Update IP allow and deny parameters require './webmin-lib.pl'; use Socket; &ReadParse(); &error_setup($text{'access_err'}); $raddr = $ENV{'REMOTE_ADDR'}; if ($in{"access"}) { @hosts = split(/\s+/, $in{"ip"}); if (!@hosts) { &error($text{'access_enone'}); } foreach $h (@hosts) { $err = &valid_allow($h); &error($err) if ($err); push(@ip, $h); } if ($in{"access"} == 1 && !&ip_match($raddr, @ip) || $in{"access"} == 2 && &ip_match($raddr, @ip)) { &error(&text('access_eself', $raddr)); } } eval "use Authen::Libwrap qw(hosts_ctl STRING_UNKNOWN)"; if (!$@ && $in{'libwrap'}) { # Check if the current address would be denied if (!hosts_ctl("webmin", STRING_UNKNOWN, $raddr, STRING_UNKNOWN)) { &error(&text('access_eself', $raddr)); } } &lock_file($ENV{'MINISERV_CONFIG'}); &get_miniserv_config(\%miniserv); delete($miniserv{"allow"}); delete($miniserv{"deny"}); if ($in{"access"} == 1) { $miniserv{"allow"} = join(' ', @hosts); } elsif ($in{"access"} == 2) { $miniserv{"deny"} = join(' ', @hosts); } $miniserv{'libwrap'} = $in{'libwrap'}; $miniserv{'alwaysresolve'} = $in{'alwaysresolve'}; &put_miniserv_config(\%miniserv); &unlock_file($ENV{'MINISERV_CONFIG'}); &show_restart_page(); &webmin_log("access", undef, undef, \%in); webmin/restart.cgi 0000775 0005671 0000012 00000000135 11140375505 014174 0 ustar jcameron wheel #!/usr/local/bin/perl # Re-start Webmin require './webmin-lib.pl'; &show_restart_page(); webmin/config.info.tr 0000664 0005671 0000012 00000000225 11140375505 014567 0 ustar jcameron wheel standard_url=Standart modllerin listesinin URL'si,3,www.webmin.com adresinde third_url=nc parti modl listesi URL'si,3,www.webmin.com adresinde webmin/edit_categories.cgi 0000775 0005671 0000012 00000003711 11140375505 015645 0 ustar jcameron wheel #!/usr/local/bin/perl # Show a form for editing custom category names require './webmin-lib.pl'; ReadParse(); ui_print_header(undef, $text{'categories_title'}, undef); # Show language selector print ui_form_start("edit_categories.cgi"); print "$text{'categories_lang'}\n"; print ui_select("lang", $in{'lang'}, [ [ "", "<$text{'default'}>" ], map { [ $_->{'lang'}, "$_->{'desc'} (".uc($_->{'lang'}).")" ] } list_languages() ]),"\n"; print ui_submit($text{'categories_langok'}),"\n"; print ui_form_end(); print "$text{'categories_desc'}
\n"; print ui_form_start("save_categories.cgi"); print ui_hidden("lang", $in{'lang'}); print ui_table_start($text{'categories_header'}); # Show the existing categories $file = "$config_directory/webmin.catnames"; $file .= ".".$in{'lang'} if ($in{'lang'}); read_file($file, \%catnames); foreach $t (keys %text) { $t =~ s/^category_// || next; print "
$out"); } system("cat $ctemp $ktemp >$miniserv{'ca'}"); unlink($ctemp); unlink($ktemp); unlink("$config_directory/acl/crl.pem"); chmod(0700, $miniserv{'ca'}); &unlock_file($miniserv{'ca'}); &put_miniserv_config(\%miniserv); &unlock_file($ENV{'MINISERV_CONFIG'}); &ui_print_header(undef, $text{'ca_title'}, ""); print "
$text{'ca_setupok'}
\n"; &ui_print_footer("", $text{'index_return'}); &restart_miniserv(1); &webmin_log("setupca", undef, undef, \%in); webmin/log_parser.pl 0000775 0005671 0000012 00000002044 11140375505 014517 0 ustar jcameron wheel # log_parser.pl # Functions for parsing this module's logs do 'webmin-lib.pl'; # parse_webmin_log(user, script, action, type, object, ¶ms) # Converts logged information from this module into human-readable form sub parse_webmin_log { local ($user, $script, $action, $type, $object, $p) = @_; if ($action eq 'install') { return &text('log_install', "$p->{'desc'}"); } elsif ($action eq 'tinstall') { return &text('log_tinstall', "$p->{'desc'}"); } elsif ($action eq 'clone') { return &text('log_clone', "$p->{'desc'}", "$p->{'dstdesc'}"); } elsif ($action eq 'delete') { return &text('log_delete', "$p->{'desc'}"); } elsif ($action eq 'upgrade') { return &text('log_upgrade', $p->{'version'}); } elsif ($action eq 'theme') { return $p->{'theme'} ? &text('log_theme', "$p->{'theme'}") : $text{'log_theme_def'}; } elsif ($action eq 'deletecache') { return &text('log_deletecache', $object); } elsif ($text{"log_$action"}) { return $text{"log_$action"}; } else { return undef; } } webmin/upgrade.cgi 0000775 0005671 0000012 00000037313 11140375505 014147 0 ustar jcameron wheel #!/usr/local/bin/perl # upgrade.cgi # Upgrade webmin if possible require './webmin-lib.pl'; do './gnupg-lib.pl'; &foreign_require("proc", "proc-lib.pl"); &foreign_require("acl", "acl-lib.pl"); &ReadParseMime(); $| = 1; $theme_no_table = 1; &ui_print_header(undef, $text{'upgrade_title'}, ""); # Save this CGI from being killed by the upgrade $SIG{'TERM'} = 'IGNORE'; if ($in{'source'} == 0) { # from local file &error_setup(&text('upgrade_err1', $in{'file'})); $file = $in{'file'}; if (!-r $file) { &inst_error($text{'upgrade_efile'}); } if ($file =~ /webmin-(\d+\.\d+)/) { $version = $1; } if (!$in{'force'}) { if ($version == &get_webmin_version()) { &inst_error(&text('upgrade_elatest', $version)); } elsif ($version <= &get_webmin_version()) { &inst_error(&text('upgrade_eversion', $version)); } } } elsif ($in{'source'} == 1) { # from uploaded file &error_setup($text{'upgrade_err2'}); $file = &transname(); $need_unlink = 1; if ($no_upload) { &inst_error($text{'upgrade_ebrowser'}); } open(MOD, ">$file"); print MOD $in{'upload'}; close(MOD); if ($in{'upload_filename'} =~ /webmin-(\d+\.\d+)/) { $version = $1; } } elsif ($in{'source'} == 2) { # find latest version at www.webmin.com by looking at index page &error_setup($text{'upgrade_err3'}); ($ok, $version) = &get_latest_webmin_version(); $ok || &inst_error($version); if (!$in{'force'}) { if ($version == &get_webmin_version()) { &inst_error(&text('upgrade_elatest', $version)); } elsif ($version <= &get_webmin_version()) { &inst_error(&text('upgrade_eversion', $version)); } } if ($in{'mode'} eq 'rpm') { # Downloading RPM $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin-$version-1.noarch.rpm"); } elsif ($in{'mode'} eq 'deb') { # Downloading Debian package $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin_${version}_all.deb"); } elsif ($in{'mode'} eq 'solaris-pkg') { # Downloading my Solaris package $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin-$version.pkg.gz"); } else { # Downloading tar.gz file $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin-$version.tar.gz"); } $progress_callback_url = $redirect_url."/upgrade/". $progress_callback_url; ($host, $port, $page, $ssl) = &parse_http_url($progress_callback_url); $file = &transname(); &http_download($host, $port, $page, $file, \$error, \&progress_callback, $ssl); $error && &inst_error($error); $need_unlink = 1; } elsif ($in{'source'} == 5) { # Download from some URL &error_setup(&text('upgrade_err5', $in{'url'})); $file = &transname(); $in{'url'} = &convert_osdn_url($in{'url'}); $progress_callback_url = $in{'url'}; if ($in{'url'} =~ /^(http|https):\/\/([^\/]+)(\/.*)$/) { $ssl = $1 eq 'https'; $host = $2; $page = $3; $port = $ssl ? 443 : 80; if ($host =~ /^(.*):(\d+)$/) { $host = $1; $port = $2; } &http_download($host, $port, $page, $file, \$error, \&progress_callback, $ssl); } elsif ($in{'url'} =~ /^ftp:\/\/([^\/]+)(:21)?\/(.*)$/) { $host = $1; $ffile = $3; &ftp_download($host, $ffile, $file, \$error, \&progress_callback); } else { &inst_error($text{'upgrade_eurl'}); } $need_unlink = 1; $error && &inst_error($error); if ($in{'url'} =~ /webmin-(\d+\.\d+)/) { $version = $1; } } elsif ($in{'source'} == 3) { # Get the latest version from Caldera with cupdate &redirect("/cupdate/"); } elsif ($in{'source'} == 4) { # Just run the command emerge webmin &error_setup(&text('upgrade_err4')); $file = "webmin"; $need_unlink = 0; } $qfile = quotemeta($file); # Import the signature for RPM if ($in{'mode'} eq 'rpm') { system("rpm --import $module_root_directory/jcameron-key.asc >/dev/null 2>&1"); } # Check the signature if possible if ($in{'sig'}) { # Check the package signature ($ec, $emsg) = &gnupg_setup(); if (!$ec) { if ($in{'mode'} eq 'rpm') { # Use rpm's gpg signature verification local $out = `rpm --checksig $qfile 2>&1`; if ($?) { $ec = 3; $emsg = &text('upgrade_echecksig', "
$out"); } } else { # Do a manual signature check if ($in{'source'} == 2) { # Download the key for this tar.gz local ($sigtemp, $sigerror); &http_download($update_host, $update_port, "/download/sigs/webmin-$version.tar.gz-sig.asc", \$sigtemp, \$sigerror); if ($sigerror) { $ec = 4; $emsg = &text('upgrade_edownsig', $sigerror); } else { local $data = `cat $qfile`; local ($vc, $vmsg) = &verify_data($data, $sigtemp); if ($vc > 1) { $ec = 3; $emsg = &text( "upgrade_everify$vc", &html_escape($vmsg)); } } } else { $emsg = $text{'upgrade_nosig'}; } } } # Tell the user about any GnuPG error if ($ec) { &inst_error($emsg); } elsif ($emsg) { print "$emsg
\n"; } else { print "$text{'upgrade_sigok'}
\n"; } } else { print "$text{'upgrade_nocheck'}
\n";
}
if ($in{'mode'} ne 'gentoo') {
# gunzip the file if needed
open(FILE, $file);
read(FILE, $two, 2);
close(FILE);
if ($two eq "\037\213") {
if (!&has_command("gunzip")) {
&inst_error($text{'upgrade_egunzip'});
}
$newfile = &transname();
$out = `gunzip -c $qfile 2>&1 >$newfile`;
if ($?) {
unlink($newfile);
&inst_error(&text('upgrade_egzip', "$out"));
}
unlink($file) if ($need_unlink);
$need_unlink = 1;
$file = $newfile;
}
}
$qfile = quotemeta($file);
if ($in{'mode'} eq 'rpm') {
# Check if it is an RPM package
$rpmname = "webmin";
if (open(RPM, "$root_directory/rpm-name")) {
chop($rpmname = ",$text{'upgrade_setuprpm'}," \n";
print " ",$text{'upgrade_setupdeb'}," \n";
print " ",$text{'upgrade_setuppackage'}," \n";
print "PKG: $pkg ",$text{'upgrade_setup'}," \n";
print " ",$text{'upgrade_setuprpm'}," \n";
print " ",$text{'upgrade_setupgentoo'}," \n";
print " ",$text{'upgrade_setup'}," \n";
print " \n";
}
&ui_print_footer("", $text{'index_return'});
sub inst_error
{
unlink($file) if ($need_unlink);
unlink($updatestemp);
print "$main::whatfailed : $_[0] \n";
&ui_print_footer("", $text{'index_return'});
exit;
}
webmin/edit_proxy.cgi 0000775 0005671 0000012 00000010305 11140375505 014676 0 ustar jcameron wheel #!/usr/local/bin/perl
# edit_proxy.cgi
# Proxy servers config form
require './webmin-lib.pl';
&ReadParse();
&ui_print_header(undef, $text{'proxy_title'}, "");
# Show tabs
@tabs = ( [ "proxy", $text{'proxy_tabproxy'}, "edit_proxy.cgi?mode=proxy" ],
[ "down", $text{'proxy_tabdown'}, "edit_proxy.cgi?mode=down" ] );
print &ui_tabs_start(\@tabs, "pd", $in{'mode'} || "proxy", 1);
print &ui_tabs_start_tab("pd", "proxy");
print $text{'proxy_desc'}," \n";
print &ui_form_start("change_proxy.cgi", "post");
print &ui_table_start($text{'proxy_header'}, undef, 2, [ "width=30%" ]);
# HTTP proxy
print &ui_table_row($text{'proxy_http'},
&ui_opt_textbox("http", $gconfig{'http_proxy'}, 50,
$text{'proxy_none'}));
# FTP proxy
print &ui_table_row($text{'proxy_ftp'},
&ui_opt_textbox("ftp", $gconfig{'ftp_proxy'}, 50,
$text{'proxy_none'}));
# No proxy for domains
print &ui_table_row($text{'proxy_nofor'},
&ui_textbox("noproxy", $gconfig{'noproxy'}, 60));
# User and password
print &ui_table_row($text{'proxy_user'},
&ui_textbox("puser", $gconfig{'proxy_user'}, 20));
print &ui_table_row($text{'proxy_pass'},
&ui_password("ppass", $gconfig{'proxy_pass'}, 20));
# Bind to address for outgoing connections
print &ui_table_row($text{'proxy_bind'},
&ui_opt_textbox("bind", $gconfig{'bind_proxy'}, 35, $text{'default'}));
# Fallback to direct
print &ui_table_row($text{'proxy_fallback'},
&ui_yesno_radio("fallback", int($gconfig{'proxy_fallback'})));
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ] ]);
print &ui_tabs_end_tab();
# OSDN mirror form
print &ui_tabs_start_tab("pd", "down");
print $text{'proxy_desc2'}," \n";
print &ui_form_start("change_osdn.cgi");
print &ui_table_start($text{'proxy_header2'}, undef, 2, [ "width=30%" ]);
if ($config{'osdn'}) {
# Show list of mirrors to choose from
$base = &get_webmin_base_version();
@mirrors = &list_osdn_mirrors("webadmin", "webmin-$base.tar.gz");
@codes = map { $_->{'mirror'} } @mirrors;
$inlist = !$gconfig{'osdn_mirror'} ||
&indexof($gconfig{'osdn_mirror'}, @codes) >= 0;
print &ui_table_row($text{'proxy_osdn'},
&ui_select("mirror", $inlist ? $gconfig{'osdn_mirror'} : "*",
[ [ "", $text{'proxy_mirrordef'} ],
(map { [ $_->{'mirror'},
$_->{'country'} ? "$_->{'mirror'} ($_->{'country'})" : $_->{'mirror'} ] } @mirrors),
[ "*", $text{'proxy_other'} ] ])." ".
&ui_textbox("other",
$inlist ? "" : $gconfig{'osdn_mirror'}, 10));
}
else {
# Just show text field for mirror code
print &ui_table_row($text{'proxy_osdn'},
&ui_opt_textbox("mirror", $gconfig{'osdn_mirror'}, 10,
$text{'proxy_mirrordef2'}));
}
# Cache size
print &ui_table_row($text{'proxy_cache'},
&ui_radio("cache_def", $gconfig{'cache_size'} ? 0 : 1,
[ [ 1, $text{'proxy_cache1'} ],
[ 0, $text{'proxy_cache0'} ] ])."\n".
&ui_bytesbox("cache", $gconfig{'cache_size'}, 8));
# Cache time
print &ui_table_row($text{'proxy_daysmax'},
&ui_opt_textbox("days", $gconfig{'cache_days'}, 5,
$text{'proxy_daysdef'})." ".$text{'proxy_days'});
# Modules to cache in
$excl = ($gconfig{'cache_mods'} =~ s/^\!//);
@mods = split(/\s+/, $gconfig{'cache_mods'});
print &ui_table_row($text{'proxy_mods'},
&ui_radio("mods_def", !$gconfig{'cache_mods'} ? 0 :
$excl ? 2 : 1,
[ [ 0, $text{'proxy_mods0'} ],
[ 1, $text{'proxy_mods1'} ],
[ 2, $text{'proxy_mods2'} ] ])." ";
print ui_form_start("upgrade.cgi", "form-data");
print ui_hidden("mode", $mode);
print ui_hidden("dir", $dir);
print ui_table_start($text{'upgrade_title'}, undef, 1);
print " \n";
if (!$mode && !$dir) {
# Checkbox to delete original directory
print " ",
"$text{'upgrade_delete'} \n";
print ui_form_start("save_newmod.cgi", "post");
print ui_table_start($text{'newmod_header'});
$newmod = &get_newmodule_users();
printf " %s \n";
print ui_form_start("update.cgi", "post");
print ui_table_start($text{'update_header1'});
print " \n";
print ui_form_start("update_sched.cgi", "post");
print ui_table_start($text{'update_header2'});
print " \n",
$config{'update'} ? 'checked' : '', $text{'update_enabled'};
printf " %s \n";
print &ui_form_start("change_access.cgi", "post");
print &ui_table_start($text{'access_header'}, undef, 2, [ "width=30%" ]);
$access = $miniserv{"allow"} ? 1 : $miniserv{"deny"} ? 2 : 0;
print &ui_table_row($text{'access_ip'},
&ui_radio("access", $access,
[ [ 0, $text{'access_all'} ],
[ 1, $text{'access_allow'} ],
[ 2, $text{'access_deny'} ] ])." \n";
# Fetch updates
@urls = $in{'source'} == 0 ? ( $update_url ) : split(/\r?\n/, $in{'other'});
$count = 0;
foreach $url (@urls) {
# Get updates from this URL, and filter to those for this system
($updates, $host, $port, $page, $ssl) =
&fetch_updates($url, $in{'upuser'}, $in{'uppass'});
$count += scalar(@$updates);
$updates = &filter_updates($updates, undef,
$in{'third'}, $in{'missing'});
foreach $u (@$updates) {
# Get module or theme's details
local %minfo = &get_module_info($u->[0]);
local %tinfo = &get_theme_info($u->[0]);
local %info = %minfo ? %minfo : %tinfo;
if ($in{'show'}) {
# Just tell the user what would be done
print &text('update_mshow', "$u->[0]", "$u->[1]"),
" \n";
$donemodule{$u->[0]} = 1;
}
else {
# Actually do the update ..
local (@mdescs, @mdirs, @msizes);
print &text('update_mok', "$u->[0]", "$u->[1]"),
" \n";
}
else {
print &text('update_mdesc', "$irv->[0]->[0]",
"$irv->[2]->[0]")," \n";
$donemodule{$irv->[0]->[0]} = 1;
}
}
}
}
print &text('update_none')," \n";
}
&ui_print_footer("", $text{'index_return'});
webmin/edit_blocked.cgi 0000775 0005671 0000012 00000001561 11140375505 015124 0 ustar jcameron wheel #!/usr/local/bin/perl
# Show a list of blocked users and hosts
require './webmin-lib.pl';
&ui_print_header(undef, $text{'blocked_title'}, "");
&get_miniserv_config(\%miniserv);
@blocked = &get_blocked_users_hosts(\%miniserv);
if (@blocked) {
print &ui_columns_start([ $text{'blocked_type'},
$text{'blocked_who'},
$text{'blocked_fails'},
$text{'blocked_when'},
]);
foreach $b (@blocked) {
print &ui_columns_row([
$text{'blocked_'.$b->{'type'}},
$b->{'user'} || $b->{'host'},
$b->{'fails'},
&make_date($b->{'when'}),
]);
}
print &ui_columns_end();
print &ui_hr();
print &ui_buttons_start();
print &ui_buttons_row("clear_blocked.cgi",
$text{'blocked_clear'},
$text{'blocked_cleardesc'});
print &ui_buttons_end();
}
else {
print "$text{'blocked_none'} \n";
}
&ui_print_footer("", $text{'index_return'});
webmin/config.info.ja_JP.UTF-8 0000664 0005671 0000012 00000000237 11140375505 015732 0 ustar jcameron wheel standard_url=標準モジュールリストのURL,3,www.webmin.com を使用
third_url=サードパーティモジュールのリストのURL,3,www.webmin.com
webmin/module.info 0000664 0005671 0000012 00000001620 11140375506 014164 0 ustar jcameron wheel desc_nl=Webmin Configuratie
desc_ko_KR.euc=Webmin
risk=low medium high
desc_ru_SU= Webmin
desc_zh_TW.Big5=Webmin պA
desc_pl=Konfiguracja Webmina
desc_de=Webmin-Konfiguration
name=Webmin
desc_zh_CN=Webmin
desc_pt=Configurao do Webmin
category=webmin
desc_tr=Webmin Yaplandrmas
desc=Webmin Configuration
desc_es=Configuracin de Webmin
desc_sv=Webmin-instllningar
desc_fr=Configuration de Webmin
desc_ja_JP.euc=Webmin
desc_hu=Webmin belltsok
desc_ru_RU= Webmin
desc_ca=Configuraci de Webmin
depends=cron
desc_no=Webmin konfigurasjon
longdesc=Configure Webmin itself, such as allowed hosts, SSL, installed modules and themes.
desc_sk=Konfigurcia Webminu
desc_zh_TW.UTF-8=Webmin 組態
desc_zh_CN.UTF-8=Webmin 配置
desc_ja_JP.UTF-8=Webmin 設定
cpan=1
syslog=1
desc_ko_KR.UTF-8=Webmin 구성
desc_it=Configurazione di Webmin
desc_cz=Konfigurace Webminu
version=1.451
webmin/install_mod.cgi 0000775 0005671 0000012 00000007731 11140375505 015026 0 ustar jcameron wheel #!/usr/local/bin/perl
# install_mod.cgi
# Download and install a webmin module
require './webmin-lib.pl';
if ($ENV{REQUEST_METHOD} eq "POST") { &ReadParseMime(); }
else { &ReadParse(); $no_upload = 1; }
$| = 1;
$theme_no_table = 1 if ($in{'source'} == 2 || $in{'source'} == 4);
&ui_print_header(undef, $text{'install_title'}, "");
if ($in{'source'} == 0) {
# from local file
&error_setup(&text('install_err1', $in{'file'}));
$file = $in{'file'};
if (!(-r $file)) { &inst_error($text{'install_efile'}); }
}
elsif ($in{'source'} == 1) {
# from uploaded file
&error_setup($text{'install_err2'});
$need_unlink = 1;
if ($no_upload) {
&inst_error($text{'install_ebrowser'});
}
$file = &transname(&file_basename($in{'upload_filename'}));
open(MOD, ">$file");
binmode(MOD);
print MOD $in{'upload'};
close(MOD);
}
elsif ($in{'source'} == 2 || $in{'source'} == 4) {
# from ftp or http url (possible third-party)
$url = $in{'source'} == 2 ? $in{'url'} : $in{'third'};
&error_setup(&text('install_err3', $url));
$file = &transname(&file_basename($url));
$need_unlink = 1;
local $error;
$progress_callback_url = $url;
if ($url =~ /^(http|https):\/\/([^\/]+)(\/.*)$/) {
$ssl = $1 eq 'https';
$host = $2; $page = $3; $port = $ssl ? 443 : 80;
if ($host =~ /^(.*):(\d+)$/) { $host = $1; $port = $2; }
&http_download($host, $port, $page, $file, \$error,
\&progress_callback, $ssl);
}
elsif ($url =~ /^ftp:\/\/([^\/]+)(:21)?\/(.*)$/) {
$host = $1; $ffile = $3;
&ftp_download($host, $ffile, $file, \$error, \&progress_callback);
}
else { &inst_error($text{'install_eurl'}); }
&inst_error($error) if ($error);
}
elsif ($in{'source'} == 3) {
# from www.webmin.com
&error_setup($text{'install_err4'});
$in{'standard'} =~ /^\S+$/ || &error($text{'install_estandard'});
$need_unlink = 1;
local $error;
# Find the URL of the package
$mods = &list_standard_modules();
ref($mods) || &error(&text('standard_failed', $error));
local ($info) = grep { $_->[0] eq $in{'standard'} } @$mods;
$info || &error($text{'install_emissing'});
if ($config{'standard_url'}) {
($host, $port, $page, $ssl) = &parse_http_url(
$config{'standard_url'});
$host || &error($text{'standard_eurl'});
}
else {
($host, $port, $page, $ssl) = ($standard_host, $standard_port,
$standard_page, $standard_ssl);
}
($host, $port, $page, $ssl) = &parse_http_url(
$info->[2], $host, $port, $page, $ssl);
$progress_callback_url = $info->[2];
$file = &transname($info->[2]);
&http_download($host, $port, $page, $file, \$error,
\&progress_callback, $ssl);
&inst_error($error) if ($error);
}
# Install the module(s)
$rv = &install_webmin_module($file, $need_unlink, $in{'nodeps'},
$in{'grant'} ? undef : [ split(/\s+/, $in{'grantto'}) ]);
if (ref($rv)) {
@mdescs = @{$rv->[0]};
@mdirs = @{$rv->[1]};
@msizes = @{$rv->[2]};
}
else {
&inst_error($rv);
}
# Display something nice for the user
&read_file("$config_directory/webmin.catnames", \%catnames);
print "$text{'install_desc'} \n";
print " \n";
if (defined(&theme_post_change_modules)) {
&theme_post_change_modules();
}
&ui_print_footer("edit_mods.cgi?mode=install", $text{'mods_return'},
"", $text{'index_return'});
sub inst_error
{
print "$main::whatfailed : $_[0] \n";
&ui_print_footer("", $text{'index_return'});
exit;
}
webmin/config.info.ko_KR.UTF-8 0000664 0005671 0000012 00000000422 11140375505 015750 0 ustar jcameron wheel osdn=Webmin OSDN 미러 사이트의 리스트 받기?,1,1-Yes,0-No
standard_url=표준 모듈 리스트 URL,3,www.webmin.com
third_url=third party 모듈 리스트 URL,3,www.webmin.com
cron_mode=업데이트 시간 보기,1,0-간단한 인터페이스,1-Cron 시간 선택
webmin/edit_session.cgi 0000775 0005671 0000012 00000011502 11140375505 015200 0 ustar jcameron wheel #!/usr/local/bin/perl
# edit_session.cgi
# Edit session login options
require './webmin-lib.pl';
print "Set-Cookie: sessiontest=1; path=/\n";
ui_print_header(undef, $text{'session_title'}, "");
get_miniserv_config(\%miniserv);
print "$text{'session_desc1'} \n";
print "$text{'session_desc2'} \n";
print ui_form_start("change_session.cgi", "post");
print ui_table_start($text{'session_header'});
print " \n";
printf " %s \n";
printf " %s \n";
printf " %s \n";
print "$text{'session_pmodedesc3'} \n" : " \n";
# Password encryption format
printf " %s \n";
}
else {
print &text('savekey_done', "$miniserv{'keyfile'}")," \n";
}
&ui_print_footer("", $text{'index_return'});
&webmin_log("savekey");
&restart_miniserv(1);
webmin/images/ 0000775 0005671 0000012 00000000000 11140375506 013270 5 ustar jcameron wheel webmin/images/themes.gif 0000664 0005671 0000012 00000003632 11140375505 015247 0 ustar jcameron wheel GIF89a0 0 Frv*ξR.N~V**22&>Bnn.NN2檦>>>BB~~&&6>fjҶbRFFzNNN~~~VVVVVjnjF:jVZZ^j¾j666z^^^NN溺^^v^v
^b^nrnrjf
:^^Ɔr"66ffjjj...~z>B>⾾vzv66RRfjfΪʦFjj֊ƾJJNvvv26*FF>>ֲ
nfff֚ʦVNN>:>:6rr::ޮ
~z~NbfbnZnnnFvz..vnjfZV>jjJJ:::Ʋrrv
ZZ.zvv~֦FB
!Made with GIMP ! , 0 0 H*\ȰÇDŋ
|ĤǏ C40IzT0b$S73tЈΟ@J(3N&c$m: IL0PB.QF@41)X&E?\ʼnӊ$iB5lbdS.\@Z!sdE&'r}!Hp+Fl#D)xBt`/ A5Nx';!u{I[p5k$4O~<D~oT{k4 S2v
L6@% {1R,yL(`UL_`f:!>
|$* &;}&^wHp=[u$YJ6d%-ߐC7"} "MVB#N* 02^M~l!)xy`Mn駚YQp-"* {&";
if ($in{'force'}) {
&proc::safe_process_exec(
"rpm -U --force $qfile", 0, 0,
STDOUT, undef, 1, 1);
}
else {
&proc::safe_process_exec(
"rpm -U --ignoreos --ignorearch $qfile", 0, 0,
STDOUT, undef, 1, 1);
}
unlink($file) if ($need_unlink);
print "\n";
}
elsif ($in{'mode'} eq 'deb') {
# Check if it is a Debian package
$debname = "webmin";
if (open(RPM, "$root_directory/deb-name")) {
chop($debname = ";
&proc::safe_process_exec("dpkg --install $qfile", 0, 0,
STDOUT, undef, 1, 1);
unlink($file) if ($need_unlink);
print "\n";
}
elsif ($in{'mode'} eq 'solaris-pkg' || $in{'mode'} eq 'sun-pkg') {
# Check if it is a solaris package
&foreign_require("software", "software-lib.pl");
&foreign_call("software", "is_package", $file) ||
&inst_error($text{'upgrade_epackage'});
local @p = &foreign_call("software", "file_packages", $file);
#
# The package name will always include "webmin" in lower case,
# but may be preceeded by the source package source ("WS" for the
# Webmin.com package, "SUNW" for the Sun distributed package).
# and it could have trailing characters to define a set of items
# that are installed separately ("r" for the Sun "root" package,
# "u" for the Sun "usr" package.
#
# So the problem is how to match the requested package to the
# currently installed package.
#
foreach $p (@p) {
# Hardcode till I can get a better thought for doing this
# via a config (or other) file..
($pkg, $description) = split(/ /, $p);
if ($pkg =~ /^(SUNWwebminu|WSwebmin)$/) {
break;
}
else {
$pkg ='';
}
}
# Fallthrough error
if ($pkg eq '' ) {
&inst_error($text{'upgrade_ewpackage'});
}
# Install the package
print "
";
$ENV{'KEEP_ETC_WEBMIN'} = 1;
# Need to do this inline, otherwise the child process won't install the
# package. It would be interesting, however, if this were embedded in
# a remote script that could be nohup'd and it would restart the server.
chdir("/");
&proc::safe_process_exec_logged(
"$config_directory/stop", 0, 0, STDOUT, undef, 1,1);
$software::in{'root'} = '/';
$software::in{'adminfile'} = '$module_root_directory/adminupgrade';
$rv = &foreign_call("software", "install_package", $file, $pkg);
unlink($file) if ($need_unlink);
$ENV{'config_dir'} = $config_directory;
$ENV{'webmin_upgrade'} = 1;
$ENV{'autothird'} = 1;
$ENV{'tempdir'} = $gconfig{'tempdir'};
print "";
# We now need to figure out the installed directory for
# this package. The best way is to find the basename
# for the miniserv.pl file associated with this package
# or, in grep context:
# grep "miniserv.pl.*$pkg"
# and the first element includes the pathname.
#
$targ = `grep "miniserv.pl.*$pkg" /var/sadm/install/contents`;
if ($targ =~ /^(.*)\/miniserv.pl.*$/) {
$dir = $1;
}
$setup = $in{'dir'} ? "./setup.sh '$in{'dir'}'" : "./setup.sh";
print "Package Directory: $dir\n";
}
elsif ($in{'mode'} eq 'caldera') {
# Check if it is a Caldera RPM of Webmin
$out = `rpm -qp $file`;
$out =~ /^webmin-(\d+\.\d+)/ ||
&inst_error($text{'upgrade_erpm'});
if ($1 <= &get_webmin_version() && !$in{'force'}) {
&inst_error(&text('upgrade_eversion', "$1"));
}
local $wfound = 0;
open(OUT, "rpm -qpl $file |");
while(
";
print "cd $dir && ./setup.sh
";
&proc::safe_process_exec(
"cd $dir && ./setup.sh", 0, 0, STDOUT, undef, 1, 1);
&proc::safe_process_exec_logged(
"$config_directory/start", 0, 0, STDOUT, undef, 1,1);
print "";
&proc::safe_process_exec("rpm -U --ignoreos --ignorearch '$file'", 0, 0,
STDOUT, undef, 1, 1);
unlink($file) if ($need_unlink);
print "\n";
}
elsif ($in{'mode'} eq 'gentoo') {
# Check if it is a gentoo .tar.gz or .ebuild file of webmin
open(EMERGE, "emerge --pretend '$file' 2>/dev/null |");
while(";
&proc::safe_process_exec("emerge '$file'", 0, 0, STDOUT, undef, 1, 1);
unlink($file) if ($need_unlink);
print "\n";
}
else {
# Check if it is a webmin tarfile
open(TAR, "tar tf $file 2>&1 |");
while(";
$setup = $in{'dir'} ? "./setup.sh '$in{'dir'}'" : "./setup.sh";
&proc::safe_process_exec(
"cd $extract/webmin-$version && $setup", 0, 0,
STDOUT, undef, 1, 1);
print "\n";
if (!$?) {
if ($in{'delete'}) {
# Can delete the old root directory
system("rm -rf \"$root_directory\"");
}
elsif ($in{'dir'}) {
# Can delete the temporary source directory
system("rm -rf \"$extract\"");
}
}
}
&webmin_log("upgrade", undef, undef, { 'version' => $version,
'mode' => $in{'mode'} });
if ($in{'disc'}) {
# Forcibly disconnect all other login sessions
&foreign_require("acl", "acl-lib.pl");
&get_miniserv_config(\%miniserv);
&acl::open_session_db(\%miniserv);
foreach $s (keys %acl::sessiondb) {
if ($s ne $main::session_id) {
delete($acl::sessiondb{$s});
}
}
dbmclose(%acl::sessiondb);
&restart_miniserv(1);
}
# Find out about any updates for this new version.
($updates) = &fetch_updates($update_url);
$updates = &filter_updates($updates, $version);
if (scalar(@$updates)) {
print "
",&text('upgrade_updates', scalar(@$updates),
"update.cgi?source=0&show=0&missing=0"),"
\n".
&ui_select("mods", \@mods,
[ map { [ $_->{'dir'}, $_->{'desc'} ] }
sort { lc($a->{'desc'}) cmp lc($b->{'desc'}) }
&get_all_module_infos() ],
10, 1));
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ],
[ "clear", $text{'proxy_clear'} ] ]);
@cached = &list_cached_files();
if (@cached) {
# Show cache management and clearing buttons
print &ui_hr();
print &ui_buttons_start();
print &ui_buttons_row("cache.cgi", $text{'proxy_cacheb'},
$text{'proxy_cachebdesc'});
$sz = &nice_size(&disk_usage_kb($main::http_cache_directory)*1024);
print &ui_buttons_row("clear_cache.cgi", $text{'proxy_clear'},
&text('proxy_cleardesc', scalar(@cached), $sz));
print &ui_buttons_end();
}
print &ui_tabs_end_tab();
print &ui_tabs_end(1);
&ui_print_footer("", $text{'index_return'});
webmin/edit_upgrade.cgi 0000775 0005671 0000012 00000016517 11140375505 015157 0 ustar jcameron wheel #!/usr/local/bin/perl
# edit_upgrade.cgi
# Display a form for upgrading all of webmin from a tarfile
require './webmin-lib.pl';
do './gnupg-lib.pl';
&ReadParse();
&ui_print_header(undef, $text{'upgrade_title'}, "");
if (&shared_root_directory()) {
&ui_print_endpage($text{'upgrade_eroot'});
}
# what kind of install was this?
$mode = &get_install_type();
# was the install to a target directory?
if (open(DIR, "$config_directory/install-dir")) {
chop($dir = \n";
print " $text{'upgrade_local'}\n";
print "\n";
print file_chooser_button("file", 0),"
\n";
print " $text{'upgrade_uploaded'}\n";
print "
\n";
print " $text{'upgrade_url'}\n";
print "
\n";
if ($mode eq 'caldera') {
print " $text{'upgrade_cup'}\n";
}
elsif ($mode eq "gentoo") {
print " $text{'upgrade_emerge'}\n";
}
elsif ($mode ne "sun-pkg") {
print " $text{'upgrade_ftp'}\n";
}
print "
\n";
}
if ((!$mode || $mode eq "rpm") && &foreign_check("proc")) {
# Checkbox to check signature
($ec, $emsg) = &gnupg_setup();
printf " %s
\n",
$ec ? "" : "checked", $text{'upgrade_sig'};
}
if (!$mode) {
# Checkbox to not install missing modules
printf " %s
\n",
-r "$root_directory/minimal-install" ? "checked" : "",
$text{'upgrade_only'};
}
printf " %s
\n",
$text{'upgrade_force'};
if ($main::session_id) {
# Checkbox to disconnect other sessions
printf " %s
\n",
$text{'upgrade_disc'};
}
print ui_table_end();
print "\n";
print "\n";
print ui_tabs_end_tab();
}
# Display new module grants form
print ui_tabs_start_tab("mode", "grants");
print "$text{'newmod_desc'}
\n",
$newmod ? "" : "checked", $text{'newmod_def'};
printf " %s\n",
$newmod ? "checked" : "", $text{'newmod_users'};
printf "
\n",
join(" ", @$newmod);
print ui_table_end();
print "\n";
print ui_tabs_end_tab();
# Display module update form
print ui_tabs_start_tab("mode", "update");
print "$text{'update_desc1'} \n";
printf " %s
\n",
$config{'upsource'} ? "" : "checked", $text{'update_webmin'};
printf " %s
\n",
$config{'upsource'} ? "checked" : "", $text{'update_other'};
print " " x 4;
print &ui_textarea("other", join("\n", split(/\t+/, $config{'upsource'})),
2, 50),"
\n";
printf " %s
\n",
$config{'upshow'} ? "checked" : "", $text{'update_show'};
printf " %s
\n",
$config{'upmissing'} ? "checked" : "", $text{'update_missing'};
printf " %s
\n",
$config{'upthird'} ? "checked" : "", $text{'update_third'};
print "\n";
print "
\n";
print ui_table_end();
print "\n";
print "\n";
print ui_tabs_end_tab();
# Display scheduled update form
print ui_tabs_start_tab("mode", "sched");
print "$text{'update_desc2'} \n";
print "$text{'update_user'} \n";
print "",&ui_textbox("upuser", $config{'upuser'}, 30)," \n";
print "$text{'update_pass'} \n";
print "",&ui_password("uppass", $config{'uppass'}, 30)," \n";
printf " %s
\n",
$config{'upsource'} ? "" : "checked", $text{'update_webmin'};
printf " %s
\n",
$config{'upsource'} ? "checked" : "", $text{'update_other'};
print " " x 4;
print &ui_textarea("other", join("\n", split(/\t+/, $config{'upsource'})),
2, 50),"
\n";
if ($config{'cron_mode'} == 0) {
$upmins = sprintf "%2.2d", $config{'upmins'};
print &text('update_sched2',
"",
"",
""),"
\n";
}
else {
&foreign_require("cron", "cron-lib.pl");
@jobs = &cron::list_cron_jobs();
$job = &find_cron_job(\@jobs);
$job ||= { 'mins' => 0,
'hours' => $config{'uphour'},
'days' => "*/$config{'updays'}",
'months' => '*',
'weekdays' => '*' };
print "\n";
&cron::show_times_input($job, 1);
print "
\n";
}
printf " %s
\n",
$config{'upshow'} ? 'checked' : '', $text{'update_show'};
printf " %s
\n",
$config{'upmissing'} ? 'checked' : '', $text{'update_missing'};
printf " %s
\n",
$config{'upthird'} ? "checked" : "", $text{'update_third'};
printf " %s
\n",
$config{'upquiet'} ? 'checked' : '', $text{'update_quiet'};
print "\n";
print "
\n";
print ui_table_end();
print "\n";
print "\n";
print ui_tabs_end_tab();
print &ui_tabs_end(1);
&ui_print_footer("", $text{'index_return'});
webmin/change_lock.cgi 0000775 0005671 0000012 00000001060 11140375505 014743 0 ustar jcameron wheel #!/usr/local/bin/perl
# Save file locking settings
require './webmin-lib.pl';
&ReadParse();
# Validate inputs
&error_setup($text{'lock_err'});
if ($in{'lockmode'} >= 2) {
@dirs = split(/\n+/, $in{'lockdirs'});
foreach $d (@dirs) {
$d =~ /^\// || &error(&text('lock_edir', $d));
}
@dirs || &error($text{'lock_edirs'});
}
# Write out config
&lock_file($config_file);
$gconfig{'lockmode'} = $in{'lockmode'};
$gconfig{'lockdirs'} = join("\t", @dirs);
&save_module_config(\%gconfig, "");
&unlock_file($config_file);
&webmin_log("lock");
&redirect("");
webmin/edit_access.cgi 0000775 0005671 0000012 00000002231 11140375505 014755 0 ustar jcameron wheel #!/usr/local/bin/perl
# edit_access.cgi
# Display IP access control form
require './webmin-lib.pl';
&ui_print_header(undef, $text{'access_title'}, "");
&get_miniserv_config(\%miniserv);
print $text{'access_desc'}," \n";
print "$text{'update_email'} \n";
print "",&ui_textbox("email", $config{'upemail'}, 30)," \n";
print "$text{'update_user'} \n";
print "",&ui_textbox("upuser", $config{'upuser'}, 30)," \n";
print "$text{'update_pass'} \n";
print "",&ui_password("uppass", $config{'uppass'}, 30),"
\n".
&ui_textarea("ip",
$access == 1 ? join("\n", split(/\s+/, $miniserv{"allow"})) :
$access == 2 ? join("\n", split(/\s+/, $miniserv{"deny"})) : "",
6, 30));
print &ui_table_row($text{'access_always'},
&ui_yesno_radio("alwaysresolve", int($miniserv{'alwaysresolve'})));
eval "use Authen::Libwrap qw(hosts_ctl STRING_UNKNOWN)";
if (!$@) {
print &ui_table_row($text{'access_libwrap'},
&ui_yesno_radio("libwrap", int($miniserv{'libwrap'})));
}
print &ui_table_end();
print &ui_form_end([ [ "save", $text{'save'} ] ]);
&ui_print_footer("", $text{'index_return'});
webmin/change_bind.cgi 0000775 0005671 0000012 00000005334 11140375505 014737 0 ustar jcameron wheel #!/usr/local/bin/perl
# change_bind.cgi
# Update the binding IP address and port for miniserv
require './webmin-lib.pl';
use Socket;
&ReadParse();
&get_miniserv_config(\%miniserv);
%oldminiserv = %miniserv;
&error_setup($text{'bind_err'});
# Validate inputs
for($i=0; defined($in{"ip_def_$i"}); $i++) {
next if (!$in{"ip_def_$i"});
if ($in{"ip_def_$i"} == 1) {
$ip = "*";
}
else {
$ip = $in{"ip_$i"};
&check_ipaddress($ip) || &error(&text('bind_eip2', $ip));
}
if ($in{"port_def_$i"} == 1) {
$port = $in{"port_$i"};
$port =~ /^\d+$/ && $port < 65536 ||
&error(&text('bind_eport2', $port));
}
else {
$port = "*";
}
push(@sockets, [ $ip, $port ]);
}
@sockets || &error($text{'bind_enone'});
$in{'listen_def'} || $in{'listen'} =~ /^\d+$/ || &error($text{'bind_elisten'});
$in{'hostname_def'} || $in{'hostname'} =~ /^[a-z0-9\.\-]+$/i ||
&error($text{'bind_ehostname'});
# Update config file
&lock_file($ENV{'MINISERV_CONFIG'});
$first = shift(@sockets);
$miniserv{'port'} = $first->[1];
if ($first->[0] eq "*") {
delete($miniserv{'bind'});
}
else {
$miniserv{'bind'} = $first->[0];
}
$miniserv{'sockets'} = join(" ", map { "$_->[0]:$_->[1]" } @sockets);
if ($in{'listen_def'}) {
delete($miniserv{'listen'});
}
else {
$miniserv{'listen'} = $in{'listen'};
}
if ($in{'hostname_def'}) {
delete($miniserv{'host'});
}
else {
$miniserv{'host'} = $in{'hostname'};
}
$miniserv{'no_resolv_myname'} = $in{'no_resolv_myname'};
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});
# Attempt to re-start miniserv
$SIG{'TERM'} = 'ignore';
&system_logged("$config_directory/stop >/dev/null 2>&1 $temp 2>&1 /dev/null 2>&1 \n";
print "top.location = '$url';\n";
print "\n";
&ui_print_footer("", $text{'index_return'});
}
else {
$url .= ":$miniserv{'port'}/webmin/";
&redirect($url);
}
webmin/jcameron-key.asc 0000664 0005671 0000012 00000002450 11140375505 015077 0 ustar jcameron wheel -----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.7 (GNU/Linux)
mQGiBDx9wR0RBACR3xGPTkG5Staj7EVeiVJDrYXIPF28MGCrOEGw04tQmQTALz0E
YEcyfvui7KScrpHmZpy70PwgwxUDPUMik7vvRiUa9RRbJsDYyom06NGk+Z4dURhn
DeNRhcBrNBfyMvUY7HSJ2JP9jhQDWb8Lo1i231tvlnY0tNudVsP484ax6wCgrBwW
myad6TLYaETj0+AxGJxYgikD/iERqNF60x+WyfEH/SIOuKGlV/QoxmqOePn2gj9V
DWiOOAZ9DDWD6DpRNK/UVZRD1MK37HU1ePv7i92DTL9yIbyJwFcZNkEyMU3t+GBj
zf4YvaQnvtA09EdQNsC1GXxNXqYkVmTE1dHH83UK+chaXRoDQ6O9KD9SFE2vsj1d
z9VPBACPgmuVcUKXag6ZBY+SBColQzwyZfXtTOCnBh0HP4HOjU4G6CRTcAgLQrdM
1Uu29Al7TaE2p8HZb37dVoTRntM+Nf5O+2dX5iHA6ncdozKGftuXQMC7z9758nUi
2E4Svo9hmroM+NKonpZByt6TilhDXrPIcNYHlNsxpTAxq+lnw7QjSmFtaWUgQ2Ft
ZXJvbiA8amNhbWVyb25Ad2VibWluLmNvbT6IVwQTEQIAFwUCPH3BHQULBwoDBAMV
AwIDFgIBAheAAAoJENl6OukR9jxRQZEAoIHxngo/LxLBeFF9cpEViVGgChRIAJ90
zwqcBfw02su5AavnXjv6HxXF8bkBDQQ8fcEqEAQAx88aO9zI912/tbsNjLhDXpq0
WMw5F6fUUlwYpkaspPwWZ3UgDJaR1+oL3xnJKlD1Eu5x9B3r+rxYyoFpXubWz4R6
sL1u4kMRb347+fv140dE/RGFNEmqefZDeysz1TQG1Sskyyf7sV2KRUmI8wJTwg3n
IOtbyOoE3XlxI5FUrW8AAwUD/iEBdIH5DYB/FnOb/EkP3G3kCXGgTdZk7UA9HPKB
dV7JckgSicpi/mX898LxQrr0jyb6nyi2900OgQUQArrviTnp37j4ciQj214gTHzf
ssA40O5QR4t915z6wS4Ml+fAc5ZOeL6EQxiP+x+rz6h9+Mc8rawowY+7sBnvVw5O
YoVXiEYEGBECAAYFAjx9wSoACgkQ2Xo66RH2PFH+ZgCggAyuOLaoE9t9tyJbifEz
/YzvqYwAnj85Ehe8EmnKuor/k/TPtKl4MzDm
=oxvD
-----END PGP PUBLIC KEY BLOCK-----
webmin/save_newmod.cgi 0000775 0005671 0000012 00000000434 11140375505 015021 0 ustar jcameron wheel #!/usr/local/bin/perl
# save_newmod.cgi
# Save the new module user settings
require './webmin-lib.pl';
&ReadParse();
if ($in{'newmod_def'}) {
&save_newmodule_users(undef);
}
else {
&save_newmodule_users([ split(/\s+/, $in{'newmod'}) ]);
}
&webmin_log("newmod");
&redirect("");
webmin/update.cgi 0000775 0005671 0000012 00000004730 11140375505 013777 0 ustar jcameron wheel #!/usr/local/bin/perl
# update.cgi
# Find and install modules that need updating
require './webmin-lib.pl';
&ReadParse();
&error_setup($text{'update_err'});
# Display the results and maybe take action
$| = 1;
$theme_no_table = 1;
&ui_print_header(undef, $text{'update_title'}, "");
print "",&text('update_info'),"
\n";
print " " x 10;
print "$text{'update_fixes'} : " if ($info{'longdesc'});
print $u->[4],"
\n";
print " " x 10;
print "$text{'update_fixes'} : " if ($info{'longdesc'});
print $u->[4],"
\n";
($mhost, $mport, $mpage, $mssl) =
&parse_http_url($u->[2], $host, $port, $page, $ssl);
($mfile = $mpage) =~ s/^(.*)\///;
$mtemp = &transname($mfile);
$progress_callback_url = $u->[2];
$progress_callback_prefix = " " x 10;
&http_download($mhost, $mport, $mpage, $mtemp, undef,
\&progress_callback, $mssl,
$in{'upuser'}, $in{'uppass'});
$irv = &install_webmin_module($mtemp, 1, 0,
[ $base_remote_user ]);
print " " x 10;
if (!ref($irv)) {
print &text('update_failed', $irv),"
\n" if (!$count);
# Check if a new version of webmin itself is available
$version = &get_latest_webmin_version();
if ($version > &get_webmin_version()) {
print "",&text('update_version', $version),"\n";
for($i=0; $i<@mdescs; $i++) {
$mdirs[$i] =~ /\/([^\/]+)$/;
if (%minfo = &get_module_info($1)) {
# Installed a module
local $cat = $catnames{$minfo{'category'}};
$cat = $text{"category_".$minfo{'category'}} if (!$cat);
$cat = $text{"category_"} if (!$cat);
print &text($minfo{'hidden'} ? 'install_line3' :
'install_line2', "$mdescs[$i]",
"$mdirs[$i]", $msizes[$i], $cat,
"../$minfo{'dir'}/"),
"
\n";
}
elsif (%tinfo = &get_theme_info($1)) {
# Installed a theme
print &text('themes_line', "$mdescs[$i]",
"$mdirs[$i]", $msizes[$i]),
"
\n";
}
}
print " \n";
# Bad password delay
printf " %s
\n",
$miniserv{'passdelay'} ? '' : 'checked', $text{'session_pdisable'};
printf " %s
\n",
$miniserv{'passdelay'} ? 'checked' : '', $text{'session_penable'};
# Block bad hosts
printf " \n",
$miniserv{'blockhost_failures'} ? "checked" : "";
print text('session_blockhost',
ui_textbox("blockhost_failures", $miniserv{'blockhost_failures'}, 4),
ui_textbox("blockhost_time", $miniserv{'blockhost_time'}, 4)),"
\n";
# Block bad users
printf " \n",
$miniserv{'blockuser_failures'} ? "checked" : "";
print text('session_blockuser',
ui_textbox("blockuser_failures", $miniserv{'blockuser_failures'}, 4),
ui_textbox("blockuser_time", $miniserv{'blockuser_time'}, 4)),"
\n";
# Lock bad users
print " \n",
ui_checkbox("blocklock", 1, $text{'session_blocklock'},
$miniserv{'blocklock'}),"
\n";
# Log to syslog
eval "use Sys::Syslog qw(:DEFAULT setlogsock)";
if (!$@) {
print ui_checkbox('syslog', 1, $text{'session_syslog2'},
$miniserv{'syslog'});
}
else {
print ui_hidden('syslog', $miniserv{'syslog'});
}
print "
\n",
!$miniserv{'session'} ? "checked" : "", $text{'session_disable'};
printf " %s
\n",
$miniserv{'session'} ? "checked" : "", $text{'session_enable'};
printf " \n",
$miniserv{'logouttime'} ? "checked" : "";
print text('session_logout',
""),"
\n";
#printf " \n",
# $gconfig{'locking'} ? "checked" : "";
#print "$text{'session_locking'}
\n";
print ' ', ui_checkbox('remember', 1, $text{'session_remember'},
!$gconfig{'noremember'}), "
\n";
print ' ', ui_checkbox('realname', 1,
$text{'session_realname'}, $gconfig{'realname'}), "
\n";
print ' ', ui_checkbox('utmp', 1, $text{'session_utmp'},
$miniserv{'utmp'}), "
\n";
printf " %s\n",
$gconfig{'loginbanner'} ? "" : "checked", $text{'session_banner1'};
printf " %s\n",
$gconfig{'loginbanner'} ? "checked" : "", $text{'session_banner0'};
printf " %s
\n",
$gconfig{'loginbanner'}, &file_chooser_button("banner");
print "
\n",
!$miniserv{'localauth'} ? "checked" : "", $text{'session_localoff'};
printf " %s
\n",
$miniserv{'localauth'} ? "checked" : "", $text{'session_localon'};
print "
\n",
!$miniserv{'no_pam'} ? "checked" : "", $text{'session_pamon'};
printf " %s
\n",
$miniserv{'no_pam'} ? "checked" : "", $text{'session_pamoff'};
print " ",&text('session_pfile',
"",
"",
""),
"
\n";
print " ",
ui_checkbox("pam_conv", 1, $text{'session_pamconv'},
$miniserv{'pam_conv'}),"
\n";
foreach $m (0 .. 2) {
printf " %s\n",
$m, $miniserv{'passwd_mode'} == $m ? "checked" : "",
$text{'session_pmode'.$m};
print $m == 2 ? "
\n";
}
# Squid-style authentication program
print "$text{'session_extauth'} ",
"
\n",
!$gconfig{'md5pass'} ? "checked" : "", $text{'session_md5off'};
printf " %s
\n",
$gconfig{'md5pass'} ? "checked" : "", $text{'session_md5on'};
print ui_table_end();
print ui_form_end([ [ "save", $text{'save'} ] ]);
ui_print_footer("", $text{'index_return'});
webmin/savekey.cgi 0000775 0005671 0000012 00000003343 11140375505 014163 0 ustar jcameron wheel #!/usr/local/bin/perl
# Replace the existing Webmin SSL key
require './webmin-lib.pl';
&ReadParseMime();
&error_setup($text{'savekey_err'});
# Validate inputs
$key = $in{'key'} || $in{'keyfile'};
$key =~ s/\r//g;
$key =~ /BEGIN RSA PRIVATE KEY/ &&
$key =~ /END RSA PRIVATE KEY/ || &error($text{'savekey_ekey'});
if (!$in{'cert_def'}) {
# Make sure cert is valid
$cert = $in{'cert'} || $in{'certfile'};
$cert =~ s/\r//g;
$cert =~ /BEGIN CERTIFICATE/ &&
$cert =~ /END CERTIFICATE/ || &error($text{'savekey_ecert'});
}
else {
# Make sure key contains cert
$key =~ /BEGIN CERTIFICATE/ &&
$key =~ /END CERTIFICATE/ || &error($text{'savekey_ecert2'});
}
# Save config and key file
&lock_file($ENV{'MINISERV_CONFIG'});
&get_miniserv_config(\%miniserv);
$miniserv{'keyfile'} ||= "$config_directory/miniserv.pem";
&lock_file($miniserv{'keyfile'});
&open_tempfile(KEY, ">$miniserv{'keyfile'}");
&print_tempfile(KEY, $key);
&close_tempfile(KEY);
&unlock_file($miniserv{'keyfile'});
if ($in{'cert_def'}) {
delete($miniserv{'certfile'});
}
else {
$miniserv{'certfile'} ||= "$config_directory/miniserv.cert";
&lock_file($miniserv{'certfile'});
&open_tempfile(CERT, ">$miniserv{'certfile'}");
&print_tempfile(CERT, $cert);
&close_tempfile(CERT);
&unlock_file($miniserv{'certfile'});
}
&put_miniserv_config(\%miniserv);
&unlock_file($ENV{'MINISERV_CONFIG'});
# Tell the user
&ui_print_header(undef, $text{'savekey_title'}, "");
if ($miniserv{'certfile'}) {
print &text('savekey_done2', "$miniserv{'keyfile'}",
"$miniserv{'certfile'}"),"