Compare commits

..

149 Commits
1.972 ... 1.974

Author SHA1 Message Date
Ilia Rostovtsev
24bd1daf6e Fix mysterious leading space for some languages
Presumably this is Google Translator bug and language translator script does't work around it yet
2021-04-28 12:11:24 +03:00
Ilia Rostovtsev
d880b7a8e3 Update language for Status module 2021-04-28 12:05:43 +03:00
Jamie Cameron
0fc43dc254 Add referer check even when upgrading 2021-04-27 16:20:15 -07:00
Jamie Cameron
1467fc769a Merge branch 'master' of github.com:webmin/webmin 2021-04-27 16:03:33 -07:00
Jamie Cameron
ecdd7c458f Add missing strings from isup patch 2021-04-27 16:03:29 -07:00
Jamie Cameron
a84f70d05c Merge pull request #1480 from ypapouin/deadman-logic-system-monitoring
New setting to be compatible with external services monitoring cron jobs and similar periodic processes
2021-04-27 16:01:41 -07:00
Ilia Rostovtsev
0bc86a3147 Check if opts are passed 2021-04-27 21:41:11 +03:00
Yann Papouin
28ee04c6d7 New setting to be compatible with external services monitoring cron jobs and similar periodic processes 2021-04-27 16:30:54 +02:00
Ilia Rostovtsev
8725fd83fc Add ability to utilize env 2021-04-27 16:05:09 +03:00
Ilia Rostovtsev
b64effa5f1 Add flexibility in creating systemd services 2021-04-27 15:36:56 +03:00
Jamie Cameron
e505ecef2e Merge branch 'master' of github.com:webmin/webmin 2021-04-25 20:12:21 -07:00
Jamie Cameron
7ebef3d060 New version bump 2021-04-25 20:11:24 -07:00
Ilia Rostovtsev
f437eab3c4 Improve passwd change command https://github.com/webmin/webmin/pull/1477#issuecomment-825446689
1. Allow passing username as regular param
  2. Do no print verbose `Success:` on success
2021-04-25 12:34:40 +03:00
Jamie Cameron
05c6c917f5 Merge pull request #1477 from webmin/dev/changepass-use-new-api
Use new API with old `changepass.pl` for compatibility
2021-04-22 22:40:10 -07:00
Ilia
35e05c7f85 Merge pull request #1478 from ZeroDream-CN/master
Fixed Simplified Chinese translation issues
2021-04-23 00:36:43 +03:00
Akkariin Meiko
fbe5604588 Update zh.auto 2021-04-23 05:05:48 +08:00
Akkariin Meiko
a616d828e8 Update zh.auto 2021-04-22 20:31:47 +08:00
Ilia Rostovtsev
c974590077 Fix more formatting 2021-04-22 14:02:33 +03:00
Ilia Rostovtsev
a8927f42f1 Fix formatting 2021-04-22 14:02:11 +03:00
Ilia Rostovtsev
3b8861b1c9 Fix script to consider command path https://github.com/webmin/webmin/pull/1477#discussion_r618115481 2021-04-22 14:01:20 +03:00
Ilia Rostovtsev
2fe48a7b48 Fix typo 2021-04-22 13:07:20 +03:00
Jamie Cameron
5b5f86c1a1 Add a new way of overriding the module.info description, and use it for MySQL 2021-04-21 21:54:07 -07:00
Jamie Cameron
47af093d57 Revert module.info overrides via function 2021-04-21 21:30:31 -07:00
Jamie Cameron
72e608c857 Merge branch 'master' of github.com:webmin/webmin 2021-04-21 17:25:20 -07:00
Jamie Cameron
0c85e067df Also disallow untrusted referers when using the perl install script 2021-04-21 16:43:43 -07:00
Ilia Rostovtsev
31a5f1781b Fix typo 2021-04-22 00:08:09 +03:00
Ilia Rostovtsev
fe7d915262 Merge branch 'master' of github.com:webmin/webmin 2021-04-21 14:31:34 +03:00
Ilia Rostovtsev
1c03e37a80 Add minor improvements 2021-04-21 14:31:22 +03:00
Ilia Rostovtsev
86fe633785 Use the full path to webmin command 2021-04-21 11:43:45 +03:00
Jamie Cameron
cb4e9508fd Merge branch 'master' of github.com:webmin/webmin 2021-04-20 20:57:09 -07:00
Jamie Cameron
09436eda3b Add option to not check DNSSEC expiry, which can be slow on large zone files https://sourceforge.net/p/webadmin/discussion/600155/thread/8d78d189e1 2021-04-20 20:56:18 -07:00
Ilia Rostovtsev
b48e86dded Use new API with old changepass.pl for compatibility 2021-04-20 23:44:25 +03:00
Ilia Rostovtsev
584d22020e Add exit codes, file check, nicer errors and color formatting 2021-04-20 23:23:08 +03:00
Ilia Rostovtsev
8e702239c3 Backup first previous miniserv.users file 2021-04-20 18:37:31 +03:00
Ilia Rostovtsev
41b15fb101 Add API to change Webmin user password 2021-04-20 17:43:24 +03:00
Jamie Cameron
e9999de7a8 Add API to get a quick list of files in a records file 2021-04-19 18:46:04 -07:00
Jamie Cameron
1b09f176fc Remove flag for unsupported conntrack mode https://sourceforge.net/p/webadmin/bugs/5478/ 2021-04-17 11:59:51 -07:00
Jamie Cameron
be5684df20 Always sort views by name https://github.com/webmin/webmin/issues/1455 2021-04-15 18:46:44 -07:00
Jamie Cameron
7ee351b511 Fix another incorrect Oracle Linux version line https://sourceforge.net/p/webadmin/bugs/5456/ 2021-04-15 18:03:25 -07:00
Jamie Cameron
83ce82502d Exit fast if at directory doesn't exist https://sourceforge.net/p/webadmin/bugs/5479/ 2021-04-15 17:45:12 -07:00
Ilia Rostovtsev
b72dc18e72 Update language 2021-04-15 11:24:16 +03:00
Jamie Cameron
7123f239ce Fix Oracle Linux version detection https://sourceforge.net/p/webadmin/bugs/5456/ 2021-04-14 18:22:20 -07:00
Jamie Cameron
3fc3f564d1 Add the -w flag to avoid locks if available https://sourceforge.net/p/webadmin/bugs/5475/ 2021-04-13 12:47:51 -07:00
Jamie Cameron
175ed8b3df Add option to always rename users, even if password isn't synced https://github.com/webmin/webmin/issues/1462 2021-04-12 21:49:26 -07:00
Jamie Cameron
59f877ffad Merge branch 'master' of https://github.com/webmin/webmin 2021-04-12 17:40:19 -07:00
Jamie Cameron
a7eaef4517 Add back code to delete PID file on successful exit https://sourceforge.net/p/webadmin/bugs/5471/ 2021-04-12 17:40:06 -07:00
Jamie Cameron
0b2973dcbe Merge pull request #1470 from webmin/dev/module-info-override
Add ability to override module's info #1421
2021-04-11 19:18:21 -07:00
Jamie Cameron
291a0f58eb Fix another warning 2021-04-11 17:44:06 -07:00
Jamie Cameron
eb122dff5e Fix more perl warnings 2021-04-11 17:42:45 -07:00
Jamie Cameron
26abfef1ab Fix perl warning 2021-04-11 17:23:29 -07:00
Jamie Cameron
98259a6128 Test commit 2021-04-11 17:11:59 -07:00
Ilia
da136f4476 Update README.md 2021-04-11 21:07:58 +03:00
Ilia
91df388044 Update README.md 2021-04-11 17:43:58 +03:00
Ilia Rostovtsev
fc638f5d90 Fix to use already existing hashref 2021-04-11 14:28:26 +03:00
Ilia Rostovtsev
f358fa2a98 Simplify https://github.com/webmin/webmin/pull/1470#issuecomment-816270694 2021-04-09 18:58:16 +03:00
Jamie Cameron
058c63c606 Add config files specific to Alam Linux, copied from CentOS 2021-04-08 22:08:41 -07:00
Jamie Cameron
158fd0b6b4 A hash in a value is legit https://sourceforge.net/p/webadmin/bugs/5474/ 2021-04-08 21:10:53 -07:00
Ilia Rostovtsev
575a801c6d Fix to prevent endless loop on lib auto-detection; force define to -lib.pl file
Call module override prior theme overrides
2021-04-06 22:19:11 +03:00
Ilia Rostovtsev
3db32b8cfa Add ability to override module's info https://github.com/webmin/webmin/issues/1421#issuecomment-772137324
https://github.com/virtualmin/virtualmin-gpl/issues/275
2021-04-06 18:34:11 +03:00
Jamie Cameron
04cb9899b2 Merge pull request #1468 from ctrlbru/master
Replaced java applet with jsTree in Bacula restore files selector
2021-04-03 20:33:01 -07:00
Jamie Cameron
84572640e7 Don't totally fail if some units can be read 2021-04-03 19:24:42 -07:00
Jamie Cameron
5fc0bc9ce5 Fix duplicate assignment of tostr 2021-04-03 18:24:09 -07:00
Jamie Cameron
c4a5b46b6e Merge pull request #1469 from nikokio/bug_remote_rpc_call_web_func
Variable $tostr used 100 lines above its declaration !
2021-04-03 18:23:33 -07:00
Jamie Cameron
a946e958f9 Merge branch 'master' of github.com:webmin/webmin 2021-04-03 13:07:24 -07:00
Jamie Cameron
ae64743265 Add function to remove spam prefix 2021-04-03 13:01:29 -07:00
Dario Corti
08468bfb8b Restored web-lib-funcs.pl 2021-04-03 16:56:23 +02:00
Dario Corti
5f72cb63d4 Restored original trailing spaces 2021-04-03 16:51:33 +02:00
Dario Corti
c116e919cd Tweaked jsTree settings, disabled web workers 2021-04-03 16:36:30 +02:00
nikokio
679b57c6ff Variable $tostr used 100 lines above its declaration ! 2021-04-01 17:51:10 +02:00
Ilia Rostovtsev
4cb4177ae6 Fix to prevent sending CSP if defined in custom headers or by theme 2021-03-29 15:19:37 +03:00
Dario Corti
7259d0199d Replaced java applet with jstree in bacula restore file selector 2021-03-29 00:24:59 +02:00
Ilia Rostovtsev
39b14afb7e Theme needs a control over x-no-links header 2021-03-28 16:44:06 +03:00
Ilia Rostovtsev
ea8587578a UI reposition network buffer option 2021-03-28 14:17:48 +03:00
Jamie Cameron
88c5dc21f2 Add UI for changing network buffer size 2021-03-27 20:00:25 -07:00
Jamie Cameron
638895ea67 Use standard function for writing an entire file 2021-03-27 12:58:26 -07:00
Jamie Cameron
cbfeb6aa01 Use standard function for reading an entire file 2021-03-27 12:55:32 -07:00
Jamie Cameron
e6017f7761 Replace some more old hard-coded 1024 byte buffers with the new function 2021-03-27 12:49:56 -07:00
Jamie Cameron
d6e50e7f41 Replace some old hard-coded 1024 byte buffers with the new function 2021-03-27 12:24:54 -07:00
Jamie Cameron
11d382cb36 Use new function to get buffer size, instead of hard-coding 2021-03-27 12:17:22 -07:00
Jamie Cameron
9feae324d6 Move buffer size into a function 2021-03-27 12:08:52 -07:00
Jamie Cameron
407ac1a1a0 Your variable is in another castle 2021-03-26 23:08:32 -07:00
Jamie Cameron
50b0da315f Add support for iptables-persistent mode on Ubuntu 20, and clean up some other use of init scripts 2021-03-26 16:22:57 -07:00
Jamie Cameron
db132bf00c Merge branch 'master' of github.com:webmin/webmin 2021-03-26 13:17:59 -07:00
Jamie Cameron
17724f2b9b Move buffer size into a global 2021-03-26 13:17:47 -07:00
Ilia Rostovtsev
1b54c49813 Fix to allow limiting list_combined_webmin_menu to specific module 2021-03-26 20:40:16 +03:00
Ilia Rostovtsev
e79a678a78 Don't test for file existence, just return undef
49f75d239a (r48753651)
2021-03-26 19:26:31 +03:00
Ilia Rostovtsev
e54887482d Fix formatting 2021-03-26 15:40:43 +03:00
Ilia Rostovtsev
49f75d239a Fix bad design that I shouldn't have ever added #1466 2021-03-26 15:37:12 +03:00
Jamie Cameron
5110269a57 Theme links outside the webmin directory should still be listed 2021-03-23 18:37:44 -07:00
Jamie Cameron
1abd48d958 Table names always need quoting https://github.com/virtualmin/virtualmin-gpl/issues/258 2021-03-21 13:20:59 -07:00
Jamie Cameron
fe7a48170a Use a larger buffer size for receiving RPCs https://www.virtualmin.com/node/54835 2021-03-19 10:48:28 -07:00
Jamie Cameron
ae071bf4f6 Use a larger buffer size for uploads https://www.virtualmin.com/node/54835 2021-03-19 10:46:08 -07:00
Jamie Cameron
6eeff56140 Properly escape key names 2021-03-16 22:37:13 -07:00
Ilia Rostovtsev
1b9334d000 Assign vars explicitly 2021-03-16 16:44:10 +03:00
Ilia Rostovtsev
b337c192c8 Fix to_ip6address sub variables scope and missing ;
44b98ef4fc
2021-03-16 16:24:25 +03:00
Jamie Cameron
68ff9998a8 Merge branch 'master' of github.com:webmin/webmin 2021-03-15 23:54:38 -07:00
Jamie Cameron
44b98ef4fc Add extra protection against internal perl error on IPv6 lookup 2021-03-15 23:54:10 -07:00
Ilia Rostovtsev
d1472cc25d Merge pull request #1458 from HonkXL/master
fix Änderung
2021-03-15 19:15:59 +03:00
Thomas Weiland
295ab86116 fix Änderung
änderung ist wrong - must be Änderung
2021-03-15 16:58:58 +01:00
Jamie Cameron
f8ae8c81fb Attempt to fix 'attempt to copy freed scalar' error 2021-03-14 18:14:30 -07:00
Jamie Cameron
35108b2ba4 Merge branch 'master' of github.com:webmin/webmin 2021-03-11 20:36:41 -08:00
Jamie Cameron
204d8b2dd9 Fix oracle linux detection 2021-03-11 20:29:19 -08:00
Jamie Cameron
0dba42d041 Merge pull request #1457 from IvanI3/patch-1
Unset LANG in status monitor script like @ /etc/webmin/start script
2021-03-10 21:00:43 -08:00
IvanI3
7ee58607a9 Unset LANG in status monitor script like @ /etc/webmin/start script
Non-US/EN default system locale affects float point format "," or "." (e.g. in uptime monitor, which goes down on wrong locale when parsing 1,5,15 mins load)
2021-03-10 11:05:47 +02:00
Jamie Cameron
03bcf594c8 /usr/bin/webmin should only be in webmin 2021-03-09 19:18:21 -08:00
Jamie Cameron
ec140956e8 Merge branch 'master' of github.com:webmin/webmin 2021-03-08 16:16:43 -08:00
Jamie Cameron
a03a8ff15a make blue-theme a link, except in RPMs 2021-03-08 16:15:27 -08:00
Ilia Rostovtsev
4c6ba93328 Fix missing view for BIND
https://github.com/webmin/webmin/issues/1454
2021-03-08 14:30:09 +03:00
Ilia Rostovtsev
c6430c2c2d Ajaxterm doesn't support Python3
https://sourceforge.net/p/webadmin/bugs/5463/
2021-03-07 14:43:57 +03:00
Jamie Cameron
d732304725 Allow replacement of /etc/init.d/webmin 2021-03-06 13:06:42 -08:00
Jamie Cameron
750f4fa89d Fix duplicate string 2021-03-06 12:24:20 -08:00
Jamie Cameron
e6e15781c5 Current theme is always visible 2021-03-06 12:15:41 -08:00
Jamie Cameron
c75957ccf2 Current theme is always visible 2021-03-06 12:14:25 -08:00
Jamie Cameron
e2866aefa9 Merge pull request #1453 from webmin/dev/no-list-blue-theme
Change: Dev/no list blue theme
2021-03-06 12:08:18 -08:00
Ilia Rostovtsev
38deb9c132 Unroll to perform checking when UI select is printed
3fd024ac7f (r588913864)
2021-03-06 23:01:34 +03:00
Jamie Cameron
34ccf16be0 Merge pull request #1452 from webmin/dev/no-list-def-theme
Change: Do not list Legacy Theme in dropdown
2021-03-06 11:51:55 -08:00
Ilia Rostovtsev
cefd479223 Revert: This fix must be in dev/no-list-blue-theme 2021-03-06 22:46:12 +03:00
Ilia Rostovtsev
4882e980f6 Fix to display Legacy Theme if currently selected 2021-03-06 22:44:39 +03:00
Ilia Rostovtsev
72f4a33d84 Fix status detection on running cmd with set input or cmd containing special chars 2021-03-06 17:33:38 +03:00
Ilia Rostovtsev
8a8abf2ee5 Fix to match cron job exactly when possible
https://sourceforge.net/p/webadmin/bugs/5462
2021-03-06 16:34:19 +03:00
Ilia Rostovtsev
e7deccae71 Update class name to conventional 2021-03-06 15:35:24 +03:00
Ilia Rostovtsev
9a9342edf0 Do not list Legacy Theme in dropdown in Change Language and Theme module 2021-03-06 15:07:07 +03:00
Ilia Rostovtsev
2ae9cb3296 Use list visible themes sub 2021-03-06 15:02:16 +03:00
Ilia Rostovtsev
3fd024ac7f All symlinked themes must not be listed to prevent confusing dupes 2/2 2021-03-06 14:10:00 +03:00
Ilia Rostovtsev
6e25287e27 All symlink themes must not be listed to prevent confusing dupes 2021-03-06 13:52:44 +03:00
Ilia Rostovtsev
c614274043 Do not list Legacy Theme in dropdown 2021-03-06 11:01:58 +03:00
Ilia Rostovtsev
843b7a6cc3 Fix a bug for creating a link for blue-theme 2021-03-06 10:27:16 +03:00
Ilia Rostovtsev
fa2e4c87b7 Don't test for non-native services as returned status may be false-positive 2021-03-05 21:11:35 +03:00
Ilia Rostovtsev
ab3597bf42 Add ui_help bubble tooltip UI API
1461a60f66
2021-03-05 16:19:45 +03:00
Ilia Rostovtsev
4970243edf Add move_source_dest file API a4c78aecc7 (commitcomment-47871889) 2021-03-05 12:59:35 +03:00
Jamie Cameron
5e037839d0 Dev version bump 2021-03-04 23:59:04 -08:00
Ilia Rostovtsev
4b82fe84c4 Fix to catch non-native systemd service output 2021-03-05 00:48:31 +03:00
Ilia Rostovtsev
45922e76aa Merge pull request #1451 from tomldickson/master
Update access_desc to make it clear how to use IPv6
2021-03-05 00:35:14 +03:00
Tom Dickson
d9f8905f9a Update .gitignore 2021-03-04 06:55:28 -06:00
Tom Dickson
ff1a1dcb87 Update access_desc to show IPv6 examples
I was able to (I think) update the translation for all but "fa" which I am not certain I can edit properly.
2021-03-04 06:55:04 -06:00
Jamie Cameron
1461a60f66 For root users who aren't allowed access to the whole filesystem, respect the configured paths 2021-03-03 21:40:30 -08:00
Jamie Cameron
2a9dda3f1a Revert "Support limiting allowed dirs to root-capable users in File Manager"
This reverts commit 2b8deb0dbf, prior to
implementing the original request differently.
2021-03-03 21:14:25 -08:00
Jamie Cameron
fec9b6eec6 Fix bug that caused init scripts to be ignored if in systemd mode https://www.virtualmin.com/node/70782 2021-03-03 18:07:43 -08:00
Ilia Rostovtsev
d3f1f04bbd Merge branch 'master' of github.com:webmin/webmin 2021-03-03 18:53:34 +03:00
Ilia Rostovtsev
b477bf37e0 Fix typo in sub name for Firewall modules
https://sourceforge.net/p/webadmin/bugs/5460/
2021-03-03 18:53:11 +03:00
Jamie Cameron
c5f598ae58 Don't copy in blue-theme, just make it a link 2021-03-02 15:47:50 -08:00
Ilia Rostovtsev
19f4b5ebda Revert "Don't double list symlinked themes"
This reverts commit e188641664.
2021-03-03 02:45:53 +03:00
Ilia Rostovtsev
e188641664 Don't double list symlinked themes 2021-03-03 02:38:12 +03:00
Ilia Rostovtsev
d93cffc7f2 Revert "Drop blue-theme"
This reverts commit 8bb5b23550.
2021-03-03 02:37:03 +03:00
Ilia Rostovtsev
90b6978279 Rename Usermin old theme as well 2021-03-01 22:27:03 +03:00
Ilia Rostovtsev
8bb5b23550 Drop blue-theme 2021-03-01 22:25:38 +03:00
Ilia Rostovtsev
79a8328f2f (Perl) Balance printing spaces to print regular and dev versions nicely 2021-03-01 19:05:10 +03:00
Ilia Rostovtsev
23e7e1975c Balance printing spaces to print regular and dev versions nicely 2021-03-01 18:57:55 +03:00
Ilia Rostovtsev
c777d9cb75 Fix to support devel updates on BSD systems as well
https://github.com/webmin/webmin/issues/1232#issuecomment-615903971
2021-03-01 17:29:31 +03:00
327 changed files with 4934 additions and 1068 deletions

1
.gitignore vendored
View File

@@ -20,3 +20,4 @@ core
# makedist.pl
tarballs/
minimal/
.DS_Store

View File

@@ -10,7 +10,7 @@
**Webmin** is a web-based system administration tool for Unix-like servers, and services with over _1,000,000_ installations worldwide. Using it, it is possible to configure operating system internals, such as users, disk quotas, services or configuration files, as well as modify, and control open-source apps, such as BIND DNS Server, Apache HTTP Server, PHP, MySQL, and [many more](https://doxfer.webmin.com/Webmin/Introduction).
[![Quick UI overview 2021](https://rostovtsev.io/pub/media/screenshots/webmin-2021-screenshot-updated.png)](https://www.youtube.com/watch?v=daYG6O4AsEw&feature=emb_logo)
[![Quick UI overview 2021](https://user-images.githubusercontent.com/4426533/114315375-61a1c480-9b07-11eb-9aaf-4aa949a39ab7.png)
Usability can be expanded by installing modules, which can be custom made. Aside from this, there are two other major projects that extend its functionality:
@@ -29,7 +29,7 @@ Webmin can be installed in two different ways:
1. By downloading a pre-built package, available for different distributions (CentOS, Fedora, SuSE, Mandriva, Debian, Ubuntu, Solaris and [other](http://www.webmin.com/support.html)) from our [download page](http://webmin.com/download.html);
<kbd>Note: It is highly recommended to [add repository](https://doxfer.webmin.com/Webmin/Installation) to your system for having automatic updates.</kbd>
2. By downloading, extracting [source file](https://prdownloads.sourceforge.net/webadmin/webmin-1.972.tar.gz), and running [_setup.sh_](http://www.webmin.com/tgz.html) script, with no arguments, which will setup to run it directly from this directory, or with a command-line argument, such as targeted directory.
2. By downloading, extracting [source file](https://prdownloads.sourceforge.net/webadmin/webmin-1.974.tar.gz), and running [_setup.sh_](http://www.webmin.com/tgz.html) script, with no arguments, which will setup to run it directly from this directory, or with a command-line argument, such as targeted directory.
<kbd>Note: If you are installing Webmin [on Windows](http://www.webmin.com/windows.html) system, you must run the command `perl setup.pl` instead. The Windows version depends on several programs, and modules that may not be part of the standard distribution. You will need _process.exe_ commmand, _sc.exe_ command, and _Win32::Daemon_ Perl module.</kbd>
## Documentation

File diff suppressed because one or more lines are too long

View File

@@ -26,6 +26,8 @@ print &ui_table_row($text{'sync_when'},
"<br>\n".
&ui_checkbox("delete", 1, $text{'sync_delete'}, $config{'sync_delete'}).
"<br>\n".
&ui_checkbox("modify", 1, $text{'sync_modify'}, $config{'sync_modify'}).
"<br>\n".
&ui_checkbox("unix", 1, $text{'sync_unix'}, $config{'sync_unix'}));
# Assign new users to group

View File

@@ -211,14 +211,14 @@ if ($access{'cats'}) {
[ 0, $text{'default'} ] ]));
}
my @all = &webmin::list_themes();
my @all = &webmin::list_visible_themes($user{'theme'});
my @themes = grep { !$_->{'overlay'} } @all;
my @overlays = grep { $_->{'overlay'} } @all;
if ($access{'theme'}) {
# Current theme
my @topts = ( );
push(@topts, [ "", $text{'edit_themedef'} ]);
push(@topts, !$user{'theme'} ? [ '', $text{'edit_themedef'} ] : ());
foreach my $t (@themes) {
push(@topts, [ $t->{'dir'}, $t->{'desc'} ]);
}

View File

@@ -306,6 +306,7 @@ sync_when=When to synchronize
sync_create=Create a Webmin user when a Unix user is created.
sync_update=Update the matching Webmin user when a Unix user is updated.
sync_delete=Delete the matching Webmin user when a Unix user is deleted.
sync_modify=Rename the matching Webmin user when a Unix user is renamed.
sync_group=Assign new users to Webmin group
sync_unix=Set password for new users to Unix authentication.
sync_ecannot=You are not allowed to configure user synchronization.

View File

@@ -12,6 +12,7 @@ $access{'sync'} && $access{'create'} && $access{'delete'} ||
&lock_file("$module_config_directory/config");
$config{'sync_create'} = $in{'create'};
$config{'sync_delete'} = $in{'delete'};
$config{'sync_modify'} = $in{'modify'};
$config{'sync_unix'} = $in{'unix'};
$config{'sync_group'} = $in{'group'};
&write_file("$module_config_directory/config", \%config);

View File

@@ -10,14 +10,15 @@ our (%config, $config_directory);
# Create a new webmin user in the group
sub useradmin_create_user
{
my ($unix) = @_;
return if (!$config{'sync_create'});
my $group = &get_group($config{'sync_group'});
return if (!$group);
my $clash = &get_user($_[0]->{'user'}) || &get_group($_[0]->{'user'});
my $clash = &get_user($unix->{'user'}) || &get_group($unix->{'user'});
return if ($clash);
return if ($_[0]->{'user'} !~ /^[A-z0-9\-\_\.]+$/);
my $user = { 'name' => $_[0]->{'user'},
'pass' => $config{'sync_unix'} ? 'x' : $_[0]->{'pass'},
return if ($unix->{'user'} !~ /^[A-z0-9\-\_\.]+$/);
my $user = { 'name' => $unix->{'user'},
'pass' => $config{'sync_unix'} ? 'x' : $unix->{'pass'},
'sync' => 1,
'modules' => $group->{'modules'} };
&create_user($user);
@@ -40,8 +41,9 @@ foreach my $m (@{$group->{'modules'}}, "") {
# Delete this webmin user if in sync
sub useradmin_delete_user
{
my ($unix) = @_;
return if (!$config{'sync_delete'});
my $u = &get_user($_[0]->{'user'});
my $u = &get_user($unix->{'user'});
if ($u) {
&delete_user($u->{'name'});
&reload_miniserv();
@@ -62,35 +64,36 @@ foreach my $g (&list_groups()) {
# Update this users password if in sync
sub useradmin_modify_user
{
return if ($_[0]->{'passmode'} == 4 && $_[0]->{'olduser'} eq $_[0]->{'user'});
my $u = &get_user($_[0]->{'olduser'});
if ($u && $u->{'sync'}) {
if ($_[0]->{'user'} ne $_[0]->{'olduser'}) {
# New name might clash (or be invalid)
my $clash = &get_user($_[0]->{'user'}) ||
&get_group($_[0]->{'user'});
my ($unix) = @_;
return if ($unix->{'passmode'} == 4 && $unix->{'olduser'} eq $unix->{'user'});
my $u = &get_user($unix->{'olduser'});
if ($u && ($u->{'sync'} || $config{'sync_modify'})) {
if ($unix->{'user'} ne $unix->{'olduser'}) {
# User has been renamed .. but name might clash or be invalid
my $clash = &get_user($unix->{'user'}) ||
&get_group($unix->{'user'});
return if ($clash);
return if ($_[0]->{'user'} !~ /^[A-z0-9\-\_\.]+$/);
return if ($unix->{'user'} !~ /^[A-z0-9\-\_\.]+$/);
}
$u->{'name'} = $_[0]->{'user'};
if ($u->{'pass'} ne 'x') {
$u->{'pass'} = $_[0]->{'passmode'} == 3 ?
&encrypt_password($_[0]->{'plainpass'}) :
$_[0]->{'pass'};
$u->{'name'} = $unix->{'user'};
if ($u->{'pass'} ne 'x' && $u->{'sync'}) {
# Password has been updated
$u->{'pass'} = $unix->{'passmode'} == 3 ?
&encrypt_password($unix->{'plainpass'}) :
$unix->{'pass'};
}
&modify_user($_[0]->{'olduser'}, $u);
&modify_user($unix->{'olduser'}, $u);
&reload_miniserv();
}
if ($_[0]->{'olduser'} && $_[0]->{'user'} ne $_[0]->{'olduser'}) {
if ($unix->{'olduser'} && $unix->{'user'} ne $unix->{'olduser'}) {
# Check other users' acl module acls
foreach my $u (&list_users()) {
my %uaccess = &get_module_acl($u->{'name'});
my @au = split(/\s+/, $uaccess{'users'});
my $idx = &indexof($_[0]->{'olduser'}, @au);
my $idx = &indexof($unix->{'olduser'}, @au);
if ($idx != -1) {
$au[$idx] = $_[0]->{'user'};
$au[$idx] = $unix->{'user'};
$uaccess{'users'} = join(" ", @au);
&save_module_acl(\%uaccess, $u->{'name'});
}
@@ -99,9 +102,9 @@ if ($_[0]->{'olduser'} && $_[0]->{'user'} ne $_[0]->{'olduser'}) {
# Rename the user in his group
foreach my $g (&list_groups()) {
my @mems = @{$g->{'members'}};
my $i = &indexof($_[0]->{'olduser'}, @mems);
my $i = &indexof($unix->{'olduser'}, @mems);
if ($i >= 0) {
$mems[$i] = $_[0]->{'user'};
$mems[$i] = $unix->{'user'};
$g->{'members'} = \@mems;
&modify_group($g->{'name'}, $g);
}

View File

@@ -16,7 +16,7 @@ our $module_name;
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1);
# Check for python
my $python = &get_python_cmd();
my $python = &has_command("python2") || &has_command("python");
if (!$python) {
&ui_print_endpage(&text('index_epython', "<tt>python</tt>"));
}

View File

@@ -0,0 +1,18 @@
show_list=0
httpd_dir=/etc/httpd
httpd_path=/usr/sbin/httpd
mime_types=/etc/mime.types
start_cmd=systemctl start httpd.service
apply_cmd=systemctl reload httpd.service
stop_cmd=systemctl stop httpd.service
show_order=0
max_servers=100
test_config=1
test_manual=0
apachectl_path=/usr/sbin/apachectl
test_always=0
test_apachectl=1
auto_mods=1
show_names=0
allow_virtualmin=0
pid_file=/run/httpd/httpd.pid

View File

@@ -6,7 +6,7 @@ our (%config);
sub list_atjobs
{
my @rv;
opendir(my $DIR, $config{'at_dir'});
opendir(my $DIR, $config{'at_dir'}) || return ();
while(my $f = readdir($DIR)) {
my $p = "$config{'at_dir'}/$f";
if ($f =~ /^c(\S{5})(\S+)$/) {

View File

@@ -5,7 +5,7 @@ use POSIX;
sub list_atjobs
{
local @rv;
opendir(DIR, $config{'at_dir'});
opendir(DIR, $config{'at_dir'}) || return ();
while($f = readdir(DIR)) {
local $p = "$config{'at_dir'}/$f";
if ($f =~ /^(\d+)\.a$/) {

View File

@@ -6,7 +6,7 @@ our (%config);
sub list_atjobs
{
my @rv;
opendir(my $DIR, $config{'at_dir'});
opendir(my $DIR, $config{'at_dir'}) || return ();
while(my $f = readdir($DIR)) {
my $p = "$config{'at_dir'}/$f";
if ($f =~ /^a(\S{5})(\S+)$/) {

View File

@@ -6,7 +6,7 @@ our %config;
sub list_atjobs
{
my @rv;
opendir(my $DIR, $config{'at_dir'});
opendir(my $DIR, $config{'at_dir'}) || return ();
while(my $f = readdir($DIR)) {
my $p = "$config{'at_dir'}/$f";
if ($f =~ /^a(\S+)\.(\d+)$/) {

View File

@@ -5,7 +5,7 @@ use POSIX;
sub list_atjobs
{
local @rv;
opendir(DIR, $config{'at_dir'});
opendir(DIR, $config{'at_dir'}) || return ();
while($f = readdir(DIR)) {
local $p = "$config{'at_dir'}/$f";
if ($f =~ /^(\d+)\.a(\S+)$/) {

View File

@@ -8,7 +8,7 @@ use POSIX;
sub list_atjobs
{
my @rv;
opendir(my $DIR, $config{'at_dir'});
opendir(my $DIR, $config{'at_dir'}) || return ();
while(my $f = readdir($DIR)) {
my $p = "$config{'at_dir'}/$f";
if ($f =~ /^(\d+)\.a$/) {

View File

@@ -50,7 +50,8 @@ else {
print "Content-type: application/x-gzip\n\n";
my $buf;
open(TEMP, "<$temp");
while(read(TEMP, $buf, 1024)) {
my $bs = &get_buffer_size();
while(read(TEMP, $buf, $bs)) {
print $buf;
}
close(TEMP);

View File

@@ -417,9 +417,10 @@ return @rv;
# bacula_file_button(filesfield, [jobfield], [volume])
# Pops up a window for selecting multiple files, using a tree-like view
# Brackets around "window" are to hijack Authentic Theme replacement of popups with modals ("undefined")
sub bacula_file_button
{
return "<input type=button onClick='ifield = form.$_[0]; jfield = form.$_[1]; chooser = window.open(\"treechooser.cgi?volume=".&urlize($_[2])."&files=\"+escape(ifield.value)+\"&job=\"+escape(jfield.value), \"chooser\", \"toolbar=no,menubar=no,scrollbar=no,width=500,height=400\"); chooser.ifield = ifield; window.ifield = ifield' value=\"...\">\n";
return "<input type=button onClick='ifield = form.$_[0]; jfield = form.$_[1]; chooser = (window).open(\"treechooser.cgi?volume=".&urlize($_[2])."&files=\"+escape(ifield.value)+\"&job=\"+escape(jfield.value), \"chooser\", \"toolbar=no,menubar=no,scrollbar=no,width=500,height=400\"); chooser.ifield = ifield; window.ifield = ifield' value=\"...\">\n";
}
sub tape_select

File diff suppressed because one or more lines are too long

6
bacula-backup/jstree/jstree.min.js vendored Normal file

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -4,100 +4,149 @@
$trust_unknown_referers = 1;
require './bacula-backup-lib.pl';
&ReadParse();
print "Content-type: text/plain\n\n";
use JSON::PP;
# Input sanitization
die "Illegal input" if ($in{'job'} and $in{'job'} !~ /^\d+\z/);
# Output the appropriate content-type
if ($in{'fmt'} eq "json") {
print "Content-type: application/json\n\n";
}
else {
print "Content-type: text/plain\n\n";
}
# Format the parent with ending slash if missing
$d = ($in{'dir'} =~ /\/\z/) ? $in{'dir'} : $in{'dir'}."/";
$wind = &unix_to_dos($d);
# Get the parent directory ID
$dbh = &connect_to_database();
$cmd = $dbh->prepare("select PathId from Path where Path = ?");
$d = $in{'dir'} eq "/" ? "/" : $in{'dir'}."/";
$wind = &unix_to_dos($d);
$cmd = $dbh->prepare("SELECT PathId FROM Path WHERE Path = ?");
$cmd->execute($wind);
($pid) = $cmd->fetchrow();
$cmd->finish();
if ($in{'job'} ne "") {
$jobsql = "and Job.JobId = $in{'job'}";
}
if ($in{'job'}) {
$jobsql = "AND Job.JobId = $in{'job'}";
}
@nodes = ();
if ($in{'volume'}) {
# Search just within one volume
# Subdirectories of directory, that are on this volume
$cmd1 = $dbh->prepare("
select Path.Path
from Path, File, Job, JobMedia, Media
where File.PathId = Path.PathId
and File.JobId = Job.JobId
and Job.JobId = JobMedia.JobId
and JobMedia.MediaId = Media.MediaId
and Media.VolumeName = ?
$jobsql
");
$cmd1->execute($in{'volume'}) || die "db error : ".$dbh->errstr;
while(($f) = $cmd1->fetchrow()) {
$f = &dos_to_unix($f);
if ($f =~ /^(\Q$d\E[^\/]+\/)/) {
push(@rv, $1);
}
}
$cmd1->finish();
$cmd = $dbh->prepare("
SELECT DISTINCT Path.Path
FROM Job, File, Path, JobMedia, Media
WHERE Job.JobId = File.JobId
AND Job.JobId = JobMedia.JobId
AND File.PathId = Path.PathId
AND JobMedia.MediaId = Media.MediaId
AND Media.VolumeName = ?
$jobsql
ORDER BY Path.Path
");
# Files in directory, that are on this volume
$cmd2 = $dbh->prepare("
select Filename.Name
from File, Filename, Job, JobMedia, Media
where File.FilenameId = Filename.FilenameId
and File.PathId = ?
and File.JobId = Job.JobId
and Job.JobId = JobMedia.JobId
and JobMedia.MediaId = Media.MediaId
and Media.VolumeName = ?
$jobsql
");
$cmd2->execute($pid, $in{'volume'}) || die "db error : ".$dbh->errstr;
while(($f) = $cmd2->fetchrow()) {
push(@rv, "$d$f") if ($f =~ /\S/);
}
$cmd2->finish();
}
$cmd->execute($in{'volume'}) || die "db error: ".$dbh->errstr;
}
else {
# Search all files
# Subdirectories of directory
$cmd1 = $dbh->prepare("
select Path
from Path, File, Job
where File.PathId = Path.PathId
and File.JobId = Job.JobId
$jobsql
");
$cmd1->execute() || die "db error : ".$dbh->errstr;
while(($f) = $cmd1->fetchrow()) {
$f = &dos_to_unix($f);
if ($f =~ /^(\Q$d\E[^\/]+\/)/) {
push(@rv, $1);
}
}
$cmd1->finish();
$cmd = $dbh->prepare("
SELECT DISTINCT Path.Path
FROM Job, File, Path
WHERE Job.JobId = File.JobId
AND File.PathId = Path.PathId
$jobsql
ORDER BY Path.Path
");
# Files in directory
$cmd2 = $dbh->prepare("
select Filename.Name
from File, Filename, Job
where File.FilenameId = Filename.FilenameId
and File.PathId = ?
and File.JobId = Job.JobId
$jobsql
");
$cmd2->execute($pid) || die "db error : ".$dbh->errstr;
while(($f) = $cmd2->fetchrow()) {
push(@rv, "$d$f") if ($f =~ /\S/);
}
$cmd2->finish();
$cmd->execute() || die "db error: ".$dbh->errstr;
}
# Push all folders direcly under the starting path
while(($f) = $cmd->fetchrow()) {
$f = &dos_to_unix($f);
if ($f =~ /^(\Q$d\E([^\/]+)\/)/) {
push(@rv, $1);
}
}
$cmd->finish();
@rv = &unique(@rv);
# Build the nodes structure for folders
foreach $f (@rv) {
$f =~ /([^\/]+)\/\Z/;
push @nodes, {
text => $1,
fullpath => $f,
children => JSON::PP::true,
icon => "jstree-folder"
};
}
if ($in{'volume'}) {
# Files in directory, that are on this volume
$cmd = $dbh->prepare("
SELECT Filename.Name
FROM File, Filename, Job, JobMedia, Media
WHERE File.FilenameId = Filename.FilenameId
AND File.JobId = Job.JobId
AND Job.JobId = JobMedia.JobId
AND JobMedia.MediaId = Media.MediaId
AND File.PathId = ?
AND Media.VolumeName = ?
$jobsql
ORDER BY Filename.Name
");
$cmd->execute($pid, $in{'volume'}) || die "db error: ".$dbh->errstr;
}
else {
# Files in directory
$cmd = $dbh->prepare("
SELECT Filename.Name
FROM Job, File, Filename
WHERE Job.JobId = File.JobId
AND File.FilenameId = Filename.FilenameId
AND File.PathId = ?
$jobsql
ORDER BY Filename.Name
");
$cmd->execute($pid) || die "db error: ".$dbh->errstr;
}
# Push all the files in the starting path
while(($f) = $cmd->fetchrow()) {
if ($f =~ /\S/) {
push(@rv, "$d$f");
# Build the nodes structure for files
push @nodes, {
text => $f,
fullpath => "$d$f",
children => JSON::PP::false,
icon => "jstree-file"
};
}
}
$cmd->finish();
# Return output
@rv = &unique(@rv);
print "\n";
foreach $f (@rv) {
print $f,"\n";
}
if($in{'fmt'} eq "json") {
print JSON::PP->new->utf8->encode(\@nodes);
}
else {
print "\n";
foreach $f (@rv) {
print $f,"\n";
}
}

View File

@@ -1,43 +1,94 @@
#!/usr/local/bin/perl
# treechooser.cgi
# Outputs HTML for a java file-chooser tree
# Outputs HTML for a javascript file-chooser tree
require './bacula-backup-lib.pl';
&PrintHeader();
&ReadParse();
$shortest = "/";
if ($main::session_id) {
$session = "<param name=session value=\"sid=$main::session_id\">";
}
$in{'job'} =~ s/^(.*)_(\d+)$/$2/g;
print <<EOF;
<html><head><title>$text{'tree_title'}</title><body>
<html>
<head>
<title>$text{'tree_title'}</title>
<link rel="stylesheet" href="jstree/themes/default/style.min.css" />
<style>
body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 0.8em;
}
.buttons {
display: flex;
flex-flow: row nowrap;
justify-content: center;
padding: 5px;
}
.main-container {
display: flex;
flex-flow: column nowrap;
height: 100%;
}
.spaced-button {
margin: 5px;
}
#jstree {
flex: 1;
margin: 10px;
margin-bottom: 0px;
border: thin solid gray;
overflow: auto;
}
</style>
</head>
<body>
<div class="main-container">
<div id="jstree"></div>
<div class="buttons">
<button id="confirm" class="ui-button ui-widget ui-corner-all spaced-button">OK</button>
<button id="cancel" class="ui-button ui-widget ui-corner-all spaced-button">Cancel</button>
</div>
</div>
<script src="jstree/jquery-3.6.0.min.js"></script>
<script src="jstree/jstree.min.js"></script>
<script>
function clear_files()
{
top.ifield.value = "";
}
\$("#cancel").click(function() {
window.close();
});
function add_file(file)
{
top.ifield.value = top.ifield.value + file + "\\n";
}
\$("#confirm").click(function() {
let list = \$('#jstree').jstree(true).get_selected(true).map(n => n.original.fullpath).sort().reduce((a, v) => (a + '\\n' + v));
\$(top.ifield).val(list);
window.close();
});
function finished()
{
window.close();
}
\$(function () {
\$('#jstree').jstree({
'plugins' : [ 'checkbox' ],
'core' : {
'animation': 100,
'worker' : false,
'force_text': true,
'data' : {
'url' : function (node) {
const r = [];
r.push('fmt=' + 'json');
r.push('job=' + encodeURIComponent('$in{'job'}'));
r.push('volume=' + encodeURIComponent('$in{'volume'}'));
r.push('dir=' + ((node.id == '#') ? encodeURIComponent('$shortest') : encodeURIComponent(node.original.fullpath)));
return 'list.cgi?' + r.join('&');
}
}
}
});
});
</script>
<applet code=TreeChooser name=TreeChooser width=100% height=100% MAYSCRIPT>
<param name=volume value="$in{'volume'}">
<param name=root value="$shortest">
<param name=job value="$in{'job'}">
$session
</applet>
</body></html>
</body>
</html>
EOF

240
bin/passwd Executable file
View File

@@ -0,0 +1,240 @@
#!/usr/bin/env perl
# passwd - change Webmin users password
use strict;
use warnings;
use 5.010;
use Getopt::Long;
use Pod::Usage;
use Term::ANSIColor qw(:constants);
sub main
{
my %opt;
GetOptions('help|h' => \$opt{'help'},
'config|c=s' => \$opt{'config'},
'user|u=s' => \$opt{'user'},
'password|p=s' => \$opt{'password'});
# If username passed as regular param
my $user = scalar(@ARGV) == 1 && $ARGV[0];
# Show usage
pod2usage(0) if ($opt{'help'} || (!$opt{'user'} && !$user));
# Assign defaults
$opt{'config'} ||= "/etc/webmin";
$opt{'user'} = $user if ($user && !$opt{'user'});
# Catch kill signal
my $sigkill = sub {
system("stty echo");
print "\n^C";
print "\n";
exit 1;
};
$SIG{INT} = \&$sigkill;
# Run change password command
change_password(\%opt);
return 0;
}
exit main(\@ARGV) if !caller(0);
sub change_password
{
my ($optref) = @_;
my ($minserv_uconf_file, %lusers, @users, %uinfos, %ulines);
my $user = $optref->{'user'};
my $pass = $optref->{'password'};
my $confdif = $optref->{'config'};
my $conf = "$confdif/config";
my $mconf = "$confdif/miniserv.conf";
my $encrypt_password = sub {
my ($pass, $gconfig) = @_;
if ($gconfig->{'md5pass'} == 1) {
# Use MD5 encryption
return &encrypt_md5($pass);
} elsif ($gconfig->{'md5pass'} == 2) {
# Use SHA512 encryption
return &encrypt_sha512($pass);
} else {
# Use Unix DES
srand(time() ^ $$);
return crypt($pass, chr(int(rand(26)) + 65) . chr(int(rand(26)) + 65));
}
};
my $conf_check = sub {
my ($configs) = @_;
foreach my $config (@{$configs}) {
if (!-r $config) {
say BRIGHT_RED, "Error: ", RESET, "Failed to read Webmin essential config file: ", BRIGHT_YELLOW, $config,
RESET, " doesn't exist";
exit 1;
}
}
};
my $root = root($confdif, \&$conf_check);
# Load libs
do "$root/acl/md5-lib.pl";
do "$root/web-lib-funcs.pl";
# Check for main config and miniserv config files
&$conf_check([$conf, $mconf]);
# Read and parse configs
my (%config, %gconfig, %uconfig);
read_file($mconf, \%config);
read_file($conf, \%gconfig);
$minserv_uconf_file = $config{'userfile'};
# Check for main user file
&$conf_check([$minserv_uconf_file]);
# Read and parse `miniserv.users` config file
read_file($minserv_uconf_file, \%lusers, undef, undef, ":");
@users = keys %lusers;
map {my @uinfo = split(':', "$lusers{$_}"); $uinfos{$_} = \@uinfo} @users;
# Check if user exists
if (!defined($uinfos{$user})) {
my $user_str = scalar(@users) > 1 ? 'users' : 'user';
my $user_str2 = scalar(@users) > 1 ? 'are' : 'is';
die(BRIGHT_RED, "Error: ", RESET . "Webmin user ",
BRIGHT_YELLOW, $user, RESET, " doesn't exist. Existing Webmin $user_str on your system $user_str2 — ",
BRIGHT_YELLOW, join(", ", sort(@users)),
RESET, "\n");
}
# Ask for password on stdin
my $suc_pre_msg = "";
my $suc_msg = 'updated successfully';
if (!$pass) {
print "Enter password for user ", BRIGHT_YELLOW, $user, RESET, ":";
system("stty -echo");
$pass = <STDIN>;
system("stty echo");
print "\nRetype new password:";
system("stty -echo");
my $pass2 = <STDIN>;
system("stty echo");
print "\n";
if ($pass ne $pass2) {
say BRIGHT_RED, "Error: ", RESET, "Passwords do not match";
exit 1;
}
chomp $pass;
if (!$pass) {
$suc_pre_msg = BOLD BRIGHT_RED ON_WHITE . 'Warning:' . RESET . " ";
$suc_msg = "has been removed, enabling anyone to login without authentication";
}
}
# Update with new password and store timestamp
$uinfos{$user}->[0] = &$encrypt_password($pass, \%gconfig);
$uinfos{$user}->[5] = time() if ($uinfos{$user}->[5]);
map {$ulines{$_} = join(":", @{ $uinfos{$_} })} keys %uinfos;
# Store original file first
copy_source_dest($minserv_uconf_file, "$minserv_uconf_file-");
# Restart Webmin and write new user config file
system("$confdif/stop >/dev/null 2>&1");
write_file($minserv_uconf_file, \%ulines, ":");
system("$confdif/start >/dev/null 2>&1");
# Print user message
say "${suc_pre_msg}Password for Webmin user ", BRIGHT_YELLOW, $user, RESET, " $suc_msg";
exit 0;
}
sub root
{
my ($config, $conf_check) = @_;
my $mconf = "$config/miniserv.conf";
$conf_check->([$mconf]);
open(my $CONF, "<", $mconf);
my $root;
while (<$CONF>) {
if (/^root=(.*)/) {
$root = $1;
}
}
close($CONF);
# Does the Webmin root exist?
if ($root) {
die BRIGHT_RED, "Error: ", BRIGHT_YELLOW, $root, RESET, " is not a directory\n" unless (-d $root);
} else {
# Try to guess where Webmin lives, since config file didn't know.
die BRIGHT_RED, "Error: ", RESET, "Unable to determine Webmin installation directory\n";
}
return $root;
}
1;
=pod
=head1 NAME
passwd
=head1 DESCRIPTION
This program allows you to change the password of a user in the Webmin password file
=head1 SYNOPSIS
passwd [options]
=head1 OPTIONS
=over
=item --help, -h
Print this usage summary and exit.
Examples of usage:
- passwd root
- passwd --user root
- passwd --user root --password ycwyMQRVAZY
- passwd --config /usr/local/etc/webmin --user root --password ycwyMQRVAZY
=item --config, -c
Specify the full path to the Webmin configuration directory. Defaults to C</etc/webmin>
=item --user, -u
Existing Webmin user to change password for
=item --password, -p
Set new user password. Using this option may be unsecure.
=back
=head1 LICENSE AND COPYRIGHT
Copyright 2021 Jamie Cameron <jcameron@webmin.com>
Joe Cooper <joe@virtualmin.com>
Ilia Rostovtsev <ilia@virtualmin.com>

View File

@@ -15,7 +15,7 @@ use Cwd qw(cwd);
my %opt;
GetOptions('help|h' => \$opt{'help'},
'product|p=s' => \$opt{'product'},
'theme|p:s' => \$opt{'theme'});
'theme|t:s' => \$opt{'theme'});
pod2usage(0) if ($opt{'help'} || !$opt{'product'});
# Get current path

View File

@@ -28,8 +28,12 @@ foreach my $z (@zones) {
next if ($tv ne "master" && $tv ne "hint");
my $file = &find_value("file", $z->{'members'});
next if (!$file);
my @recs = &read_zone_file($file, $z->{'value'});
push(@rv, map { $_->{'file'} } @recs);
if (&is_raw_format_records(&make_chroot($file))) {
push(@rv, $file);
}
else {
push(@rv, &files_in_zone_file($file));
}
}
return map { &make_chroot($_) } &unique(@rv);

View File

@@ -3161,10 +3161,13 @@ my ($zone) = @_;
my @rv;
if (!$access{'ro'} && $access{'apply'}) {
my $r = $ENV{'REQUEST_METHOD'} eq 'POST' ? 0 : 1;
my $zone_name;
my $link_params = "";
if ($zone) {
$zone_name = "&" . "zone=$zone->{'name'}&type=$zone->{'type'}";
}
$link_params = "&zone=$zone->{'name'}&type=$zone->{'type'}";
if ($zone->{'viewindex'}) {
$link_params .= "&view=$zone->{'viewindex'}";
}
}
if (&is_bind_running()) {
if ($zone && ($access{'apply'} == 1 || $access{'apply'} == 2)) {
# Apply this zone
@@ -3175,16 +3178,16 @@ if (!$access{'ro'} && $access{'apply'}) {
}
# Apply whole config
if ($access{'apply'} == 1 || $access{'apply'} == 3) {
push(@rv, &ui_link("restart.cgi?return=$r$zone_name", $text{'links_restart'}) );
push(@rv, &ui_link("restart.cgi?return=$r$link_params", $text{'links_restart'}) );
}
if ($access{'apply'} == 1) {
# Stop BIND
push(@rv, &ui_link("stop.cgi?return=$r$zone_name", $text{'links_stop'}) );
push(@rv, &ui_link("stop.cgi?return=$r$link_params", $text{'links_stop'}) );
}
}
elsif ($access{'apply'} == 1) {
# Start BIND
push(@rv, &ui_link("start.cgi?return=$r$zone_name", $text{'links_start'}));
push(@rv, &ui_link("start.cgi?return=$r$link_params", $text{'links_start'}));
}
}
return join('<br>', @rv);

View File

@@ -0,0 +1,56 @@
soa_style=0
named_path=/usr/sbin/named
named_conf=/etc/named.conf
show_list=0
records_order=0
start_cmd=service named start
stop_cmd=service named stop
max_zones=50
rev_def=0
support_aaaa=1
allow_comments=0
allow_wild=1
allow_long=0
master_ttl=1
pid_file=/var/run/named.pid /run/named.pid
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
master_dir=/var/named
slave_dir=/var/named/slaves
no_pid_chroot=0
soa_start=0
rndc_conf=/etc/rndc.conf
rndcconf_cmd=rndc-confgen
largezones=0
checkzone=named-checkzone
keygen=dnssec-keygen
signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
restart_cmd=restart
keygen=dnssec-keygen
tmpl_dnssec=0
dnssec_period=21
tmpl_dnssec_dt=1
dnssectools_conf=/etc/dnssec-tools/dnssec-tools.conf
dnssectools_rollrec=/var/named/system.rollrec
dnssectools_keydir=/var/named/dtkeys
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -53,3 +53,4 @@ dnssectools_keydir=/var/named/dtkeys
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -46,3 +46,4 @@ other_slaves=1
restart_cmd=restart
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -46,3 +46,4 @@ other_slaves=1
restart_cmd=restart
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -37,3 +37,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -43,3 +43,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -42,3 +42,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -43,3 +43,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -40,3 +40,4 @@ other_slaves=1
force_random=0
spf_record=0
pid_file=/var/run/named/pid
dnssec_info=1

View File

@@ -40,3 +40,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -42,3 +42,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -40,3 +40,4 @@ other_slaves=1
pid_file=/var/run/named/named.pid /private/var/run/named/named.pid
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -42,3 +42,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -42,3 +42,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -41,3 +41,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -41,3 +41,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -40,3 +40,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -41,3 +41,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -44,3 +44,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -41,3 +41,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -46,3 +46,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -46,3 +46,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -46,3 +46,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -42,3 +42,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -40,3 +40,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -42,3 +42,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -40,3 +40,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -40,3 +40,4 @@ checkconf=/usr/bin/named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -44,3 +44,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -45,3 +45,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -47,3 +47,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -34,3 +34,4 @@ updserial_def=0
other_slaves=1
updserial_man=1
master_ttl=1
dnssec_info=1

View File

@@ -46,3 +46,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -46,3 +46,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -46,3 +46,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -42,3 +42,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -40,3 +40,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -57,3 +57,4 @@ checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0
dnssec_info=1

View File

@@ -24,6 +24,7 @@ extra_forward=Extra record types for forward zones,0
extra_reverse=Extra record types for reverse zones,0
largezones=Show records in zones?,1,0-Yes,1-No (for large zones)
default_view=Default view for new zones,3,First in list
dnssec_info=Show DNSSEC expired zones on system information page?,1,1-Yes,0-No
line2=Zone file options,11
soa_style=Serial number style,1,0-Running number,1-Date based (YYYYMMDDnn),2-Unix time

View File

@@ -47,6 +47,7 @@ my @zones = grep { $_->{'type'} ne 'view' &&
&can_edit_zone($_) &&
(!$access{'ro'} || $_->{'name'} ne '.') } @allzones;
my @views = grep { $_->{'type'} eq 'view' } @allzones;
@views = sort { $a->{'name'} cmp $b->{'name'} } @views;
my @hashint = grep { $_->{'type'} ne 'view' &&
$_->{'name'} eq '.' } @allzones;
@@ -60,7 +61,7 @@ if (@zones == 1 && $access{'zones'} ne '*' && !$access{'defaults'} &&
exit;
}
my $chroot = &get_chroot();
my $chroot = &get_chroot() || "";
&ui_print_header(undef, $text{'index_title'}, "", undef, 1, 1, 0,
&restart_links().'<br>'.
&help_search_link("bind", "doc", "google"), undef, undef,
@@ -501,6 +502,8 @@ sub compare_zones
my @sp0 = split(/\./, lc($_[0] || ""));
my @sp1 = split(/\./, lc($_[1] || ""));
for(my $i=0; $i<@sp0 || $i<@sp1; $i++) {
$sp0[$i] = "" if (!defined($sp0[$i]));
$sp1[$i] = "" if (!defined($sp1[$i]));
if ($sp0[$i] =~ /^\d+$/ && $sp1[$i] =~ /^\d+$/) {
return -1 if ($sp0[$i] < $sp1[$i]);
return 1 if ($sp0[$i] > $sp1[$i]);

View File

@@ -323,6 +323,24 @@ while($i < @tok) {
return @rv;
}
# files_in_zone_file(file)
# Quickly finds all includes in a zone file
sub files_in_zone_file
{
my ($file) = @_;
my @rv = ( $file );
my $fh;
open($fh, "<", $file);
while(<$fh>) {
if (/^\$include\s+(\S+)/) {
my $inc = $1;
push(@rv, &files_in_zone_file($inc));
}
}
close($fh);
return @rv;
}
# create_record(file, name, ttl, class, type, values, comment)
# Add a new record of some type to some zone file
sub create_record

View File

@@ -31,6 +31,9 @@ my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" :
my $zone;
if ($in{'zone'}) {
$zone = "?zone=$in{'zone'}";
}
if ($in{'view'}) {
$zone .= "&view=$in{'view'}";
}
}
&redirect($zone && $in{'return'} ? "$redir_targ$zone" : "");

View File

@@ -18,10 +18,4 @@ my $err = &restart_zone($zone->{'name'}, $zone->{'view'});
my $tv = $zone->{'type'};
my $redir_targ = ($tv eq "master" ? "edit_master.cgi" :
$tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi");
if ($in{'return'}) {
&redirect($redir_targ . "?zone=$in{'zone'}");
}
else {
&redirect($redir_targ . "?zone=$in{'zone'}&view=$in{'view'}");
}
&redirect($redir_targ . "?zone=$in{'zone'}&view=$in{'view'}");

View File

@@ -17,6 +17,9 @@ my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" :
my $zone;
if ($in{'zone'}) {
$zone = "?zone=$in{'zone'}";
}
if ($in{'view'}) {
$zone .= "&view=$in{'view'}";
}
}
&redirect($zone && $in{'return'} ? "$redir_targ$zone" : "");

View File

@@ -13,6 +13,9 @@ my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" :
my $zone;
if ($in{'zone'}) {
$zone = "?zone=$in{'zone'}";
}
if ($in{'view'}) {
$zone .= "&view=$in{'view'}";
}
}
&redirect($zone && $in{'return'} ? "$redir_targ$zone" : "");

View File

@@ -5,7 +5,8 @@ sub list_system_info
{
my ($data, $in) = @_;
my @rv;
if (&foreign_available($module_name) && $access{'defaults'}) {
if (&foreign_available($module_name) && $access{'defaults'} &&
$config{'dnssec_info'}) {
# Show DNSSEC client config errors
my $err = &check_dnssec_client();
if ($err) {
@@ -14,7 +15,8 @@ if (&foreign_available($module_name) && $access{'defaults'}) {
'warning' => $err });
}
}
if (&foreign_available($module_name) && !$access{'noconfig'}) {
if (&foreign_available($module_name) && !$access{'noconfig'} &&
$config{'dnssec_info'}) {
# Show DNSSEC expired domains
my @exps = &list_dnssec_expired_domains();
if (@exps) {

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