From 6543236fa105478232d0928926c1e347fb066eee Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 28 Nov 2003 23:10:09 +0000 Subject: [PATCH] removed chrootsafe.cc; such an implementation seems to be impossible... git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/branches/SYSCALL_SWITCH@450 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/tests/Makefile-files | 6 +--- util-vserver/tests/chrootsafe.cc | 64 --------------------------------------- 2 files changed, 1 insertion(+), 69 deletions(-) delete mode 100644 util-vserver/tests/chrootsafe.cc diff --git a/util-vserver/tests/Makefile-files b/util-vserver/tests/Makefile-files index f4b4331..2145465 100644 --- a/util-vserver/tests/Makefile-files +++ b/util-vserver/tests/Makefile-files @@ -17,16 +17,12 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ## -test_PRGS = tests/chrootsafe \ - tests/escaperoot \ +test_PRGS = tests/escaperoot \ tests/forkbomb \ tests/testipc \ tests/testlimit \ tests/testopenf -tests_chrootsafe_SOURCES = tests/chrootsafe.cc -tests_chrootsafe_LDADD = lib/libvserver.a - tests_escaperoot_SOURCES = tests/escaperoot.cc tests_forkbomb_SOURCES = tests/forkbomb.cc tests_testipc_SOURCES = tests/testipc.cc diff --git a/util-vserver/tests/chrootsafe.cc b/util-vserver/tests/chrootsafe.cc deleted file mode 100644 index 9a5d333..0000000 --- a/util-vserver/tests/chrootsafe.cc +++ /dev/null @@ -1,64 +0,0 @@ -// $Id$ --*- c++ -*-- - -// Copyright (C) 2003 Enrico Scholz -// based on tests/chrootsafe.cc by Jacques Gelinas -// -// 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; either version 2, or (at your option) -// any later version. -// -// 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. - -/* - Test the chrootsafe command. - Pass the path of a vserver as the only argument - - chrootsafe /vservers/test -*/ -#ifdef HAVE_CONFIG_H -# include -#endif -#include "compat.h" - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "vserver.h" - -int main (int, char *argv[]) -{ - // This test must fail - int fd = open ("/",O_RDONLY); - if (fd != -1){ - if (vc_chrootsafe(argv[1])==-1){ - fprintf (stderr,"Ok, chrootsafe failed with one open directory errno=%s\n",strerror(errno)); - }else{ - fprintf (stderr,"Hum, chrootsafe succeed with one open directory\n"); - system ("/bin/sh"); - } - close (fd); - } - // Now it should work - if (vc_chrootsafe(argv[1])!=-1){ - fprintf (stderr,"Ok, chrootsafe worked\n"); - system ("/bin/sh"); - }else{ - fprintf (stderr,"chrootsafe failed errno=%s\n",strerror(errno)); - } - return 0; -} - -- 1.8.1.5