diff options
author | edwin <edwin@FreeBSD.org> | 2004-07-18 19:45:30 +0800 |
---|---|---|
committer | edwin <edwin@FreeBSD.org> | 2004-07-18 19:45:30 +0800 |
commit | 44d64025a0c12dbc7d7643b2a16eb66a5d147770 (patch) | |
tree | 4ca21e3180aea5b2420f3799810d6d71829454b6 /sysutils/jailuser | |
parent | 7e7ccd79e0bd2dad78a962201a7d3d1179d1f669 (diff) | |
download | freebsd-ports-gnome-44d64025a0c12dbc7d7643b2a16eb66a5d147770.tar.gz freebsd-ports-gnome-44d64025a0c12dbc7d7643b2a16eb66a5d147770.tar.zst freebsd-ports-gnome-44d64025a0c12dbc7d7643b2a16eb66a5d147770.zip |
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>
Diffstat (limited to 'sysutils/jailuser')
-rw-r--r-- | sysutils/jailuser/Makefile | 40 | ||||
-rw-r--r-- | sysutils/jailuser/distinfo | 2 | ||||
-rw-r--r-- | sysutils/jailuser/files/patch-Makefile | 32 | ||||
-rw-r--r-- | sysutils/jailuser/files/patch-functions | 40 | ||||
-rw-r--r-- | sysutils/jailuser/files/patch-install.sh | 128 | ||||
-rw-r--r-- | sysutils/jailuser/pkg-descr | 9 | ||||
-rw-r--r-- | sysutils/jailuser/pkg-message | 5 | ||||
-rw-r--r-- | sysutils/jailuser/pkg-plist | 33 |
8 files changed, 289 insertions, 0 deletions
diff --git a/sysutils/jailuser/Makefile b/sysutils/jailuser/Makefile new file mode 100644 index 000000000000..940398ca4fd6 --- /dev/null +++ b/sysutils/jailuser/Makefile @@ -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> diff --git a/sysutils/jailuser/distinfo b/sysutils/jailuser/distinfo new file mode 100644 index 000000000000..15a5c55bf47a --- /dev/null +++ b/sysutils/jailuser/distinfo @@ -0,0 +1,2 @@ +MD5 (jail_1.9.tar.gz) = d9c4ae58e658e8b13809399c69726154 +SIZE (jail_1.9.tar.gz) = 32994 diff --git a/sysutils/jailuser/files/patch-Makefile b/sysutils/jailuser/files/patch-Makefile new file mode 100644 index 000000000000..5e924d77fb8f --- /dev/null +++ b/sysutils/jailuser/files/patch-Makefile @@ -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)) diff --git a/sysutils/jailuser/files/patch-functions b/sysutils/jailuser/files/patch-functions new file mode 100644 index 000000000000..28af47e60c20 --- /dev/null +++ b/sysutils/jailuser/files/patch-functions @@ -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); + } + } diff --git a/sysutils/jailuser/files/patch-install.sh b/sysutils/jailuser/files/patch-install.sh new file mode 100644 index 000000000000..ddb20b7ab162 --- /dev/null +++ b/sysutils/jailuser/files/patch-install.sh @@ -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 + diff --git a/sysutils/jailuser/pkg-descr b/sysutils/jailuser/pkg-descr new file mode 100644 index 000000000000..9701b75e0eac --- /dev/null +++ b/sysutils/jailuser/pkg-descr @@ -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 diff --git a/sysutils/jailuser/pkg-message b/sysutils/jailuser/pkg-message new file mode 100644 index 000000000000..3625ffa59240 --- /dev/null +++ b/sysutils/jailuser/pkg-message @@ -0,0 +1,5 @@ + +############################################################################# + Installed additional documentation in: PREFIX/share/doc/jail + Copy PREFIX/etc/jail.conf.sample to PREFIX/etc/jail.conf +############################################################################# diff --git a/sysutils/jailuser/pkg-plist b/sysutils/jailuser/pkg-plist new file mode 100644 index 000000000000..3f64f4aaff76 --- /dev/null +++ b/sysutils/jailuser/pkg-plist @@ -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%% |