1cf92b474SAlfred Perlstein.\" 2cf92b474SAlfred Perlstein.\" Copyright (c) 2004 Alfred Perlstein 3cf92b474SAlfred Perlstein.\" All rights reserved. 4cf92b474SAlfred Perlstein.\" 5cf92b474SAlfred Perlstein.\" Redistribution and use in source and binary forms, with or without 6cf92b474SAlfred Perlstein.\" modification, are permitted provided that the following conditions 7cf92b474SAlfred Perlstein.\" are met: 8cf92b474SAlfred Perlstein.\" 1. Redistributions of source code must retain the above copyright 9cf92b474SAlfred Perlstein.\" notice, this list of conditions and the following disclaimer. 10cf92b474SAlfred Perlstein.\" 2. Redistributions in binary form must reproduce the above copyright 11cf92b474SAlfred Perlstein.\" notice, this list of conditions and the following disclaimer in the 12cf92b474SAlfred Perlstein.\" documentation and/or other materials provided with the distribution. 13cf92b474SAlfred Perlstein.\" 14cf92b474SAlfred Perlstein.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15cf92b474SAlfred Perlstein.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16cf92b474SAlfred Perlstein.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17cf92b474SAlfred Perlstein.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18cf92b474SAlfred Perlstein.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 19cf92b474SAlfred Perlstein.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20cf92b474SAlfred Perlstein.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 21cf92b474SAlfred Perlstein.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22cf92b474SAlfred Perlstein.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23cf92b474SAlfred Perlstein.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24cf92b474SAlfred Perlstein.\" SUCH DAMAGE. 25cf92b474SAlfred Perlstein.\" 26cf92b474SAlfred Perlstein.Dd April 2, 2004 27cf92b474SAlfred Perlstein.Dt VFS_SUSER 9 28cf92b474SAlfred Perlstein.Os 29cf92b474SAlfred Perlstein.Sh NAME 30cf92b474SAlfred Perlstein.Nm vfs_suser 31cf92b474SAlfred Perlstein.Nd check if credentials have superuser privileges for a mount point 32cf92b474SAlfred Perlstein.Sh SYNOPSIS 33cf92b474SAlfred Perlstein.In sys/param.h 34cf92b474SAlfred Perlstein.In sys/systm.h 35cf92b474SAlfred Perlstein.In sys/mount.h 36cf92b474SAlfred Perlstein.Ft int 37d7b6d54bSRuslan Ermilov.Fn vfs_suser "struct mount *mp" "struct thread *td" 38cf92b474SAlfred Perlstein.Sh DESCRIPTION 39cf92b474SAlfred PerlsteinThe 40cf92b474SAlfred Perlstein.Fn vfs_suser 41d7b6d54bSRuslan Ermilovfunction checks if the credentials given include superuser powers 42d7b6d54bSRuslan Ermilovfor the given mount point. 43d7b6d54bSRuslan ErmilovIt will check to see if the thread 44cf92b474SAlfred Perlsteinpassed in has the same credentials as the user that mounted the 45d7b6d54bSRuslan Ermilovfile system. 46d7b6d54bSRuslan ErmilovIf so, it returns 0, otherwise it returns what 47cecd8edbSAttilio Rao.Xr priv_check 9 48cf92b474SAlfred Perlsteinwould have returned. 49cf92b474SAlfred Perlstein.Sh RETURN VALUES 50cf92b474SAlfred PerlsteinThe 51cf92b474SAlfred Perlstein.Fn vfs_suser 52d7b6d54bSRuslan Ermilovfunction returns 0 if the user has superuser powers and 53cf92b474SAlfred Perlstein.Er EPERM 54cf92b474SAlfred Perlsteinotherwise. 55cf92b474SAlfred PerlsteinThis is the 56cf92b474SAlfred Perlstein.Em reverse logic 57cf92b474SAlfred Perlsteinof some other implementations of 58cf92b474SAlfred Perlstein.Fn suser 59cf92b474SAlfred Perlsteinin which a TRUE response indicates superuser powers. 60cf92b474SAlfred Perlstein.Sh SEE ALSO 61cf92b474SAlfred Perlstein.Xr chroot 2 , 62cecd8edbSAttilio Rao.Xr jail 2 63cf92b474SAlfred Perlstein.Sh HISTORY 64cf92b474SAlfred PerlsteinThe 65cf92b474SAlfred Perlstein.Fn vfs_suser 66cf92b474SAlfred Perlsteinfunction was introduced in 67cf92b474SAlfred Perlstein.Fx 5.2 . 68cf92b474SAlfred Perlstein.Sh AUTHORS 69cf92b474SAlfred PerlsteinThis manual page was written by 70cf92b474SAlfred Perlstein.An Alfred Perlstein . 71