aboutsummaryrefslogtreecommitdiff
path: root/coreutils/chroot.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 18:39:58 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2006-04-12 18:39:58 +0000
commitd9cf7ac781c1274d6d23fa5674b6b90baaf4cf61 (patch)
treec7e395cfe1eafcd601bc16e0231fc30f8789e4d9 /coreutils/chroot.c
parent67f641e75b685abe1588b634b409c1ee2ff68c22 (diff)
downloadbusybox-w32-d9cf7ac781c1274d6d23fa5674b6b90baaf4cf61.tar.gz
busybox-w32-d9cf7ac781c1274d6d23fa5674b6b90baaf4cf61.tar.bz2
busybox-w32-d9cf7ac781c1274d6d23fa5674b6b90baaf4cf61.zip
- patch from Denis Vlasenko to add and use bb_xchdir()
Diffstat (limited to 'coreutils/chroot.c')
-rw-r--r--coreutils/chroot.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index 62257021d..8ad680c02 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */ 10/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
@@ -35,9 +22,10 @@ int chroot_main(int argc, char **argv)
35 } 22 }
36 23
37 ++argv; 24 ++argv;
38 if (chroot(*argv) || (chdir("/"))) { 25 if (chroot(*argv)) {
39 bb_perror_msg_and_die("cannot change root directory to %s", *argv); 26 bb_perror_msg_and_die("cannot change root directory to %s", *argv);
40 } 27 }
28 bb_xchdir("/");
41 29
42 ++argv; 30 ++argv;
43 if (argc == 2) { 31 if (argc == 2) {