Hey Jonathan,

Jonathan Nieder [2011-06-15 16:11 -0500]:
> One approach would be to say that running a typical test suite is not
> something fakeroot can fully support

Note that this isn't really a test suite problem -- it applies to a
plain "fakeroot apt-cache", which could be done in any kind of package
build, or worse, in "fakeroot fakechroot" environments where you
actually have a work environment.

It's trivial to work around it in test suites, but harder to do in
fakechroot environments.

>  - on the other hand, it can be used as in Martin's example test
>    suite, to opportunistically say "If I have permission to make
>    something --- e.g., a cache --- in the system a little better,
>    let me actually do that".

Right, that's how apt-cache seems to use it (again, it's nothing to do
with my test suite, that was just a place where I noticed it). As a
check like

  if (access(file))
      if (open() < 0)
          error_handling
  else
      no_perm_fallback()

is usually bad programming style due to race conditions, as you
already said, I filed the bug against apt and not fakeroot.

It's usually better to do

  if (open() < 0)
      if (errno == EPERM)
         no_perm_fallback()
      else
         error_handling

> But we live in the real world.  Maybe it would be best to revert the
> change in sid and introduce it in experimental, to get a better sense
> of whether the weight of the impact goes one way or another.
> 
> Anyway, Clint, please feel free to revert the change.  I'll think
> more.

Let's not get in a hurry here. I deliberately filed the bug as "minor"
and against apt, not fakeroot. If the apt maintainers are okay with
changing the code to not use access() at all here, we can make both
use cases work.

Thanks!

Martin
-- 
Martin Pitt                        | http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

Attachment: signature.asc
Description: Digital signature

Reply via email to