mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 16:50:24 +00:00
Added detection for vservers
This commit is contained in:
@@ -24,3 +24,4 @@ depends=mount 1.276
|
||||
version=1.276
|
||||
desc_ru_RU=Êàòàëîãè NFS
|
||||
desc_ca=Exportacions NFS
|
||||
novserver=1
|
||||
|
||||
@@ -23,3 +23,4 @@ desc_zh_TW.UTF-8=本機磁碟分割區
|
||||
desc_zh_CN.UTF-8=本地ç£<C3A7>盘分区
|
||||
desc_ja_JP.UTF-8=ãƒãƒ¼ã‚«ãƒ« ディスクã<C2AF>®ãƒ‘ーティション
|
||||
desc_ko_KR.UTF-8=ì§€ì— ë””ìŠ¤í<C2A4>¬ 파티션
|
||||
novserver=1
|
||||
|
||||
@@ -27,3 +27,4 @@ desc_zh_TW.UTF-8=磁碟與網路檔案系統
|
||||
desc_zh_CN.UTF-8=ç£<C3A7>盘和网络文件系统
|
||||
desc_ja_JP.UTF-8=ディスクã<C2AF>Šã‚ˆã<CB86>³ãƒ<C3A3>ットワーク・ファイルシステãƒ
|
||||
desc_ko_KR.UTF-8=디스í<C2A4>¬ ë°<C3AB> 네트워í<C592>¬ 파ì<C592>¼ì‹œìŠ¤í…œ
|
||||
novserver=1
|
||||
|
||||
@@ -6,10 +6,11 @@ require './net-lib.pl';
|
||||
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
|
||||
&help_search_link("ifconfig hosts resolve.conf nsswitch.conf", "man"));
|
||||
|
||||
$zone = &running_in_zone() || &running_in_vserver();
|
||||
foreach $i ('ifcs', 'routes', 'dns', 'hosts',
|
||||
($config{'ipnodes_file'} ? ('ipnodes') : ( ))) {
|
||||
next if (!$access{$i});
|
||||
next if ($i eq "ifcs" && &running_in_zone());
|
||||
next if ($i eq "ifcs" && $zone);
|
||||
|
||||
push(@links, "list_${i}.cgi");
|
||||
push(@titles, $text{"${i}_title"});
|
||||
@@ -17,7 +18,7 @@ foreach $i ('ifcs', 'routes', 'dns', 'hosts',
|
||||
}
|
||||
&icons_table(\@links, \@titles, \@icons, @icons > 4 ? scalar(@icons) : 4);
|
||||
|
||||
if (defined(&apply_network) && $access{'apply'} && !&running_in_zone()) {
|
||||
if (defined(&apply_network) && $access{'apply'} && !$zone) {
|
||||
# Allow the user to apply the network config
|
||||
print "<hr>\n";
|
||||
print "<form action=apply.cgi>\n";
|
||||
|
||||
@@ -27,3 +27,4 @@ desc_zh_TW.UTF-8=系統時間
|
||||
desc_zh_CN.UTF-8=系统时间
|
||||
desc_ja_JP.UTF-8=システム時間
|
||||
desc_ko_KR.UTF-8=시스템 시간
|
||||
novserver=1
|
||||
|
||||
@@ -1319,6 +1319,10 @@ if ($_[0]->{'nozone'} && &running_in_zone()) {
|
||||
# Not supported in a Solaris Zone
|
||||
return 0;
|
||||
}
|
||||
if ($_[0]->{'novserver'} && &running_in_vserver()) {
|
||||
# Not supported in a Linux vserver
|
||||
return 0;
|
||||
}
|
||||
return 1 if (!$oss || $oss eq '*');
|
||||
local $osver = $_[2] || $gconfig{'os_version'};
|
||||
local $ostype = $_[1] || $gconfig{'os_type'};
|
||||
@@ -5937,6 +5941,25 @@ chop($zn);
|
||||
return $zn && $zn ne "global";
|
||||
}
|
||||
|
||||
# running_in_vserver()
|
||||
# Returns 1 if the current Webmin instance is running in a Linux VServer.
|
||||
# Used to disable modules and features that are not appropriate
|
||||
sub running_in_vserver
|
||||
{
|
||||
return 0 if ($gconfig{'os_type'} !~ /^\*-linux$/);
|
||||
local $vserver;
|
||||
open(MTAB, "/etc/mtab");
|
||||
while(<MTAB>) {
|
||||
local ($dev, $mp) = split(/\s+/, $_);
|
||||
if ($mp eq "/" && $dev =~ /^\/dev\/hdv/) {
|
||||
$vserver = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
close(MTAB);
|
||||
return $vserver;
|
||||
}
|
||||
|
||||
# list_categories(&modules)
|
||||
# Returns a hash mapping category codes to names
|
||||
sub list_categories
|
||||
|
||||
Reference in New Issue
Block a user