coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Various tests give illusory results


From: Bernhard Voelker
Subject: Re: Various tests give illusory results
Date: Fri, 10 Aug 2012 08:53:21 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120713 Thunderbird/14.0

On 08/09/2012 05:43 PM, Ondrej Oprala wrote:
> Hi, I think I got a fix for this bugzilla 
> https://bugzilla.redhat.com/show_bug.cgi?id=556358.
> I added a bit of permission checking to require_root_ so no tests have 
> to be rewriten.
> Have a nice day :) ,
>   Ondrej
> 

Hi Ondrej,

> +setuidgid_has_perm_()
> +{
> +
> +  cat << \EOF > cmds.tmp
> +  IFS=:
> +  for DIR in $PATH; do
> +    test -x $DIR || exit 1
> +  done
> +  exit 0
> +EOF
> +
> +  su -s /bin/sh $NON_ROOT_USERNAME < cmds.tmp
> +
> +  RET=$?
> +  return $RET
> +}
> +

just a thought: if setuidgid is part of the test failure,
then why not using setuidgid in here?

Furthermore: the problem is finding the correct binary, right?
E.g. in tests/rm/fail-2eperm there is already such a test:

  # Try to ensure that $NON_ROOT_USERNAME can access
  # the required version of rm.
  rm_version=$(
    setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm --version |
    sed -n '1s/.* //p'
  )
  case $rm_version in
    $PACKAGE_VERSION) ;;
    *) skip_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
  esac


Have a nice day,
Berny



reply via email to

[Prev in Thread] Current Thread [Next in Thread]