summaryrefslogtreecommitdiffstats
path: root/share/man/man9/suser.9
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1999-04-28 11:38:52 +0000
committerphk <phk@FreeBSD.org>1999-04-28 11:38:52 +0000
commitca21a25f173ed030b0093e4d83140e3b0b43db01 (patch)
tree0ced832ca84afcb7423214e45fa0bc0cdd71a660 /share/man/man9/suser.9
parent58c42d9a16bbdef6b833ed08531a2a3541db6595 (diff)
downloadFreeBSD-src-ca21a25f173ed030b0093e4d83140e3b0b43db01.zip
FreeBSD-src-ca21a25f173ed030b0093e4d83140e3b0b43db01.tar.gz
This Implements the mumbled about "Jail" feature.
This is a seriously beefed up chroot kind of thing. The process is jailed along the same lines as a chroot does it, but with additional tough restrictions imposed on what the superuser can do. For all I know, it is safe to hand over the root bit inside a prison to the customer living in that prison, this is what it was developed for in fact: "real virtual servers". Each prison has an ip number associated with it, which all IP communications will be coerced to use and each prison has its own hostname. Needless to say, you need more RAM this way, but the advantage is that each customer can run their own particular version of apache and not stomp on the toes of their neighbors. It generally does what one would expect, but setting up a jail still takes a little knowledge. A few notes: I have no scripts for setting up a jail, don't ask me for them. The IP number should be an alias on one of the interfaces. mount a /proc in each jail, it will make ps more useable. /proc/<pid>/status tells the hostname of the prison for jailed processes. Quotas are only sensible if you have a mountpoint per prison. There are no privisions for stopping resource-hogging. Some "#ifdef INET" and similar may be missing (send patches!) If somebody wants to take it from here and develop it into more of a "virtual machine" they should be most welcome! Tools, comments, patches & documentation most welcome. Have fun... Sponsored by: http://www.rndassociates.com/ Run for almost a year by: http://www.servetheweb.com/
Diffstat (limited to 'share/man/man9/suser.9')
-rw-r--r--share/man/man9/suser.955
1 files changed, 45 insertions, 10 deletions
diff --git a/share/man/man9/suser.9 b/share/man/man9/suser.9
index 916ceec..39d5ed36 100644
--- a/share/man/man9/suser.9
+++ b/share/man/man9/suser.9
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Id: suser.9,v 1.4 1997/03/07 02:53:37 jmg Exp $
+.\" $Id: suser.9,v 1.5 1998/01/16 18:06:23 bde Exp $
.\"
.Dd Oct 15, 1996
.Dt SUSER 9
@@ -43,25 +43,60 @@
.Fd #include <sys/param.h>
.Fd #include <sys/ucred.h>
.Ft int
-.Fn suser "struct ucred *cred, u_short *acflag"
+.Fn suser "struct proc *proc"
+.Ft int
+.Fn suser_xxx "struct ucred *cred, struct proc *proc, int flags"
.Sh DESCRIPTION
The
.Nm
-function checks if the credentials given include superuser powers.
+and
+.Nm suser_xxx
+functions checks if the credentials given include superuser powers.
+.Pp
+The
+.Nm
+function is the most common, and should be used unless special
+circumstances dictate otherwise.
+.Pp
+The
+.Nm suser_xxx
+function should be used when the credentials to be checked are
+not the process' own, when there is no process or when superuser
+powers should be extended to prisoned roots.
+.Pp
+By default a process does not command superuser powers if it has
+been imprisoned by the
+.Xr jail 2
+system call.
+There are cases however where this is appropriate, and this can
+be done by setting the
+.Ql PRISON_ROOT
+bit in the flags argument to the
+.Nm suser_xxx
+function. It is important to review carefully in each case that
+this does not weaken the prison. Generally only where the action
+is protected by the
+.Xr chroot 2
+implicit in
+.Xr jail 2
+call should such powers be granted.
.Pp
The
.Nm
-routine notes the fact that superuser powers have been used in the
-word pointed to by the second argument which should be a pointer to
-the p_acflags word of the proc structure. If the second argument is NULL
-then the usage is not noted. Because part of it's function is to notice
+and
+.Nm suser_xxx
+functions notes the fact that superuser powers have been used in the
+process structure of the process specified.
+Because part of its function is to notice
whether super powers have been used,
-.Nm
-should be called after other permission possibilities have been exhausted.
+the functions should only be called after other permission
+possibilities have been exhausted.
.Sh RETURN VALUES
The
.Nm
-function returns 0 if the user has super powers and EPERM otherwise.
+and
+.Nm suser_xxx
+functions returns 0 if the user has super powers and EPERM otherwise.
This is the
.Em reverse logic
of some other implementations of
OpenPOWER on IntegriCloud