[Ocfs2-test-devel] [PATCH 1/1] Ocfs2-test: Forbid root user to run xattr-test.

Tao Ma tao.ma at oracle.com
Mon Feb 16 00:54:14 PST 2009



tristan.ye wrote:
> On Mon, 2009-02-16 at 16:14 +0800, Tao Ma wrote:
>> Hi tristan,
>> 	Thank you for that.
>>
>> 	Just one question: As you said in the commit log, remote_mount forbid 
>> running as root, then why we need the check for xattr-single-run.sh? It 
>> doens't use remote_mount AFAICS.
> 
> Yes, I've thought about it, I just prevent root user from running it for
> the sake of security reasons, and what's more, it also keeps a
> unification in flavor with other former tests in ocfs2-test written by
> marcos:)
ok. So
Signed-off-by: Tao Ma <tao.ma at oracle.com>
> 
> Tristan.
> 
> 
>> Regards,
>> Tao
>>
>> Tristan Ye wrote:
>>> Since xattr-tests use remote_mount(which forbid us to run as root), we
>>> as well prevent the user from running test at the very beginning. so it
>>> will not try to do the needless and time-consuming  mkfs before remote_mount
>>> when we're root.
>>>
>>> Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
>>> ---
>>>  programs/xattr_tests/xattr-multi-run.sh  |    4 ++++
>>>  programs/xattr_tests/xattr-single-run.sh |    6 ++++++
>>>  2 files changed, 10 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/programs/xattr_tests/xattr-multi-run.sh b/programs/xattr_tests/xattr-multi-run.sh
>>> index 9b91f3a..cb6984f 100755
>>> --- a/programs/xattr_tests/xattr-multi-run.sh
>>> +++ b/programs/xattr_tests/xattr-multi-run.sh
>>> @@ -203,6 +203,10 @@ f_create_hostfile()
>>>  
>>>  f_setup()
>>>  {
>>> +	if [ "${UID}" = "0" ];then
>>> +		echo "Should not run tests as root."
>>> +		exit 1
>>> +	fi
>>>  
>>>  	f_getoptions $*
>>>  	
>>> diff --git a/programs/xattr_tests/xattr-single-run.sh b/programs/xattr_tests/xattr-single-run.sh
>>> index 87d31dd..0ab7df5 100755
>>> --- a/programs/xattr_tests/xattr-single-run.sh
>>> +++ b/programs/xattr_tests/xattr-single-run.sh
>>> @@ -178,6 +178,12 @@ f_getoptions()
>>>  
>>>  f_setup()
>>>  {
>>> +
>>> +	if [ "${UID}" = "0" ];then
>>> +		echo "Should not run tests as root."
>>> +		exit 1
>>> +	fi
>>> +
>>>  	f_getoptions $*
>>>  
>>>  	if [ -z "${MOUNT_POINT}" ];then 
> 



More information about the Ocfs2-test-devel mailing list