104 lines
3.5 KiB
HTML
104 lines
3.5 KiB
HTML
|
||
<!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"> </A>
|
||
<H2>NAME</H2>
|
||
|
||
dh_testroot - ensure that a package is built with necessary level of root permissions
|
||
<A NAME="lbAC"> </A>
|
||
<H2>SYNOPSIS</H2>
|
||
|
||
|
||
|
||
<B>dh_testroot</B> [<I>debhelper options</I>]
|
||
<A NAME="lbAD"> </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>"binary-targets"</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>"no"</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"> </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"> </A>
|
||
<H2>AUTHOR</H2>
|
||
|
||
|
||
|
||
Joey Hess <<A HREF="mailto:joeyh@debian.org">joeyh@debian.org</A>>
|
||
<P>
|
||
|
||
<HR>
|
||
<A NAME="index"> </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>
|