mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Do not allow pkgnames to start with a hyphen
Commandline arguments starting with a hyphen are usually recognized as options by unix tools. Therefore, allowing hyphens at the beginning of a package name requires a different handling of pkgnames as suggested by rm's manpage. It would be possible to make the scripts 'hyphen-safe', but hyphen-prefixed packages will cause trouble for pacman users which do not know these tricks. Signed-off-by: Cedric Staniewski <cedric@gmx.ca> [Dan: remove the repo-add check] Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
2013d06266
commit
fb97d325a5
@ -1122,6 +1122,10 @@ check_sanity() {
|
||||
error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
|
||||
return 1
|
||||
fi
|
||||
if [ "${pkgname:0:1}" == "-" ]; then
|
||||
error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
|
||||
return 1
|
||||
fi
|
||||
if [ "$pkgver" != "${pkgver//-/}" ]; then
|
||||
error "$(gettext "%s is not allowed to contain hyphens.")" "pkgver"
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user