summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-13 21:40:30 +0200
committerDan McGee <dan@archlinux.org>2012-04-21 01:14:45 +0200
commit5f71570ec48588bf24bfe786f40b500216084d07 (patch)
tree20c349cc04f66efb47b84221024b880be622751c /scripts
parent133d174e60951dcca39d4c4063a85de75f52f6a8 (diff)
downloadpacman-5f71570ec48588bf24bfe786f40b500216084d07.tar.gz
pacman-5f71570ec48588bf24bfe786f40b500216084d07.tar.xz
makepkg: restrict allowed characters in pkgname
Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index eeb7ede1..6990572b 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1454,6 +1454,11 @@ check_sanity() {
error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
ret=1
fi
+ if [[ $i = *[^[:alnum:]+_.@-]* ]]; then
+ error "$(gettext "%s contains invalid characters: '%s'")" \
+ 'pkgname' "${pkgname//[[:alnum:]+_.@-]}"
+ ret=1
+ fi
done
if [[ ${pkgbase:0:1} = "-" ]]; then