summaryrefslogtreecommitdiff
path: root/static/freebsd/man9/vfs_suser.9 4.html
blob: ae8790a78f121ffb01218b4b2cade419377332aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<table class="head">
  <tr>
    <td class="head-ltitle">VFS_SUSER(9)</td>
    <td class="head-vol">Kernel Developer's Manual</td>
    <td class="head-rtitle">VFS_SUSER(9)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<p class="Pp"><code class="Nm">vfs_suser</code> &#x2014; <span class="Nd">check
    if credentials have superuser privileges for a mount point</span></p>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<p class="Pp"><code class="In">#include
    &lt;<a class="In">sys/param.h</a>&gt;</code>
  <br/>
  <code class="In">#include &lt;<a class="In">sys/systm.h</a>&gt;</code>
  <br/>
  <code class="In">#include &lt;<a class="In">sys/mount.h</a>&gt;</code></p>
<p class="Pp"><var class="Ft">int</var>
  <br/>
  <code class="Fn">vfs_suser</code>(<var class="Fa" style="white-space: nowrap;">struct
    mount *mp</var>, <var class="Fa" style="white-space: nowrap;">struct thread
    *td</var>);</p>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<p class="Pp">The
    <a class="permalink" href="#vfs_suser"><code class="Fn" id="vfs_suser">vfs_suser</code></a>()
    function checks if the credentials given include superuser powers for the
    given mount point. It will check to see if the thread passed in has the same
    credentials as the user that mounted the file system. If so, it returns 0,
    otherwise it returns what <a class="Xr">priv_check(9)</a> would have
    returned.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN
  VALUES</a></h1>
<p class="Pp">The <code class="Fn">vfs_suser</code>() function returns 0 if the
    user has superuser powers and <code class="Er">EPERM</code> otherwise. This
    is the
    <a class="permalink" href="#reverse"><i class="Em" id="reverse">reverse
    logic</i></a> of some other implementations of
    <code class="Fn">suser</code>() in which a TRUE response indicates superuser
    powers.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<p class="Pp"><a class="Xr">chroot(2)</a>, <a class="Xr">jail(2)</a></p>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<p class="Pp">The <code class="Fn">vfs_suser</code>() function was introduced in
    <span class="Ux">FreeBSD 5.2</span>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
<p class="Pp">This manual page was written by <span class="An">Alfred
    Perlstein</span>.</p>
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">April 2, 2004</td>
    <td class="foot-os">FreeBSD 15.0</td>
  </tr>
</table>