#865637 pdebuild: please allow to clean the environment

Package:
pbuilder
Source:
pbuilder
Submitter:
Guido Günther
Date:
2026-07-31 20:43:49 UTC
Severity:
wishlist
Tags:
#865637#5
Date:
2017-06-23 11:43:39 UTC
From:
To:
Hi,
it would be nice if pbuilder would allow to clean the environment to
avoid things like

https://anonscm.debian.org/cgit/pkg-mozilla/icedove.git/commit/?id=4e87d6b4670f1f2d1e88ff7cf6f76e83b5db0b7c

from happening. In this case "gbp buildpackage" sets DIST which gets
passed on to git-pbuilder which gets passed on to pbuilder and ends
up in the build environment of the package. I've added a fix for this
to git-pbulder

https://git.sigxcpu.org/cgit/git-buildpackage/commit/?id=021fe9dfb39815827e14199ff480d8c00096df55

but it would be nice if pbuilder would allow to clean the environment
completely before invoking commands in the chroot. This is somewhat
realted to

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623322

Cheers,
 -- Guido

#865637#14
Date:
2019-09-09 12:07:52 UTC
From:
To:
Dear Maintainer,

I'm using
	pdebuild --use-pdebuild-internal
which today failed for CUPS: It evaulates $USER for its test case, which
is still set to 'root' despite using 'su pbuser'. 'cupsd' then failes to
start as it refuses to run as user 'root':

$ ps axfuww

$ xargs -0 -n1 -a /proc/12142/environ echo | grep -e USER -e LOGNAME -e HOME -e PATH

/usr/lib/pbuilder/pdebuild-internal:

It was changed by git:4d6220c0d2e3abdcf247838168591e9d5e4a078b

pbuilder should really provide a clean environment or at least provide
sane defaults for the environment variables listed in <man:su(1)>:
- HOME (done)
- PATH (done)
- USER (missing)
- LOGNAME (missing)
- SHELL (missing)
and also
- XDG_CONFIG_HOME
- TMPDIR (breaks every 'mktemp' when combined with 'pam_tmpdir.so')
- ...

See attached patch.