libmakepkg: fix unsanitized source filenames
There were a couple places where filenames beginning with "-" were not properly guarded against by passing them after "--". Some PKGBUILD authors are crazy, but we still take those into account. Signed-off-by: Eli Schwartz <eschwartz93@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
3c433abb54
commit
9c604af0a0
1 changed files with 2 additions and 2 deletions
|
@ -96,7 +96,7 @@ extract_file() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# do not rely on extension for file type
|
# do not rely on extension for file type
|
||||||
local file_type=$(file -bizL "$file")
|
local file_type=$(file -bizL -- "$file")
|
||||||
local ext=${file##*.}
|
local ext=${file##*.}
|
||||||
local cmd=''
|
local cmd=''
|
||||||
case "$file_type" in
|
case "$file_type" in
|
||||||
|
@ -132,7 +132,7 @@ extract_file() {
|
||||||
$cmd -xf "$file" || ret=$?
|
$cmd -xf "$file" || ret=$?
|
||||||
else
|
else
|
||||||
rm -f -- "${file%.*}"
|
rm -f -- "${file%.*}"
|
||||||
$cmd -dcf "$file" > "${file%.*}" || ret=$?
|
$cmd -dcf -- "$file" > "${file%.*}" || ret=$?
|
||||||
fi
|
fi
|
||||||
if (( ret )); then
|
if (( ret )); then
|
||||||
error "$(gettext "Failed to extract %s")" "$file"
|
error "$(gettext "Failed to extract %s")" "$file"
|
||||||
|
|
Loading…
Add table
Reference in a new issue