Compare commits

..

117 Commits

Author SHA1 Message Date
Ilia Ross
25321b467b Update changelog 2024-08-11 21:10:43 +03:00
Ilia Ross
dc17b3cbe5 Fix changelog 2024-08-11 21:06:19 +03:00
Ilia Ross
a4621a800b Fix changelog 2024-08-11 21:01:33 +03:00
Jamie Cameron
97308e69aa changelog update 2024-08-11 07:42:09 -07:00
Jamie Cameron
86144e16f7 New version bump 2024-08-11 07:41:05 -07:00
Jamie Cameron
b18b9decd4 Fix schema page description 2024-08-11 03:48:02 -07:00
Jamie Cameron
90cd81893e Fix bugs in LDAP import 2024-08-11 03:42:06 -07:00
Jamie Cameron
9d7c3fdd9a Work on schema import support 2024-08-11 03:27:04 -07:00
Jamie Cameron
c0e36426bd Remove useless fixed spacing 2024-08-11 02:50:23 -07:00
Jamie Cameron
9dd678946d Use proper function to check status 2024-08-08 19:25:14 -07:00
Jamie Cameron
d440ba7f58 Let the user know why no rules are down 2024-08-08 19:24:10 -07:00
Jamie Cameron
090a769145 Use proper function 2024-08-08 19:21:34 -07:00
Jamie Cameron
bcec22b385 Merge branch 'master' of github.com:webmin/webmin 2024-08-08 19:20:43 -07:00
Jamie Cameron
dbfc621482 Add a monitor for firewalld https://github.com/virtualmin/virtualmin-gpl/issues/870 2024-08-08 19:16:00 -07:00
Ilia Ross
6bc70a7738 Add support for disk I/O in FreeBSD 2024-08-07 15:28:58 +03:00
Ilia Ross
f5b3f9cc1d Fix to use os_type for OS check
0ac51a83e9 (r145024453)
2024-08-06 12:21:19 +03:00
Ilia Ross
24055330d3 Fix build system 2024-08-04 17:03:41 +03:00
Ilia Ross
0ac51a83e9 Add an API to count processes 2024-08-03 17:05:56 +03:00
Ilia Ross
e517300fe0 Fix to display wildcard char next to dbs https://github.com/virtualmin/virtualmin-gpl/issues/723#issuecomment-2263713657 2024-08-02 15:22:21 +03:00
Ilia Ross
ae34d0ef86 Fix to unquote database name in view
https://github.com/virtualmin/virtualmin-gpl/issues/723#issuecomment-2262824643
2024-08-01 20:29:40 +03:00
Ilia Ross
8236fb2fd8 Add support to display tag, algo and digests in table #2245 2024-08-01 13:01:30 +03:00
Ilia Ross
f499c62da4 Update CHANGELOG.md 2024-08-01 00:52:57 +03:00
Ilia Ross
a51e3d0a22 Fix BIND service name is now named.service in Debian 12 and Ubuntu 24.04
[build]
2024-08-01 00:34:02 +03:00
Ilia Ross
e1398bf75b Version bump 2.202 2024-07-30 22:13:20 +03:00
Ilia Ross
ba26d2aac0 Merge pull request #2241 from bim-g/update_ui_print_header_documentation
[FIX] Add missing `title` parameter to `ui_print_header` method on the documentation
2024-07-30 05:12:35 +03:00
bim-g
7225ccab73 [FIX] Add missing title parameter to ui_print_header documentation 2024-07-30 01:02:54 +02:00
Ilia Ross
d224d0aafc Fix backup file naming to be consistent with Virtualmin 2024-07-28 23:46:38 +03:00
Ilia Ross
8220fef7e0 Fix to name downloaded backup file nicely #2239
E.g. webmin-backup-config-host.ubuntu24-pro.virtualmin.dev-2024-07-28-20-08.tgz
2024-07-28 20:11:55 +03:00
Jamie Cameron
1a658b1010 If given names are enabled, always add the needed class 2024-07-27 14:53:23 -07:00
Jamie Cameron
4c3b792adc LDAP config file param has moved to the ldap-client module 2024-07-27 14:40:18 -07:00
Jamie Cameron
19940bae86 Base may have a sub-entry for users and groups 2024-07-27 14:26:25 -07:00
Jamie Cameron
256178c6c3 sometimes LDAP connect fails with sigpipe 2024-07-26 21:04:55 -07:00
Jamie Cameron
2a43a870c2 Fix init script name 2024-07-26 19:09:02 -07:00
Jamie Cameron
615765b995 Check status from init script if possible 2024-07-26 19:06:16 -07:00
Jamie Cameron
6f7003965e Merge branch 'master' of github.com:webmin/webmin 2024-07-26 14:56:52 -07:00
Jamie Cameron
d8a7a583a3 Prevent duplication of systemd actions and init scripts https://github.com/webmin/webmin/issues/2227 2024-07-26 14:56:46 -07:00
Jamie Cameron
c51cc8f38a Merge pull request #2234 from webmin/dev/mysql-improve-operations-with-large-dbs
Fix to optimize getting table index structure for large databases
2024-07-26 14:22:58 -07:00
Ilia Ross
5210f623f3 Fix to use prepared statements 2024-07-26 21:11:05 +03:00
Jamie Cameron
ba4b65774e Merge branch 'master' of github.com:webmin/webmin 2024-07-26 10:20:51 -07:00
Jamie Cameron
b1d273c555 BIND 4 is ancient and shouldn't be shown by default https://github.com/webmin/webmin/issues/2232 2024-07-26 10:20:42 -07:00
Ilia Ross
b03f1b766f Fix to optimize getting table index stats for large tables 2024-07-26 19:56:45 +03:00
Ilia Ross
a9ed10401d Update changelog (progress) 2024-07-26 00:55:11 +03:00
Ilia Ross
253d85b6ee Fix setting webprefix for WebSocket URL
https://forum.virtualmin.com/t/after-update-webmin-2-200-cant-view-stat-history/128119/6?u=ilia
2024-07-26 00:41:40 +03:00
Jamie Cameron
0247b71fb7 Show full BIND version https://github.com/webmin/webmin/issues/2226 2024-07-24 14:02:00 -07:00
Jamie Cameron
fd819d83e8 New version bump 2024-07-23 21:58:01 -07:00
Jamie Cameron
8c5fcef916 Fix string for update logging 2024-07-23 21:57:32 -07:00
Jamie Cameron
c15bbca109 Separate comment column https://github.com/webmin/webmin/issues/2221 2024-07-23 21:52:24 -07:00
Jamie Cameron
c47c4b7ffd Merge branch 'master' of github.com:webmin/webmin 2024-07-23 20:12:17 -07:00
Jamie Cameron
8efa25eabf Add missing function 2024-07-23 20:12:06 -07:00
Ilia Ross
190bd58b1b Fix to clarify option name 2024-07-24 03:50:01 +03:00
Ilia Ross
d645dc9345 Update changelog for Webmin 2.201 2024-07-24 03:25:43 +03:00
Ilia Ross
963bb60c02 Fix to go directly to viewing logs on module load 2024-07-24 03:18:31 +03:00
Jamie Cameron
fa4e39ec9a Merge branch 'master' of github.com:webmin/webmin 2024-07-23 17:00:41 -07:00
Jamie Cameron
c1b45ff210 Add option to include compressed rotated logs in searches, and enable it by default, to maintain parity with the old sylog module 2024-07-23 17:00:34 -07:00
Ilia Ross
5cb103bde3 Revert "Fix to call exit after redirect"
This reverts commit e3a1fd849b.
2024-07-24 02:02:14 +03:00
Ilia Ross
7282348b7d Fix to use consistent download page 2024-07-24 00:20:58 +03:00
Ilia Ross
e3a1fd849b Fix to call exit after redirect 2024-07-24 00:20:47 +03:00
Jamie Cameron
1fb01aa46e Fix permissions 2024-07-23 13:50:19 -07:00
Jamie Cameron
779ebb4a63 Fix redirection to first log 2024-07-23 13:50:02 -07:00
Jamie Cameron
c391830670 Fix more cases where switch_to_unix_user isn't being passed the username 2024-07-22 16:48:28 -07:00
Jamie Cameron
c8c6c3e40f Merge branch 'master' of github.com:webmin/webmin 2024-07-22 16:11:41 -07:00
Jamie Cameron
c1f45d6d61 When running a command as a different user, the username needs to be passed to switch_to_unix_user so that all the secondary groups can be populated https://github.com/webmin/webmin/issues/2223 2024-07-22 16:11:37 -07:00
Ilia Ross
8804ba6529 Update CHANGELOG.md 2024-07-22 16:00:56 +03:00
Ilia Ross
11ae39081c Fix to try more simple patch command at first 2024-07-22 14:18:51 +03:00
Jamie Cameron
2751224d4d Really update version 2024-07-21 10:21:20 -07:00
Jamie Cameron
6fce9fa491 New version bump 2024-07-21 10:20:43 -07:00
Jamie Cameron
41fdb5dac2 Fix renumbering when adding a domain 2024-07-20 21:53:49 -07:00
Jamie Cameron
4ffca4597c Clean up group_to_dn function 2024-07-20 21:30:46 -07:00
Jamie Cameron
ecfc06d9c6 Preserve firstname and surname 2024-07-20 21:28:45 -07:00
Jamie Cameron
db55dde7ce Merge branch 'master' of github.com:webmin/webmin 2024-07-20 21:23:16 -07:00
Jamie Cameron
c6edd4b97d Code cleanups 2024-07-20 21:19:01 -07:00
Ilia Ross
8cd2dbae96 Fix to redirect to tabs only inside same module
https://forum.virtualmin.com/t/small-upgrade-error-maybe-wrong-url-on-button/127999?u=ilia
2024-07-21 02:37:32 +03:00
Jamie Cameron
8676a3fb21 Merge branch 'master' of github.com:webmin/webmin 2024-07-20 16:18:25 -07:00
Jamie Cameron
27339eb1bf Use my instead of local 2024-07-20 16:18:16 -07:00
Ilia Ross
e014926854 Update CHANGELOG.md for 2.200 2024-07-21 02:00:01 +03:00
Ilia Ross
a721f60f9c Fix to allow service-worker.js in unauth [build] 2024-07-20 15:57:40 +03:00
Jamie Cameron
46c76e13f9 Merge branch 'master' of github.com:webmin/webmin 2024-07-19 16:52:29 -07:00
Jamie Cameron
f72058306b COnfig option to show hostname and comment https://github.com/webmin/webmin.com/issues/18 2024-07-19 16:52:23 -07:00
Ilia Ross
a15446d3b1 Fix to simplify the code and use no globals [build] 2024-07-19 13:40:14 +03:00
Ilia Ross
fc9ce7f3dd Fix comment 2024-07-19 13:30:01 +03:00
Ilia Ross
72cd50a054 Fix to consider "F" as new theme name "Framed" not "Gray" 2024-07-19 13:13:53 +03:00
Ilia Ross
e307fb4dcd Fix to drop unnecessary option 2024-07-19 12:36:52 +03:00
Jamie Cameron
d631929194 Merge branch 'master' of github.com:webmin/webmin 2024-07-16 16:08:06 -07:00
Jamie Cameron
db9628e7eb Update MIME types for javascript and gzipped files 2024-07-16 16:08:01 -07:00
Jamie Cameron
2c04c04ce7 Merge pull request #2217 from webmin/dev/package-updates-always-show-sec
Fix to always show security updates button
2024-07-16 11:51:16 -07:00
Ilia Ross
a5301245d3 Fix to always show security updates button 2024-07-16 17:38:14 +03:00
Jamie Cameron
165af690c7 Log automatic package updates 2024-07-13 17:07:07 -07:00
Jamie Cameron
29da8ea3d0 Clarify what kind of update it is https://forum.virtualmin.com/t/security-updates-being-auto-installed-regardles-of-software-scheduled-upgrades-set-to-just-notify/127852 2024-07-12 17:22:19 -07:00
Jamie Cameron
73b7e62f13 Merge branch 'master' of github.com:webmin/webmin 2024-07-09 08:30:51 -07:00
Ilia Ross
76141ce22f Fix to use larger QR code [build] 2024-07-09 15:53:18 +03:00
Jamie Cameron
4b575b8168 Clarify comment 2024-07-08 22:55:44 -07:00
Ilia Ross
2b28521297 Fix to display correct return button 2024-07-08 21:03:40 +03:00
Ilia Ross
be767951ca Fix to have no block elements in header 2024-07-08 19:33:52 +03:00
Jamie Cameron
9960d6011f Update comment to match reality 2024-07-07 11:12:47 -07:00
Jamie Cameron
461bd30e2a Save last size and subset mode 2024-07-06 15:26:57 -07:00
Jamie Cameron
2f88a4eefb Follow default reuse option 2024-07-06 15:23:17 -07:00
Jamie Cameron
c9f368d264 Properly check all ServerAlias directives and ports 2024-07-06 15:12:08 -07:00
Jamie Cameron
0e24e8ac61 Merge branch 'master' of github.com:webmin/webmin 2024-07-05 10:32:21 -07:00
Jamie Cameron
1d0d25efac Don't add tab param twice https://sourceforge.net/p/webadmin/bugs/5648/ 2024-07-05 10:01:55 -07:00
Jamie Cameron
1c5d2d2bd7 Merge pull request #2211 from webmin/dev/preserve-file-acls
Add ability to preserve original file ACLs
2024-07-03 15:43:43 -07:00
Ilia Ross
77e809166c Fix to use backquote_command instead 2024-07-03 10:40:20 +03:00
Jamie Cameron
927a2c32d8 Show queue state in list 2024-07-02 21:36:05 -07:00
Jamie Cameron
4a3c6c4854 Merge branch 'master' of github.com:webmin/webmin 2024-07-02 21:21:27 -07:00
Jamie Cameron
37beab77ba Show mail queue directory 2024-07-02 21:21:21 -07:00
Ilia Ross
82f5284ffc Fix to use pipe handling data directly in memory
https://github.com/webmin/webmin/pull/2211#discussion_r1663042881
2024-07-02 22:48:40 +03:00
Ilia Ross
5f579e8ded Fix to invalidate OS EOL data on upgrade 2024-07-02 22:24:09 +03:00
Ilia Ross
4b66ac0be5 Add ability to preserve original file ACLs
https://github.com/webmin/authentic-theme/discussions/1511#discussioncomment-9913902
2024-07-02 20:50:19 +03:00
Jamie Cameron
e69fb75c8e Show the mail queue path 2024-07-01 21:33:22 -07:00
Jamie Cameron
ff8781c112 Merge branch 'master' of github.com:webmin/webmin 2024-07-01 21:15:04 -07:00
Jamie Cameron
0dd75db8d8 Don't wrap header lines 2024-07-01 21:09:17 -07:00
Jamie Cameron
05d01aeef3 Merge pull request #2207 from webmin/dev/patch-api
Add apply patch CLI API
2024-06-30 11:05:00 -07:00
Jamie Cameron
11f2bc20eb Merge branch 'master' of github.com:webmin/webmin 2024-06-30 10:07:08 -07:00
Jamie Cameron
52c3178b92 Add API to delete sections 2024-06-30 10:07:01 -07:00
Jamie Cameron
e3dec2222d Merge pull request #2209 from webmin/dev/separate-temps-collection-2208
Fix to separate drive and CPU temperatures collection #2208
2024-06-30 08:24:26 -07:00
Ilia Ross
05752faec0 Fix to separate drive and CPU temperatures collection #2208 2024-06-30 15:54:47 +03:00
Jamie Cameron
1cf3813fb6 Merge branch 'master' of github.com:webmin/webmin 2024-06-27 19:45:29 -07:00
Jamie Cameron
1216ae709b Stop showing and editing dnssec-lookaside https://github.com/webmin/webmin/issues/617 2024-06-27 19:45:21 -07:00
126 changed files with 935 additions and 348 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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'} || "");

View File

@@ -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

View File

@@ -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 = ( );

View 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

View 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

View 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

View File

@@ -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

View File

@@ -68,7 +68,7 @@ my $chroot = &get_chroot() || "";
&restart_links().'<br>'.
&help_search_link("bind", "doc", "google"), undef, undef,
&text($chroot eq "/" || !$chroot ? 'index_version' : 'index_chroot',
$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) {

View File

@@ -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.

View File

@@ -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 = ( );

View File

@@ -8,7 +8,7 @@ lease_refresh=Seconds between refreshing lease list,3,Never
show_ip=Show IP addresses for hosts?,1,1-Yes,0-No
show_mac=Show MAC addresses for hosts?,1,1-Yes,0-No
group_name=Show group names as,1,1-<tt>domain&#45;name</tt> option,0-Name or member count,2-Description
desc_name=Show 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&#44; hosts and groups to file,3,Main configuration file
line2=System configuration,11

View File

@@ -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&#45;nom</tt>,0-Nom o recompte de membres,2-Descripció
desc_name=Mostra les descripcions dels altres objectes en lloc dels noms,1,1-Sí,0-No
display_max=Nombre màxim de subxarxes i hosts a mostrar,3,Il·limitat
add_file=Afegeix subxarxes noves&#44; hosts i grups al fitxer,3,Fitxer de configuració principal
line2=Configuració del sistema,11

View File

@@ -6,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

View File

@@ -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&#45;navne</tt> indstilling,0-Navn eller medlemsantal,2-Beskrivelse
desc_name=Vis andre objektbeskrivelse istedet for navne?,1,1-Ja,0-Nej
display_max=Maksimalt antal hosts og subnet der skal vises,3,Ubegrænset
line2=Systemkonfiguration
dhcpd_conf=DHCP server config fil,0

View File

@@ -7,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&#45;name</tt> Option,0-Name oder Mitglied,2-Beschreibung
desc_name=Zeige andere Objektbeschreibungen statt Namen?,1,1-Ja,0-Nein
display_max=Maximale Anzahl an Subnetzen und Hosts zum Anzeigen,3,Unbegrenzt
add_file=Füge neue Subnetze&#44; Hosts und Gruppen in einer Datei hinzu,3,Haupt-Konfigurationsdatei
line2=Systemkonfiguration,11

View File

@@ -6,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

View File

@@ -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

View File

@@ -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>ドメイン&#45;名</tt> オプション,0-名前またはメンバー数
desc_name=名称の替わりにオブジェクトの説明を表示しますか?,1,1-はい,0-いいえ
display_max=サブネットとホストの表示する最大数,3,無制限
line2=システム設定,11
dhcpd_conf=DHCPサーバ 設定ファイル,0

View File

@@ -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&#45;naam</tt> optie,0-Naam of Lid van,2-Omschrijving
desc_name=Laat andere object omschrijvingen zien in plaats van namen?,1,1-Ja,0-Nee
display_max=Maximum aantal subnets en hosts om te laten zien,3,Ongelimiteerd
add_file=Toevoegen nieuwe subnetten&#44; host en groepen aan file,3,Hoofd configuratie file
line2=Systeem configuratie,11

View File

@@ -7,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&#45;navn</tt> alternativ,0-Navn eller antall medlemmer,2-Beskrivelse
desc_name=Vis andre objektbeskrivelser i stedet for navn,1,1-Ja,0-Nei
display_max=Maks antall subnett og verter som skal vises,3,Ubegrenset
add_file=Legg til nye subnett&#44; verter og grupper i filen,3,Hoved konfigurasjonsfil
line2=System konfigurasjon,11

View File

@@ -7,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&#45;name</tt>,0-Ilość lub nazwa użytkowników,2-Opis
desc_name=Wyświetlać inne opisy obiektów zamiast nazw,1,1-Tak,0-Nie
display_max=Maksymalna liczba wyświetlanych podsieci i hostów,3,Nieograniczona
add_file=Dodaj nowe podsieci&#44; hosty i grupy do pliku,3,Główny plik konfiguracyjny
line2=Opcje systemowe,11

View File

@@ -6,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&#45;domínio</tt>,0-Nome ou membro
desc_name=Mostrar descrição de objetos ao invés de nomes?,1,1-Sim,0-Não
display_max=Número máximo de subredes e computadores a serem
add_file=Acrescentar novas subredes&#44; hosts e grupos para arquivo,3,Arquivo principal de configuração
line2=Configuração do sistema,11

View File

@@ -6,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

View File

@@ -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 = "\&nbsp;\&nbsp;";
}
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 = "\&nbsp;\&nbsp;";
}
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} ?

View File

@@ -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:

View File

@@ -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, &section)
# Remove a section and all it's members from the config file
sub delete_section
{
my ($conf, $section) = @_;
my $lref = &read_file_lines($section->{'file'});
my $len = $section->{'eline'} - $section->{'line'} + 1;
splice(@$lref, $section->{'line'}, $len);
&renumber($conf, $section->{'line'}, $section->{'file'}, -$len);
}
# renumber(&conf, line, file, offset)
sub renumber
{

View File

@@ -55,7 +55,7 @@ if (@jails) {
$col =~ s/\s/_/g;
if ($col !~ /journal_matches/ &&
$col !~ /file_list/) {
push(@head, "<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);

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

View 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) {

View File

@@ -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

View 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 };

View File

@@ -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>");
}

View File

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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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()) {

View File

@@ -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
View 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'});

View File

@@ -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

View File

@@ -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);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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]) {

View File

@@ -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'} ) : ( ),
);
}

View File

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

View File

@@ -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

View File

@@ -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

View File

@@ -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
View File

View File

@@ -269,9 +269,9 @@ application/x-director dcr dir dxr
application/x-dvi dvi # DVI
application/x-futuresplash spl
application/x-gtar gtar
application/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

View File

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

View 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'}}));
}

View File

@@ -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))."&nbsp;$wildcard</a>");
push(@cols, $u->[2] eq '' ? $text{'dbs_anon'}
: &html_escape($u->[2]));
push(@cols, $u->[0] eq '%' ? $text{'dbs_any'} :

View File

@@ -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

View File

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

View File

@@ -103,6 +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_schedup=Background installed $1 updated packages
log_sched=Enabled scheduled updates
log_unsched=Disabled scheduled updates
log_refresh=Refreshed available packages

View File

@@ -18,6 +18,9 @@ elsif ($type eq 'repo') {
elsif ($action eq 'update') {
return &text('log_update', $object);
}
elsif ($action eq 'schedup') {
return &text('log_schedup', $object);
}
elsif ($action eq 'sched') {
return $text{$object ? 'log_sched' : 'log_unsched'};
}

View File

@@ -15,10 +15,10 @@ else {
$redir = "index.cgi?mode=".&urlize($in{'mode'}).
"&search=".&urlize($in{'search'});
$redirdesc = $text{'index_return'};
$redir = $redir =~ /tab=/ ? $redir :
$redir =~ /\?/ ? "$redir&tab=pkgs" : "$redir?tab=pkgs";
}
$redir = ($redir =~ /\?/) ? "$redir&tab=pkgs" : "$redir?tab=pkgs";
if ($in{'refresh'} || $in{'refresh_top'}) {
&ui_print_unbuffered_header(undef, $text{'refresh_title'}, "");

View File

@@ -17,19 +17,22 @@ if ($ARGV[0] eq "--debug" || $ARGV[0] eq "-debug") {
$tellcount = 0;
%already = ( );
&start_update_progress([ map { $_->{'name'} } @todo ]);
$icount = 0;
foreach $t (@todo) {
next if ($already{$t->{'update'}});
my $umsg = $t->{'security'} ? "security update" : "update";
if ($config{'sched_action'} == 2 ||
$config{'sched_action'} == 1 && $t->{'security'}) {
# Can install
$body .= "An update to $t->{'name'} from $t->{'oldversion'} to $t->{'version'} is needed.\n";
$body .= "An $umsg to $t->{'name'} from $t->{'oldversion'} to $t->{'version'} is needed.\n";
$icount++;
($out, $done) = &capture_function_output(
\&package_install, $t->{'update'});
if (@$done) {
$body .= "This update has been successfully installed.\n\n";
$body .= "This $umsg has been successfully installed.\n\n";
}
else {
$body .= "However, this update could not be installed! Try the update manually\nusing the Package Updates module.\n\n";
$body .= "However, this $usmg could not be installed! Try the update manually\nusing the Package Updates module.\n\n";
}
foreach $p (@$done) {
$already{$p}++;
@@ -39,7 +42,7 @@ foreach $t (@todo) {
$config{'sched_action'} == 0 ||
$config{'sched_action'} == -1 && $t->{'security'}) {
# Just tell the user about it
$body .= "An update to $t->{'name'} from $t->{'oldversion'} to $t->{'version'} is available.\n\n";
$body .= "An $umsg to $t->{'name'} from $t->{'oldversion'} to $t->{'version'} is available.\n\n";
$tellcount++;
}
}
@@ -69,3 +72,7 @@ if ($config{'sched_email'} && $body) {
}
}
# Log the update, if anything was installed
if ($icount) {
&webmin_log("schedup", "packages", $icount);
}

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