[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:14:04 PST 2009


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.

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