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
|
||||
|
||||
# do not rely on extension for file type
|
||||
local file_type=$(file -bizL "$file")
|
||||
local file_type=$(file -bizL -- "$file")
|
||||
local ext=${file##*.}
|
||||
local cmd=''
|
||||
case "$file_type" in
|
||||
|
@ -132,7 +132,7 @@ extract_file() {
|
|||
$cmd -xf "$file" || ret=$?
|
||||
else
|
||||
rm -f -- "${file%.*}"
|
||||
$cmd -dcf "$file" > "${file%.*}" || ret=$?
|
||||
$cmd -dcf -- "$file" > "${file%.*}" || ret=$?
|
||||
fi
|
||||
if (( ret )); then
|
||||
error "$(gettext "Failed to extract %s")" "$file"
|
||||
|
|
Loading…
Add table
Reference in a new issue