Changeset 2720
- Timestamp:
- 06/17/08 18:16:47 (5 months ago)
- Files:
-
- trunk/src/chroot-sh.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/chroot-sh.c
r2536 r2720 211 211 } 212 212 213 static int 214 execMv(int argc, char *argv[]) 215 { 216 int res = EXIT_SUCCESS; 217 218 if (argc!=3) { 219 WRITE_MSG(2, "Need exactly two files for 'mv' operation; try '--help' for more information\n"); 220 return wrapper_exit_code; 221 } 222 223 if (rename(argv[1], argv[2])==-1) { 224 PERROR_Q(ENSC_WRAPPERS_PREFIX "mv", argv[1]); 225 res = EXIT_FAILURE; 226 } 227 228 return res; 229 } 230 213 231 static struct Command { 214 232 char const *cmd; … … 223 241 { "chmod", execChmod }, 224 242 { "link", execLink }, 243 { "mv", execMv }, 225 244 { 0,0 } 226 245 }; … … 237 256 "\n" 238 257 "The supported commands are:\n" 239 " cat <file> ... gives out <file> to stdout\n"240 " append <file> ... appends stdin to <file> which is created when needed\n"241 " truncate <file> ... clear <file> and fill it with stdin; the <file> is\n"258 " cat <file> ... gives out <file> to stdout\n" 259 " append <file> ... appends stdin to <file> which is created when needed\n" 260 " truncate <file> ... clear <file> and fill it with stdin; the <file> is\n" 242 261 " created when needed\n" 243 " rm <file>+ ... unlink the given files\n"244 " mkdir <file>+ ... create the given directories\n"262 " rm <file>+ ... unlink the given files\n" 263 " mkdir <file>+ ... create the given directories\n" 245 264 " chmod <mode> <file>+\n" 246 " ... change access permissions of files\n" 247 " link <src> dst> ... create a symbolic link from <src> to <dst>\n\n" 248 "Please report bugs to " PACKAGE_BUGREPORT "\n"); 265 " ... change access permissions of files\n" 266 " link <src> <dst> ... create a symbolic link from <src> to <dst>\n" 267 " mv <src> <dst> ... rename <src> to <dst>\n" 268 "\nPlease report bugs to " PACKAGE_BUGREPORT "\n"); 249 269 exit(0); 250 270 }
