Compare commits

...

13 Commits

Author SHA1 Message Date
Ilia Ross
77e809166c Fix to use backquote_command instead 2024-07-03 10:40:20 +03: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
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
12 changed files with 40 additions and 71 deletions

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

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

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

@@ -512,6 +512,7 @@ mail_forward=Forward
mail_rfc=From line
mail_move=Move to:
mail_eexists=Message no longer exists!
mail_qfile=Mail queue file
view_title=Read Email
view_desc=Message $1 in $2

View File

@@ -1504,6 +1504,7 @@ $mail->{'headers'} = \@headers;
foreach $h (@headers) {
$mail->{'header'}->{lc($h->[0])} = $h->[1];
}
$mail->{'file'} = $file;
return $mail;
}

View File

@@ -51,8 +51,10 @@ if ($in{'headers'}) {
}
foreach $h (@{$mail->{'headers'}}) {
print &ui_table_row($h->[0],
&html_escape(&decode_mimewords($h->[1])));
&html_escape(&decode_mimewords($h->[1])), 1, [ "nowrap" ]);
}
print &ui_table_row($text{'mail_qfile'},
"<tt>".&html_escape($mail->{'file'})."</tt>");
}
else {
# Just show the most useful headers

View File

@@ -61,7 +61,7 @@ if ($in{'headers'}) {
}
foreach $h (@{$mail->{'headers'}}) {
print &ui_table_row($h->[0],
&html_escape(&decode_mimewords($h->[1])));
&html_escape(&decode_mimewords($h->[1])), 1, [ "nowrap" ]);
}
}
else {

View File

@@ -74,7 +74,7 @@ if (&foreign_installed("package-updates") && $config{'collect_pkgs'}) {
}
# CPU and drive temps
if (!$config{'collect_notemp'} && defined(&proc::get_current_cpu_data)) {
if (!$config{'collect_notemp2'} && defined(&proc::get_current_cpu_data)) {
my ($cpu, $fans) = &proc::get_current_cpu_data();
$info->{'cputemps'} = $cpu if (ref($cpu) && @{$cpu} >= 1);
$info->{'cpufans'} = $fans if (ref($fans) && @{$fans} >= 1);

View File

@@ -10676,6 +10676,16 @@ elsif (defined($main::open_tempfiles{$_[0]})) {
# Closing a file
my $noerror = $main::open_tempfiles_noerror{$_[0]};
&webmin_debug_log("CLOSE", $_[0]) if ($gconfig{'debug_what_write'});
my $getfacl = &has_command("getfacl");
my $setfacl = &has_command("setfacl");
my $file_acls;
if ($getfacl && $setfacl) {
# Set original ACLs
my $qaclfile = quotemeta($_[0]);
$file_acls = &backquote_command(
"$getfacl --absolute-names $qaclfile 2>/dev/null");
}
# Get status info for a file
my @st = stat($_[0]);
if (&is_selinux_enabled() && &has_command("chcon")) {
# Set original security context
@@ -10697,6 +10707,12 @@ elsif (defined($main::open_tempfiles{$_[0]})) {
chmod($st[2], $_[0]);
chown($st[4], $st[5], $_[0]);
}
if ($file_acls) {
# Set original ACLs
open(my $pipe, '|-', "$setfacl --restore=-");
print($pipe $file_acls);
close($pipe);
}
&reset_file_attributes($_[0], \@old_attributes);
delete($main::open_tempfiles{$_[0]});
delete($main::open_tempfiles_noerror{$_[0]});

View File

@@ -18,6 +18,7 @@ else {
# Save collection options
$system_status::config{'collect_pkgs'} = $in{'pkgs'};
$system_status::config{'collect_notemp2'} = !$in{'temp2'};
$system_status::config{'collect_notemp'} = !$in{'temp'};
$system_status::config{'collect_units'} = $in{'units'};

View File

@@ -19,6 +19,10 @@ print &ui_table_row($text{'status_interval'},
print &ui_table_row($text{'status_pkgs'},
&ui_yesno_radio("pkgs", $system_status::config{'collect_pkgs'}));
# Collect CPU temerature?
print &ui_table_row($text{'status_temp2'},
&ui_yesno_radio("temp2", !$system_status::config{'collect_notemp2'}));
# Collect drive temps?
print &ui_table_row($text{'status_temp'},
&ui_yesno_radio("temp", !$system_status::config{'collect_notemp'}));

View File

@@ -1061,6 +1061,7 @@ status_interval0=Every
status_mins=minutes
status_pkgs=Collect available package updates?
status_temp=Collect drive temperatures?
status_temp2=Collect CPU temperatures and fans speed?
status_units=Units for temperatures
status_celsius=Celsius
status_fahrenheit=Fahrenheit