mirror of
https://github.com/webmin/webmin.git
synced 2026-02-05 15:12:15 +00:00
Compare commits
64 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25321b467b | ||
|
|
dc17b3cbe5 | ||
|
|
a4621a800b | ||
|
|
97308e69aa | ||
|
|
86144e16f7 | ||
|
|
b18b9decd4 | ||
|
|
90cd81893e | ||
|
|
9d7c3fdd9a | ||
|
|
c0e36426bd | ||
|
|
9dd678946d | ||
|
|
d440ba7f58 | ||
|
|
090a769145 | ||
|
|
bcec22b385 | ||
|
|
dbfc621482 | ||
|
|
6bc70a7738 | ||
|
|
f5b3f9cc1d | ||
|
|
24055330d3 | ||
|
|
0ac51a83e9 | ||
|
|
e517300fe0 | ||
|
|
ae34d0ef86 | ||
|
|
8236fb2fd8 | ||
|
|
f499c62da4 | ||
|
|
a51e3d0a22 | ||
|
|
e1398bf75b | ||
|
|
ba26d2aac0 | ||
|
|
7225ccab73 | ||
|
|
d224d0aafc | ||
|
|
8220fef7e0 | ||
|
|
1a658b1010 | ||
|
|
4c3b792adc | ||
|
|
19940bae86 | ||
|
|
256178c6c3 | ||
|
|
2a43a870c2 | ||
|
|
615765b995 | ||
|
|
6f7003965e | ||
|
|
d8a7a583a3 | ||
|
|
c51cc8f38a | ||
|
|
5210f623f3 | ||
|
|
ba4b65774e | ||
|
|
b1d273c555 | ||
|
|
b03f1b766f | ||
|
|
a9ed10401d | ||
|
|
253d85b6ee | ||
|
|
0247b71fb7 | ||
|
|
fd819d83e8 | ||
|
|
8c5fcef916 | ||
|
|
c15bbca109 | ||
|
|
c47c4b7ffd | ||
|
|
8efa25eabf | ||
|
|
190bd58b1b | ||
|
|
d645dc9345 | ||
|
|
963bb60c02 | ||
|
|
fa4e39ec9a | ||
|
|
c1b45ff210 | ||
|
|
5cb103bde3 | ||
|
|
7282348b7d | ||
|
|
e3a1fd849b | ||
|
|
1fb01aa46e | ||
|
|
779ebb4a63 | ||
|
|
c391830670 | ||
|
|
c8c6c3e40f | ||
|
|
c1f45d6d61 | ||
|
|
8804ba6529 | ||
|
|
11ae39081c |
@@ -7,13 +7,13 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
packages: git tar gzip openssl curl openssh-client rpm perl libjson-pp-perl libdigest-sha-perl liblist-moreutils-perl libencode-detect-perl zstd
|
||||
version: 1.0
|
||||
- uses: szenius/set-timezone@v1.2
|
||||
with:
|
||||
|
||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,5 +1,19 @@
|
||||
## 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
|
||||
@@ -12,7 +26,6 @@
|
||||
* 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 allow disabling the newly introduced enforcement of _sudo_-capable logins in the Terminal module
|
||||
* 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
|
||||
@@ -22,6 +35,7 @@
|
||||
* 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)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX qw(strftime);
|
||||
no warnings 'redefine';
|
||||
no warnings 'uninitialized';
|
||||
require './backup-config-lib.pl';
|
||||
@@ -59,7 +60,12 @@ print &ui_tabs_end_tab();
|
||||
|
||||
# Show immediate form
|
||||
print &ui_tabs_start_tab("tab", "backup");
|
||||
print &ui_form_start("backup.cgi/backup.tgz", "post");
|
||||
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_table_start($text{'index_header'}, undef, 2);
|
||||
|
||||
my @dmods = split(/\s+/, $config{'mods'} || "");
|
||||
|
||||
33
bin/patch
33
bin/patch
@@ -37,14 +37,16 @@ init_config();
|
||||
|
||||
# Check if curl is installed
|
||||
if (!has_command('curl')) {
|
||||
print "curl is not installed\n";
|
||||
print "\"curl\" command is not installed\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Check if git is installed
|
||||
if (!has_command('git')) {
|
||||
print "git is not installed\n";
|
||||
exit 1;
|
||||
if (!has_command('patch')) {
|
||||
if (!has_command('git')) {
|
||||
print "Neither \"patch\" nor \"git\" commands are installed\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
# Get patch URL or file
|
||||
@@ -96,14 +98,23 @@ else {
|
||||
$cmd = "cat @{[quotemeta($patch)]}";
|
||||
}
|
||||
|
||||
# Apply patch using Git
|
||||
my $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;
|
||||
}
|
||||
# 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+)/mg;
|
||||
print " $1\n" while $output =~ /^(?|Applied patch\s+(\S+)|patching file\s+(\S+))/mg;
|
||||
system("$config_dir/restart");
|
||||
|
||||
=pod
|
||||
|
||||
50
bind8/config-Ubuntu-Linux-24.04-ALL
Normal file
50
bind8/config-Ubuntu-Linux-24.04-ALL
Normal file
@@ -0,0 +1,50 @@
|
||||
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
|
||||
50
bind8/config-debian-linux-10.0-11.99
Normal file
50
bind8/config-debian-linux-10.0-11.99
Normal file
@@ -0,0 +1,50 @@
|
||||
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
|
||||
50
bind8/config-debian-linux-12.0-ALL
Normal file
50
bind8/config-debian-linux-12.0-ALL
Normal file
@@ -0,0 +1,50 @@
|
||||
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
|
||||
@@ -68,8 +68,28 @@ if (@keyrecs) {
|
||||
my $ds = &get_ds_record($zone);
|
||||
if ($ds) {
|
||||
print $text{'zonekey_ds'},"<br>\n";
|
||||
print &ui_textarea("ds", join("\n".$desc, split(/$desc/, $ds)), 2, 80, "off", 0,
|
||||
# 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,
|
||||
"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
|
||||
|
||||
@@ -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',
|
||||
$bind_version, "<tt>$chroot</tt>"));
|
||||
&get_bind_version(), "<tt>$chroot</tt>"));
|
||||
|
||||
# If the named.conf file does not exist, offer to create it
|
||||
if ($need_create) {
|
||||
|
||||
@@ -1282,6 +1282,10 @@ 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.
|
||||
|
||||
@@ -597,7 +597,13 @@ sub host_table
|
||||
{
|
||||
local ($i, $h, $parent);
|
||||
local @tds = ( "width=5" );
|
||||
print &ui_columns_start([ "", $text{'index_hostgroup'},
|
||||
my $hascmt;
|
||||
for ($i = $_[1]; $i < $_[2]; $i++) {
|
||||
$hascmt++ if ($_[4]->[$i] =~ /\(.*\)/);
|
||||
}
|
||||
print &ui_columns_start([ "",
|
||||
$text{'index_hostgroup'},
|
||||
$hascmt ? ( $text{'index_comment'} ) : ( ),
|
||||
$text{'index_parent'}, $text{'index_hardware'},
|
||||
$text{'index_nameip'} ], 100, 0, \@tds);
|
||||
for ($i = $_[1]; $i < $_[2]; $i++) {
|
||||
@@ -613,6 +619,10 @@ for ($i = $_[1]; $i < $_[2]; $i++) {
|
||||
$firstcol .= $text{'index_group'}." ";
|
||||
$sp = "\ \ ";
|
||||
}
|
||||
my $cmt;
|
||||
if ($_[4]->[$i] =~ s/\s+\((.*)\)//) {
|
||||
$cmt = $1;
|
||||
}
|
||||
if ($_[3]->[$i]) {
|
||||
$firstcol .= &ui_link($_[3]->[$i], $_[4]->[$i]);
|
||||
}
|
||||
@@ -620,6 +630,7 @@ 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'};
|
||||
@@ -648,7 +659,14 @@ sub net_table
|
||||
{
|
||||
local ($i, $n);
|
||||
local @tds = ( "width=5" );
|
||||
print &ui_columns_start([ "", $text{'index_net'}, $text{'index_netmask'},
|
||||
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'},
|
||||
$text{'index_desc'}, $text{'index_parent'} ], 100,
|
||||
0, \@tds);
|
||||
for ($i = $_[1]; $i < $_[2]; $i++) {
|
||||
@@ -661,6 +679,10 @@ for ($i = $_[1]; $i < $_[2]; $i++) {
|
||||
else {
|
||||
$sp = "\ \ ";
|
||||
}
|
||||
my $cmt;
|
||||
if ($_[4]->[$i] =~ s/\s+\((.*)\)//) {
|
||||
$cmt = $1;
|
||||
}
|
||||
if ($_[3]->[$i]) {
|
||||
$first .= &ui_link($_[3]->[$i],$_[4]->[$i]);
|
||||
}
|
||||
@@ -668,6 +690,7 @@ 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} ?
|
||||
|
||||
@@ -14,6 +14,7 @@ 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:
|
||||
|
||||
0
firewalld/block_ip.cgi
Normal file → Executable file
0
firewalld/block_ip.cgi
Normal file → Executable file
@@ -173,7 +173,10 @@ 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) {
|
||||
|
||||
@@ -45,6 +45,7 @@ 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
|
||||
|
||||
@@ -2212,6 +2212,7 @@ 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};
|
||||
@@ -2233,6 +2234,7 @@ foreach my $name (keys %info) {
|
||||
'pid' => $i->{'ExecMainPID'},
|
||||
'file' => $i->{'FragmentPath'} || $root."/".$name,
|
||||
});
|
||||
$done{$name}++;
|
||||
}
|
||||
|
||||
# Also add legacy init scripts
|
||||
@@ -2240,6 +2242,7 @@ 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 };
|
||||
|
||||
@@ -235,6 +235,7 @@ 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',
|
||||
@@ -267,10 +268,18 @@ elsif ($uri) {
|
||||
elsif (!$port && $proto eq "ldaps") {
|
||||
$port = 636;
|
||||
}
|
||||
$ldap = Net::LDAP->new($host, port => $port,
|
||||
scheme => $proto,
|
||||
inet6 => &should_use_inet6($host));
|
||||
if (!$ldap) {
|
||||
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) {
|
||||
$err = &text('ldap_econn',
|
||||
"<tt>$host</tt>","<tt>$port</tt>");
|
||||
}
|
||||
|
||||
@@ -4,3 +4,4 @@ slapd=slapd
|
||||
ldap_user=ldap
|
||||
browse_max=100
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=/etc/init.d/ldap stop
|
||||
apply_cmd=/etc/init.d/ldap restart
|
||||
init_name=ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ 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=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -9,3 +9,4 @@ apply_cmd=/etc/init.d/ldap restart
|
||||
init_name=ldap
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,6 +6,7 @@ browse_max=100
|
||||
start_cmd=systemctl start slapd
|
||||
stop_cmd=systemctl stop slapd
|
||||
apply_cmd=systemctl restart slapd
|
||||
init_name=ldap
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=/etc/init.d/slapd stop
|
||||
apply_cmd=/etc/init.d/slapd restart
|
||||
init_name=slapd
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=/etc/init.d/slapd stop
|
||||
apply_cmd=/etc/init.d/slapd restart
|
||||
init_name=slapd
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=/etc/init.d/slapd stop
|
||||
apply_cmd=/etc/init.d/slapd restart
|
||||
init_name=slapd
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -7,3 +7,4 @@ 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
|
||||
|
||||
@@ -8,3 +8,4 @@ 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
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=/etc/rc./init.d/ldap stop
|
||||
apply_cmd=/etc/rc./init.d/ldap restart
|
||||
init_name=ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=systemctl stop ldap
|
||||
apply_cmd=systemctl restart ldap
|
||||
init_name=ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -6,3 +6,4 @@ browse_max=100
|
||||
data_dir=/var/lib/openladp-data
|
||||
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -9,3 +9,4 @@ apply_cmd=/etc/init.d/ldap restart
|
||||
init_name=ldap
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -9,3 +9,4 @@ apply_cmd=systemctl restart slapd.service
|
||||
init_name=slapd
|
||||
data_dir=/var/lib/ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -5,3 +5,4 @@ slapd=/opt/csw/libexec/slapd
|
||||
ldap_user=ldap
|
||||
browse_max=100
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=/etc/init.d/ldap stop
|
||||
apply_cmd=/etc/init.d/ldap restart
|
||||
init_name=ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ config_file=/etc/ldap/slapd.conf
|
||||
stop_cmd=/etc/init.d/ldap stop
|
||||
attr_count=6
|
||||
browse_max=100
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -8,3 +8,4 @@ stop_cmd=/etc/rc./init.d/ldap stop
|
||||
apply_cmd=/etc/rc./init.d/ldap restart
|
||||
init_name=ldap
|
||||
attr_count=6
|
||||
ldapadd=ldapadd
|
||||
|
||||
@@ -7,6 +7,7 @@ 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
|
||||
|
||||
@@ -6,11 +6,10 @@ 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,\@tds);
|
||||
"basic", 1);
|
||||
|
||||
# Top-level DN
|
||||
$defdb = &get_default_db();
|
||||
@@ -74,7 +73,7 @@ print &ui_hidden_table_end("basic");
|
||||
|
||||
# SSL section
|
||||
print &ui_hidden_table_start($text{'slapd_header2'}, "width=100%", 2,
|
||||
"ssl", 0, \@tds);
|
||||
"ssl", 0);
|
||||
|
||||
# Protocols to serve
|
||||
if (&can_get_ldap_protocols()) {
|
||||
|
||||
@@ -18,7 +18,12 @@ if (&get_config_type() == 1) {
|
||||
}
|
||||
|
||||
# Show a table of all known schema files, with checkboxes
|
||||
print $text{'schema_pagedesc'},"<p>\n";
|
||||
if (&get_config_type() == 1) {
|
||||
print $text{'schema_pagedesc'},"<p>\n";
|
||||
}
|
||||
else {
|
||||
print $text{'schema_pagedesc2'},"<p>\n";
|
||||
}
|
||||
@tds = ( $editable ? ( "width=5" ) : ( ),
|
||||
"width=20%", "width=65%", "width=10%", "width=5% nowrap" );
|
||||
print &ui_form_start("save_schema.cgi", "post");
|
||||
@@ -31,8 +36,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'}),
|
||||
@@ -56,6 +61,8 @@ 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'},
|
||||
|
||||
61
ldap-server/import_sfile.cgi
Executable file
61
ldap-server/import_sfile.cgi
Executable file
@@ -0,0 +1,61 @@
|
||||
#!/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'});
|
||||
@@ -84,11 +84,13 @@ 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
|
||||
@@ -214,6 +216,7 @@ 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
|
||||
|
||||
@@ -328,4 +331,13 @@ 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
|
||||
|
||||
@@ -526,6 +526,7 @@ 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', $!);
|
||||
}
|
||||
}
|
||||
@@ -564,6 +565,9 @@ 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);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/pam_ldap/auth_ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/usr/share/libnss-ldap/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaSamAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/libnss-ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaSamAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaSamAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/ldap/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaSamAccount
|
||||
imap_class=SquirrelMailUser inetLocalMailRecipient
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/openldap/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/openldap/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaSamAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/openldap/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
samba_class=sambaAccount
|
||||
auth_ldap=/etc/pam_ldap/auth_ldap.conf
|
||||
ldap_tls=0
|
||||
imap_login=cyrus
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/openldap/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
auth_ldap=/etc/openldap/ldap.conf
|
||||
imap_login=cyrus
|
||||
samba_class=sambaAccount
|
||||
imap_class=SuSEeMailObject
|
||||
|
||||
@@ -8,8 +8,9 @@ do 'ldap-useradmin-lib.pl';
|
||||
# For mode 0, returns 1 if installed, 0 if not
|
||||
sub is_installed
|
||||
{
|
||||
if ($config{'auth_ldap'}) {
|
||||
return 0 if (!-r $config{'auth_ldap'});
|
||||
my $cfile = &ldap_client::get_ldap_config_file();
|
||||
if ($cfile) {
|
||||
return 0 if (!-r $cfile);
|
||||
}
|
||||
else {
|
||||
if ($_[0]) {
|
||||
|
||||
@@ -92,8 +92,15 @@ 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;
|
||||
@@ -103,8 +110,15 @@ 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;
|
||||
@@ -241,6 +255,9 @@ my $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);
|
||||
|
||||
@@ -3,3 +3,4 @@ lines=100
|
||||
others=1
|
||||
reverse=1
|
||||
log_any=0
|
||||
compressed=1
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
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
|
||||
|
||||
@@ -143,11 +143,9 @@ if (!@acols) {
|
||||
}
|
||||
|
||||
# If we jump directly to logs just redirect
|
||||
if ($config{'skip_index'} == 1) {
|
||||
if ($lnks[0]) {
|
||||
&redirect($lnks[0]);
|
||||
exit;
|
||||
}
|
||||
if ($config{'skip_index'} == 1 && $lnks[0]) {
|
||||
&redirect($lnks[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
# Print the header
|
||||
|
||||
@@ -251,5 +251,29 @@ 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
Normal file → Executable file
0
logviewer/view_log_progress.cgi
Normal file → Executable file
@@ -117,9 +117,11 @@ 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 = &index_structure($in{'db'}, $t);
|
||||
$str = &parse_index_structure($table_index_stats,
|
||||
$in{'db'}, $t);
|
||||
push(@rows, "<i>$text{'dbase_index'}</i>");
|
||||
push(@fields, scalar(@{$str->{'cols'}}));
|
||||
}
|
||||
|
||||
@@ -26,9 +26,13 @@ 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($u->[1]))."</a>");
|
||||
($u->[1] eq '%' || $u->[1] eq '' ? $text{'dbs_any'} :
|
||||
&html_escape($dbname))." $wildcard</a>");
|
||||
push(@cols, $u->[2] eq '' ? $text{'dbs_anon'}
|
||||
: &html_escape($u->[2]));
|
||||
push(@cols, $u->[0] eq '%' ? $text{'dbs_any'} :
|
||||
|
||||
@@ -675,6 +675,15 @@ $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
|
||||
@@ -1304,6 +1313,39 @@ 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
|
||||
@@ -1352,6 +1394,33 @@ 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
|
||||
|
||||
@@ -103,7 +103,7 @@ 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_sched=Background 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
|
||||
|
||||
@@ -18,8 +18,8 @@ elsif ($type eq 'repo') {
|
||||
elsif ($action eq 'update') {
|
||||
return &text('log_update', $object);
|
||||
}
|
||||
elsif ($action eq 'sched') {
|
||||
return &text('log_sched', $object);
|
||||
elsif ($action eq 'schedup') {
|
||||
return &text('log_schedup', $object);
|
||||
}
|
||||
elsif ($action eq 'sched') {
|
||||
return $text{$object ? 'log_sched' : 'log_unsched'};
|
||||
|
||||
@@ -74,5 +74,5 @@ if ($config{'sched_email'} && $body) {
|
||||
|
||||
# Log the update, if anything was installed
|
||||
if ($icount) {
|
||||
&webmin_log("sched", "packages", $icount);
|
||||
&webmin_log("schedup", "packages", $icount);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,20 @@ return ( ) if ($?);
|
||||
my @lines = split(/\r?\n/, $out);
|
||||
my @w = split(/\s+/, $lines[$#lines]);
|
||||
shift(@w) if ($w[0] eq '');
|
||||
return ( $w[-3], $w[-2], $w[-1], 0, 0, undef, undef );
|
||||
my ($bi, $bo) = (0, 0);
|
||||
my $out2 = &backquote_command("iostat -Ix -d -t da 0.25 2 2>/dev/null");
|
||||
if (!$?) {
|
||||
foreach my $l (split(/\r?\n/, $out2)) {
|
||||
# Getting the 4th and 5th columns of the last line for direct access device
|
||||
# device r/i w/i kr/i kw/i qlen tsvc_t/i sb/i
|
||||
# ada0 3457.0 134574.0 61068.0 8443152.0 0 36.3 19.2
|
||||
if ($l =~ /^.*?da\d+\s+\S+\s+\S+\s+(\S+)\s+(\S+)\s+\d/) {
|
||||
$bi = int($1) * 4; # kr/i per period, i.e. 0.25 seconds
|
||||
$bo = int($2) * 4; # kw/i per period, i.e. 0.25 seconds
|
||||
}
|
||||
}
|
||||
}
|
||||
return ( $w[-3], $w[-2], $w[-1], 0, 0, $bi, $bo );
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -156,14 +156,14 @@ else {
|
||||
close(OUTr); close(INw);
|
||||
|
||||
if ($_[1]) {
|
||||
local @u = getpwuid($_[1]);
|
||||
if (defined($_[2])) {
|
||||
# switch to given UID and GID
|
||||
&switch_to_unix_user(
|
||||
[ undef, undef, $_[1], $_[2] ]);
|
||||
[ $u[0], undef, $_[1], $_[2] ]);
|
||||
}
|
||||
else {
|
||||
# switch to UID and all GIDs
|
||||
local @u = getpwuid($_[1]);
|
||||
&switch_to_unix_user(\@u);
|
||||
}
|
||||
}
|
||||
@@ -286,8 +286,9 @@ if (!$@) {
|
||||
|
||||
close(STDIN); close(STDOUT); close(STDERR);
|
||||
untie(*STDIN); untie(*STDOUT); untie(*STDERR);
|
||||
if ($_[1]) {
|
||||
&switch_to_unix_user([ undef, undef, $_[1], $_[2] ]);
|
||||
if ($uid) {
|
||||
my $username = getpwuid($uid);
|
||||
&switch_to_unix_user([ $username, undef, $uid, $gid ]);
|
||||
}
|
||||
|
||||
close($ptyfh); # Used by other side only
|
||||
@@ -345,8 +346,9 @@ else {
|
||||
close(STDIN); close(STDOUT); close(STDERR);
|
||||
untie(*STDIN); untie(*STDOUT); untie(*STDERR);
|
||||
#setpgrp(0, $$);
|
||||
if ($_[1]) {
|
||||
&switch_to_unix_user([ undef, undef, $_[1], $_[2] ]);
|
||||
if ($uid) {
|
||||
my $username = getpwuid($uid);
|
||||
&switch_to_unix_user([ $username, undef, $uid, $gid ]);
|
||||
}
|
||||
|
||||
open(STDIN, "<$tty");
|
||||
@@ -708,5 +710,29 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
# count_processes()
|
||||
sub count_processes
|
||||
{
|
||||
my $process_count = 0;
|
||||
if ($gconfig{'os_type'} eq 'windows') {
|
||||
open(my $ps, '-|', 'tasklist /FO CSV') || return -1;
|
||||
while (my $line = <$ps>) {
|
||||
next if $. == 1; # Skip the header line
|
||||
$process_count++;
|
||||
}
|
||||
close($ps);
|
||||
return $process_count;
|
||||
}
|
||||
else {
|
||||
open(my $ps, '-|', 'ps -e') || return -1;
|
||||
while (<$ps>) {
|
||||
$process_count++;
|
||||
}
|
||||
close($ps);
|
||||
# Skip the header line
|
||||
return $process_count - 1;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
webmin_host="download.webmin.com"
|
||||
webmin_download="https://$webmin_host"
|
||||
webmin_download_nightly="https://builds.webmin.dev"
|
||||
webmin_download_nightly="https://download.webmin.dev"
|
||||
webmin_key="developers-key.asc"
|
||||
webmin_key_download="$webmin_download/$webmin_key"
|
||||
webmin_key_suffix="webmin-developers"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
sub get_alive_status
|
||||
{
|
||||
local $out = `uptime 2>/dev/null`;
|
||||
local $out = &backquote_command("uptime 2>/dev/null");
|
||||
return { 'up' => 1,
|
||||
'desc' => $out =~ /\s+up\s+([^,]+),/ ? &text('alive_up', "$1")
|
||||
: undef };
|
||||
|
||||
9
status/firewalld-monitor.pl
Normal file
9
status/firewalld-monitor.pl
Normal file
@@ -0,0 +1,9 @@
|
||||
# Monitorthe firewalld server on this host
|
||||
|
||||
sub get_firewalld_status
|
||||
{
|
||||
my ($mon, $mod) = @_;
|
||||
return { 'up' => -1 } if (!&foreign_installed("firewalld"));
|
||||
&foreign_require("firewalld");
|
||||
return { 'up' => &firewalld::is_firewalld_running() };
|
||||
}
|
||||
@@ -182,7 +182,9 @@ if ($access{'edit'}) {
|
||||
print &ui_submit($text{'index_madd'});
|
||||
my @opts;
|
||||
foreach $h (sort { $a->[1] cmp $b->[1] } &list_handlers()) {
|
||||
push(@opts, [ $h->[0], $h->[1] ]);
|
||||
if (!$h->[2]) {
|
||||
push(@opts, [ $h->[0], $h->[1] ]);
|
||||
}
|
||||
}
|
||||
print &ui_select("type", undef, \@opts);
|
||||
print &ui_form_end();
|
||||
|
||||
@@ -76,6 +76,7 @@ type_slapd=LDAP Server
|
||||
type_ldap=LDAP Connection
|
||||
type_smtp=SMTP Connection
|
||||
type_imap=IMAP Connection
|
||||
type_firewalld=FirewallD Server
|
||||
|
||||
mon_create=Create Monitor
|
||||
mon_edit=Edit Monitor
|
||||
|
||||
@@ -43,6 +43,8 @@ $templates_dir = "$module_config_directory/templates";
|
||||
%monitor_os_support = ( 'traffic' => { 'os_support' => '*-linux freebsd' },
|
||||
);
|
||||
|
||||
%monitor_deprecated = ( 'dnsadmin' => 1 );
|
||||
|
||||
@monitor_statuses = ( 'up', 'down', 'un', 'webmin', 'timed', 'isdown' );
|
||||
|
||||
$mysql_variant = "mysql";
|
||||
@@ -230,7 +232,8 @@ return map { $_->{'dir'} } grep { &check_os_support($_) }
|
||||
|
||||
# list_handlers()
|
||||
# Returns a list of the module's monitor type handlers, and those
|
||||
# defined in other modules.
|
||||
# defined in other modules. Each is a array ref with ID, description
|
||||
# and deprecated fields.
|
||||
sub list_handlers
|
||||
{
|
||||
my ($f, @rv);
|
||||
@@ -240,7 +243,8 @@ while($f = readdir(DIR)) {
|
||||
my $m = $1;
|
||||
my $oss = $monitor_os_support{$m};
|
||||
next if ($oss && !&check_os_support($oss));
|
||||
push(@rv, [ $m, $text{"type_$m"} ]);
|
||||
my $dep = $monitor_deprecated{$m} ? 1 : 0;
|
||||
push(@rv, [ $m, $text{"type_$m"}, $dep ]);
|
||||
}
|
||||
}
|
||||
closedir(DIR);
|
||||
@@ -252,7 +256,7 @@ foreach my $m (&get_all_module_infos()) {
|
||||
&check_os_support($m)) {
|
||||
&foreign_require($m->{'dir'}, "status_monitor.pl");
|
||||
my @mms = &foreign_call($m->{'dir'}, "status_monitor_list");
|
||||
push(@rv, map { [ $m->{'dir'}."::".$_->[0], $_->[1] ] } @mms);
|
||||
push(@rv, map { [ $m->{'dir'}."::".$_->[0], $_->[1], $_->[2] ] } @mms);
|
||||
}
|
||||
}
|
||||
return @rv;
|
||||
|
||||
@@ -1690,7 +1690,7 @@ if (!$tconfig{'nohr'} && !$tconfig{'nobottomhr'}) {
|
||||
return $rv;
|
||||
}
|
||||
|
||||
=head2 ui_print_header(subtext, image, [help], [config], [nomodule], [nowebmin], [rightside], [head-stuff], [body-stuff], [below])
|
||||
=head2 ui_print_header(subtext, title, image, [help], [config], [nomodule], [nowebmin], [rightside], [head-stuff], [body-stuff], [below])
|
||||
|
||||
Print HTML for a header with the post-header line. The args are the same
|
||||
as those passed to header(), defined in web-lib-funcs.pl, with the addition
|
||||
|
||||
@@ -13718,6 +13718,7 @@ my ($port, $host, $module) = @_;
|
||||
$module ||= $module_name;
|
||||
my $ws_proto = lc($ENV{'HTTPS'}) eq 'on' ? 'wss' : 'ws';
|
||||
my %miniserv;
|
||||
my $webprefix = &get_webprefix();
|
||||
&get_miniserv_config(\%miniserv);
|
||||
my $http_host_conf = &trim($miniserv{'websocket_host'} || $host);
|
||||
# Pass as defined
|
||||
@@ -13731,12 +13732,12 @@ if ($http_host_conf) {
|
||||
if (!defined($http_host_conf)) {
|
||||
my $forwarded_host = $ENV{'HTTP_X_FORWARDED_HOST'};
|
||||
if ($forwarded_host) {
|
||||
$http_host_conf = "$ws_proto://$forwarded_host".
|
||||
&get_webprefix();
|
||||
$http_host_conf =~ s/\/$//;
|
||||
$http_host_conf = "$ws_proto://$forwarded_host";
|
||||
$http_host_conf =~ s/[\/]+$//g;
|
||||
}
|
||||
}
|
||||
my $http_host = $http_host_conf || "$ws_proto://$ENV{'HTTP_HOST'}";
|
||||
$http_host .= $webprefix if ($webprefix);
|
||||
return "$http_host/$module/ws-$port";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user