Skip to content

Commit

Permalink
Extra checks that we're not replacing nothing https://forum.virtualmi…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Feb 18, 2023
1 parent f3f3408 commit e707cad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion virtual_feature.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,8 @@ sub feature_restore
}

# Fix up home directory if changed
if ($oldd && $d->{'home'} ne $oldd->{'home'}) {
if ($oldd && $d->{'home'} && $oldd->{'home'} &&
$d->{'home'} ne $oldd->{'home'}) {
&recursive_change_directives(
$server, $oldd->{'home'}, $d->{'home'}, 0, 1);
}
Expand Down
1 change: 1 addition & 0 deletions virtualmin-nginx-lib.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,7 @@ sub switch_write_user
sub recursive_change_directives
{
my ($parent, $oldv, $newv, $suffix, $prefix, $infix) = @_;
return if (!$oldv);
foreach my $dir (@{$parent->{'members'}}) {
my $changed = 0;
foreach my $w (@{$dir->{'words'}}) {
Expand Down

0 comments on commit e707cad

Please sign in to comment.