X-Git-Url: http://git.onelab.eu/?p=util-vserver.git;a=blobdiff_plain;f=src%2Fchroot-sh.c;h=f8baac3a0abef03bcf0be6557c6296f346bd8deb;hp=a1d4bb990dfbe35fb84a24f8be7eb80a2172b5d5;hb=3b34449070c0846fdc49436d1edd5916512f1644;hpb=7370d748ee384dd549f2947c60ebc9a647907d06 diff --git a/src/chroot-sh.c b/src/chroot-sh.c index a1d4bb9..f8baac3 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 2407 2006-11-25 19:18:06Z dhozac $ --*- 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,55 @@ 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); }