From 77716ebf1cde97db63dfbc2aa2c50f084e7c126f Mon Sep 17 00:00:00 2001 From: Benedikt Boehm Date: Wed, 1 Nov 2006 15:34:06 +0000 Subject: [PATCH] add mkdir and chmod functions to chroot-sh git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2359 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- src/Makefile-files | 1 + src/chroot-sh.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/src/Makefile-files b/src/Makefile-files index c6e8588..aa6af6c 100644 --- a/src/Makefile-files +++ b/src/Makefile-files @@ -181,6 +181,7 @@ src_filetime_LDFLAGS = $(VSERVER_LDFLGS) src_chain_echo_SOURCES = src/chain-echo.c src_chroot_sh_SOURCES = src/chroot-sh.c +src_chroot_sh_LDADD = $(LIBINTERNAL) src_exec_cd_SOURCES = src/exec-cd.c src_fakerunlevel_SOURCES = src/fakerunlevel.c src_ifspec_SOURCES = src/ifspec.c diff --git a/src/chroot-sh.c b/src/chroot-sh.c index addb0f9..a7aa744 100644 --- a/src/chroot-sh.c +++ b/src/chroot-sh.c @@ -142,6 +142,54 @@ execTestFile(int argc, char *argv[]) return res!=-1 && S_ISREG(res) ? EXIT_SUCCESS : EXIT_FAILURE; } +static int +execMkdir(int argc, char *argv[]) +{ + int i = 1; + int res = EXIT_SUCCESS; + + if (argc<2) { + WRITE_MSG(2, "No files specified for 'mkdir' operation; try '--help' for more information\n"); + return wrapper_exit_code; + } + + for (;i ... appends stdin to which is created when needed\n" " truncate ... clear and fill it with stdin; the is\n" " created when needed\n" - " rm + ... unlink the given files\n\n" + " rm + ... unlink the given files\n" + " mkdir + ... create the given directories\n" + " chmod +\n" + " ... change access permissions of files\n\n" "Please report bugs to " PACKAGE_BUGREPORT "\n"); exit(0); } -- 1.8.1.5