1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-15 07:56:36 +00:00

New port: sysutils/jail Builds a chrooted environment

I've made a port for: http://sourceforge.net/projects/jail/

	Jail Chroot Project is an attempt of write a tool that
	builds a chrooted environment. The main goal of Jail is to
	be as simple as possible, and highly portable. The most
	difficult step when building a chrooted environment is to
	set up the right libraries.

PR:		ports/67900
Submitted by:	bugghy <bugghy@phenix.rootshell.be>
This commit is contained in:
Edwin Groothuis 2004-07-18 11:45:30 +00:00
parent 3c101f4840
commit 5dc7c6ada7
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=113899
9 changed files with 290 additions and 0 deletions

View File

@ -180,6 +180,7 @@
SUBDIR += ipsc
SUBDIR += jailadmin
SUBDIR += jailer
SUBDIR += jailuser
SUBDIR += jailutils
SUBDIR += jdiskreport
SUBDIR += jkill

View File

@ -0,0 +1,40 @@
# New ports collection makefile for: jailuser
# Date created: 10 Jun 2004
# Whom: bugghy <bugghy@SAFe-mail.net>
#
# $FreeBSD$
#
PORTNAME= jailuser
PORTVERSION= 1.9
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= jail
DISTNAME= jail_${PORTVERSION}
MAINTAINER= bugghy@SAFe-mail.net
COMMENT= Builds a chrooted environment
WRKSRC= ${WRKDIR}/jail_1-9_stable/src
USE_PERL5= yes
post-patch:
@${SED} -e 's!/usr/bin/perl!${PERL}!g' ${WRKSRC}/Makefile > ${WRKSRC}/Makefile.tmp
@${MV} ${WRKSRC}/Makefile.tmp ${WRKSRC}/Makefile
post-install:
.if !defined(NOPORTDOCS)
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/CHANGELOG ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/INSTALL ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/README ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/SECURITY ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/VERSION ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/download ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/features ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/../doc/intro ${DOCSDIR}
.endif
@${SED} -e 's!PREFIX!${PREFIX}!g' ${.CURDIR}/pkg-message
.include <bsd.port.mk>

View File

@ -0,0 +1,2 @@
MD5 (jail_1.9.tar.gz) = d9c4ae58e658e8b13809399c69726154
SIZE (jail_1.9.tar.gz) = 32994

View File

@ -0,0 +1,32 @@
--- Makefile.orig Mon Oct 29 17:40:48 2001
+++ Makefile Sun Jul 18 11:39:46 2004
@@ -19,16 +19,16 @@
#
##############################################################################
-ARCH=__LINUX__
-#ARCH=__FREEBSD__
+#ARCH=__LINUX__
+ARCH=__FREEBSD__
#ARCH=__IRIX__
#ARCH=__SOLARIS__
DEBUG = 0
-INSTALL_DIR = /usr/local
+INSTALL_DIR = ${LOCALBASE}
PERL = /usr/bin/perl
ROOTUSER = root
-ROOTGROUP = root
+ROOTGROUP = wheel
# ----------------------------------------------------------------------
#
@@ -61,7 +61,7 @@
jail: jail.c $(OBJ)
$(CC) $(CFLAGS) $(INCLUDE) jail.c -o jail $(OBJ) $(LIBS) && \
- cp jail ../bin
+ cp jail ../bin/jailuser
clean:
@(rm -f jail $(OBJ))

View File

@ -0,0 +1,40 @@
// A little bug patched in jail 1.9 (it didn't set the shell correctly in /etc/shells)
// v1.0a
// by Bugghy (bugghy@rootshell.be)
*** ../lib/arch/generic/functions Fri Oct 26 12:36:09 2001
--- ../lib/arch/generic/functions Sat Jun 14 13:41:22 2003
***************
*** 823,829 ****
close(F);
for $k (@elem) {
! if ($k =~ /^$INSTALL_DIR\/jail/) {
$found = 1;
last;
}
--- 823,829 ----
close(F);
for $k (@elem) {
! if ($k =~ /^$INSTALL_DIR\/bin/jail/) {
$found = 1;
last;
}
***************
*** 831,837 ****
if (!$found || !-e $SHELLS_FILE) {
open(F,">>".$SHELLS_FILE);
! print F "$INSTALL_DIR/jail\n";
close(F);
}
}
--- 831,837 ----
if (!$found || !-e $SHELLS_FILE) {
open(F,">>".$SHELLS_FILE);
! print F "$INSTALL_DIR/bin/jail\n";
close(F);
}
}

View File

@ -0,0 +1,128 @@
--- ../install.sh.orig Fri Oct 26 09:37:07 2001
+++ ../install.sh Sun Jun 13 23:00:48 2004
@@ -23,7 +23,7 @@
#
##############################################################################
-TMPFILE=/tmp/jail.tmp
+TMPFILE=jail.tmp
# ----------------------------------------------------------------------------
@@ -63,16 +63,16 @@
gen_jail_conf() {
-cp etc/jail.conf /tmp/jail.conf.tmp
+cp etc/jail.conf jail.conf.tmp
-parse_tag /tmp/jail.conf.tmp __VERSION__ $1
-parse_tag /tmp/jail.conf.tmp __ARCH__ $2
-parse_tag /tmp/jail.conf.tmp __DEBUG__ $3
-parse_tag /tmp/jail.conf.tmp __INSTALLDIR__ $4
-
-mv /tmp/jail.conf.tmp /tmp/jail.conf
-install_file /tmp/jail.conf $4/etc $5 $6 $7
-rm /tmp/jail.conf
+parse_tag jail.conf.tmp __VERSION__ $1
+parse_tag jail.conf.tmp __ARCH__ $2
+parse_tag jail.conf.tmp __DEBUG__ $3
+parse_tag jail.conf.tmp __INSTALLDIR__ $4
+
+mv jail.conf.tmp jail.conf.sample
+install_file jail.conf.sample $4/etc $5 $6 $7
+rm jail.conf.sample
}
@@ -80,13 +80,13 @@
gen_libjail() {
-cp lib/libjail.pm /tmp/libjail.pm.tmp
+cp lib/libjail.pm libjail.pm.tmp
-parse_tag /tmp/libjail.pm.tmp __INSTALLDIR__ $1
+parse_tag libjail.pm.tmp __INSTALLDIR__ $1
-mv /tmp/libjail.pm.tmp /tmp/libjail.pm
-install_file /tmp/libjail.pm $1/lib $2 $3 $4
-rm /tmp/libjail.pm
+mv libjail.pm.tmp libjail.pm
+install_file libjail.pm $1/lib $2 $3 $4
+rm libjail.pm
}
@@ -94,14 +94,14 @@
gen_mkenv() {
-cp bin/mkjailenv /tmp/mkjailenv.tmp
+cp bin/mkjailenv mkjailenv.tmp
-parse_tag /tmp/mkjailenv.tmp __INSTALLDIR__ $1
-parse_tag /tmp/mkjailenv.tmp __PERL__ $2
+parse_tag mkjailenv.tmp __INSTALLDIR__ $1
+parse_tag mkjailenv.tmp __PERL__ $2
-mv /tmp/mkjailenv.tmp /tmp/mkjailenv
-install_file /tmp/mkjailenv $1/bin $3 $4 $5
-rm /tmp/mkjailenv
+mv mkjailenv.tmp mkjailenv
+install_file mkjailenv $1/bin $3 $4 $5
+rm mkjailenv
}
@@ -109,14 +109,14 @@
gen_addjailsw() {
-cp bin/addjailsw /tmp/addjailsw.tmp
+cp bin/addjailsw addjailsw.tmp
-parse_tag /tmp/addjailsw.tmp __INSTALLDIR__ $1
-parse_tag /tmp/addjailsw.tmp __PERL__ $2
+parse_tag addjailsw.tmp __INSTALLDIR__ $1
+parse_tag addjailsw.tmp __PERL__ $2
-mv /tmp/addjailsw.tmp /tmp/addjailsw
-install_file /tmp/addjailsw $1/bin $3 $4 $5
-rm /tmp/addjailsw
+mv addjailsw.tmp addjailsw
+install_file addjailsw $1/bin $3 $4 $5
+rm addjailsw
}
@@ -125,14 +125,14 @@
gen_addjailuser() {
-cp bin/addjailuser /tmp/addjailuser.tmp
+cp bin/addjailuser addjailuser.tmp
-parse_tag /tmp/addjailuser.tmp __INSTALLDIR__ $1
-parse_tag /tmp/addjailuser.tmp __PERL__ $2
+parse_tag addjailuser.tmp __INSTALLDIR__ $1
+parse_tag addjailuser.tmp __PERL__ $2
-mv /tmp/addjailuser.tmp /tmp/addjailuser
-install_file /tmp/addjailuser $1/bin $3 $4 $5
-rm /tmp/addjailuser
+mv addjailuser.tmp addjailuser
+install_file addjailuser $1/bin $3 $4 $5
+rm addjailuser
}
@@ -165,7 +165,7 @@
ROOTID=$6
ROOTGID=$7
-install_file ./bin/jail $INSTALLDIR/bin 4755 $ROOTID $ROOTGID
+install_file ./bin/jailuser $INSTALLDIR/bin 4755 $ROOTID $ROOTGID
gen_jail_conf $VERSION $ARCH $DEBUG $INSTALLDIR 755 $ROOTID $ROOTGID
gen_libjail $INSTALLDIR 755 $ROOTID $ROOTGID

View File

@ -0,0 +1,9 @@
Jail Chroot Project is an attempt of write a tool that builds a chrooted
environment. The main goal of Jail is to be as simple as possible, and
highly portable. The most difficult step when building a chrooted environment
is to set up the right libraries.
WWW: http://sourceforge.net/projects/jail/
- bugghy
bugghy@SAFe-mail.net

View File

@ -0,0 +1,5 @@
#############################################################################
Installed additional documentation in: PREFIX/share/doc/jail
Copy PREFIX/etc/jail.conf.sample to PREFIX/etc/jail.conf
#############################################################################

View File

@ -0,0 +1,33 @@
bin/jailuser
bin/mkjailenv
bin/addjailsw
bin/addjailuser
etc/jail.conf.sample
lib/libjail.pm
lib/arch/generic/definitions
lib/arch/generic/functions
lib/arch/linux/definitions
lib/arch/linux/functions
lib/arch/freebsd/definitions
lib/arch/freebsd/functions
lib/arch/irix/definitions
lib/arch/irix/functions
lib/arch/solaris/definitions
lib/arch/solaris/functions
@dirrm lib/arch/generic
@dirrm lib/arch/linux
@dirrm lib/arch/freebsd
@dirrm lib/arch/irix
@dirrm lib/arch/solaris
@dirrm lib/arch
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
%%PORTDOCS%%%%DOCSDIR%%/README
%%PORTDOCS%%%%DOCSDIR%%/SECURITY
%%PORTDOCS%%%%DOCSDIR%%/VERSION
%%PORTDOCS%%%%DOCSDIR%%/download
%%PORTDOCS%%%%DOCSDIR%%/features
%%PORTDOCS%%%%DOCSDIR%%/intro
%%PORTDOCS%%@dirrm %%DOCSDIR%%