Compare commits

..

2 Commits

Author SHA1 Message Date
Ilia Ross
7231eedf20 Fix param name 2024-06-21 20:11:32 +03:00
Ilia Ross
d69609f49a Fix to consider unsafe params in index page referer check 2024-06-21 20:05:04 +03:00
129 changed files with 342 additions and 1175 deletions

View File

@@ -7,13 +7,13 @@ on:
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: contains(github.event.head_commit.message, '[build]')
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: git tar gzip openssl curl openssh-client rpm perl libjson-pp-perl libdigest-sha-perl liblist-moreutils-perl libencode-detect-perl zstd
packages: git tar gzip openssl curl openssh-client rpm perl libjson-pp-perl libdigest-sha-perl liblist-moreutils-perl libencode-detect-perl
version: 1.0
- uses: szenius/set-timezone@v1.2
with:

View File

@@ -1,43 +1,5 @@
## Changelog
#### 2.202 (August 12, 2024)
* Add support for importing schemas to the LDAP Server module
* Add support for displaying disk and network I/Os in FreeBSD on the dashboard
* Fix to automatically set the WebSocket URL webprefix correctly
* Fix to name downloaded backup file nicely in Backup Configuration Files module [#2239](https://github.com/webmin/webmin/issues/2239)
* Fix to optimize getting table index stats for large tables in MySQL/MariaDB module [pull#2234](https://github.com/webmin/webmin/pull/2234)
* Fix duplication of _systemd_ actions and init scripts [#2227](https://github.com/webmin/webmin/issues/2227)
* Fix BIND service name for Debian 12 and Ubuntu 24.04
* Update the Authentic theme to the latest version with various fixes and improvements
#### 2.201 (July 24, 2024)
* Fix real-time monitoring not updating graphs in the Dashboard [#2222](https://github.com/webmin/webmin/issues/2222)
* Fix Terminal module to work correctly with _sudo_-capable users [#2223](https://github.com/webmin/webmin/issues/2223)
#### 2.200 (July 21, 2024)
* Add support for blocking a given IP temporarily or permanently in the FirewallD module
* Add support for parsing iCalendar event files in the Mailbox module
* Add support for tailing logs in real time in System Logs module
* Add ability to preserve original file ACLs when writing files [webmin/authentic-theme#1511](https://github.com/webmin/authentic-theme/discussions/1511#discussioncomment-9913902)
* Add a `patch` sub-command to the `webmin` command for easy application of patches
* Add a config option to display hostname and comment in the DHCP Server module [#2221](https://github.com/webmin/webmin/issues/2221)
* Add support for ED25519 and ED448 algorithms in BIND DNS module for DNSSEC
* Add support for larger ranger of authentication methods in Dovecot module
* Add improved support for displaying last logins in the Users and Groups module
* Fix to prevent duplicate `also-notify` and `allow-transfer` IPs in the BIND DNS module
* Fix issues with Terminal module to correct text display problems in editor mode
* Fix to store Terminal module logs in the `/var/webmin` directory
* Fix to display the Spam folder nicely in the Mailbox module
* Fix how modules are loaded in ProFTPd module
* Fix support for the Chrony service on Debian systems in the System Time module
* Fix to use static routes to set the default gateway in Network Configuration module
* Fix to correctly invalidate EOL cache on re-checks [#2139](https://github.com/webmin/webmin/issues/2139)
* Fix to change default monitor name based on database used MariaDB vs MySQL [#2139](https://github.com/virtualmin/virtualmin-gpl/issues/798)
* Fix to disable manual upgrades for systems installed from the repository
* Fix to preserve Webmin service state during package upgrades [#2133](https://github.com/webmin/webmin/issues/2133)
* Change to enforce _sudo_-capable logins as themselves in the Terminal module [docs/modules/terminal](https://webmin.com/docs/modules/terminal/#about)
* Rename "System Logs" module to "System Logs RS" and "System Logs Viewer" to "System Logs" for clarity
#### 2.111 (April 16, 2024)
* Fix EOL detection for unreleased Linux distributions

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,6 @@
use strict;
use warnings;
use POSIX qw(strftime);
no warnings 'redefine';
no warnings 'uninitialized';
require './backup-config-lib.pl';
@@ -60,12 +59,7 @@ print &ui_tabs_end_tab();
# Show immediate form
print &ui_tabs_start_tab("tab", "backup");
my $filename = 'webmin-backup-config-on-';
my $hostname = &get_system_hostname();
$hostname =~ s/\./-/g;
$filename .= $hostname;
$filename .= "-".strftime("%Y-%m-%d-%H-%M", localtime);
print &ui_form_start("backup.cgi/$filename.tgz", "post");
print &ui_form_start("backup.cgi/backup.tgz", "post");
print &ui_table_start($text{'index_header'}, undef, 2);
my @dmods = split(/\s+/, $config{'mods'} || "");

164
bin/patch
View File

@@ -1,164 +0,0 @@
#!/usr/bin/env perl
# patch - Apply a patch to Webmin core or its modules from GitHub or a local file
use strict;
use warnings;
use 5.010;
use Getopt::Long qw(:config permute pass_through);
use Pod::Usage;
use File::Basename;
use Cwd qw(cwd);
my %opt;
GetOptions(
'help|h' => \$opt{'help'},
'config|c=s' => \$opt{'config'},
);
pod2usage(0) if ($opt{'help'});
# Get Webmin path
my $path = cwd;
my $lib = "web-lib-funcs.pl";
if (!-r "$path/$lib") {
$path = dirname(dirname($0));
if (!-r "$path/$lib") {
$path = $path = Cwd::realpath('..');
}
}
# Init core
my $config_dir = $opt{'config'} || '/etc/webmin';
$ENV{'WEBMIN_CONFIG'} = $config_dir;
push(@INC, $path);
eval 'use WebminCore';
init_config();
# Check if curl is installed
if (!has_command('curl')) {
print "\"curl\" command is not installed\n";
exit 1;
}
# Check if git is installed
if (!has_command('patch')) {
if (!has_command('git')) {
print "Neither \"patch\" nor \"git\" commands are installed\n";
exit 1;
}
}
# Get patch URL or file
my $patch = $ARGV[0];
# Params check
if (!$patch) {
pod2usage(0);
exit 1;
}
# Patch check
if ($patch !~ /^https?:\/\//) {
if (!-r $patch) {
print "Patch file $patch doesn't exist\n";
exit 1;
}
}
elsif ($patch =~ /^https?:\/\/(github|gitlab)\.com/ &&
$patch !~ /\.patch$/ && $patch !~ /\.diff$/) {
$patch .= '.patch';
}
# Parse module name from URL
my $module = "";
if ($patch =~ m{https://(github|gitlab)\.com/[^/]+/([^/]+)/commit/[^/]+}) {
$module = $2;
$module = "" if ($2 eq 'webmin');
# Special handling for some modules
$module = $module =~ /^virtualmin-pro$/ ?
'virtual-server/pro' :
'virtual-server'
if $module =~ /^virtualmin-(gpl|pro)$/;
}
# Check if module exists
if (!-d "$path/$module") {
print "Module $module doesn't exist\n";
exit 1;
}
# Download command or cat patch file
my $cmd;
if ($patch =~ /^https?:\/\//) {
$cmd = "curl -s @{[quotemeta($patch)]}";
chdir "$path/$module";
}
else {
$cmd = "cat @{[quotemeta($patch)]}";
}
# Apply patch using Patch or Git command
my $output;
if (has_command('patch')) {
$output = `$cmd 2>&1 | patch -p1 --verbose 2>&1`;
if ($output !~ /succeeded/i) {
print "Patch failed: $output\n";
exit 1;
}
} else {
$output = `$cmd 2>&1 | git apply --reject --verbose --whitespace=fix 2>&1`;
if ($output !~ /applied patch.*?cleanly/i) {
print "Patch failed: $output\n";
exit 1;
}
}
print "Patch applied successfully to:\n";
print " $1\n" while $output =~ /^(?|Applied patch\s+(\S+)|patching file\s+(\S+))/mg;
system("$config_dir/restart");
=pod
=head1 NAME
patch
=head1 DESCRIPTION
Apply a patch to Webmin core or its modules from GitHub or a local file.
=head1 SYNOPSIS
webmin patch patch-url/file
=head1 OPTIONS
=over
=item --help, -h
Give this help list.
=item --config, -c
Specify the full path to the Webmin configuration directory. Defaults to
C</etc/webmin>
Examples of usage:
Apply a patch from a URL.
- webmin patch https://github.com/webmin/webmin/commit/e6a2bb15b0.patch
- webmin patch https://github.com/virtualmin/virtualmin-gpl/commit/f4433153d
Apply a patch from local file.
- cd /usr/libexec/webmin/virtual-server/pro &&
webmin patch /root/virtualmin-pro/patches/patch-1.patch
=back
=head1 LICENSE AND COPYRIGHT
Copyright 2024 Ilia Ross <ilia@virtualmin.com>

View File

@@ -17,6 +17,7 @@ $access{'defaults'} || &error($text{'trusted_ecannot'});
my $conf = &get_config();
my $options = &find("options", $conf);
my $mems = $options->{'members'};
my @dlv = &find("dnssec-lookaside", $mems);
my $tkeys = &find("trusted-keys", $conf);
$tkeys ||= { 'members' => [ ] };
@@ -37,6 +38,33 @@ if (&supports_dnssec_client() == 2) {
$text{'default'}, undef);
}
# Trusted DLVs (obsolete)
if (@dlv) {
my @dtable = ( );
my $i = 0;
foreach my $d (@dlv, { 'values' => [ '.' ] }) {
my $dlv = $d->{'values'}->[0];
$dlv = "" if ($dlv eq ".");
push(@dtable, [
&ui_opt_textbox("anchor_$i", $d->{'values'}->[2],
30, $text{'trusted_none'}),
&ui_opt_textbox("dlv_$i", $dlv, 20,
$text{'trusted_root'}) ]);
$i++;
}
print &ui_table_row($text{'trusted_dlvs'},
&ui_radio("dlv_auto",
@dlv == 0 ? 2 :
@dlv == 1 && $dlv[0]->{'values'}->[0] eq 'auto' ? 1 : 0,
[ [ 1, $text{'trusted_dlvs1'} ],
[ 2, $text{'trusted_dlvs2'} ],
[ 0, $text{'trusted_dlvs0'} ] ])."<br>\n".
&ui_columns_table([ $text{'trusted_anchor'},
$text{'trusted_dlv'} ],
undef,
\@dtable), 3);
}
# Trusted keys
if (@{$tkeys->{'members'}}) {
my @ktable = ( );

View File

@@ -1,50 +0,0 @@
soa_style=1
named_path=/usr/sbin/named
named_conf=/etc/bind/named.conf
show_list=1
records_order=0
max_zones=50
rev_def=0
support_aaaa=1
allow_comments=0
allow_wild=1
allow_long=0
master_ttl=1
whois_cmd=whois
short_names=0
updserial_def=0
updserial_on=1
updserial_man=1
ndc_cmd=ndc
forwardzonefilename_format=ZONE.hosts
reversezonefilename_format=ZONE.rev
rev_must=0
ipv6_mode=1
allow_underscore=1
by_view=0
confirm_zone=1
confirm_rec=0
no_chroot=0
relative_paths=0
rndc_cmd=rndc
pid_file=/var/run/named/named.pid
zones_file=/etc/bind/named.conf.local
master_dir=/var/lib/bind
slave_dir=/var/lib/bind
no_pid_chroot=0
soa_start=0
rndc_conf=/etc/bind/rndc.conf
rndcconf_cmd=rndc-confgen
largezones=0
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1
start_cmd=systemctl start named.service
stop_cmd=systemctl stop named.service
restart_cmd=systemctl reload named.service
dnssec_period=21

View File

@@ -1,50 +0,0 @@
soa_style=1
named_path=/usr/sbin/named
named_conf=/etc/bind/named.conf
show_list=1
records_order=0
max_zones=50
rev_def=0
support_aaaa=1
allow_comments=0
allow_wild=1
allow_long=0
master_ttl=1
whois_cmd=whois
short_names=0
updserial_def=0
updserial_on=1
updserial_man=1
ndc_cmd=ndc
forwardzonefilename_format=ZONE.hosts
reversezonefilename_format=ZONE.rev
rev_must=0
ipv6_mode=1
allow_underscore=1
by_view=0
confirm_zone=1
confirm_rec=0
no_chroot=0
relative_paths=0
rndc_cmd=rndc
pid_file=/var/run/named/named.pid
zones_file=/etc/bind/named.conf.local
master_dir=/var/lib/bind
slave_dir=/var/lib/bind
no_pid_chroot=0
soa_start=0
rndc_conf=/etc/bind/rndc.conf
rndcconf_cmd=rndc-confgen
largezones=0
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1
start_cmd=systemctl start bind9.service
stop_cmd=systemctl stop bind9.service
restart_cmd=systemctl reload bind9.service
dnssec_period=21

View File

@@ -1,50 +0,0 @@
soa_style=1
named_path=/usr/sbin/named
named_conf=/etc/bind/named.conf
show_list=1
records_order=0
max_zones=50
rev_def=0
support_aaaa=1
allow_comments=0
allow_wild=1
allow_long=0
master_ttl=1
whois_cmd=whois
short_names=0
updserial_def=0
updserial_on=1
updserial_man=1
ndc_cmd=ndc
forwardzonefilename_format=ZONE.hosts
reversezonefilename_format=ZONE.rev
rev_must=0
ipv6_mode=1
allow_underscore=1
by_view=0
confirm_zone=1
confirm_rec=0
no_chroot=0
relative_paths=0
rndc_cmd=rndc
pid_file=/var/run/named/named.pid
zones_file=/etc/bind/named.conf.local
master_dir=/var/lib/bind
slave_dir=/var/lib/bind
no_pid_chroot=0
soa_start=0
rndc_conf=/etc/bind/rndc.conf
rndcconf_cmd=rndc-confgen
largezones=0
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1
start_cmd=systemctl start named.service
stop_cmd=systemctl stop named.service
restart_cmd=systemctl reload named.service
dnssec_period=21

View File

@@ -68,28 +68,8 @@ if (@keyrecs) {
my $ds = &get_ds_record($zone);
if ($ds) {
print $text{'zonekey_ds'},"<br>\n";
# Split DS records in string into a list
my @ds = split(/\s(?=\S+\.\s+\d+\s+IN\s+DS\s+\d+\s+
\d+\s+\d+\s+[0-9A-Fa-f]{16,})/x, $ds);
print &ui_textarea("ds", join("\n", @ds), 2, 80, "off", 0,
print &ui_textarea("ds", join("\n".$desc, split(/$desc/, $ds)), 2, 80, "off", 0,
"readonly style='width:90%'"),"<br>\n";
print &ui_columns_start([
$text{'zonekey_ds_keytag'},
$text{'zonekey_ds_alg'},
$text{'zonekey_ds_type'},
$text{'zonekey_ds_digest'},
]);
foreach my $r (@ds) {
if ($r =~ /
\bDS\s+(?<key_tag>\d+)\s+(?<algorithm>\d+)\s+
(?<digest_type>\d+)\s+
(?<digest>[0-9A-Fa-f]+)\b/x) {
print &ui_columns_row([
$+{key_tag}, $+{algorithm},
$+{digest_type}, $+{digest}]);
}
}
print &ui_columns_end();
}
# Offer to disable

View File

@@ -68,7 +68,7 @@ my $chroot = &get_chroot() || "";
&restart_links().'<br>'.
&help_search_link("bind", "doc", "google"), undef, undef,
&text($chroot eq "/" || !$chroot ? 'index_version' : 'index_chroot',
&get_bind_version(), "<tt>$chroot</tt>"));
$bind_version, "<tt>$chroot</tt>"));
# If the named.conf file does not exist, offer to create it
if ($need_create) {

View File

@@ -1282,10 +1282,6 @@ zonekey_private=Private key details :
zonekey_privatefile=Private key file : $1
zonekey_algorithm=DNSSEC algorithm : $1
zonekey_ds=DS record for parent zone :
zonekey_ds_keytag=Key tag
zonekey_ds_alg=Algorithm
zonekey_ds_type=Digest type
zonekey_ds_digest=Digest string
zonekey_expandksk=Show public and private key-signing-key details ..
zonekey_expandzone=Show public and private zone-key details ..
zonekey_noprivate=However, Webmin could not find the private key associated with the zone, and so will not be able to re-sign it.

View File

@@ -24,6 +24,46 @@ if (&supports_dnssec_client() == 2) {
&save_choice("dnssec-validation", $options, 1);
}
# Save DLV zones
if (defined($in{'dlv_auto'})) {
my @dlvs = ( );
if ($in{'dlv_auto'} == 1) {
# Automatic mode
push(@dlvs, { 'name' => 'dnssec-lookaside',
'values' => [ 'auto' ] });
}
elsif ($in{'dlv_auto'} == 0) {
# Listed zones
my $dlv;
for(my $i=0; defined($in{"anchor_$i"}); $i++) {
if (!$in{"anchor_${i}_def"}) {
$in{"anchor_$i"} =~ /^[a-z0-9\.\-\_]+$/ ||
&error(&text('trusted_eanchor', $i+1));
$in{"anchor_$i"} .= "."
if ($in{"anchor_$i"} !~ /\.$/);
if ($in{"dlv_${i}_def"}) {
$dlv = ".";
}
else {
$in{"dlv_$i"} =~ /^[a-z0-9\.\-\_]+$/ ||
&error(&text('trusted_edlv', $i+1));
$dlv = $in{"dlv_$i"};
$dlv .= "." if ($dlv !~ /\.$/);
}
push(@dlvs, { 'name' => 'dnssec-lookaside',
'values' => [
$dlv, "trust-anchor",
$in{"anchor_$i"} ] });
}
}
}
elsif ($in{'dlv_auto'} == 2) {
# None
@dlvs = ( );
}
&save_directive($options, "dnssec-lookaside", \@dlvs, 1);
}
# Save trusted keys
if (defined($in{'zone_0'})) {
my @keys = ( );

View File

@@ -8,7 +8,7 @@ lease_refresh=Seconds between refreshing lease list,3,Never
show_ip=Show IP addresses for hosts?,1,1-Yes,0-No
show_mac=Show MAC addresses for hosts?,1,1-Yes,0-No
group_name=Show group names as,1,1-<tt>domain&#45;name</tt> option,0-Name or member count,2-Description
desc_name=Show descriptions instead of names?,1,1-Description only,0-Name only,2-Both name and description
desc_name=Show other object descriptions instead of names?,1,1-Yes,0-No
display_max=Maximum number of subnets and hosts to display,3,Unlimited
add_file=Add new subnets&#44; hosts and groups to file,3,Main configuration file
line2=System configuration,11

View File

@@ -7,6 +7,7 @@ lease_refresh=Segons entre refrescs de la llista de préstecs,3,Mai
show_ip=Mostra les adreces IP dels hosts,1,1-Sí,0-No
show_mac=Mostra les adreces MAC dels hosts,1,1-Sí,0-No
group_name=Mostra els noms de grup com,1,1-Opció <tt>domini&#45;nom</tt>,0-Nom o recompte de membres,2-Descripció
desc_name=Mostra les descripcions dels altres objectes en lloc dels noms,1,1-Sí,0-No
display_max=Nombre màxim de subxarxes i hosts a mostrar,3,Il·limitat
add_file=Afegeix subxarxes noves&#44; hosts i grups al fitxer,3,Fitxer de configuració principal
line2=Configuració del sistema,11

View File

@@ -6,6 +6,7 @@ lease_tz=Zobrazit dobu pronájmu v,1,0-GMT,1-Lokálním čase
show_ip=Zobrazit IP adresy pro hosty?,1,1-ano,0-ne
show_mac=Zobrazit MAC adresy hostů?,1,1-Ano,0-Ne
group_name=Zobrazení jmen skupin jako,1,1-<tt>doménová jména</tt>,0-Jména nebo počtu členů,2-Popisu
desc_name=Ukázat popisy objektů místo jejich názvů?,1,1-Ano,0-Ne
display_max=Počet maximálně zobrazených podsítí a hostů,3,Bezomezení
line2=Konfigurace systému,11
dhcpd_conf=Konfigurační soubor DHCP serveru,0

View File

@@ -6,6 +6,7 @@ lease_tz=Vis lease tider i,1,0-GMT,1-Lokal tid
show_ip=Vis IP adresser for hosts?,1,1-Ja,0-Nej
show_mac=Vis MAC adresser for hosts?,1,1-Ja,0-Nej
group_name=Vis gruppenavne som,1,1-<tt>domæne&#45;navne</tt> indstilling,0-Navn eller medlemsantal,2-Beskrivelse
desc_name=Vis andre objektbeskrivelse istedet for navne?,1,1-Ja,0-Nej
display_max=Maksimalt antal hosts og subnet der skal vises,3,Ubegrænset
line2=Systemkonfiguration
dhcpd_conf=DHCP server config fil,0

View File

@@ -7,6 +7,7 @@ lease_refresh=Sekunden zwischen dem Aktualisieren der Leasing-Liste,3,Niemals
show_ip=Zeige IP-Adressen für Hosts?,1,1-Ja,0-Nein
show_mac=Zeige MAC-Adressen für Hosts?,1,1-Ja,0-Nein
group_name=Zeige Gruppennamen als,1,1-<tt>domain&#45;name</tt> Option,0-Name oder Mitglied,2-Beschreibung
desc_name=Zeige andere Objektbeschreibungen statt Namen?,1,1-Ja,0-Nein
display_max=Maximale Anzahl an Subnetzen und Hosts zum Anzeigen,3,Unbegrenzt
add_file=Füge neue Subnetze&#44; Hosts und Gruppen in einer Datei hinzu,3,Haupt-Konfigurationsdatei
line2=Systemkonfiguration,11

View File

@@ -6,6 +6,7 @@ lease_tz=نمايش زمان انتساب داده شده‌ها براساس,1,
show_ip=آيا نشانيهاي IP براي ميزبانها نشان داده شود؟,1,1-بله,0-خير
show_mac=آيا نشانيهاي MACبراي ميزبانها نشان داده شود؟,1,1-بله,0-خير
group_name=نشان‌دادن نامهاي گروه به‌صورت,1,1- گزينه<tt> دامنه/نام </tt>,0-نام يا تعداد اعضا,2-شرح
desc_name=آيا ساير شرحها به جاي نام نشان داده شود؟,1,1-بله,0-خير
display_max=حداکثر تعداد زيرشبکه‌ها و ميزبانها جهت نمايش,3,نامحدود
line2=پيکربندي سيستم,11
dhcpd_conf=پرونده پيکربندي کارساز DHCP,0

View File

@@ -6,6 +6,7 @@ lease_tz=Afficher les temps de bail en,1,0-GMT,1-Temps local
show_ip=Montrer les adresses IP des postes ?,1,1-Oui,0-Non
show_mac=Montrer les adresses MAC des postes ?,1,1-Oui,0-Non
group_name=Montrer les noms de groupe comme,1,1-Nom de domaine,0-Nom ou numero de membre
desc_name=Montrer les descriptions au lieu des noms ?,1,1-Oui,0-Non
display_max=Nombre maximum de sous-reseaux et de postes a afficher,3,Illimite
line2=Configuration du systeme,11
dhcpd_conf=Fichier de configuration du serveur DHCP,0

View File

@@ -6,6 +6,7 @@ lease_tz=リース時間の表示形式,1,0-GMT,1-ローカル時間
show_ip=ホストのIPアドレスを表示しますか?,1,1-はい,0-いいえ
show_mac=ホストのMACアドレスを表示しますか?,1,1-はい,0-いいえ
group_name=グループ名の表示方法,1,1-<tt>ドメイン&#45;名</tt> オプション,0-名前またはメンバー数
desc_name=名称の替わりにオブジェクトの説明を表示しますか?,1,1-はい,0-いいえ
display_max=サブネットとホストの表示する最大数,3,無制限
line2=システム設定,11
dhcpd_conf=DHCPサーバ 設定ファイル,0

View File

@@ -7,6 +7,7 @@ lease_refresh=Seconden tussen verversen van lease lijst,3,Nooit
show_ip=Laat IP adressen zien voor hosts?,1,1-Ja,0-Nee
show_mac=Laat MAC adressen zien voor hosts?,1,1-Ja,0-Nee
group_name=Laat groep namen zien als,1,1-<tt>domein&#45;naam</tt> optie,0-Naam of Lid van,2-Omschrijving
desc_name=Laat andere object omschrijvingen zien in plaats van namen?,1,1-Ja,0-Nee
display_max=Maximum aantal subnets en hosts om te laten zien,3,Ongelimiteerd
add_file=Toevoegen nieuwe subnetten&#44; host en groepen aan file,3,Hoofd configuratie file
line2=Systeem configuratie,11

View File

@@ -7,6 +7,7 @@ lease_refresh=Sekunder mellom oppfrisking av liste med leieavtaler,3,Aldri
show_ip=Vis IP adresser for verter?,1,1-Ja,0-Nei
show_mac=Vis MAC adresser for verter?,1,1-Ja,0-Nei
group_name=Vis gruppenavn som,1,1-<tt>domene&#45;navn</tt> alternativ,0-Navn eller antall medlemmer,2-Beskrivelse
desc_name=Vis andre objektbeskrivelser i stedet for navn,1,1-Ja,0-Nei
display_max=Maks antall subnett og verter som skal vises,3,Ubegrenset
add_file=Legg til nye subnett&#44; verter og grupper i filen,3,Hoved konfigurasjonsfil
line2=System konfigurasjon,11

View File

@@ -7,6 +7,7 @@ lease_refresh=Sekund pomiędzy odświeżaniem listy dzierżawy,3,Nigdy
show_ip=Wyświetlać adres IP hostów?,1,1-Tak,0-Nie
show_mac=Wyświetlać adres MAC hostów?,1,1-Tak,0-Nie
group_name=Wyświetl nazwy grupy jako,1,1-<tt>domain&#45;name</tt>,0-Ilość lub nazwa użytkowników,2-Opis
desc_name=Wyświetlać inne opisy obiektów zamiast nazw,1,1-Tak,0-Nie
display_max=Maksymalna liczba wyświetlanych podsieci i hostów,3,Nieograniczona
add_file=Dodaj nowe podsieci&#44; hosty i grupy do pliku,3,Główny plik konfiguracyjny
line2=Opcje systemowe,11

View File

@@ -6,6 +6,7 @@ lease_tz=Display leases times in,1,0-GMT,1-Local time
show_ip=Mostrar endereço IP para computadores?,1,1-Sim,0-Não
show_mac=Mostrar endereço MAC para computadores?,1,1-Sim,0-Não
group_name=Mostrar nomes de grupo como,1,1-<tt>nome de&#45;domínio</tt>,0-Nome ou membro
desc_name=Mostrar descrição de objetos ao invés de nomes?,1,1-Sim,0-Não
display_max=Número máximo de subredes e computadores a serem
add_file=Acrescentar novas subredes&#44; hosts e grupos para arquivo,3,Arquivo principal de configuração
line2=Configuração do sistema,11

View File

@@ -6,6 +6,7 @@ lease_tz=Zobraziť časy pridelených adries v,1,0-GMT,1-Lokálnom čase
show_ip=Zobraziť IP adresy pre počítače?,1,1-Áno,0-Nie
show_mac=Zobraziť MAC adresy pre počítače?,1,1-Áno,0-Nie
group_name=Zobraziť skupinové mená ako ,1,1-<tt>doménové mená</tt> ,0-Meno alebo počet členov,2-Popis
desc_name=Ukázať popisy objektov namiesto ich názvov?,1,1-Áno,0-Nie
display_max=Maximálny počet subnetov a hostiteľov pre zobrazenie,3,Bez limitu
line2=Systémové nastavenia,11
dhcpd_conf=Konfiguračný súbor DHCP servera,0

View File

@@ -211,18 +211,14 @@ foreach $u (@subn) {
push(@sicons, $i = "images/shared.gif");
push(@checkboxids, $u->{'index'});
}
if ($config{'desc_name'} == 0) {
$t = $u->{'values'}->[0];
}
elsif ($config{'desc_name'} == 1) {
$t = $u->{'comment'} || $u->{'values'}->[0];
if ($config{'desc_name'} && $u->{'comment'}) {
push(@utitles, $t = &html_escape($u->{'comment'}));
}
else {
$t = $u->{'values'}->[0].($u->{'comment'} ? " ($u->{'comment'})" : "");
push(@utitles, $t = &html_escape($u->{'values'}->[0]));
}
push(@utitles, &html_escape($t));
push(@uslinks, $l); # so that ordering is preserved
push(@ustitles, &html_escape($t));
push(@ustitles, $t);
push(@usicons, $i);
}
@checkboxes = map { &ui_checkbox("d", $_) } @checkboxids;
@@ -340,16 +336,12 @@ foreach $h (@host) {
(defined($subnet{$h}) ? "&uidx=$subnet{$h}" : "").
(defined($shared{$h}) ? "&sidx=$shared{$h}" : "") :
undef);
if ($config{'desc_name'} == 0) {
$t = $h->{'values'}->[0];
}
elsif ($config{'desc_name'} == 1) {
$t = $h->{'comment'} || $h->{'values'}->[0];
if ($config{'desc_name'} && $h->{'comment'}) {
push(@htitles, &html_escape($h->{'comment'}));
}
else {
$t = $h->{'values'}->[0].($h->{'comment'} ? " ($h->{'comment'})" : "");
push(@htitles, &html_escape($h->{'values'}->[0]));
}
push(@htitles, &html_escape($t));
if ($config{'show_ip'}) {
$fv = &fixedaddr($h);
$htitles[$#htitles] .= "<br>".$fv if ($fv);
@@ -597,13 +589,7 @@ sub host_table
{
local ($i, $h, $parent);
local @tds = ( "width=5" );
my $hascmt;
for ($i = $_[1]; $i < $_[2]; $i++) {
$hascmt++ if ($_[4]->[$i] =~ /\(.*\)/);
}
print &ui_columns_start([ "",
$text{'index_hostgroup'},
$hascmt ? ( $text{'index_comment'} ) : ( ),
print &ui_columns_start([ "", $text{'index_hostgroup'},
$text{'index_parent'}, $text{'index_hardware'},
$text{'index_nameip'} ], 100, 0, \@tds);
for ($i = $_[1]; $i < $_[2]; $i++) {
@@ -619,10 +605,6 @@ for ($i = $_[1]; $i < $_[2]; $i++) {
$firstcol .= $text{'index_group'}." ";
$sp = "\&nbsp;\&nbsp;";
}
my $cmt;
if ($_[4]->[$i] =~ s/\s+\((.*)\)//) {
$cmt = $1;
}
if ($_[3]->[$i]) {
$firstcol .= &ui_link($_[3]->[$i], $_[4]->[$i]);
}
@@ -630,7 +612,6 @@ for ($i = $_[1]; $i < $_[2]; $i++) {
$firstcol .= $_[4]->[$i];
}
push(@cols, $firstcol);
push(@cols, $cmt) if ($hascmt);
if ($par{$h}->{'name'} eq "group") {
$par_type = $text{'index_togroup'};
@@ -659,14 +640,7 @@ sub net_table
{
local ($i, $n);
local @tds = ( "width=5" );
my $hascmt;
for ($i = $_[1]; $i < $_[2]; $i++) {
$hascmt++ if ($_[4]->[$i] =~ /\(.*\)/);
}
print &ui_columns_start([ "",
$text{'index_net'},
$hascmt ? ( $text{'index_comment'} ) : ( ),
$text{'index_netmask'},
print &ui_columns_start([ "", $text{'index_net'}, $text{'index_netmask'},
$text{'index_desc'}, $text{'index_parent'} ], 100,
0, \@tds);
for ($i = $_[1]; $i < $_[2]; $i++) {
@@ -679,10 +653,6 @@ for ($i = $_[1]; $i < $_[2]; $i++) {
else {
$sp = "\&nbsp;\&nbsp;";
}
my $cmt;
if ($_[4]->[$i] =~ s/\s+\((.*)\)//) {
$cmt = $1;
}
if ($_[3]->[$i]) {
$first .= &ui_link($_[3]->[$i],$_[4]->[$i]);
}
@@ -690,7 +660,6 @@ for ($i = $_[1]; $i < $_[2]; $i++) {
$first .= $_[4]->[$i];
}
push(@cols, $first);
push(@cols, $cmt) if ($hascmt);
push(@cols, $_[3]->[$i] ? &netmask($n) : "");
push(@cols, $n->{'comment'});
push(@cols, $par{$n} ?

View File

@@ -14,7 +14,6 @@ index_memb=$1 members
index_hst=Hosts and Host Groups
index_nohst=No hosts or groups have been defined.
index_hostgroup=Host/Group
index_comment=Description
index_parent=Parent
index_hardware=Hardware Address
index_group=Group:

View File

@@ -95,7 +95,7 @@ foreach (@lines) {
}
}
elsif (/^(\s*)(#?)([a-z0-9\_]+)\s+=\s*(.*)/) {
# A directive which may or may not be inside a section
# A directive inside a section
local $dir = { 'name' => $3,
'value' => $4,
'enabled' => !$2,
@@ -376,9 +376,9 @@ else {
}
}
splice(@$lref, $section->{'line'}, 0, @newlines);
$section->{'eline'} = $section->{'line'} + scalar(@newlines) - 1;
&renumber($conf, $section->{'eline'}, $section->{'file'},
scalar(@newlines)-$oldlen);
$section->{'eline'} = $section->{'line'} + scalar(@newlines) - 1;
$section->{'file'} = $file;
my $i = 1;
foreach my $m (@{$section->{'members'}}) {
@@ -391,17 +391,6 @@ foreach my $m (@{$section->{'members'}}) {
}
}
# delete_section(&conf, &section)
# Remove a section and all it's members from the config file
sub delete_section
{
my ($conf, $section) = @_;
my $lref = &read_file_lines($section->{'file'});
my $len = $section->{'eline'} - $section->{'line'} + 1;
splice(@$lref, $section->{'line'}, $len);
&renumber($conf, $section->{'line'}, $section->{'file'}, -$len);
}
# renumber(&conf, line, file, offset)
sub renumber
{

View File

@@ -55,7 +55,7 @@ if (@jails) {
$col =~ s/\s/_/g;
if ($col !~ /journal_matches/ &&
$col !~ /file_list/) {
push(@head, "<span $tdc>".$text{"status_head_$col"}."</span>");
push(@head, "<div $tdc>".$text{"status_head_$col"}."</div>");
if ($col =~ /banned_ip_list/) {
$jips = $val;
my @ips = split(/\s+/, $val);

0
firewalld/block_ip.cgi Executable file → Normal file
View File

View File

@@ -173,10 +173,7 @@ if ($ok) {
print &ui_buttons_row("stop.cgi", $text{'index_stop'},
$text{'index_stopdesc'},
[ [ "zone", $zone->{'name'} ] ]);
}
else {
print &ui_alert_box($text{'index_downrules'}, 'warn');
}
}
# Show Start and disable/enabled at boot button
if (!$ok) {

View File

@@ -45,7 +45,6 @@ index_restart_firewallddesc=Reload the FirewallD server and apply the rules that
index_listrules_restartdesc=List details about existing rich and direct FirewallD rules in $1 zone.
index_dependent=Failed to restart $1 dependent service
index_manual=Edit Config Files.
index_downrules=FirewallD rules cannot be created or edited and are not enforced unless the server is running.
manual_title=Edit Config Files
manual_editsel=Edit FirewallD configuration file

View File

@@ -2212,7 +2212,6 @@ if ($ecount && keys(%info) < 2) {
# Extract info we want
my @rv;
my %done;
foreach my $name (keys %info) {
my $root = &get_systemd_root($name);
my $i = $info{$name};
@@ -2234,7 +2233,6 @@ foreach my $name (keys %info) {
'pid' => $i->{'ExecMainPID'},
'file' => $i->{'FragmentPath'} || $root."/".$name,
});
$done{$name}++;
}
# Also add legacy init scripts
@@ -2242,7 +2240,6 @@ if (!$noinit) {
my @rls = &get_inittab_runlevel();
foreach my $a (&list_actions()) {
$a =~ s/\s+\d+$//;
next if ($done{$a} || $done{$a.".service"});
my $f = &action_filename($a);
my $s = { 'name' => $a,
'legacy' => 1 };

View File

@@ -235,7 +235,6 @@ if ($ldap_hosts) {
&find_svalue("port", $conf) ||
($use_ssl == 1 ? 636 : 389);
foreach my $h (@hosts) {
local $SIG{'PIPE'} = 'ignore';
eval {
$ldap = Net::LDAP->new($h, port => $port,
scheme => $use_ssl == 1 ? 'ldaps' : 'ldap',
@@ -268,18 +267,10 @@ elsif ($uri) {
elsif (!$port && $proto eq "ldaps") {
$port = 636;
}
local $SIG{'PIPE'} = 'ignore';
eval {
$ldap = Net::LDAP->new($host, port => $port,
scheme => $proto,
inet6 => &should_use_inet6($host));
};
if ($@) {
$err = &text('ldap_econn2',
"<tt>$host</tt>", "<tt>$port</tt>",
&html_escape($@));
}
elsif (!$ldap) {
$ldap = Net::LDAP->new($host, port => $port,
scheme => $proto,
inet6 => &should_use_inet6($host));
if (!$ldap) {
$err = &text('ldap_econn',
"<tt>$host</tt>","<tt>$port</tt>");
}

View File

@@ -4,4 +4,3 @@ slapd=slapd
ldap_user=ldap
browse_max=100
attr_count=6
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=/etc/init.d/ldap stop
apply_cmd=/etc/init.d/ldap restart
init_name=ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=/etc/init.d/slapd start
stop_cmd=/etc/init.d/slapd stop
apply_cmd=/etc/init.d/slapd restart
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -9,4 +9,3 @@ apply_cmd=/etc/init.d/ldap restart
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,7 +6,6 @@ browse_max=100
start_cmd=systemctl start slapd
stop_cmd=systemctl stop slapd
apply_cmd=systemctl restart slapd
init_name=slapd
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=/etc/init.d/slapd stop
apply_cmd=/etc/init.d/slapd restart
init_name=slapd
attr_count=6
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=/etc/init.d/slapd stop
apply_cmd=/etc/init.d/slapd restart
init_name=slapd
attr_count=6
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=/etc/init.d/slapd stop
apply_cmd=/etc/init.d/slapd restart
init_name=slapd
attr_count=6
ldapadd=ldapadd

View File

@@ -7,4 +7,3 @@ attr_count=6
start_cmd=/usr/local/etc/rc.d/slapd start
stop_cmd=/usr/local/etc/rc.d/slapd stop
apply_cmd=/usr/local/etc/rc.d/slapd restart
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ start_cmd=/usr/local/etc/rc.d/slapd forcestart
stop_cmd=/usr/local/etc/rc.d/slapd forcestop
apply_cmd=/usr/local/etc/rc.d/slapd onerestart
init_name=slapd
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=/etc/rc./init.d/ldap stop
apply_cmd=/etc/rc./init.d/ldap restart
init_name=ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=systemctl stop ldap
apply_cmd=systemctl restart ldap
init_name=ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -6,4 +6,3 @@ browse_max=100
data_dir=/var/lib/openladp-data
attr_count=6
ldapadd=ldapadd

View File

@@ -9,4 +9,3 @@ apply_cmd=/etc/init.d/ldap restart
init_name=ldap
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -9,4 +9,3 @@ apply_cmd=systemctl restart slapd.service
init_name=slapd
data_dir=/var/lib/ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -5,4 +5,3 @@ slapd=/opt/csw/libexec/slapd
ldap_user=ldap
browse_max=100
attr_count=6
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=/etc/init.d/ldap stop
apply_cmd=/etc/init.d/ldap restart
init_name=ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ config_file=/etc/ldap/slapd.conf
stop_cmd=/etc/init.d/ldap stop
attr_count=6
browse_max=100
ldapadd=ldapadd

View File

@@ -8,4 +8,3 @@ stop_cmd=/etc/rc./init.d/ldap stop
apply_cmd=/etc/rc./init.d/ldap restart
init_name=ldap
attr_count=6
ldapadd=ldapadd

View File

@@ -7,7 +7,6 @@ ssl=Use encryption with LDAP server?,1,-Detect automatically,1-Yes,2-Yes TLS,0-N
line4=LDAP server options,11
slapd=Full path to OpenLDAP server program,8
ldapadd=Full path to <tt>ldapadd</tt> command,8
config_file=OpenLDAP server configuration file or directory,8
schema_dir=OpenLDAP schema directory,7
ldap_user=User OpenLDAP server runs as,5

View File

@@ -6,10 +6,11 @@ require './ldap-server-lib.pl';
$access{'slapd'} || &error($text{'slapd_ecannot'});
&ui_print_header(undef, $text{'slapd_title'}, "", "slapd");
$conf = &get_ldif_config();
@tds = ( "width=30%" );
print &ui_form_start("save_ldif.cgi", "post");
print &ui_hidden_table_start($text{'slapd_header'}, "width=100%", 2,
"basic", 1);
"basic", 1,\@tds);
# Top-level DN
$defdb = &get_default_db();
@@ -73,7 +74,7 @@ print &ui_hidden_table_end("basic");
# SSL section
print &ui_hidden_table_start($text{'slapd_header2'}, "width=100%", 2,
"ssl", 0);
"ssl", 0, \@tds);
# Protocols to serve
if (&can_get_ldap_protocols()) {

View File

@@ -18,12 +18,7 @@ if (&get_config_type() == 1) {
}
# Show a table of all known schema files, with checkboxes
if (&get_config_type() == 1) {
print $text{'schema_pagedesc'},"<p>\n";
}
else {
print $text{'schema_pagedesc2'},"<p>\n";
}
print $text{'schema_pagedesc'},"<p>\n";
@tds = ( $editable ? ( "width=5" ) : ( ),
"width=20%", "width=65%", "width=10%", "width=5% nowrap" );
print &ui_form_start("save_schema.cgi", "post");
@@ -36,8 +31,8 @@ print &ui_columns_start([ $editable ? ( "" ) : ( ),
@files = sort { &schema_sorter } &list_schema_files();
for($i=0; $i<@files; $i++) {
$s = $files[$i];
@acts = ( &ui_link("view_sfile.cgi?file=".&urlize($s->{'file'}), $text{'schema_view'}),
&ui_link("edit_sfile.cgi?file=".&urlize($s->{'file'}), $text{'schema_edit'}) );
@acts = ( &ui_link("view_sfile.cgi?file=".&urlize($s->{'file'})."",$text{'schema_view'}),
&ui_link("edit_sfile.cgi?file=".&urlize($s->{'file'})."",$text{'schema_edit'}) );
if ($incs{$s->{'file'}}) {
$mover = &ui_up_down_arrows(
"up_schema.cgi?file=".&urlize($s->{'file'}),
@@ -61,8 +56,6 @@ for($i=0; $i<@files; $i++) {
}
else {
# View files only
push(@acts, &ui_link("import_sfile.cgi?file=".&urlize($s->{'file'}),
$text{'schema_import'}));
print &ui_columns_row(
[ $s->{'name'},
$s->{'desc'} || $s->{'file'},

View File

@@ -1,61 +0,0 @@
#!/usr/local/bin/perl
# Import a schema file into the server
require './ldap-server-lib.pl';
&error_setup($text{'import_err'});
&local_ldap_server() == 1 || &error($text{'slapd_elocal'});
$access{'schema'} || &error($text{'schema_ecannot'});
&ReadParse();
&is_under_directory($config{'schema_dir'}, $in{'file'}) ||
&error($text{'schema_edir'});
&has_command($config{'ldapadd'}) ||
&error(&text('import_eldapadd', "<tt>$config{'ldapadd'}</tt>"));
# Get login credentials
$user = $config{'user'};
$pass = $config{'pass'};
if (&get_config_type() == 1) {
my $conf = &get_config();
$user ||= &find_value("rootdn", $conf);
$pass ||= &find_value("rootpw", $conf);
}
else {
$defdb = &get_default_db();
$conf = &get_ldif_config();
$user ||= &find_ldif_value("olcRootDN", $conf, $defdb);
$pass ||= &find_ldif_value("olcRootPW", $conf, $defdb);
}
$user || &error($text{'import_euser'});
# Check that there's a corresponding LDIF file
$ldiffile = $in{'file'};
$ldiffile =~ s/\.schema$/.ldif/;
-r $ldiffile ||
&error(&text('import_eldif', "<tt>".&html_escape($ldiffile)."</tt>"));
# Run the import command
$cmd = $config{'ldapadd'}.
" -D ".quotemeta($user).
" -w ".quotemeta($pass).
" -H ldapi:///".
" -Y external".
" -f ".quotemeta($ldiffile);
&ui_print_unbuffered_header(undef, $text{'import_title'}, "");
print &text('import_doing', "<tt>".&html_escape($ldiffile)."</tt>"),"<p>\n";
print "<pre>\n";
&open_execute_command(CMD, $cmd, 2);
while(<CMD>) {
print &html_escape($_);
}
close(CMD);
print "</pre>\n";
if ($?) {
print $text{'import_failed'},"<p>\n";
}
else {
print $text{'import_ok'},"<p>\n";
}
&ui_print_footer("edit_schema.cgi", $text{'schema_return'});

View File

@@ -84,13 +84,11 @@ schema_title=Manage Schema
schema_file=Name
schema_desc=Description
schema_pagedesc=The LDAP schema determines which object classes and attributes can be stored in your LDAP database. This page allows you to select which schema types are supported by your server - but be careful de-selecting any entries that are used by existing objects.
schema_pagedesc2=The LDAP schema determines which object classes and attributes can be stored in your LDAP database. Schemas files must be imported before their types can be used to create objects.
schema_err=Failed to save schema
schema_move=Move
schema_act=Actions..
schema_view=View
schema_edit=Edit
schema_import=Import
schema_edir=File is not in the schema directory!
schema_etitle=Edit Schema File
schema_eheader=Schema file contents
@@ -216,7 +214,6 @@ apply_ecannot=You are not allowed to apply the configuration
stop_err=Failed to stop LDAP server
stop_ecmd=$1 failed : $2
stop_egone=No longer running!
stop_egone2=Running but PID is unknown!
stop_ekill=Kill process failed : $1
stop_ecannot=You are not allowed to stop the LDAP server
@@ -331,13 +328,4 @@ eacl_eaccess=Missing or invalid access level in row $1
eacl_order=Rule order
eacl_noorder=None set
import_err=Failed to import schema
import_eldapadd=Could not find the $1 command
import_euser=Could not work out LDAP server login
import_eldif=LDIF file $1 does not exist
import_title=Import Schema
import_doing=Importing LDIF schema file $1 ..
import_failed=.. import failed!
import_ok=.. import completed successfully
__norefs=1

View File

@@ -526,7 +526,6 @@ if ($config{'stop_cmd'}) {
else {
local $pid = &is_ldap_server_running();
$pid || return $text{'stop_egone'};
$pid > 1 || return $text{'stop_egone2'};
return kill('TERM', $pid) ? undef : &text('stop_ekill', $!);
}
}
@@ -565,9 +564,6 @@ else {
# Returns the process ID of the running LDAP server, or undef
sub is_ldap_server_running
{
&foreign_require("init");
my $iname = $config{'init_name'} || $module_name;
return 1 if (&init::status_action($iname) == 1);
local $pidfile = &get_ldap_server_pidfile();
if ($pidfile) {
return &check_pid_file($pidfile);

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/pam_ldap/auth_ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/usr/share/libnss-ldap/ldap.conf
imap_login=cyrus
samba_class=sambaSamAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/libnss-ldap.conf
imap_login=cyrus
samba_class=sambaSamAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/ldap.conf
imap_login=cyrus
samba_class=sambaSamAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/ldap/ldap.conf
imap_login=cyrus
samba_class=sambaSamAccount
imap_class=SquirrelMailUser inetLocalMailRecipient

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/openldap/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/openldap/ldap.conf
imap_login=cyrus
samba_class=sambaSamAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/openldap/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,4 +1,5 @@
samba_class=sambaAccount
auth_ldap=/etc/pam_ldap/auth_ldap.conf
ldap_tls=0
imap_login=cyrus
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/openldap/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -1,3 +1,4 @@
auth_ldap=/etc/openldap/ldap.conf
imap_login=cyrus
samba_class=sambaAccount
imap_class=SuSEeMailObject

View File

@@ -8,9 +8,8 @@ do 'ldap-useradmin-lib.pl';
# For mode 0, returns 1 if installed, 0 if not
sub is_installed
{
my $cfile = &ldap_client::get_ldap_config_file();
if ($cfile) {
return 0 if (!-r $cfile);
if ($config{'auth_ldap'}) {
return 0 if (!-r $config{'auth_ldap'});
}
else {
if ($_[0]) {

View File

@@ -92,15 +92,8 @@ else { &error($ldap); }
sub get_user_base
{
local $conf = &ldap_client::get_config();
local $passwd_base;
foreach my $b (&ldap_client::find_value("base", $conf)) {
if ($b =~ /^passwd\s+(\S+)/) {
$passwd_base = $1;
}
}
local $base = $config{'user_base'} ||
&ldap_client::find_svalue("nss_base_passwd", $conf) ||
$passwd_base ||
&ldap_client::find_svalue("base", $conf);
$base =~ s/\?.*$//;
return $base;
@@ -110,15 +103,8 @@ return $base;
sub get_group_base
{
local $conf = &ldap_client::get_config();
local $group_base;
foreach my $b (&ldap_client::find_value("base", $conf)) {
if ($b =~ /^group\s+(\S+)/) {
$group_base = $1;
}
}
local $base = $config{'group_base'} ||
&ldap_client::find_svalue("nss_base_group", $conf) ||
$group_base ||
&ldap_client::find_svalue("base", $conf);
$base =~ s/\?.*$//;
return $base;
@@ -244,35 +230,31 @@ return @list_users_cache;
# it to the LDAP database
sub create_user
{
my ($user) = @_;
my $ldap = &ldap_connect();
my $base = &get_user_base();
$user->{'dn'} = "uid=$user->{'user'},$base";
my @classes = ( &def_user_obj_class(), "shadowAccount",
local $ldap = &ldap_connect();
local $base = &get_user_base();
$_[0]->{'dn'} = "uid=$_[0]->{'user'},$base";
local @classes = ( &def_user_obj_class(), "shadowAccount",
split(/\s+/, $config{'other_class'}),
@{$user->{'ldap_class'}} );
my $schema = $ldap->schema();
@{$_[0]->{'ldap_class'}} );
local $schema = $ldap->schema();
if ($schema->objectclass("person") && $config{'person'}) {
push(@classes, "person");
}
if ($config{'given'}) {
push(@classes, $config{'given_class'});
}
@classes = &uniquelc(@classes);
@classes = grep { /\S/ } @classes; # Remove empty
my @attrs = &user_to_dn($user);
push(@attrs, &split_props($config{'props'}, $user));
push(@attrs, @{$user->{'ldap_attrs'}});
local @attrs = &user_to_dn($_[0]);
push(@attrs, &split_props($config{'props'}, $_[0]));
push(@attrs, @{$_[0]->{'ldap_attrs'}});
push(@attrs, "objectClass" => \@classes);
if (&indexoflc("person", @classes) >= 0 && !&in_props(\@attrs, "sn")) {
# Person needs 'sn'
push(@attrs, "sn", &in_props(\@attrs, "cn"));
}
my $rv = $ldap->add($user->{'dn'}, attr => \@attrs);
local $rv = $ldap->add($_[0]->{'dn'}, attr => \@attrs);
if ($rv->code) {
&error(&text('usave_eadd', $rv->error));
}
push(@list_users_cache, $user) if (scalar(@list_users_cache));
push(@list_users_cache, $_[0]) if (scalar(@list_users_cache));
$ldap->unbind();
&useradmin::refresh_nscd() if (!$batch_mode);
}
@@ -282,9 +264,8 @@ $ldap->unbind();
# it from the LDAP database
sub delete_user
{
my ($user) = @_;
my $ldap = &ldap_connect();
my $rv = $ldap->delete($user->{'dn'});
local $ldap = &ldap_connect();
local $rv = $ldap->delete($_[0]->{'dn'});
if ($rv->code) {
my $err = $rv->error;
if ($err !~ /No such object/i) {
@@ -292,7 +273,7 @@ if ($rv->code) {
}
}
$ldap->unbind();
@list_users_cache = grep { $_ ne $user } @list_users_cache
@list_users_cache = grep { $_ ne $_[0] } @list_users_cache
if (scalar(@list_users_cache));
&useradmin::refresh_nscd() if (!$batch_mode);
}
@@ -300,53 +281,52 @@ $ldap->unbind();
# modify_user(&olduser, &newuser)
sub modify_user
{
my ($olduser, $user) = @_;
my $ldap = &ldap_connect();
my $base = &get_user_base();
my @attrs = &user_to_dn($user);
push(@attrs, &split_props($config{'mod_props'}, $user));
push(@attrs, @{$user->{'ldap_attrs'}});
if ($user->{'ldap_class'} &&
(!ref($user->{'ldap_class'}) || @{$user->{'ldap_class'}})) {
push(@attrs, "objectClass" => $user->{'ldap_class'});
local $ldap = &ldap_connect();
local $base = &get_user_base();
local @attrs = &user_to_dn($_[1]);
push(@attrs, &split_props($config{'mod_props'}, $_[1]));
push(@attrs, @{$_[1]->{'ldap_attrs'}});
if ($_[1]->{'ldap_class'} &&
(!ref($_[1]->{'ldap_class'}) || @{$_[1]->{'ldap_class'}})) {
push(@attrs, "objectClass" => $_[1]->{'ldap_class'});
}
if (&indexoflc("person", @{$user->{'ldap_class'}}) >= 0 &&
if (&indexoflc("person", @{$_[1]->{'ldap_class'}}) >= 0 &&
!&in_props(\@attrs, "sn")) {
# Person needs 'sn'
push(@attrs, "sn", &in_props(\@attrs, "cn"));
}
my %replace;
local %replace;
for(my $i=0; $i<@attrs; $i+=2) {
$replace{$attrs[$i]} ||= [ ];
my $v = $attrs[$i+1];
local $v = $attrs[$i+1];
push(@{$replace{$attrs[$i]}}, ref($v) ? @$v : $v);
}
if ($olduser->{'pass'} eq $user->{'pass'}) {
if ($_[0]->{'pass'} eq $_[1]->{'pass'}) {
# Don't change password attribute if not change
delete($replace{'userPassword'});
}
# Do rename to new DN first
if ($olduser->{'user'} ne $user->{'user'}) {
my $newdn = $olduser->{'dn'};
if ($newdn !~ s/^uid=$olduser->{'user'},/uid=$user->{'user'},/) {
$newdn = "uid=$user->{'user'},$base";
if ($_[0]->{'user'} ne $_[1]->{'user'}) {
local $newdn = $_[0]->{'dn'};
if ($newdn !~ s/^uid=$_[0]->{'user'},/uid=$_[1]->{'user'},/) {
$newdn = "uid=$_[1]->{'user'},$base";
}
if (!&same_dn($newdn, $olduser->{'dn'})) {
$rv = $ldap->moddn($olduser->{'dn'},
newrdn => "uid=$user->{'user'}");
if (!&same_dn($newdn, $_[0]->{'dn'})) {
$rv = $ldap->moddn($_[0]->{'dn'},
newrdn => "uid=$_[1]->{'user'}");
if ($rv->code) {
&error(&text('usave_emoddn', $rv->error));
}
$user->{'dn'} = $newdn;
$_[1]->{'dn'} = $newdn;
}
}
my $rv = $ldap->modify($user->{'dn'}, replace => \%replace);
local $rv = $ldap->modify($_[1]->{'dn'}, replace => \%replace);
if ($rv->code) {
&error(&text('usave_emod', $rv->error));
}
if ($olduser ne $user && &indexof($olduser, @list_users_cache) != -1) {
if ($_[0] ne $_[1] && &indexof($_[0], @list_users_cache) != -1) {
# Update old object in cache
%{$olduser} = %{$user};
%{$_[0]} = %{$_[1]};
}
$ldap->unbind();
&useradmin::refresh_nscd() if (!$batch_mode);
@@ -451,42 +431,37 @@ $ldap->unbind();
# in the same format uses by the useradmin module
sub dn_to_hash
{
my ($obj) = @_;
if ($obj->get_value("uid")) {
my %user = ( 'dn' => $obj->dn(),
'user' => $obj->get_value("uid"),
'uid' => $obj->get_value("uidNumber"),
'gid' => $obj->get_value("gidNumber"),
'real' => $obj->get_value("cn"),
'home' => $obj->get_value("homeDirectory"),
'shell' => $obj->get_value("loginShell"),
'pass' => $obj->get_value("userPassword"),
'change' => $obj->get_value("shadowLastChange") || "",
'expire' => $obj->get_value("shadowExpire") || "",
'min' => $obj->get_value("shadowMin") || "",
'max' => $obj->get_value("shadowMax") || "",
'warn' => $obj->get_value("shadowWarning") || "",
'inactive' => $obj->get_value("shadowInactive") || "",
);
if ($config{'given'}) {
$user{'firstname'} = $obj->get_value("givenName");
$user{'surname'} = $obj->get_value("sn");
}
if ($_[0]->get_value("uid")) {
local %user = ( 'dn' => $_[0]->dn(),
'user' => $_[0]->get_value("uid"),
'uid' => $_[0]->get_value("uidNumber"),
'gid' => $_[0]->get_value("gidNumber"),
'real' => $_[0]->get_value("cn"),
'home' => $_[0]->get_value("homeDirectory"),
'shell' => $_[0]->get_value("loginShell"),
'pass' => $_[0]->get_value("userPassword"),
'change' => $_[0]->get_value("shadowLastChange") || "",
'expire' => $_[0]->get_value("shadowExpire") || "",
'min' => $_[0]->get_value("shadowMin") || "",
'max' => $_[0]->get_value("shadowMax") || "",
'warn' => $_[0]->get_value("shadowWarning") || "",
'inactive' => $_[0]->get_value("shadowInactive") || "",
);
$user{'pass'} =~ s/^(\!?)\{[a-z0-9]+\}/$1/i;
$user{'all_ldap_attrs'} = { map { lc($_), scalar($obj->get_value($_)) }
$obj->attributes() };
$user{'ldap_class'} = [ $obj->get_value('objectClass') ];
$user{'all_ldap_attrs'} = { map { lc($_), scalar($_[0]->get_value($_)) }
$_[0]->attributes() };
$user{'ldap_class'} = [ $_[0]->get_value('objectClass') ];
return %user;
}
else {
my @members = $obj->get_value('memberUid');
my %group = ( 'dn' => $obj->dn(),
'group' => $obj->get_value("cn"),
'gid' => $obj->get_value("gidNumber"),
'pass' => $obj->get_value("userPassword") || "",
'members' => join(",", @members) || "",
'desc' => $obj->get_value("description"),
);
local @members = $_[0]->get_value('memberUid');
local %group = ( 'dn' => $_[0]->dn(),
'group' => $_[0]->get_value("cn"),
'gid' => $_[0]->get_value("gidNumber"),
'pass' => $_[0]->get_value("userPassword") || "",
'members' => join(",", @members) || "",
'desc' => $_[0]->get_value("description"),
);
return %group;
}
}
@@ -495,56 +470,48 @@ else {
# Given a useradmin-style user hash, returns a list of properties
sub user_to_dn
{
my ($user) = @_;
my $pfx = $user->{'pass'} =~ /^\{[a-z0-9]+\}/i ? undef :
$user->{'pass'} =~ /^\$1\$/ ? "{md5}" :
$user->{'pass'} =~ /^[a-zA-Z0-9\.\/]{13}$/ ? "{crypt}" :
$config{'md5'} == 1 || $config{'md5'} == 3 ? "{md5}" :
$config{'md5'} == 4 ? "{ssha}" :
$config{'md5'} == 0 ? "{crypt}" : "";
my $pass = $user->{'pass'};
my $disabled;
local $pfx = $_[0]->{'pass'} =~ /^\{[a-z0-9]+\}/i ? undef :
$_[0]->{'pass'} =~ /^\$1\$/ ? "{md5}" :
$_[0]->{'pass'} =~ /^[a-zA-Z0-9\.\/]{13}$/ ? "{crypt}" :
$config{'md5'} == 1 || $config{'md5'} == 3 ? "{md5}" :
$config{'md5'} == 4 ? "{ssha}" :
$config{'md5'} == 0 ? "{crypt}" : "";
local $pass = $_[0]->{'pass'};
local $disabled;
if ($pass =~ s/^\!//) {
$disabled = "!";
}
my $cn = $user->{'real'} eq '' ? $user->{'user'} : $user->{'real'};
$cn = $_[0]->{'real'} eq '' ? $_[0]->{'user'} : $_[0]->{'real'};
return ( "cn" => $cn,
"uid" => $user->{'user'},
"uidNumber" => $user->{'uid'},
"loginShell" => $user->{'shell'},
"homeDirectory" => $user->{'home'},
"gidNumber" => $user->{'gid'},
"uid" => $_[0]->{'user'},
"uidNumber" => $_[0]->{'uid'},
"loginShell" => $_[0]->{'shell'},
"homeDirectory" => $_[0]->{'home'},
"gidNumber" => $_[0]->{'gid'},
"userPassword" => $disabled.$pfx.$pass,
$user->{'change'} eq '' ? ( ) :
( "shadowLastChange" => $user->{'change'} ),
$user->{'expire'} eq '' ? ( ) :
( "shadowExpire" => $user->{'expire'} ),
$user->{'min'} eq '' ? ( ) :
( "shadowMin" => $user->{'min'} ),
$user->{'max'} eq '' ? ( ) :
( "shadowMax" => $user->{'max'} ),
$user->{'warn'} eq '' ? ( ) :
( "shadowWarning" => $user->{'warn'} ),
$user->{'inactive'} eq '' ? ( ) :
( "shadowInactive" => $user->{'inactive'} ),
$user->{'firstname'} eq '' ? ( ) :
( "givenName" => $user->{'firstname'} ),
$user->{'surname'} eq '' ? ( ) :
( "sn" => $user->{'surname'} ),
$_[0]->{'change'} eq '' ? ( ) :
( "shadowLastChange" => $_[0]->{'change'} ),
$_[0]->{'expire'} eq '' ? ( ) :
( "shadowExpire" => $_[0]->{'expire'} ),
$_[0]->{'min'} eq '' ? ( ) :
( "shadowMin" => $_[0]->{'min'} ),
$_[0]->{'max'} eq '' ? ( ) :
( "shadowMax" => $_[0]->{'max'} ),
$_[0]->{'warn'} eq '' ? ( ) :
( "shadowWarning" => $_[0]->{'warn'} ),
$_[0]->{'inactive'} eq '' ? ( ) :
( "shadowInactive" => $_[0]->{'inactive'} )
);
}
# group_to_dn(&group)
# Given a useradmin-style group hash, returns a list of properties
sub group_to_dn
{
my ($group) = @_;
my @members = split(/,/, $group->{'members'});
return ( "cn" => $group->{'group'},
"gidNumber" => $group->{'gid'},
"userPassword" => $group->{'pass'},
local @members = split(/,/, $_[0]->{'members'});
return ( "cn" => $_[0]->{'group'},
"gidNumber" => $_[0]->{'gid'},
"userPassword" => $_[0]->{'pass'},
@members ? ( "memberUid" => \@members ) : ( ),
defined($group->{'desc'}) ? ( "description" => $group->{'desc'} ) : ( ),
defined($_[0]->{'desc'}) ? ( "description" => $_[0]->{'desc'} ) : ( ),
);
}

View File

@@ -3,4 +3,3 @@ lines=100
others=1
reverse=1
log_any=0
compressed=1

View File

@@ -1,8 +1,7 @@
skip_index=Open log view on module load?,1,1-Yes,0-No
skip_index=Open log view on module load,1,1-Yes,0-No
lines=Default number of lines to display,0,6
compressed=Include compressed logs in searches?,1,1-Yes,0-No
refresh=Seconds between log view refreshes,3,Never
others=Show logs from other modules?,1,1-Yes,0-No
others=Show logs from other modules,1,1-Yes,0-No
extras=Extra log files to show,9,50,4,\t
reverse=Log display order,1,1-Newest lines at top,0-Newest lines at bottom
log_any=Can view any file as a log?,1,1-Yes,0-No
log_any=Can view any file as a log,1,1-Yes,0-No

View File

@@ -143,9 +143,11 @@ if (!@acols) {
}
# If we jump directly to logs just redirect
if ($config{'skip_index'} == 1 && $lnks[0]) {
&redirect($lnks[0]);
return;
if ($config{'skip_index'} == 1) {
if ($lnks[0]) {
&redirect($lnks[0]);
exit;
}
}
# Print the header

View File

@@ -251,29 +251,5 @@ sub config_post_save
&clear_systemctl_cache();
}
# catter_command(file)
# Given a file that may be compressed, returns the command to output it in
# plain text, or undef if impossible
sub catter_command
{
local ($l) = @_;
local $q = quotemeta($l);
if ($l =~ /\.gz$/i) {
return &has_command("gunzip") ? "gunzip -c $q" : undef;
}
elsif ($l =~ /\.Z$/i) {
return &has_command("uncompress") ? "uncompress -c $q" : undef;
}
elsif ($l =~ /\.bz2$/i) {
return &has_command("bunzip2") ? "bunzip2 -c $q" : undef;
}
elsif ($l =~ /\.xz$/i) {
return &has_command("xz") ? "xz -d -c $q" : undef;
}
else {
return "cat $q";
}
}
1;

0
logviewer/view_log_progress.cgi Executable file → Normal file
View File

View File

@@ -107,7 +107,7 @@ if ($product eq "webmin") {
$size = int(`du -sk $tmp_dir`);
@deps = ( "perl", "libnet-ssleay-perl", "openssl", "libauthen-pam-perl", "libpam-runtime", "libio-pty-perl", "unzip", "shared-mime-info", "tar", "libdigest-sha-perl", "libdigest-md5-perl", "gzip" );
$deps = join(", ", @deps);
@recommends = ( "libdatetime-perl", "libdatetime-timezone-perl", "libdatetime-locale-perl", "libtime-piece-perl", "libencode-detect-perl", "libtime-hires-perl", "libsocket6-perl", "lynx", "qrencode" );
@recommends = ( "libdatetime-perl", "libdatetime-timezone-perl", "libdatetime-locale-perl", "libtime-piece-perl", "libencode-detect-perl", "libtime-hires-perl", "libsocket6-perl", "libthreads-perl", "libthreads-shared-perl", "lynx", "qrencode" );
$recommends = join(", ", @recommends);
open(CONTROL, ">$control_file");
print CONTROL <<EOF;

View File

@@ -87,7 +87,7 @@ Release: $rel
Provides: %{name}-%{version} perl(WebminCore)
Requires(pre): /usr/bin/perl
Requires: /bin/sh /usr/bin/perl perl(lib) perl(open) perl(Net::SSLeay) perl(Time::Local) perl(Data::Dumper) perl(File::Path) perl(File::Basename) perl(Digest::SHA) perl(Digest::MD5) openssl unzip tar gzip
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) perl(Socket6) lynx shared-mime-info perl-File-Basename perl-File-Path qrencode
Recommends: perl(DateTime) perl(DateTime::TimeZone) perl(DateTime::Locale) perl(Time::Piece) perl(Encode::Detect) perl(Time::HiRes) perl(Socket6) perl(threads) perl(threads::shared) lynx shared-mime-info perl-File-Basename perl-File-Path qrencode
AutoReq: 0
License: BSD-3-clause
Group: System/Tools

View File

@@ -269,9 +269,9 @@ application/x-director dcr dir dxr
application/x-dvi dvi # DVI
application/x-futuresplash spl
application/x-gtar gtar
application/gzip gz tgz # Gzipped data
application/x-gzip gz tgz # Gzipped data
application/x-hdf hdf
application/javascript js # Javascript source
application/x-javascript js # Javascript source
application/x-koan skp skd skt skm
application/x-latex latex # LaTeX source
application/x-netcdf nc cdf

View File

@@ -4894,7 +4894,7 @@ my %vital = ("port", 80,
"listen_delay", 5,
"pam", "webmin",
"sidname", "sid",
"unauth", "^/unauthenticated/ ^/robots.txt\$ ^[A-Za-z0-9\\-/_]+\\.jar\$ ^[A-Za-z0-9\\-/_]+\\.class\$ ^[A-Za-z0-9\\-/_]+\\.gif\$ ^[A-Za-z0-9\\-/_]+\\.png\$ ^[A-Za-z0-9\\-/_]+\\.conf\$ ^[A-Za-z0-9\\-/_]+\\.ico\$ ^/robots.txt\$ ^/service-worker.js\$",
"unauth", "^/unauthenticated/ ^/robots.txt\$ ^[A-Za-z0-9\\-/_]+\\.jar\$ ^[A-Za-z0-9\\-/_]+\\.class\$ ^[A-Za-z0-9\\-/_]+\\.gif\$ ^[A-Za-z0-9\\-/_]+\\.png\$ ^[A-Za-z0-9\\-/_]+\\.conf\$ ^[A-Za-z0-9\\-/_]+\\.ico\$ ^/robots.txt\$",
"max_post", 10000,
"expires", 7*24*60*60,
"pam_test_user", "root",

View File

@@ -117,11 +117,9 @@ elsif (@titles || @indexes) {
local @str = &table_structure($in{'db'}, $t);
push(@fields, scalar(@str));
}
my $table_index_stats = &get_table_index_stats($in{'db'});
foreach $t (@indexes) {
push(@types, $text{'dbase_typeindex'});
$str = &parse_index_structure($table_index_stats,
$in{'db'}, $t);
$str = &index_structure($in{'db'}, $t);
push(@rows, "<i>$text{'dbase_index'}</i>");
push(@fields, scalar(@{$str->{'cols'}}));
}

View File

@@ -26,13 +26,9 @@ if (@{$d->{'data'}}) {
$i++;
next if ($access{'perms'} == 2 && !&can_edit_db($u->[1]));
local @cols;
my $dbname = &unquote_mysql_database($u->[1]);
my $big_style = ' style="position: absolute; margin-top: -2px;"';
my $wildcard = $u->[1]=~ /\_/ &&
$u->[1] eq $dbname ? "<big$big_style></big>" : '';
push(@cols, "<a href='edit_db.cgi?idx=$i'>".
($u->[1] eq '%' || $u->[1] eq '' ? $text{'dbs_any'} :
&html_escape($dbname))."&nbsp;$wildcard</a>");
($u->[1] eq '%' || $u->[1] eq '' ? $text{'dbs_any'}
: &html_escape($u->[1]))."</a>");
push(@cols, $u->[2] eq '' ? $text{'dbs_anon'}
: &html_escape($u->[2]));
push(@cols, $u->[0] eq '%' ? $text{'dbs_any'} :

View File

@@ -675,15 +675,6 @@ $db =~ s/%/\\%/g;
return $db;
}
# unquote_mysql_database(name)
# Returns a MySQL database name with \% and \_ characters unescaped
sub unquote_mysql_database {
my ($db) = @_;
$db =~ s/\\%/%/g;
$db =~ s/\\_/_/g;
return $db;
}
# escapestr(string)
# Returns a string with quotes escaped, for use in SQL
sub escapestr
@@ -1313,39 +1304,6 @@ return &ui_textbox($name, $value, 8)."\n".
[ "M", "MB" ], [ "G", "GB" ] ]);
}
# get_table_index_stats(db)
# Retrieves index stats for all tables in the given database
sub get_table_index_stats
{
my ($db) = @_;
my @tables = &list_tables($db);
my $sql_query = "
SELECT
TABLE_SCHEMA,
TABLE_NAME,
INDEX_NAME,
NON_UNIQUE,
SEQ_IN_INDEX,
COLUMN_NAME,
COLLATION,
CARDINALITY,
SUB_PART,
PACKED,
NULLABLE,
INDEX_TYPE,
COMMENT,
INDEX_COMMENT
FROM
INFORMATION_SCHEMA.STATISTICS
WHERE
TABLE_SCHEMA = ?
AND
TABLE_NAME IN (" . join(", ", ("?") x @tables) . ")
";
my $rs = &execute_sql_safe($db, $sql_query, $db, @tables);
return $rs;
}
# list_indexes(db)
# Returns the names of all indexes in some database
sub list_indexes
@@ -1394,33 +1352,6 @@ foreach my $table (&list_tables($db)) {
return $info;
}
# parse_index_structure(&db_stats, db, indexname)
# Returns information on an index based on the database stats hash
sub parse_index_structure
{
my ($db_stats, $db, $index) = @_;
my ($r, $info);
foreach my $table (&list_tables($db)) {
my $s = { %$db_stats };
$s->{'data'} = [grep { $_->[1] eq $table } @{$s->{'data'}}];
my (%tp, $i);
for($i=0; $i<@{$s->{'titles'}}; $i++) {
$tp{lc($s->{'titles'}->[$i])} = $i;
}
foreach $r (@{$s->{'data'}}) {
if ($r->[$tp{'index_name'}] eq $index) {
# Found some info
$info->{'table'} = $r->[$tp{'table_name'}];
$info->{'name'} = $index;
$info->{'type'} = lc($r->[$tp{'index_type'}]) ||
lc($r->[$tp{'comment'}]);
push(@{$info->{'cols'}}, $r->[$tp{'column_name'}]);
}
}
}
return $info;
}
# list_views(db)
# Returns the names of all views in some database
sub list_views

View File

@@ -20,10 +20,12 @@ print &ui_tabs_start([ [ 'pkgs', $text{'index_tabpkgs'} ],
# See if any security updates exist
$in{'mode'} ||= 'updates';
@avail = &list_for_mode($in{'mode'}, 0);
($sec) = grep { $_->{'security'} } @avail;
# Show mode selector (all, updates only, updates and new)
@grid = ( );
foreach $m ('current', 'updates', 'security', 'new') {
foreach $m ('current', 'updates', 'new',
$sec || $in{'mode'} eq 'security' ? ( 'security' ) : ( )) {
$mmsg = $text{'index_mode_'.$m};
if ($in{'mode'} eq $m) {
push(@mlinks, "<b>$mmsg</b>");

View File

@@ -103,7 +103,6 @@ sched_yes=Scheduled checking for updates is now active.
sched_no=Scheduled checking for updates has been disabled.
log_update=Installed $1 updated packages
log_schedup=Background installed $1 updated packages
log_sched=Enabled scheduled updates
log_unsched=Disabled scheduled updates
log_refresh=Refreshed available packages

Some files were not shown because too many files have changed in this diff Show More