From 5b1edb78078414ac953ea956a6cf194c2c6c8fe7 Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 30 Dec 2003 17:41:49 +0000 Subject: [PATCH] fixed order of chroot() and parameter evaluation so that '--version' and '--help' are working as non-root also git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@525 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/src/chroot-rm.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/util-vserver/src/chroot-rm.c b/util-vserver/src/chroot-rm.c index a4e594b..3d453cc 100644 --- a/util-vserver/src/chroot-rm.c +++ b/util-vserver/src/chroot-rm.c @@ -56,12 +56,9 @@ showVersion() int main(int argc, char *argv[]) { int i; - int res; + int res = EXIT_SUCCESS; int idx = 1; - Echroot("."); - Echdir("/"); - if (argc==1) { WRITE_MSG(2, "No files given; use '--help' for more information\n"); return EXIT_FAILURE; @@ -70,7 +67,9 @@ int main(int argc, char *argv[]) if (strcmp(argv[1], "--version")==0) showVersion(); if (strcmp(argv[1], "--")==0) ++idx; - res = EXIT_SUCCESS; + Echroot("."); + Echdir("/"); + for (i=idx; i