mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-11 17:29:52 +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
|
e=1
|
||||||
fi
|
fi
|
||||||
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
|
# check directory permissions
|
||||||
i=$(find "$dir" -type d -perm -777 | sed "s|^$dir|\t|")
|
i=$(find "$dir" -type d -perm -777 | sed "s|^$dir|\t|")
|
||||||
if [ -n "$i" ]; then
|
if [ -n "$i" ]; then
|
||||||
|
@ -24,13 +24,20 @@ teardown() {
|
|||||||
|
|
||||||
@test "abuild: build failure" {
|
@test "abuild: build failure" {
|
||||||
cd testrepo/buildfail
|
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 ]
|
[ $status -ne 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "abuild: test check for /usr/lib64" {
|
@test "abuild: test check for /usr/lib64" {
|
||||||
cd testrepo/lib64test
|
cd testrepo/lib64test
|
||||||
run $ABUILD cleanpkg all
|
run $ABUILD all
|
||||||
[ $status -ne 0 ]
|
[ $status -ne 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,3 +62,4 @@ teardown() {
|
|||||||
|
|
||||||
[ "$checksums" = "$checksums2" ]
|
[ "$checksums" = "$checksums2" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user