Bug#670733: ocaml-cry: FTBFS: Incorrectly thinks it's building as root
Hi,
I played a bit around to investigate the problem. What I see is:
- inside pbuilder, after installing the build dependencies and
after patching the sources, dh_clean runs as root
[env says $SUDO_USER=tews and $USER=root; id says uid=0(root)
gid=0(root)]
- Later the configure script of the package runs not as root. At
line 2871 in configure, where the root test is, id says
uid=56789(pbuilder) gid=56789(pbuilder) groups=56789(pbuilder)
however, env still says $SUDO_USER=tews and $USER=root. The
configure script runs `whoami` only if $USER is empty.
Therefore configure believes $USER=root and aborts.
For me this looks like pbuilder is not setting the environment
correctly when changing to the non-root user. Or the configure
script is wrong in taken the contents of $USER.
Gruss,
Hendrik
PS. To reproduce
- pbuilder create
- pbuilder login --save-after-login
- in the pbuilder shell: useradd -m -u 56789 pbuilder
- put "BUILDUSERNAME=pbuilder" into /etc/pbuilderrc
- build package with git-buildpackage --git-builder=pdebuild
Reply to: