From cdaa9517afc5cd85da7c92ffa272417771632a07 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sun, 20 Jul 2014 22:32:39 -0400 Subject: repofile: Avoid segfault if querying child in non-directory The user might "ostree ls /usr/bin/bash/blah", which previously would segfault. A somewhat related future enhancement here would be for "ostree ls" to follow symbolic links. Reported-by: Dusty Mabe https://bugzilla.gnome.org/show_bug.cgi?id=733476 --- tests/test-basic.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test-basic.sh') diff --git a/tests/test-basic.sh b/tests/test-basic.sh index 19e98b1e..e0783855 100755 --- a/tests/test-basic.sh +++ b/tests/test-basic.sh @@ -267,6 +267,13 @@ cd ${test_tmpdir} $OSTREE ls test2 echo "ok ls with no argument" +cd ${test_tmpdir} +if $OSTREE ls test2 /baz/cow/notadir 2>errmsg; then + assert_not_reached +fi +assert_file_has_content errmsg "Not a directory" +echo "ok ls of not a directory" + cd ${test_tmpdir} $OSTREE show test2 echo "ok show with non-checksum" -- cgit v1.2.1