X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fchroot-sh.c;h=4cbca21f433221bff06b1c807fd90e1e2b9f4c74;hb=ec4370f7ebd7fb0ce7f002f5bf2c74f03acd3ec1;hp=a1d4bb990dfbe35fb84a24f8be7eb80a2172b5d5;hpb=9234e6a7cb48373edec38284ba54a819037b79b2;p=util-vserver.git diff --git a/src/chroot-sh.c b/src/chroot-sh.c index a1d4bb9..4cbca21 100644 --- a/src/chroot-sh.c +++ b/src/chroot-sh.c @@ -1,4 +1,4 @@ -// $Id: chroot-sh.c,v 1.2 2005/07/03 17:40:15 ensc Exp $ --*- c -*-- +// $Id: chroot-sh.c 2536 2007-04-27 09:01:20Z hollow $ --*- c -*-- // Copyright (C) 2005 Enrico Scholz // @@ -28,7 +28,7 @@ #include #include -#define ENSC_WRAPPERS_PREFIX "chroot-sh" +#define ENSC_WRAPPERS_PREFIX "chroot-sh: " #define ENSC_WRAPPERS_UNISTD 1 #define ENSC_WRAPPERS_IO 1 #define ENSC_WRAPPERS_FCNTL 1 @@ -85,7 +85,7 @@ testInternal(int argc, char *argv[], char const *operation) return wrapper_exit_code; } - if (stat(argv[1], &st)==-1) return 0; + if (stat(argv[1], &st)==-1) return -1; else return st.st_mode; } @@ -142,6 +142,73 @@ 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" + " link dst> ... create a symbolic link from to \n\n" "Please report bugs to " PACKAGE_BUGREPORT "\n"); exit(0); }