Appendix C. jbchroot.c

This appendix gives the full source code to jbchroot.c (Example C-1), which we introduced and detailed in Chapter 6. This program is a Linux and Solaris port of the OpenBSD chroot command. The code remains released under the included open source BSD license and is freely distributable. You can also download this file from this book’s web site at

Example C-1. jbchroot.c
/* $OpenBSD: chroot.c,v 1.7 2002/10/29 23:12:06 millert Exp $ */ /* $NetBSD: chroot.c,v 1.11 2001/04/06 02:34:04 lukem Exp $ */ /* * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products ...

Get Tomcat: The Definitive Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.