Skip to content

Commit

Permalink
Don't assume that current directory is the module dir https://sourcef…
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Nov 19, 2020
1 parent 21bf940 commit b050380
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webmin/upgrade.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ else {
}
else {
# Next to the current directory
$extract = "../..";
$extract = "$root_directory/..";
}

# Do the extraction of the tar file, and run setup.sh
Expand All @@ -460,7 +460,7 @@ else {
# Extact top-level files like setup.sh and os_list.txt
$topfiles = join(" ", map { quotemeta($_) }
grep { !$tardir{$_} } @topfiles);
$out = `cd $extract ; tar xf $file $topfiles 2>&1 >/dev/null`;
$out = `cd $extract && tar xf $file $topfiles 2>&1 >/dev/null`;
if ($?) {
&inst_error(&text('upgrade_euntar', "<tt>$out</tt>"));
}
Expand All @@ -482,14 +482,14 @@ else {
# Extract current modules and other directories
$mods = join(" ", map { quotemeta("webmin-$version/$_") }
@mods);
$out = `cd $extract ; tar xf $file $mods 2>&1 >/dev/null`;
$out = `cd $extract && tar xf $file $mods 2>&1 >/dev/null`;
if ($?) {
&inst_error(&text('upgrade_euntar', "<tt>$out</tt>"));
}
}
else {
# Extract the whole file
$out = `cd $extract ; tar xf $file 2>&1 >/dev/null`;
$out = `cd $extract && tar xf $file 2>&1 >/dev/null`;
if ($?) {
&inst_error(&text('upgrade_euntar', "<tt>$out</tt>"));
}
Expand Down

0 comments on commit b050380

Please sign in to comment.