* [Qemu-devel] [RFC for 3.1? or 4 v3 1/1] qemu-iotests: Don't run the test when user is root
[not found] <cover.1543610035.git.alifm@linux.ibm.com>
@ 2018-11-30 20:37 ` Farhan Ali
2018-11-30 20:52 ` Eric Blake
0 siblings, 1 reply; 3+ messages in thread
From: Farhan Ali @ 2018-11-30 20:37 UTC (permalink / raw)
To: qemu-block, qemu-devel; +Cc: peter.maydell, kwolf, eblake, alifm
Test 232 creates image files with read-only permission and
expects an error message when trying to access the image
files with read-only and auto-read-only turned off.
Don't run as root user, since root can open files with read/write
access for read-only files.
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
---
tests/qemu-iotests/232 | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/qemu-iotests/232 b/tests/qemu-iotests/232
index 0708b8b..1d34242 100755
--- a/tests/qemu-iotests/232
+++ b/tests/qemu-iotests/232
@@ -92,6 +92,11 @@ echo
chmod a-w $TEST_IMG
+if [ -w $TEST_IMG ]
+then
+ _notrun "Cannot run this test as root user"
+fi
+
run_qemu_info_block -drive driver=file,file="$TEST_IMG",if=none,read-only=on,auto-read-only=off
run_qemu_info_block -drive driver=file,file="$TEST_IMG",if=none,read-only=on,auto-read-only=on
run_qemu_info_block -drive driver=file,file="$TEST_IMG",if=none,read-only=on
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [RFC for 3.1? or 4 v3 1/1] qemu-iotests: Don't run the test when user is root
2018-11-30 20:37 ` [Qemu-devel] [RFC for 3.1? or 4 v3 1/1] qemu-iotests: Don't run the test when user is root Farhan Ali
@ 2018-11-30 20:52 ` Eric Blake
2018-11-30 21:51 ` Farhan Ali
0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2018-11-30 20:52 UTC (permalink / raw)
To: Farhan Ali, qemu-block, qemu-devel; +Cc: peter.maydell, kwolf
On 11/30/18 2:37 PM, Farhan Ali wrote:
> Test 232 creates image files with read-only permission and
> expects an error message when trying to access the image
> files with read-only and auto-read-only turned off.
>
> Don't run as root user, since root can open files with read/write
> access for read-only files.
>
> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
> ---
> tests/qemu-iotests/232 | 5 +++++
> 1 file changed, 5 insertions(+)
Did you mean to keep RFC in the subject line? Will patchew even spot it
without PATCH in the subject line?
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [RFC for 3.1? or 4 v3 1/1] qemu-iotests: Don't run the test when user is root
2018-11-30 20:52 ` Eric Blake
@ 2018-11-30 21:51 ` Farhan Ali
0 siblings, 0 replies; 3+ messages in thread
From: Farhan Ali @ 2018-11-30 21:51 UTC (permalink / raw)
To: Eric Blake, qemu-block, qemu-devel; +Cc: peter.maydell, kwolf
On 11/30/2018 03:52 PM, Eric Blake wrote:
> On 11/30/18 2:37 PM, Farhan Ali wrote:
>> Test 232 creates image files with read-only permission and
>> expects an error message when trying to access the image
>> files with read-only and auto-read-only turned off.
>>
>> Don't run as root user, since root can open files with read/write
>> access for read-only files.
>>
>> Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
>> ---
>> tests/qemu-iotests/232 | 5 +++++
>> 1 file changed, 5 insertions(+)
>
> Did you mean to keep RFC in the subject line? Will patchew even spot it
> without PATCH in the subject line?
>
> Reviewed-by: Eric Blake <eblake@redhat.com>
>
Thanks for reviewing the patch. I am not sure if patchew will pick it
up; I have no problem in spinning another patch but I will wait till
Monday to see if anyone else has any feedback.
Thanks
Farhan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-30 21:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1543610035.git.alifm@linux.ibm.com>
2018-11-30 20:37 ` [Qemu-devel] [RFC for 3.1? or 4 v3 1/1] qemu-iotests: Don't run the test when user is root Farhan Ali
2018-11-30 20:52 ` Eric Blake
2018-11-30 21:51 ` Farhan Ali
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).