diff options
author | Allan McRae <allan@archlinux.org> | 2013-06-04 05:38:48 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-06-04 05:38:48 +0200 |
commit | fe794ccb25d3ab1f7c07331b437b61c30c08a018 (patch) | |
tree | be2d85d5649738fec82f9986f86126ac5f1b40e1 | |
parent | f1d74d928a7ce106dad9303c036222823f347af2 (diff) | |
download | pacman-fe794ccb25d3ab1f7c07331b437b61c30c08a018.tar.gz pacman-fe794ccb25d3ab1f7c07331b437b61c30c08a018.tar.xz |
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 <allan@archlinux.org>
-rw-r--r-- | doc/PKGBUILD.5.txt | 2 | ||||
-rw-r--r-- | scripts/makepkg.sh.in | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index ea280a0e..e78a8e5a 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -42,7 +42,7 @@ similar to `$_basekernver`. Either the name of the package or an array of names for split packages. Valid characters for members of this array are alphanumerics, and any of the following characters: ```@ . _ + -`''. Additionally, names are not - allowed to start with hyphens. + allowed to start with hyphens or dots. *pkgver*:: The version of the software as released from the author (e.g., '2.7.1'). 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:]+_.@-]}" |