mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-22 07:00:28 +00:00
abuild: add test for invalid filenames
reject filenames with newlines fixes #10024
This commit is contained in:
parent
9246fbc8b4
commit
f35f2aa859
@ -804,6 +804,13 @@ postcheck() {
|
||||
e=1
|
||||
fi
|
||||
fi
|
||||
# check that we don't have any files names with newline
|
||||
i=$(find "$dir" -name $'*\n*')
|
||||
if [ -n "$i" ]; then
|
||||
error "Found filenames with newline:"
|
||||
echo "$i"
|
||||
e=1
|
||||
fi
|
||||
# check directory permissions
|
||||
i=$(find "$dir" -type d -perm -777 | sed "s|^$dir|\t|")
|
||||
if [ -n "$i" ]; then
|
||||
|
@ -24,13 +24,20 @@ teardown() {
|
||||
|
||||
@test "abuild: build failure" {
|
||||
cd testrepo/buildfail
|
||||
run $ABUILD cleanpkg all
|
||||
run $ABUILD all
|
||||
[ $status -ne 0 ]
|
||||
}
|
||||
|
||||
@test "abuild: test check for invalid file names" {
|
||||
cd testrepo/invalid-filename
|
||||
run $ABUILD all
|
||||
echo "$output"
|
||||
[ $status -ne 0 ]
|
||||
}
|
||||
|
||||
@test "abuild: test check for /usr/lib64" {
|
||||
cd testrepo/lib64test
|
||||
run $ABUILD cleanpkg all
|
||||
run $ABUILD all
|
||||
[ $status -ne 0 ]
|
||||
}
|
||||
|
||||
@ -55,3 +62,4 @@ teardown() {
|
||||
|
||||
[ "$checksums" = "$checksums2" ]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user