mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Compare commits
154 Commits
dev/xterm-
...
2.202
| 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 | ||
|
|
2751224d4d | ||
|
|
6fce9fa491 | ||
|
|
41fdb5dac2 | ||
|
|
4ffca4597c | ||
|
|
ecfc06d9c6 | ||
|
|
db55dde7ce | ||
|
|
c6edd4b97d | ||
|
|
8cd2dbae96 | ||
|
|
8676a3fb21 | ||
|
|
27339eb1bf | ||
|
|
e014926854 | ||
|
|
a721f60f9c | ||
|
|
46c76e13f9 | ||
|
|
f72058306b | ||
|
|
a15446d3b1 | ||
|
|
fc9ce7f3dd | ||
|
|
72cd50a054 | ||
|
|
e307fb4dcd | ||
|
|
d631929194 | ||
|
|
db9628e7eb | ||
|
|
2c04c04ce7 | ||
|
|
a5301245d3 | ||
|
|
165af690c7 | ||
|
|
29da8ea3d0 | ||
|
|
73b7e62f13 | ||
|
|
76141ce22f | ||
|
|
4b575b8168 | ||
|
|
2b28521297 | ||
|
|
be767951ca | ||
|
|
9960d6011f | ||
|
|
461bd30e2a | ||
|
|
2f88a4eefb | ||
|
|
c9f368d264 | ||
|
|
0e24e8ac61 | ||
|
|
1d0d25efac | ||
|
|
1c5d2d2bd7 | ||
|
|
77e809166c | ||
|
|
927a2c32d8 | ||
|
|
4a3c6c4854 | ||
|
|
37beab77ba | ||
|
|
82f5284ffc | ||
|
|
5f579e8ded | ||
|
|
4b66ac0be5 | ||
|
|
e69fb75c8e | ||
|
|
ff8781c112 | ||
|
|
0dd75db8d8 | ||
|
|
05d01aeef3 | ||
|
|
11f2bc20eb | ||
|
|
52c3178b92 | ||
|
|
e3dec2222d | ||
|
|
05752faec0 | ||
|
|
7507433bf1 | ||
|
|
248cb719c0 | ||
|
|
94b7fdf0ec | ||
|
|
d89f6411b6 | ||
|
|
01d08a3605 | ||
|
|
1cf3813fb6 | ||
|
|
1216ae709b | ||
|
|
3d9497ff45 | ||
|
|
a6832450d1 | ||
|
|
e41037388c | ||
|
|
a7b3af534b | ||
|
|
87e006ceeb | ||
|
|
fbee8f0588 | ||
|
|
e077b4da94 | ||
|
|
38efad8265 | ||
|
|
4d2a1fa084 | ||
|
|
13b2eca3b1 | ||
|
|
aa4c3b1de6 | ||
|
|
edaab4fd6f | ||
|
|
6fded0862c | ||
|
|
4006b0454e | ||
|
|
5d4ab58baa | ||
|
|
e6c7a60fe6 | ||
|
|
a75781d61a | ||
|
|
45348f5b02 | ||
|
|
548c078813 | ||
|
|
76ccb2b7ed | ||
|
|
61d2081371 | ||
|
|
458916b4d8 | ||
|
|
37451ad905 | ||
|
|
9eec58a1f1 | ||
|
|
178f527afa | ||
|
|
cd1555b3e1 | ||
|
|
2d7cfca67f | ||
|
|
e92a35b3ed | ||
|
|
e35efd0f00 | ||
|
|
a12f385a5b | ||
|
|
5dc7cfafd7 | ||
|
|
35aee74311 |
@@ -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:
|
||||
|
||||
38
CHANGELOG.md
38
CHANGELOG.md
@@ -1,5 +1,43 @@
|
||||
## 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
@@ -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'} || "");
|
||||
|
||||
164
bin/patch
Executable file
164
bin/patch
Executable file
@@ -0,0 +1,164 @@
|
||||
#!/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>
|
||||
@@ -1988,6 +1988,8 @@ if (@transfer) {
|
||||
}
|
||||
}
|
||||
if (@notify) {
|
||||
my %done;
|
||||
@notify = grep { !$done{$_->{'name'}}++ } @notify;
|
||||
my $also = { 'name' => 'also-notify',
|
||||
'type' => 1,
|
||||
'members' => \@notify};
|
||||
@@ -1996,6 +1998,8 @@ if (@notify) {
|
||||
'values' => [ 'yes' ] });
|
||||
}
|
||||
if (@transfer) {
|
||||
my %done;
|
||||
@transfer = grep { !$done{$_->{'name'}}++ } @transfer;
|
||||
my $allow = { 'name' => 'allow-transfer',
|
||||
'type' => 1,
|
||||
'members' => \@transfer };
|
||||
|
||||
@@ -17,7 +17,6 @@ $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' => [ ] };
|
||||
|
||||
@@ -38,33 +37,6 @@ 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 = ( );
|
||||
|
||||
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.
|
||||
|
||||
@@ -24,46 +24,6 @@ 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 = ( );
|
||||
|
||||
@@ -21,7 +21,7 @@ if ($in{'source'} == 0) {
|
||||
if (!$in{'local'})
|
||||
{ &install_error($text{'download_elocal'}); }
|
||||
if (!-r $in{'local'})
|
||||
{ &install_error(&text('download_elocal2', $in{'local'})); }
|
||||
{ &install_error(&text('download_elocal2', &html_escape($in{'local'}))); }
|
||||
$source = $in{'local'};
|
||||
@pfile = ( $in{'local'} );
|
||||
$need_unlink = 0;
|
||||
@@ -91,8 +91,9 @@ elsif ($in{'source'} == 3) {
|
||||
$i = 0;
|
||||
@fallback = ( );
|
||||
foreach $yum (@cpanyum) {
|
||||
print &text('download_yum', "<tt>$cpan[$i]</tt>",
|
||||
"<tt>$yum->{'package'}</tt>"),"<br>\n";
|
||||
print &text('download_yum',
|
||||
"<tt>".&html_escape($cpan[$i])."</tt>",
|
||||
"<tt>".&html_escape($yum->{'package'})."</tt>"),"<br>\n";
|
||||
print "<ul>\n";
|
||||
@got = &software::update_system_install(
|
||||
$yum->{'package'});
|
||||
@@ -154,7 +155,8 @@ elsif ($in{'source'} == 3) {
|
||||
|
||||
# Fail if any modules are missing from CPAN
|
||||
for($i=0; $i<@cpan; $i++) {
|
||||
push(@missing, "<tt>$cpan[$i]</tt>") if (!$source[$i]);
|
||||
push(@missing, "<tt>".&html_escape($cpan[$i])."</tt>")
|
||||
if (!$source[$i]);
|
||||
}
|
||||
|
||||
if ($in{'missingok'}) {
|
||||
@@ -167,11 +169,12 @@ elsif ($in{'source'} == 3) {
|
||||
}
|
||||
}
|
||||
@cpan || &install_error(&text('download_ecpan',
|
||||
join(" ", @missing)));
|
||||
&html_escape(join(" ", @missing))));
|
||||
}
|
||||
elsif (@missing) {
|
||||
# Fail due to missing modules
|
||||
&install_error(&text('download_ecpan', join(" ", @missing)));
|
||||
&install_error(&text('download_ecpan',
|
||||
&html_escape(join(" ", @missing))));
|
||||
}
|
||||
$source = join("<br>", @source);
|
||||
|
||||
@@ -192,14 +195,16 @@ elsif ($in{'source'} == 3) {
|
||||
&ftp_download($host, $file, $pfile, \$error,
|
||||
\&progress_callback);
|
||||
}
|
||||
else { &install_error(&text('download_eurl', $m)); }
|
||||
else {
|
||||
&install_error(&text('download_eurl',&html_escape($m)));
|
||||
}
|
||||
&install_error($error) if ($error);
|
||||
push(@pfile, $pfile);
|
||||
}
|
||||
$need_unlink = 1;
|
||||
}
|
||||
else {
|
||||
&error("Unknown source mode $in{'source'}");
|
||||
&error("Unknown source mode ".&html_escape($in{'source'}));
|
||||
}
|
||||
|
||||
# Check if the file looks like a perl module
|
||||
@@ -287,7 +292,7 @@ foreach $d (@dirs) {
|
||||
close(MAKEFILE);
|
||||
push(@allreqs, @prereqs);
|
||||
}
|
||||
system("rm -rf $mtemp");
|
||||
&unlink_file($mtemp);
|
||||
|
||||
# Work out which pre-requesites are missing
|
||||
@allreqs = &unique(@allreqs);
|
||||
|
||||
@@ -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-name</tt> option,0-Name or member count,2-Description
|
||||
desc_name=Show other object descriptions instead of names?,1,1-Yes,0-No
|
||||
desc_name=Show descriptions instead of names?,1,1-Description only,0-Name only,2-Both name and description
|
||||
display_max=Maximum number of subnets and hosts to display,3,Unlimited
|
||||
add_file=Add new subnets, hosts and groups to file,3,Main configuration file
|
||||
line2=System configuration,11
|
||||
|
||||
@@ -7,7 +7,6 @@ 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-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, hosts i grups al fitxer,3,Fitxer de configuració principal
|
||||
line2=Configuració del sistema,11
|
||||
|
||||
@@ -6,7 +6,6 @@ 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
|
||||
|
||||
@@ -6,7 +6,6 @@ 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-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
|
||||
|
||||
@@ -7,7 +7,6 @@ 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-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, Hosts und Gruppen in einer Datei hinzu,3,Haupt-Konfigurationsdatei
|
||||
line2=Systemkonfiguration,11
|
||||
|
||||
@@ -6,7 +6,6 @@ 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
|
||||
|
||||
@@ -6,7 +6,6 @@ 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
|
||||
|
||||
@@ -6,7 +6,6 @@ lease_tz=リース時間の表示形式,1,0-GMT,1-ローカル時間
|
||||
show_ip=ホストのIPアドレスを表示しますか?,1,1-はい,0-いいえ
|
||||
show_mac=ホストのMACアドレスを表示しますか?,1,1-はい,0-いいえ
|
||||
group_name=グループ名の表示方法,1,1-<tt>ドメイン-名</tt> オプション,0-名前またはメンバー数
|
||||
desc_name=名称の替わりにオブジェクトの説明を表示しますか?,1,1-はい,0-いいえ
|
||||
display_max=サブネットとホストの表示する最大数,3,無制限
|
||||
line2=システム設定,11
|
||||
dhcpd_conf=DHCPサーバ 設定ファイル,0
|
||||
|
||||
@@ -7,7 +7,6 @@ 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-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, host en groepen aan file,3,Hoofd configuratie file
|
||||
line2=Systeem configuratie,11
|
||||
|
||||
@@ -7,7 +7,6 @@ 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-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, verter og grupper i filen,3,Hoved konfigurasjonsfil
|
||||
line2=System konfigurasjon,11
|
||||
|
||||
@@ -7,7 +7,6 @@ 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-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, hosty i grupy do pliku,3,Główny plik konfiguracyjny
|
||||
line2=Opcje systemowe,11
|
||||
|
||||
@@ -6,7 +6,6 @@ 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-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, hosts e grupos para arquivo,3,Arquivo principal de configuração
|
||||
line2=Configuração do sistema,11
|
||||
|
||||
@@ -6,7 +6,6 @@ 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
|
||||
|
||||
@@ -211,14 +211,18 @@ foreach $u (@subn) {
|
||||
push(@sicons, $i = "images/shared.gif");
|
||||
push(@checkboxids, $u->{'index'});
|
||||
}
|
||||
if ($config{'desc_name'} && $u->{'comment'}) {
|
||||
push(@utitles, $t = &html_escape($u->{'comment'}));
|
||||
if ($config{'desc_name'} == 0) {
|
||||
$t = $u->{'values'}->[0];
|
||||
}
|
||||
elsif ($config{'desc_name'} == 1) {
|
||||
$t = $u->{'comment'} || $u->{'values'}->[0];
|
||||
}
|
||||
else {
|
||||
push(@utitles, $t = &html_escape($u->{'values'}->[0]));
|
||||
$t = $u->{'values'}->[0].($u->{'comment'} ? " ($u->{'comment'})" : "");
|
||||
}
|
||||
push(@utitles, &html_escape($t));
|
||||
push(@uslinks, $l); # so that ordering is preserved
|
||||
push(@ustitles, $t);
|
||||
push(@ustitles, &html_escape($t));
|
||||
push(@usicons, $i);
|
||||
}
|
||||
@checkboxes = map { &ui_checkbox("d", $_) } @checkboxids;
|
||||
@@ -336,12 +340,16 @@ foreach $h (@host) {
|
||||
(defined($subnet{$h}) ? "&uidx=$subnet{$h}" : "").
|
||||
(defined($shared{$h}) ? "&sidx=$shared{$h}" : "") :
|
||||
undef);
|
||||
if ($config{'desc_name'} && $h->{'comment'}) {
|
||||
push(@htitles, &html_escape($h->{'comment'}));
|
||||
if ($config{'desc_name'} == 0) {
|
||||
$t = $h->{'values'}->[0];
|
||||
}
|
||||
elsif ($config{'desc_name'} == 1) {
|
||||
$t = $h->{'comment'} || $h->{'values'}->[0];
|
||||
}
|
||||
else {
|
||||
push(@htitles, &html_escape($h->{'values'}->[0]));
|
||||
$t = $h->{'values'}->[0].($h->{'comment'} ? " ($h->{'comment'})" : "");
|
||||
}
|
||||
push(@htitles, &html_escape($t));
|
||||
if ($config{'show_ip'}) {
|
||||
$fv = &fixedaddr($h);
|
||||
$htitles[$#htitles] .= "<br>".$fv if ($fv);
|
||||
@@ -589,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++) {
|
||||
@@ -605,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]);
|
||||
}
|
||||
@@ -612,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'};
|
||||
@@ -640,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++) {
|
||||
@@ -653,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]);
|
||||
}
|
||||
@@ -660,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:
|
||||
|
||||
@@ -95,7 +95,7 @@ foreach (@lines) {
|
||||
}
|
||||
}
|
||||
elsif (/^(\s*)(#?)([a-z0-9\_]+)\s+=\s*(.*)/) {
|
||||
# A directive inside a section
|
||||
# A directive which may or may not be 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,6 +391,17 @@ foreach my $m (@{$section->{'members'}}) {
|
||||
}
|
||||
}
|
||||
|
||||
# delete_section(&conf, §ion)
|
||||
# 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
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ if (@jails) {
|
||||
$col =~ s/\s/_/g;
|
||||
if ($col !~ /journal_matches/ &&
|
||||
$col !~ /file_list/) {
|
||||
push(@head, "<div $tdc>".$text{"status_head_$col"}."</div>");
|
||||
push(@head, "<span $tdc>".$text{"status_head_$col"}."</span>");
|
||||
if ($col =~ /banned_ip_list/) {
|
||||
$jips = $val;
|
||||
my @ips = split(/\s+/, $val);
|
||||
|
||||
@@ -350,7 +350,7 @@ if ($fh6) {
|
||||
while(1) {
|
||||
$$port++;
|
||||
if ($$port < 0 || $$port > 65535) {
|
||||
return "Failed to allocate a free port number: $port";
|
||||
return "Failed to allocate a free port number: $$port";
|
||||
}
|
||||
$pack = pack_sockaddr_in($$port, INADDR_ANY);
|
||||
next if (!bind($fh, $pack));
|
||||
|
||||
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
|
||||
|
||||
@@ -1,7 +1 @@
|
||||
body blockquote:not([style*="border-left"]) {
|
||||
border-left: 1px solid #ccc;
|
||||
margin-left: 6px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding-left: 12px;
|
||||
}
|
||||
body blockquote:not([style*="border-left"]){border-left:1px solid #ccc;margin-left:6px;margin-top:0;margin-bottom:0;padding-left:12px;}pre{white-space:break-spaces;margin:0 0 4px 0}
|
||||
@@ -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 };
|
||||
@@ -2371,6 +2374,8 @@ if (ref($opts)) {
|
||||
&print_tempfile(CFILE, "ExecReload=$kill -HUP \$MAINPID\n") if ($opts->{'reload'} eq '0');
|
||||
&print_tempfile(CFILE, "ExecStop=$opts->{'stop'}\n") if ($opts->{'stop'});
|
||||
&print_tempfile(CFILE, "ExecReload=$opts->{'reload'}\n") if ($opts->{'reload'});
|
||||
&print_tempfile(CFILE, "ExecStartPre=$opts->{'startpre'}\n") if ($opts->{'startpre'});
|
||||
&print_tempfile(CFILE, "ExecStartPost=$opts->{'startpost'}\n") if ($opts->{'startpost'});
|
||||
&print_tempfile(CFILE, "Type=$opts->{'type'}\n") if ($opts->{'type'});
|
||||
&print_tempfile(CFILE, "Environment=\"$opts->{'env'}\"\n") if ($opts->{'env'});
|
||||
&print_tempfile(CFILE, "User=$opts->{'user'}\n") if ($opts->{'user'});
|
||||
@@ -2381,8 +2386,8 @@ if (ref($opts)) {
|
||||
&print_tempfile(CFILE, "RestartSec=$opts->{'restartsec'}\n") if ($opts->{'restartsec'});
|
||||
&print_tempfile(CFILE, "TimeoutSec=$opts->{'timeout'}\n") if ($opts->{'timeout'});
|
||||
&print_tempfile(CFILE, "TimeoutStopSec=$opts->{'timeoutstopsec'}\n") if ($opts->{'timeoutstopsec'});
|
||||
&print_tempfile(CFILE, "StandardOutput=file:$opts->{'logstd'}\n") if ($opts->{'logstd'});
|
||||
&print_tempfile(CFILE, "StandardError=file:$opts->{'logerr'}\n") if ($opts->{'logerr'});
|
||||
&print_tempfile(CFILE, "StandardOutput=".($opts->{'logstd'} =~ /^\// ? 'file:' : '')."$opts->{'logstd'}\n") if ($opts->{'logstd'});
|
||||
&print_tempfile(CFILE, "StandardError=".($opts->{'logerr'} =~ /^\// ? 'file:' : '')."$opts->{'logerr'}\n") if ($opts->{'logerr'});
|
||||
}
|
||||
|
||||
&print_tempfile(CFILE, "\n");
|
||||
|
||||
@@ -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;
|
||||
@@ -230,31 +244,35 @@ return @list_users_cache;
|
||||
# it to the LDAP database
|
||||
sub create_user
|
||||
{
|
||||
local $ldap = &ldap_connect();
|
||||
local $base = &get_user_base();
|
||||
$_[0]->{'dn'} = "uid=$_[0]->{'user'},$base";
|
||||
local @classes = ( &def_user_obj_class(), "shadowAccount",
|
||||
my ($user) = @_;
|
||||
my $ldap = &ldap_connect();
|
||||
my $base = &get_user_base();
|
||||
$user->{'dn'} = "uid=$user->{'user'},$base";
|
||||
my @classes = ( &def_user_obj_class(), "shadowAccount",
|
||||
split(/\s+/, $config{'other_class'}),
|
||||
@{$_[0]->{'ldap_class'}} );
|
||||
local $schema = $ldap->schema();
|
||||
@{$user->{'ldap_class'}} );
|
||||
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
|
||||
local @attrs = &user_to_dn($_[0]);
|
||||
push(@attrs, &split_props($config{'props'}, $_[0]));
|
||||
push(@attrs, @{$_[0]->{'ldap_attrs'}});
|
||||
my @attrs = &user_to_dn($user);
|
||||
push(@attrs, &split_props($config{'props'}, $user));
|
||||
push(@attrs, @{$user->{'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"));
|
||||
}
|
||||
local $rv = $ldap->add($_[0]->{'dn'}, attr => \@attrs);
|
||||
my $rv = $ldap->add($user->{'dn'}, attr => \@attrs);
|
||||
if ($rv->code) {
|
||||
&error(&text('usave_eadd', $rv->error));
|
||||
}
|
||||
push(@list_users_cache, $_[0]) if (scalar(@list_users_cache));
|
||||
push(@list_users_cache, $user) if (scalar(@list_users_cache));
|
||||
$ldap->unbind();
|
||||
&useradmin::refresh_nscd() if (!$batch_mode);
|
||||
}
|
||||
@@ -264,8 +282,9 @@ $ldap->unbind();
|
||||
# it from the LDAP database
|
||||
sub delete_user
|
||||
{
|
||||
local $ldap = &ldap_connect();
|
||||
local $rv = $ldap->delete($_[0]->{'dn'});
|
||||
my ($user) = @_;
|
||||
my $ldap = &ldap_connect();
|
||||
my $rv = $ldap->delete($user->{'dn'});
|
||||
if ($rv->code) {
|
||||
my $err = $rv->error;
|
||||
if ($err !~ /No such object/i) {
|
||||
@@ -273,7 +292,7 @@ if ($rv->code) {
|
||||
}
|
||||
}
|
||||
$ldap->unbind();
|
||||
@list_users_cache = grep { $_ ne $_[0] } @list_users_cache
|
||||
@list_users_cache = grep { $_ ne $user } @list_users_cache
|
||||
if (scalar(@list_users_cache));
|
||||
&useradmin::refresh_nscd() if (!$batch_mode);
|
||||
}
|
||||
@@ -281,52 +300,53 @@ $ldap->unbind();
|
||||
# modify_user(&olduser, &newuser)
|
||||
sub modify_user
|
||||
{
|
||||
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'});
|
||||
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'});
|
||||
}
|
||||
if (&indexoflc("person", @{$_[1]->{'ldap_class'}}) >= 0 &&
|
||||
if (&indexoflc("person", @{$user->{'ldap_class'}}) >= 0 &&
|
||||
!&in_props(\@attrs, "sn")) {
|
||||
# Person needs 'sn'
|
||||
push(@attrs, "sn", &in_props(\@attrs, "cn"));
|
||||
}
|
||||
local %replace;
|
||||
my %replace;
|
||||
for(my $i=0; $i<@attrs; $i+=2) {
|
||||
$replace{$attrs[$i]} ||= [ ];
|
||||
local $v = $attrs[$i+1];
|
||||
my $v = $attrs[$i+1];
|
||||
push(@{$replace{$attrs[$i]}}, ref($v) ? @$v : $v);
|
||||
}
|
||||
if ($_[0]->{'pass'} eq $_[1]->{'pass'}) {
|
||||
if ($olduser->{'pass'} eq $user->{'pass'}) {
|
||||
# Don't change password attribute if not change
|
||||
delete($replace{'userPassword'});
|
||||
}
|
||||
# Do rename to new DN first
|
||||
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 ($olduser->{'user'} ne $user->{'user'}) {
|
||||
my $newdn = $olduser->{'dn'};
|
||||
if ($newdn !~ s/^uid=$olduser->{'user'},/uid=$user->{'user'},/) {
|
||||
$newdn = "uid=$user->{'user'},$base";
|
||||
}
|
||||
if (!&same_dn($newdn, $_[0]->{'dn'})) {
|
||||
$rv = $ldap->moddn($_[0]->{'dn'},
|
||||
newrdn => "uid=$_[1]->{'user'}");
|
||||
if (!&same_dn($newdn, $olduser->{'dn'})) {
|
||||
$rv = $ldap->moddn($olduser->{'dn'},
|
||||
newrdn => "uid=$user->{'user'}");
|
||||
if ($rv->code) {
|
||||
&error(&text('usave_emoddn', $rv->error));
|
||||
}
|
||||
$_[1]->{'dn'} = $newdn;
|
||||
$user->{'dn'} = $newdn;
|
||||
}
|
||||
}
|
||||
local $rv = $ldap->modify($_[1]->{'dn'}, replace => \%replace);
|
||||
my $rv = $ldap->modify($user->{'dn'}, replace => \%replace);
|
||||
if ($rv->code) {
|
||||
&error(&text('usave_emod', $rv->error));
|
||||
}
|
||||
if ($_[0] ne $_[1] && &indexof($_[0], @list_users_cache) != -1) {
|
||||
if ($olduser ne $user && &indexof($olduser, @list_users_cache) != -1) {
|
||||
# Update old object in cache
|
||||
%{$_[0]} = %{$_[1]};
|
||||
%{$olduser} = %{$user};
|
||||
}
|
||||
$ldap->unbind();
|
||||
&useradmin::refresh_nscd() if (!$batch_mode);
|
||||
@@ -431,37 +451,42 @@ $ldap->unbind();
|
||||
# in the same format uses by the useradmin module
|
||||
sub dn_to_hash
|
||||
{
|
||||
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") || "",
|
||||
);
|
||||
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");
|
||||
}
|
||||
$user{'pass'} =~ s/^(\!?)\{[a-z0-9]+\}/$1/i;
|
||||
$user{'all_ldap_attrs'} = { map { lc($_), scalar($_[0]->get_value($_)) }
|
||||
$_[0]->attributes() };
|
||||
$user{'ldap_class'} = [ $_[0]->get_value('objectClass') ];
|
||||
$user{'all_ldap_attrs'} = { map { lc($_), scalar($obj->get_value($_)) }
|
||||
$obj->attributes() };
|
||||
$user{'ldap_class'} = [ $obj->get_value('objectClass') ];
|
||||
return %user;
|
||||
}
|
||||
else {
|
||||
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"),
|
||||
);
|
||||
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"),
|
||||
);
|
||||
return %group;
|
||||
}
|
||||
}
|
||||
@@ -470,48 +495,56 @@ else {
|
||||
# Given a useradmin-style user hash, returns a list of properties
|
||||
sub user_to_dn
|
||||
{
|
||||
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;
|
||||
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;
|
||||
if ($pass =~ s/^\!//) {
|
||||
$disabled = "!";
|
||||
}
|
||||
$cn = $_[0]->{'real'} eq '' ? $_[0]->{'user'} : $_[0]->{'real'};
|
||||
my $cn = $user->{'real'} eq '' ? $user->{'user'} : $user->{'real'};
|
||||
return ( "cn" => $cn,
|
||||
"uid" => $_[0]->{'user'},
|
||||
"uidNumber" => $_[0]->{'uid'},
|
||||
"loginShell" => $_[0]->{'shell'},
|
||||
"homeDirectory" => $_[0]->{'home'},
|
||||
"gidNumber" => $_[0]->{'gid'},
|
||||
"uid" => $user->{'user'},
|
||||
"uidNumber" => $user->{'uid'},
|
||||
"loginShell" => $user->{'shell'},
|
||||
"homeDirectory" => $user->{'home'},
|
||||
"gidNumber" => $user->{'gid'},
|
||||
"userPassword" => $disabled.$pfx.$pass,
|
||||
$_[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'} )
|
||||
$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'} ),
|
||||
);
|
||||
}
|
||||
|
||||
# group_to_dn(&group)
|
||||
# Given a useradmin-style group hash, returns a list of properties
|
||||
sub group_to_dn
|
||||
{
|
||||
local @members = split(/,/, $_[0]->{'members'});
|
||||
return ( "cn" => $_[0]->{'group'},
|
||||
"gidNumber" => $_[0]->{'gid'},
|
||||
"userPassword" => $_[0]->{'pass'},
|
||||
my ($group) = @_;
|
||||
my @members = split(/,/, $group->{'members'});
|
||||
return ( "cn" => $group->{'group'},
|
||||
"gidNumber" => $group->{'gid'},
|
||||
"userPassword" => $group->{'pass'},
|
||||
@members ? ( "memberUid" => \@members ) : ( ),
|
||||
defined($_[0]->{'desc'}) ? ( "description" => $_[0]->{'desc'} ) : ( ),
|
||||
defined($group->{'desc'}) ? ( "description" => $group->{'desc'} ) : ( ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -4412,10 +4412,10 @@ elsif ($line =~ /^END:VEVENT/) {
|
||||
# Try to add local 'when (period)'
|
||||
my $dtstart_local_obj =
|
||||
$event{'_obj_dtstart_local_time'} =
|
||||
make_date($event{'dtstart_local_timestamp'}, { _ });
|
||||
make_date($event{'dtstart_local_timestamp'}, { });
|
||||
my $dtend_local_obj =
|
||||
$event{'_obj_dtend_local_time'} =
|
||||
make_date($event{'dtend_local_timestamp'}, { _ });
|
||||
make_date($event{'dtend_local_timestamp'}, { });
|
||||
# Build when local, e.g.:
|
||||
# Tue Jun 04, 2024 04:30 PM – 05:15
|
||||
# PM (Asia/Nicosia +0300)
|
||||
|
||||
@@ -332,6 +332,7 @@ folder_inbox=Inbox
|
||||
folder_sent=Sent
|
||||
folder_drafts=Drafts
|
||||
folder_trash=Trash
|
||||
folder_spam=Spam
|
||||
|
||||
detach_err=Failed to detach file
|
||||
detach_edir=No file or directory to save to entered
|
||||
|
||||
@@ -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", "libthreads-perl", "libthreads-shared-perl", "lynx", "qrencode" );
|
||||
@recommends = ( "libdatetime-perl", "libdatetime-timezone-perl", "libdatetime-locale-perl", "libtime-piece-perl", "libencode-detect-perl", "libtime-hires-perl", "libsocket6-perl", "lynx", "qrencode" );
|
||||
$recommends = join(", ", @recommends);
|
||||
open(CONTROL, ">$control_file");
|
||||
print CONTROL <<EOF;
|
||||
|
||||
@@ -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) perl(threads) perl(threads::shared) 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) lynx shared-mime-info perl-File-Basename perl-File-Path qrencode
|
||||
AutoReq: 0
|
||||
License: BSD-3-clause
|
||||
Group: System/Tools
|
||||
|
||||
@@ -269,9 +269,9 @@ application/x-director dcr dir dxr
|
||||
application/x-dvi dvi # DVI
|
||||
application/x-futuresplash spl
|
||||
application/x-gtar gtar
|
||||
application/x-gzip gz tgz # Gzipped data
|
||||
application/gzip gz tgz # Gzipped data
|
||||
application/x-hdf hdf
|
||||
application/x-javascript js # Javascript source
|
||||
application/javascript js # Javascript source
|
||||
application/x-koan skp skd skt skm
|
||||
application/x-latex latex # LaTeX source
|
||||
application/x-netcdf nc cdf
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user