1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-15 13:55:09 -05:00

makepkg : check for invalid backup entry

This implements FS#13551

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Xavier Chantry 2009-08-18 20:30:04 +02:00 committed by Dan McGee
parent cb07265851
commit b53aa87ea9

View File

@ -949,6 +949,18 @@ write_pkginfo() {
fi fi
} }
check_package() {
cd "$pkgdir"
# check existence of backup files
local file
for file in "${backup[@]}"; do
if [ ! -f "$file" ]; then
warning "$(gettext "Invalid backup entry : %s")" "$file"
fi
done
}
create_package() { create_package() {
if [ ! -d "$pkgdir" ]; then if [ ! -d "$pkgdir" ]; then
error "$(gettext "Missing pkg/ directory.")" error "$(gettext "Missing pkg/ directory.")"
@ -956,6 +968,8 @@ create_package() {
exit 1 # $E_MISSING_PKGDIR exit 1 # $E_MISSING_PKGDIR
fi fi
check_package
cd "$pkgdir" cd "$pkgdir"
msg "$(gettext "Creating package...")" msg "$(gettext "Creating package...")"
@ -1158,6 +1172,14 @@ check_sanity() {
fi fi
done done
local file
for file in "${backup[@]}"; do
if [ "${file:0:1}" = "/" ]; then
error "$(gettext "Invalid backup entry : %s")" "$file"
return 1
fi
done
if [ "$install" -a ! -f "$install" ]; then if [ "$install" -a ! -f "$install" ]; then
error "$(gettext "Install scriptlet (%s) does not exist.")" "$install" error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
return 1 return 1