From fe794ccb25d3ab1f7c07331b437b61c30c08a018 Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Tue, 4 Jun 2013 13:38:48 +1000 Subject: Restrict pkgname from starting with a dot. Adding this restriction means we can filter any FILENAME entry from starting with a "/" or a ".". Use the term "dot" as it is more computing relevant compared to "full stop" or "period" which vary depending on English locale. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 08dcf4ce..a8a552ff 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2111,6 +2111,10 @@ check_sanity() { error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname" ret=1 fi + if [[ ${i:0:1} = "." ]]; then + error "$(gettext "%s is not allowed to start with a dot.")" "pkgname" + ret=1 + fi if [[ $i = *[^[:alnum:]+_.@-]* ]]; then error "$(gettext "%s contains invalid characters: '%s'")" \ 'pkgname' "${pkgname//[[:alnum:]+_.@-]}" -- cgit v1.2.3-24-g4f1b