summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-05-18 19:15:01 +0000
committerStef Walter <stef@memberwebs.com>2004-05-18 19:15:01 +0000
commita0012381dee49eb907b906607263638f69996fd7 (patch)
tree6b1995a923cd97e62dce2ec07c177490dc134748 /src
parentf5f4e22e50450c7459800b4ca03894326df236b9 (diff)
- Fixed implementation bugs in old jstart
- Cleaned up old src directory in CVS
Diffstat (limited to 'src')
-rw-r--r--src/.cvsignore2
-rw-r--r--src/Makefile358
-rw-r--r--src/jstart.c5
3 files changed, 5 insertions, 360 deletions
diff --git a/src/.cvsignore b/src/.cvsignore
index fc6ce37..31e246d 100644
--- a/src/.cvsignore
+++ b/src/.cvsignore
@@ -3,4 +3,4 @@ Makefile
.deps
killjail
jails
-
+jstart
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index f5739c5..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,358 +0,0 @@
-# Makefile.in generated automatically by automake 1.5 from Makefile.am.
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-
-SHELL = /usr/local/bin/bash
-
-srcdir = .
-top_srcdir = ..
-
-prefix = /usr/local
-exec_prefix = ${prefix}
-
-bindir = ${exec_prefix}/bin
-sbindir = ${exec_prefix}/sbin
-libexecdir = ${exec_prefix}/libexec
-datadir = ${prefix}/share
-sysconfdir = ${prefix}/etc
-sharedstatedir = ${prefix}/com
-localstatedir = ${prefix}/var
-libdir = ${exec_prefix}/lib
-infodir = ${prefix}/info
-mandir = ${prefix}/man
-includedir = ${prefix}/include
-oldincludedir = /usr/include
-pkgdatadir = $(datadir)/jailutils
-pkglibdir = $(libdir)/jailutils
-pkgincludedir = $(includedir)/jailutils
-top_builddir = ..
-
-ACLOCAL = ${SHELL} /home/nate/jail-work/jailutils/missing --run aclocal
-AUTOCONF = ${SHELL} /home/nate/jail-work/jailutils/missing --run autoconf
-AUTOMAKE = ${SHELL} /home/nate/jail-work/jailutils/missing --run automake
-AUTOHEADER = ${SHELL} /home/nate/jail-work/jailutils/missing --run autoheader
-
-INSTALL = /usr/bin/install -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = s,x,x,
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-AMTAR = ${SHELL} /home/nate/jail-work/jailutils/missing --run tar
-AWK = nawk
-CC = gcc
-DEPDIR = .deps
-EXEEXT =
-INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
-OBJEXT = o
-PACKAGE = jailutils
-SRC_SUB = srcx
-VERSION = 0.5.4
-am__include = include
-am__quote =
-install_sh = /home/nate/jail-work/jailutils/install-sh
-
-sbin_PROGRAMS = killjail jails
-killjail_SOURCES = killjail.c getjail.c getjail.h
-killjail_LDADD = -lkvm
-jails_SOURCES = jails.c getjail.c getjail.h
-jails_LDADD = -lkvm
-man_MANS = killjail.8 jails.8
-EXTRA_DIST = $(man_MANS)
-subdir = src
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/config.h
-CONFIG_CLEAN_FILES =
-sbin_PROGRAMS = killjail$(EXEEXT) jails$(EXEEXT)
-PROGRAMS = $(sbin_PROGRAMS)
-
-am_jails_OBJECTS = jails.$(OBJEXT) getjail.$(OBJEXT)
-jails_OBJECTS = $(am_jails_OBJECTS)
-jails_DEPENDENCIES =
-jails_LDFLAGS =
-am_killjail_OBJECTS = killjail.$(OBJEXT) getjail.$(OBJEXT)
-killjail_OBJECTS = $(am_killjail_OBJECTS)
-killjail_DEPENDENCIES =
-killjail_LDFLAGS =
-
-DEFS = -DHAVE_CONFIG_H
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
-CPPFLAGS =
-LDFLAGS =
-LIBS = -lc -lkvm
-depcomp = $(SHELL) $(top_srcdir)/depcomp
-DEP_FILES = $(DEPDIR)/getjail.Po $(DEPDIR)/jails.Po \
- $(DEPDIR)/killjail.Po
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-CFLAGS = -g -O2 -g -O0
-DIST_SOURCES = $(jails_SOURCES) $(killjail_SOURCES)
-
-NROFF = nroff
-MANS = $(man_MANS)
-DIST_COMMON = Makefile.am Makefile.in
-SOURCES = $(jails_SOURCES) $(killjail_SOURCES)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .c .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && \
- CONFIG_HEADERS= CONFIG_LINKS= \
- CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status
-install-sbinPROGRAMS: $(sbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(sbindir)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- ; then \
- f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/$$f; \
- else :; fi; \
- done
-
-uninstall-sbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
- rm -f $(DESTDIR)$(sbindir)/$$f; \
- done
-
-clean-sbinPROGRAMS:
- -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
-jails$(EXEEXT): $(jails_OBJECTS) $(jails_DEPENDENCIES)
- @rm -f jails$(EXEEXT)
- $(LINK) $(jails_LDFLAGS) $(jails_OBJECTS) $(jails_LDADD) $(LIBS)
-killjail$(EXEEXT): $(killjail_OBJECTS) $(killjail_DEPENDENCIES)
- @rm -f killjail$(EXEEXT)
- $(LINK) $(killjail_LDFLAGS) $(killjail_OBJECTS) $(killjail_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-
-distclean-compile:
- -rm -f *.tab.c
-
-include $(DEPDIR)/getjail.Po
-include $(DEPDIR)/jails.Po
-include $(DEPDIR)/killjail.Po
-
-distclean-depend:
- -rm -rf $(DEPDIR)
-
-.c.o:
- source='$<' object='$@' libtool=no \
- depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
- $(CCDEPMODE) $(depcomp) \
- $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
-
-.c.obj:
- source='$<' object='$@' libtool=no \
- depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' \
- $(CCDEPMODE) $(depcomp) \
- $(COMPILE) -c `cygpath -w $<`
-CCDEPMODE = depmode=gcc3
-uninstall-info-am:
-
-man8dir = $(mandir)/man8
-install-man8: $(man8_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(man8dir)
- @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.8*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
- else file=$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
- $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
- done
-uninstall-man8:
- @$(NORMAL_UNINSTALL)
- @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.8*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
- rm -f $(DESTDIR)$(man8dir)/$$inst; \
- done
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique $(LISP)
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || etags $(ETAGS_ARGS) $$tags $$unique $(LISP)
-
-GTAGS:
- here=`CDPATH=: && cd $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- $(mkinstalldirs) "$(distdir)/$$dir"; \
- fi; \
- if test -d $$d/$$file; then \
- cp -pR $$d/$$file $(distdir) \
- || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
-check-am: all-am
-check: check-am
-all-am: Makefile $(PROGRAMS) $(MANS)
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-sbinPROGRAMS mostlyclean-am
-
-distclean: distclean-am
-
-distclean-am: clean-am distclean-compile distclean-depend \
- distclean-generic distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
-
-install-exec-am: install-sbinPROGRAMS
-
-install-info: install-info-am
-
-install-man: install-man8
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
-
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic
-
-uninstall-am: uninstall-info-am uninstall-man uninstall-sbinPROGRAMS
-
-uninstall-man: uninstall-man8
-
-.PHONY: GTAGS all all-am check check-am clean clean-generic \
- clean-sbinPROGRAMS distclean distclean-compile distclean-depend \
- distclean-generic distclean-tags distdir dvi dvi-am info \
- info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-info install-info-am \
- install-man install-man8 install-sbinPROGRAMS install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-compile \
- mostlyclean-generic tags uninstall uninstall-am \
- uninstall-info-am uninstall-man uninstall-man8 \
- uninstall-sbinPROGRAMS
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/src/jstart.c b/src/jstart.c
index b244aa4..43c68ab 100644
--- a/src/jstart.c
+++ b/src/jstart.c
@@ -5,6 +5,7 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/jail.h>
+#include <sys/stat.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -12,8 +13,10 @@
#include <paths.h>
#include <stdio.h>
#include <err.h>
+#include <errno.h>
#include <unistd.h>
#include <limits.h>
+#include <stdlib.h>
#ifdef HAVE_CONFIG_H
#include "../config.h"
@@ -129,6 +132,6 @@ static void run_command(const char* cmd, char* args[])
MAKE_ENV_VAR("LINES");
if(execve(cmd, args, env) != 0)
- err("couldn't execute command: %s", cmd);
+ err(1, "couldn't execute command: %s", cmd);
}