man-pages/man1/dh_testroot.1.html
2021-03-31 01:06:50 +01:00

104 lines
3.5 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of DH_TESTROOT</TITLE>
</HEAD><BODY>
<H1>DH_TESTROOT</H1>
Section: Debhelper (1)<BR>Updated: 2020-03-27<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
dh_testroot - ensure that a package is built with necessary level of root permissions
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>dh_testroot</B> [<I>debhelper options</I>]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>dh_testroot</B> is used to determine if the target is being run with
suffient access to root(-like) features.
<P>
The definition of sufficient access depends on whether the builder
(the tool invoking the <I>debian/rules</I> target) supports the
<I>Rules-Requires-Root</I> (R³) field. If the builder supports R³, then
it will set the environment variable <I></I><FONT SIZE="-1"><I>DEB_RULES_REQUIRES_ROOT</I></FONT><I></I> and
<B>dh_testroot</B> will validate that the builder followed the minimum
requirements for the given value of <I></I><FONT SIZE="-1"><I>DEB_RULES_REQUIRES_ROOT</I></FONT><I></I>.
<P>
If the builder does not support <I>Rules-Requires-Root</I>, then it will
not set the <I></I><FONT SIZE="-1"><I>DEB_RULES_REQUIRES_ROOT</I></FONT><I></I> environment variable. This
will in turn make <B>dh_testroot</B> (and the rest of debhelper) fall back
to assuming that (fake)root is implied.
<P>
The following is a summary of how <B>dh_testroot</B> behaves based on the
<I></I><FONT SIZE="-1"><I>DEB_RULES_REQUIRES_ROOT</I></FONT><I></I> environment variable (leading and trailing
whitespace in the variable is ignored).
<DL COMPACT>
<DT id="1">-<DD>
If unset, or set to <TT>&quot;binary-targets&quot;</TT>, then <B>dh_testroot</B> asserts
that it is run as root or under <B><A HREF="/cgi-bin/man/man2html?1+fakeroot">fakeroot</A></B>(1).
<DT id="2">-<DD>
If set to <TT>&quot;no&quot;</TT>, then <B>dh_testroot</B> returns successfully (without
performing any additional checks).
<DT id="3">-<DD>
If set to any other value than the above, then <B>dh_testroot</B> asserts
that it is either run as root (or under <B><A HREF="/cgi-bin/man/man2html?1+fakeroot">fakeroot</A></B>(1)) or the builder
has provided the <B></B><FONT SIZE="-1"><B>DEB_GAIN_ROOT_CMD</B></FONT><B></B> environment variable (e.g. via
dpkg-buildpackage -r).
</DL>
<P>
Please note that <B>dh_testroot</B> does <I>not</I> read the
<I>Rules-Requires-Root</I> field. Which implies that <B>dh_testroot</B> may
produce incorrect result if the builder lies in
<I></I><FONT SIZE="-1"><I>DEB_RULES_REQUIRES_ROOT</I></FONT><I></I>. On the flip side, it also enables things
like testing for what will happen when <I></I><FONT SIZE="-1"><I>DEB_RULES_REQUIRES_ROOT</I></FONT><I></I> is
set to a given value.
<A NAME="lbAE">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?7+debhelper">debhelper</A></B>(7)
<P>
This program is a part of debhelper.
<A NAME="lbAF">&nbsp;</A>
<H2>AUTHOR</H2>
Joey Hess &lt;<A HREF="mailto:joeyh@debian.org">joeyh@debian.org</A>&gt;
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="7"><A HREF="#lbAE">SEE ALSO</A><DD>
<DT id="8"><A HREF="#lbAF">AUTHOR</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:11 GMT, March 31, 2021
</BODY>
</HTML>