Ignore:
Timestamp:
Feb 25, 2011, 9:26:54 PM (13 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.18.3 to avoid problems with the tar command which is now failing on recent versions with busybox 1.7.3
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/coreutils/chroot.c

    r1765 r2725  
    55 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
    66 *
    7  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
     7 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
    88 */
    99
     
    1212#include "libbb.h"
    1313
    14 int chroot_main(int argc, char **argv);
    15 int chroot_main(int argc, char **argv)
     14int chroot_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
     15int chroot_main(int argc UNUSED_PARAM, char **argv)
    1616{
    17     if (argc < 2) {
     17    ++argv;
     18    if (!*argv)
    1819        bb_show_usage();
    19     }
    20 
    21     ++argv;
    22     if (chroot(*argv)) {
    23         bb_perror_msg_and_die("cannot change root directory to %s", *argv);
    24     }
     20    xchroot(*argv);
    2521    xchdir("/");
    2622
    2723    ++argv;
    28     if (argc == 2) {
     24    if (!*argv) { /* no 2nd param (PROG), use shell */
    2925        argv -= 2;
    3026        argv[0] = getenv("SHELL");
     
    3531    }
    3632
    37     BB_EXECVP(*argv, argv);
    38     bb_perror_msg_and_die("cannot execute %s", *argv);
     33    BB_EXECVP_or_die(argv);
    3934}
Note: See TracChangeset for help on using the changeset viewer.