-.X_usr_local_etc-up-to-date
+.*-up-to-date
.deps
COPYING
ChangeLog
INSTALL
+Makefile
aclocal.m4
autom4te.cache
compile
+version 0.23.6
+==============
+
+ - fixed '--level' option on 'vserver ... chkconfig'
--- /dev/null
+// $Id$ --*- c++ -*--
+
+// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifndef H_UTIL_VSERVER_COMPAT_H
+#define H_UTIL_VSERVER_COMPAT_H
+
+#if defined(__GNUC__)
+# define UNUSED __attribute__((__unused__))
+# define NORETURN __attribute__((__noreturn__))
+# if __GNUC__ >= 3
+# define ALWAYSINLINE __attribute__((__always_inline__))
+# else
+# define ALWAYSINLINE
+# endif
+#else
+# define UNUSED
+# define NORETURN
+# define ALWAYSINLINE
+#endif
+
+#if !defined(HAVE_DECL_MS_MOVE) || !(HAVE_DECL_MS_MOVE)
+ // from <linux/fs.h>
+# define MS_MOVE 8192
+#endif
+
+#ifndef HAVE_CTX_T
+typedef short int ctx_t;
+#endif
+
+#endif // H_UTIL_VSERVER_COMPAT_H
dnl
AC_PREREQ(2.57)
-AC_INIT(util-vserver, 0.23.5, enrico.scholz@informatik.tu-chemnitz.de)
+AC_INIT(util-vserver, 0.23.6, enrico.scholz@informatik.tu-chemnitz.de)
AC_CONFIG_SRCDIR([src/capchroot.c])
AC_CONFIG_HEADER([config.h])
--- /dev/null
+.deps
+.dirstamp
--- /dev/null
+// $Id$ --*- c++ -*--
+
+// Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
+//
+// 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
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "compat.h"
+#include "vserver.h"
+#include "internal.h"
+#include <string.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define CTX_TAG "\ns_context: "
+
+ctx_t
+getctx(pid_t pid)
+{
+ static volatile size_t bufsize=4097;
+ // TODO: is this really race-free?
+ size_t cur_bufsize = bufsize;
+ int fd;
+ char status_name[ sizeof("/proc/01234/status") ];
+ char buf[cur_bufsize];
+ size_t len;
+ char *pos = 0;
+
+ strcpy(status_name, "/proc/");
+ len = utilvserver_uint2str(status_name+sizeof("/proc/")-1,
+ sizeof(status_name)-sizeof("/proc//status")+1,
+ pid, 10);
+ strcpy(status_name+sizeof("/proc/")+len-1, "/status");
+
+ fd = open(status_name, O_RDONLY);
+ if (fd==-1) return CTX_NOCTX;
+
+ len = read(fd, buf, cur_bufsize);
+ close(fd);
+
+ if (len<cur_bufsize)
+ pos = strstr(buf, CTX_TAG);
+ else if (len!=(size_t)-1) {
+ bufsize = cur_bufsize * 2 - 1;
+ errno = EAGAIN;
+ }
+
+ if (pos!=0) return atoi(pos+sizeof(CTX_TAG)-1);
+ else return CTX_NOCTX;
+}
+
+#if 0
+ctx_t
+getcctx()
+{
+ return getctx(getpid());
+}
+#endif
--- /dev/null
+util-vserver-vars
-#!/bin/sh
+#!/bin/bash
# Copyright (C) 2003 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
# based on vserver by Jacques Gelinas
exec $0 $NODEV $SILENT $VSERVER exec /sbin/service "$@"
elif [ "$2" = "chkconfig" ] ; then
VSERVER=$1
+ LEVELS=()
shift
shift
if [ "$1" = "--level" ] ; then
- shift
- LEVELS=$1
- shift
+ LEVELS=( --level "$2" )
+ shift 2
fi
if [ $# != 2 -a ! -x /vservers/$VSERVER/sbin/chkconfig ] ; then
echo Invalid argument, expected vserver name chkconfig [ --level nnn ] service on\|off
elif [ -x /vservers/$VSERVER/sbin/chkconfig ] ; then
- exec $0 --silent $VSERVER exec /sbin/chkconfig "$@"
+ exec $0 --silent $VSERVER exec /sbin/chkconfig "${LEVELS[@]}" "$@"
elif [ -x /vservers/$VSERVER/usr/sbin/update-rc.d ] ; then
if [ "$2" = "on" -o "$2" = "start" ] ; then
$0 --silent $VSERVER exec /usr/sbin/update-rc.d -f $1 remove >/dev/null
--- /dev/null
+.deps
+.dirstamp
+capchroot
+chbind
+chcontext
+fakerunlevel
+filetime
+ifspec
+listdevip
+parserpmdump
+readlink
+rebootmgr
+reducecap
+setctxlimit
+showattr
+showperm
+vbuild
+vcheck
+vdu
+vfiles
+vreboot
+vserver-stat
+vunify
int fd = sockets[i];
if (FD_ISSET(fd,&fdin)){
struct sockaddr_un unc;
- size_t len = sizeof(unc);
+ socklen_t len = sizeof(unc);
unc.sun_family = AF_UNIX;
fd = accept (fd,(struct sockaddr*)&unc,&len);
if (fd != -1){
--- /dev/null
+rebootmgr
+v_gated
+v_httpd
+v_named
+v_portmap
+v_sendmail
+v_smb
+v_sshd
+v_xinetd
+vservers
--- /dev/null
+.deps
+.dirstamp
+chrootsafe
+escaperoot
+forkbomb
+testipc
+testlimit
+testopenf