Man page - dh_testroot(1)
Packages contas this manual
- dh_installcatalogs(1)
- debhelper-obsolete-compat(7)
- dh_builddeb(1)
- dh_installsystemduser(1)
- dh_auto_configure(1)
- dh_installdeb(1)
- dh_auto_test(1)
- dh_auto_build(1)
- dh_auto_install(1)
- dh_installlogrotate(1)
- dh_assistant(1)
- dh_install(1)
- dh_strip(1)
- dh_systemd_enable(1)
- dh_testdir(1)
- dh_installalternatives(1)
- dh_movetousr(1)
- dh_listpackages(1)
- dh_installsysusers(1)
- dh_shlibdeps(1)
- dh_installpam(1)
- dh_installmenu(1)
- dh_missing(1)
- dh_fixperms(1)
- dh_installtmpfiles(1)
- dh_md5sums(1)
- dh_testroot(1)
- dh_makeshlibs(1)
- dh_lintian(1)
- dh_installcron(1)
- dh_installsystemd(1)
- dh_installinit(1)
- dh_installlogcheck(1)
- dh_installinfo(1)
- dh_link(1)
- dh_installchangelogs(1)
- dh_icons(1)
- dh_installmime(1)
- dh_installmanpages(1)
- dh_bugfiles(1)
- dh_movefiles(1)
- dh_installexamples(1)
- dh_installdebconf(1)
- dh_ucf(1)
- dh_installwm(1)
- dh_installxfonts(1)
- dh_installdirs(1)
- dh_usrlocal(1)
- dh_dwz(1)
- debhelper-compat-upgrade-checklist(7)
- dh_update_autotools_config(1)
- dh_installifupdown(1)
- dh_systemd_start(1)
- dh_clean(1)
- dh_installppp(1)
- dh_auto_clean(1)
- dh(1)
- dh_compress(1)
- dh_prep(1)
- dh_gencontrol(1)
- dh_installgsettings(1)
- dh_installemacsen(1)
- dh_perl(1)
- dh_installdocs(1)
- dh_installinitramfs(1)
- dh_installman(1)
- dh_installudev(1)
- debhelper(7)
- dh_installmodules(1)
apt-get install debhelper
Available languages:
en fr pt deManual
| DH_TESTROOT(1) | Debhelper | DH_TESTROOT(1) |
NAME
dh_testroot - ensure that a package is built with necessary level of root permissions
SYNOPSIS
dh_testroot [debhelper options]
DESCRIPTION
dh_testroot is used to determine if the target is being run with suffient access to root(-like) features.
The definition of sufficient access depends on whether the builder (the tool invoking the debian/rules target) supports the Rules-Requires-Root (R³) field. If the builder supports R³, then it will set the environment variable DEB_RULES_REQUIRES_ROOT and dh_testroot will validate that the builder followed the minimum requirements for the given value of DEB_RULES_REQUIRES_ROOT.
If the builder does not support Rules-Requires-Root, then it will not set the DEB_RULES_REQUIRES_ROOT environment variable. This will in turn make dh_testroot (and the rest of debhelper) fall back to assuming that (fake)root is implied.
The following is a summary of how dh_testroot behaves based on the DEB_RULES_REQUIRES_ROOT environment variable (leading and trailing whitespace in the variable is ignored).
- If unset, or set to "binary-targets", then dh_testroot asserts that it is run as root or under fakeroot(1).
- If set to "no", then dh_testroot returns successfully (without performing any additional checks).
- If set to any other value than the above, then dh_testroot asserts that it is either run as root (or under fakeroot(1)) or the builder has provided the DEB_GAIN_ROOT_CMD environment variable (e.g. via dpkg-buildpackage -r).
Please note that dh_testroot does not read the Rules-Requires-Root field. Which implies that dh_testroot may produce incorrect result if the builder lies in DEB_RULES_REQUIRES_ROOT. On the flip side, it also enables things like testing for what will happen when DEB_RULES_REQUIRES_ROOT is set to a given value.
SEE ALSO
debhelper(7)
This program is a part of debhelper.
AUTHOR
Joey Hess <joeyh@debian.org>
| 2025-03-29 | 13.24.2 |