<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Crashpad: crashpad::ScopedPrSetPtracer Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="crashpad_doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Crashpad </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ var searchBox = new SearchBox("searchBox", "search",false,'Search'); /* @license-end */ </script> <script type="text/javascript" src="menudata.js"></script> <script type="text/javascript" src="menu.js"></script> <script type="text/javascript"> /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ $(function() { initMenu('',true,false,'search.php','Search'); $(document).ready(function() { init_search(); }); }); /* @license-end */</script> <div id="main-nav"></div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1ScopedPrSetPtracer.html">ScopedPrSetPtracer</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="classcrashpad_1_1ScopedPrSetPtracer-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">crashpad::ScopedPrSetPtracer Class Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr class="memitem:a41e0b7ae766688bf7157a8283018e1c7"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1ScopedPrSetPtracer.html#a41e0b7ae766688bf7157a8283018e1c7">ScopedPrSetPtracer</a> (pid_t pid, bool may_log)</td></tr> <tr class="memdesc:a41e0b7ae766688bf7157a8283018e1c7"><td class="mdescLeft"> </td><td class="mdescRight">Uses <code>PR_SET_PTRACER</code> to set <em>pid</em> as the caller's ptracer. <a href="#a41e0b7ae766688bf7157a8283018e1c7">More...</a><br /></td></tr> <tr class="separator:a41e0b7ae766688bf7157a8283018e1c7"><td class="memSeparator" colspan="2"> </td></tr> </table> <h2 class="groupheader">Constructor & Destructor Documentation</h2> <a id="a41e0b7ae766688bf7157a8283018e1c7"></a> <h2 class="memtitle"><span class="permalink"><a href="#a41e0b7ae766688bf7157a8283018e1c7">◆ </a></span>ScopedPrSetPtracer()</h2> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">crashpad::ScopedPrSetPtracer::ScopedPrSetPtracer </td> <td>(</td> <td class="paramtype">pid_t </td> <td class="paramname"><em>pid</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">bool </td> <td class="paramname"><em>may_log</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Uses <code>PR_SET_PTRACER</code> to set <em>pid</em> as the caller's ptracer. </p> <p><code>PR_SET_PTRACER</code> is only supported if the Yama Linux security module (LSM) is enabled. Otherwise, <code>prctl(PR_SET_PTRACER, ...)</code> fails with <code>EINVAL</code>. See linux-4.9.20/security/yama/yama_lsm.c yama_task_prctl() and linux-4.9.20/kernel/sys.c [sys_]prctl().</p> <p>An error message will be logged on failure only if <em>may_log</em> is <code>true</code> and <code>prctl</code> does not fail with <code>EINVAL</code>;</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">pid</td><td>The process ID of the process to make the caller's ptracer. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">may_log</td><td>if <code>true</code>, this class may log error messages. </td></tr> </table> </dd> </dl> </div> </div> <hr/>The documentation for this class was generated from the following files:<ul> <li>util/linux/scoped_pr_set_ptracer.h</li> <li>util/linux/scoped_pr_set_ptracer.cc</li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.14 </small></address> </body> </html>