Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

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

    r2725 r3232  
    1010/* BB_AUDIT SUSv3 N/A -- Matches GNU behavior. */
    1111
     12//usage:#define chroot_trivial_usage
     13//usage:       "NEWROOT [PROG ARGS]"
     14//usage:#define chroot_full_usage "\n\n"
     15//usage:       "Run PROG with root directory set to NEWROOT"
     16//usage:
     17//usage:#define chroot_example_usage
     18//usage:       "$ ls -l /bin/ls\n"
     19//usage:       "lrwxrwxrwx    1 root     root          12 Apr 13 00:46 /bin/ls -> /BusyBox\n"
     20//usage:       "# mount /dev/hdc1 /mnt -t minix\n"
     21//usage:       "# chroot /mnt\n"
     22//usage:       "# ls -l /bin/ls\n"
     23//usage:       "-rwxr-xr-x    1 root     root        40816 Feb  5 07:45 /bin/ls*\n"
     24
    1225#include "libbb.h"
    1326
     
    1932        bb_show_usage();
    2033    xchroot(*argv);
    21     xchdir("/");
    2234
    2335    ++argv;
    2436    if (!*argv) { /* no 2nd param (PROG), use shell */
    2537        argv -= 2;
    26         argv[0] = getenv("SHELL");
    27         if (!argv[0]) {
    28             argv[0] = (char *) DEFAULT_SHELL;
    29         }
    30         argv[1] = (char *) "-i";
     38        argv[0] = (char *) get_shell_name();
     39        argv[1] = (char *) "-i"; /* GNU coreutils 8.4 compat */
     40        /*argv[2] = NULL; - already is */
    3141    }
    3242
Note: See TracChangeset for help on using the changeset viewer.