Index: Makefile.am =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/Makefile.am,v retrieving revision 1.1.4.11 retrieving revision 1.1.4.12 diff -u -p -I$Id: -r1.1.4.11 -r1.1.4.12 --- Makefile.am 3 Dec 2003 00:08:54 -0000 1.1.4.11 +++ Makefile.am 9 Feb 2004 23:18:59 -0000 1.1.4.12 @@ -63,7 +63,7 @@ AM_CPPFLAGS = -I $(top_srcdir)/lib -D AM_CFLAGS = -Wall -pedantic CLEANFILES = $(sysv_GENSCRPTS) $(scripts_GENSCRPTS) \ - $(linuxconf_GENFILES) \ + $(linuxconf_GENFILES) $(src_GENFILES) \ $(BUILT_SOURCES) Index: NEWS =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/NEWS,v retrieving revision 1.1.2.1.2.9 retrieving revision 1.1.2.1.2.10 diff -u -p -I$Id: -r1.1.2.1.2.9 -r1.1.2.1.2.10 --- NEWS 26 Jan 2004 18:23:13 -0000 1.1.2.1.2.9 +++ NEWS 11 Feb 2004 21:06:17 -0000 1.1.2.1.2.10 @@ -1,3 +1,13 @@ +Version 0.29 +============ + + - further compilation fixes + + - adapted the 'vserver ... build' command to the new barrier + mechanism + + + Version 0.28 ============ Index: configure.ac =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/configure.ac,v retrieving revision 1.1.2.1.2.27 retrieving revision 1.1.2.1.2.31 diff -u -p -I$Id: -r1.1.2.1.2.27 -r1.1.2.1.2.31 --- configure.ac 28 Jan 2004 11:04:13 -0000 1.1.2.1.2.27 +++ configure.ac 11 Feb 2004 21:06:17 -0000 1.1.2.1.2.31 @@ -25,7 +25,7 @@ dnl AC_PREREQ(2.57) -AC_INIT(util-vserver, 0.28, enrico.scholz@informatik.tu-chemnitz.de) +AC_INIT(util-vserver, 0.29, enrico.scholz@informatik.tu-chemnitz.de) AC_CONFIG_SRCDIR([src/capchroot.c]) AC_CONFIG_HEADER([config.h]) @@ -101,6 +101,7 @@ done IFS=$old_IFS AC_MSG_RESULT([$enable_apis]) +ENSC_SYSCALL ENSC_CHECK_EXT2FS_HEADER AC_CHECK_FUNCS([vserver]) AC_CHECK_DECLS(MS_MOVE,,,[#include ]) Index: util-vserver.spec.in =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/util-vserver.spec.in,v retrieving revision 1.4.2.5 retrieving revision 1.4.2.6 diff -u -p -I$Id: -r1.4.2.5 -r1.4.2.6 --- util-vserver.spec.in 18 Nov 2003 22:38:04 -0000 1.4.2.5 +++ util-vserver.spec.in 6 Feb 2004 22:20:59 -0000 1.4.2.6 @@ -1,3 +1,5 @@ +%define __chattr /usr/bin/chattr + Summary: Linux virtual server utilities Name: @PACKAGE@ Version: @VERSION@ @@ -13,6 +15,7 @@ Provides: vserver = %epoch:%version-%rel Conflicts: vserver < %epoch:%version-%release Conflicts: vserver > %epoch:%version-%release BuildRequires: e2fsprogs-devel +Requires(post): %__chattr %package linuxconf Summary: Linuxconf administration modules for vservers @@ -70,6 +73,8 @@ rm -rf $RPM_BUILD_ROOT for i in %v_services; do /sbin/chkconfig --add v_$i done + +%__chattr +t /vservers || : %preun Index: distrib/install-pre.sh =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/distrib/Attic/install-pre.sh,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -p -I$Id: -r1.1.4.1 -r1.1.4.2 --- distrib/install-pre.sh 30 Oct 2003 15:17:33 -0000 1.1.4.1 +++ distrib/install-pre.sh 6 Feb 2004 22:20:29 -0000 1.1.4.2 @@ -36,6 +36,8 @@ else mkdir -p /etc/vservers mkdir -p $VROOTDIR 2>/dev/null VROOT=$VROOTDIR/$1 + mkdir -p -m755 $VROOT + chattr -t $VROOT rm -fr $VROOT/dev mkdir -p $VROOT/dev && chmod 755 $VROOT/dev mkdir $VROOT/dev/pts Index: distrib/install-rh7.2 =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/distrib/Attic/install-rh7.2,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -p -I$Id: -r1.1.4.1 -r1.1.4.2 --- distrib/install-rh7.2 30 Oct 2003 15:17:33 -0000 1.1.4.1 +++ distrib/install-rh7.2 6 Feb 2004 22:20:29 -0000 1.1.4.2 @@ -42,6 +42,8 @@ else echo `ls /mnt/cdrom/RedHat/RPMS/*.noarch.rpm \ /mnt/cdrom/RedHat/RPMS/*.i386.rpm | wc -l` packages to install VROOT=$VROOTDIR/$1 + mkdir -p -m755 $VROOT + chattr -t $VROOT mkdir -p $VROOT/proc mount -t proc none $VROOT/proc mkdir -p $VROOT/var/lib/rpm Index: distrib/install-rh7.3 =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/distrib/Attic/install-rh7.3,v retrieving revision 1.1.4.1 retrieving revision 1.1.4.2 diff -u -p -I$Id: -r1.1.4.1 -r1.1.4.2 --- distrib/install-rh7.3 30 Oct 2003 15:17:33 -0000 1.1.4.1 +++ distrib/install-rh7.3 6 Feb 2004 22:20:29 -0000 1.1.4.2 @@ -42,6 +42,8 @@ elif [ ! -d /mnt/cdrom/RedHat/RPMS ] ; t echo No rpms in /mnt/cdrom/RedHat/RPMS. Is the CD mounted \? else VROOT=$VROOTDIR/$1 + mkdir -p -m755 $VROOT + chattr -t $VROOT mkdir -p $VROOT/proc mount -t proc none $VROOT/proc mkdir -p $VROOT/var/lib/rpm Index: lib/syscall-legacy.hc =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/lib/syscall-legacy.hc,v retrieving revision 1.1.4.5 retrieving revision 1.1.4.6 diff -u -p -I$Id: -r1.1.4.5 -r1.1.4.6 --- lib/syscall-legacy.hc 23 Dec 2003 16:52:12 -0000 1.1.4.5 +++ lib/syscall-legacy.hc 5 Feb 2004 03:52:45 -0000 1.1.4.6 @@ -50,7 +50,7 @@ static int __NR_set_ipv4root_rev2; static int __NR_set_ipv4root_rev3; static int rev_ipv4root=0; -#if (defined(__pic__) && defined(__i386)) || defined(__hppa__) +#ifdef ENSC_SYSCALL_TRADITIONAL inline static int set_ipv4root_rev0(unsigned long ip) { @@ -88,7 +88,7 @@ static int __NR_new_s_context_rev0; //static int __NR_new_s_context_rev1; static int rev_s_context=0; -#if defined(__pic__) && defined(__i386) +#ifdef ENSC_SYSCALL_TRADITIONAL inline static int new_s_context_rev0(int newctx, int remove_cap, int flags) { Index: lib/vserver-internal.h =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/lib/vserver-internal.h,v retrieving revision 1.1.4.12 retrieving revision 1.1.4.13 diff -u -p -I$Id: -r1.1.4.12 -r1.1.4.13 --- lib/vserver-internal.h 7 Jan 2004 16:22:59 -0000 1.1.4.12 +++ lib/vserver-internal.h 5 Feb 2004 03:52:45 -0000 1.1.4.13 @@ -88,7 +88,7 @@ extern "C" { #endif #ifndef HAVE_VSERVER -#if defined(__pic__) && defined(__i386) +#ifdef ENSC_SYSCALL_TRADITIONAL inline static UNUSED ALWAYSINLINE int vserver(uint32_t cmd, uint32_t id, void *data) { Index: m4/ensc_syscall.m4 =================================================================== RCS file: m4/ensc_syscall.m4 diff -N m4/ensc_syscall.m4 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ m4/ensc_syscall.m4 5 Feb 2004 03:52:45 -0000 1.2.2.1 @@ -0,0 +1,87 @@ +dnl $Id: ensc_syscall.m4,v 1.2.2.1 2004/02/05 03:52:45 ensc Exp $ + +dnl Copyright (C) 2004 Enrico Scholz +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; version 2 of the License. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +dnl Usage: ENSC_SYSCALL + +AC_DEFUN([ENSC_SYSCALL], +[ + AC_REQUIRE([ENSC_KERNEL_HEADERS]) + AC_MSG_CHECKING([for syscall(2) invocation method]) + AC_ARG_WITH([syscall], + [AC_HELP_STRING([--with-syscall=METHOD], + [call syscall(2) with the specified METHOD; valid values are 'fast', 'traditional' and 'auto' (default: auto)])], + [], + [with_syscall=auto]) + AC_MSG_RESULT([$with_syscall]) + + case x"$with_syscall" in + xauto) + AC_CACHE_CHECK([which syscall(2) invocation works], [ensc_cv_test_syscall], + [ + old_CPPFLAGS=$CPPFLAGS + CPPFLAGS="-I$ensc_cv_path_kernelheaders" + AC_LANG_PUSH(C) + AC_COMPILE_IFELSE([ +#include +#include +#include +#define __NR_foo0 300 +#define __NR_foo1 301 +#define __NR_foo2 302 +#define __NR_foo3 303 +#define __NR_foo4 304 +#define __NR_foo5 305 +inline static _syscall0(int, foo0) +inline static _syscall1(int, foo1, int, a) +inline static _syscall2(int, foo2, int, a, int, b) +inline static _syscall3(int, foo3, int, a, int, b, int, c) +inline static _syscall4(int, foo4, int, a, int, b, int, c, int, d) +inline static _syscall5(int, foo5, int, a, int, b, int, c, int, d, int, e) + +int main() { + return foo0() || \ + foo1(1) || \ + foo2(1,2) || \ + foo3(1,2,3) || \ + foo4(1,2,3,4) || \ + foo5(1,2,3,4,5); +} + ], + [ensc_cv_test_syscall=fast], + [ensc_cv_test_syscall=traditional]) + + AC_LANG_POP + CPPFLAGS=$old_CPPFLAGS + ]) + with_syscall=$ensc_cv_test_syscall + ;; + xfast|xtraditional) + ;; + *) + AC_MSG_ERROR(['$with_syscall' is not a valid value for '--with-syscall']) + ;; + esac + + if test x"$with_syscall" = xtraditional; then + AC_DEFINE(ENSC_SYSCALL_TRADITIONAL, 1, [Define to 1 when the fast syscall(2) invocation does not work]) + fi + + AH_BOTTOM([ +#if defined(__pic__) && defined(__i386) && !defined(ENSC_SYSCALL_TRADITIONAL) +# define ENSC_SYSCALL_TRADITIONAL 1 +#endif]) +]) Index: scripts/vserver =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/scripts/vserver,v retrieving revision 1.1.2.1.2.9 retrieving revision 1.1.2.1.2.10 diff -u -p -I$Id: -r1.1.2.1.2.9 -r1.1.2.1.2.10 --- scripts/vserver 22 Jan 2004 19:52:59 -0000 1.1.2.1.2.9 +++ scripts/vserver 6 Feb 2004 22:20:29 -0000 1.1.2.1.2.10 @@ -284,9 +284,11 @@ elif [ "$2" = "build" ] ; then if [ ! -d $VROOTDIR ] ; then mkdir $VROOTDIR || exit 1 chmod 000 $VROOTDIR + chattr +t $VROOTDIR echo Directory $VROOTDIR was created with permissions 000 fi mkdir -p $VROOTDIR/$1 || exit 1 + chattr -t $VROOTDIR/$1 chmod 755 $VROOTDIR/$1 if test "$UTIL_VSERVER_AVOID_COPY"; then mkdir -p $VROOTDIR/$1/{etc/rc.d/init.d,sbin,var/run,var/log} Index: scripts/vserver-copy =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/scripts/vserver-copy,v retrieving revision 1.1.4.4 retrieving revision 1.1.4.6 diff -u -p -I$Id: -r1.1.4.4 -r1.1.4.6 --- scripts/vserver-copy 19 Jan 2004 23:00:12 -0000 1.1.4.4 +++ scripts/vserver-copy 9 Feb 2004 22:55:00 -0000 1.1.4.6 @@ -1,7 +1,7 @@ #!/bin/sh -# Copyright (C) 2003 Enrico Scholz -# based on vserver-copy by Mark Lawrence +# Copyright (C) 2003 Mark Lawrence , +# 2203,2004 Enrico Scholz # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -297,6 +297,11 @@ if $stopstart; then info "Stopping virtual server \"$vserver\" on localhost" $SBINDIR/vserver $vserver stop fi + +test "$dhost" || { + mkdir -p -m755 $target + chattr -t $target +} info "Syncing directories" # trailing slashes very important in the rsync! Index: src/Makefile-files =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/src/Makefile-files,v retrieving revision 1.1.4.7 retrieving revision 1.1.4.8 diff -u -p -I$Id: -r1.1.4.7 -r1.1.4.8 --- src/Makefile-files 3 Dec 2003 00:07:36 -0000 1.1.4.7 +++ src/Makefile-files 9 Feb 2004 23:18:59 -0000 1.1.4.8 @@ -44,6 +44,8 @@ src_sbin_PRGS = src/chbind \ src/vfiles \ src/vkill \ src/vserver-stat + +src_GENFILES = src/setattr src_capchroot_SOURCES = src/capchroot.c src_capchroot_LDADD = lib/libvserver.a Index: src/vbuild.cc =================================================================== RCS file: /cvsroot/util-vserver/util-vserver/src/vbuild.cc,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -u -p -I$Id: -r1.1 -r1.1.4.1 --- src/vbuild.cc 29 Sep 2003 22:01:57 -0000 1.1 +++ src/vbuild.cc 9 Feb 2004 22:55:00 -0000 1.1.4.1 @@ -254,6 +254,7 @@ int main (int argc, char *argv[]) // Now, we do a recursive copy of refserv into newserv umask (0); mkdir (newserv.c_str(),0755); + setext2flag(newserv.c_str(), false, 0); // Check if it is on the same volume struct stat refst,newst; if (vutil_lstat(refserv,refst)!=-1