[darcs-users] buildbot once again

Trent W. Buck twb at cybersource.com.au
Wed Aug 5 07:57:04 UTC 2009


On Wed, Aug 05, 2009 at 08:57:53AM +0200, Petr Rockai wrote:
> twb at cybersource.com.au (Trent W. Buck) writes:
> 
> > Another thing I sometimes do to test a command "foo" is
> >
> >     env -i >/dev/null 2>&1 </dev/null foo
> >
> > which ought to remove tty-ness as well as all environment variables
> > (e.g. $HOME and $TERM).  Sticking a "sudo -u nobody" in front also
> > occurs to me, since sometimes programs use nss to expand ~ instead of
> > honouring $HOME...
> sudo -u won't reset HOME if that's what you mean (throw in -H).

That's why env -i.  The sudo -u is meant to "fix" geteuid(3), and thus
the approach of doing a getent passwd on $EUID to find out where $HOME
is when $HOME is unset.

Anyways, I've drifted completely offtopic by this point.

> Moreover, buildbot usually uses PTYs to let programs run in a
> virtual TTY.

Ew.


More information about the darcs-users mailing list