提交 28bbd7ee 编写于 作者: Y ykantser

8044419: TEST_BUG: com/sun/jdi/JdbReadTwiceTest.sh fails when run under root

Reviewed-by: dsamersoff, sla
Contributed-by: mattias.tobiasson@oracle.com
上级 ee6c30c9
...@@ -204,27 +204,37 @@ if [ ! -r c:/ ] ; then ...@@ -204,27 +204,37 @@ if [ ! -r c:/ ] ; then
clean clean
fi fi
echo
if [ ! -r c:/ ] ; then echo "+++++++++++++++++++++++++++++++++++"
# Can't make a file unreadable under MKS. echo "Read an unreadable file - verify the read fails."
echo
echo "+++++++++++++++++++++++++++++++++++" canMakeUnreadable=No
echo "Read an unreadable file - verify the read fails." id > $HOME/jdb.ini
# If the file exists, we try to read it. The if chmod a-r $HOME/jdb.ini
# read will fail. then
mkFiles $HOME/jdb.ini grep -q 'uid=0(' $HOME/jdb.ini 2> /dev/null
id > $HOME/jdb.ini case $? in
chmod a-r $HOME/jdb.ini 0)
if grep -q "uid=" $HOME/jdb.ini ; then echo "Error! Can't make file unreadable running as root"
echo "Unable to make file unreadable, so test will fail. chmod: $HOME/jdb.ini" ;;
if grep -q "uid=0" $HOME/jdb.ini ; then 1)
echo "The test is running as root. Fix infrastructure!" echo "Error! Can't make file unreadable for some other reason (windows?)"
fi ;;
fi *)
echo "OK. the file is unreadable"
canMakeUnreadable=Yes
;;
esac
else
echo "Error! Can't create or chmod file"
fi
if [ "$canMakeUnreadable" = "Yes" ]
then
doit doit
failIfNot 1 "open: $HOME/jdb.ini" failIfNot 1 "open: $HOME/jdb.ini"
clean
fi fi
clean
echo echo
...@@ -246,8 +256,8 @@ echo "read $fred" > $here/jdb.ini ...@@ -246,8 +256,8 @@ echo "read $fred" > $here/jdb.ini
doit doit
failIfNot 1 "from $fred" failIfNot 1 "from $fred"
if [ ! -r c:/ ] ; then if [ "$canMakeUnreadable" = "Yes" ]
# Can't make a file unreadable under MKS then
chmod a-r $fred chmod a-r $fred
doit doit
failIfNot 1 "open: $fred" failIfNot 1 "open: $fred"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册