[Bug 11561] New: Argument parsing in nsenter incorrect

bugzilla at busybox.net bugzilla at busybox.net
Tue Dec 11 14:58:41 UTC 2018


https://bugs.busybox.net/show_bug.cgi?id=11561

            Bug ID: 11561
           Summary: Argument parsing in nsenter incorrect
           Product: Busybox
           Version: 1.28.x
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P5
         Component: Other
          Assignee: unassigned at busybox.net
          Reporter: penn.mackintosh at gmail.com
                CC: busybox-cvs at busybox.net
  Target Milestone: ---

The correct syntax for nsenter is

    BusyBox v1.27.2 (Ubuntu 1:1.27.2-2ubuntu3) multi-call binary.

    Usage: nsenter [OPTIONS] [PROG [ARGS]]

        -t,--target PID         Target process to get namespaces from
        -m,--mount[=FILE]       Enter mount namespace
        -u,--uts[=FILE]         Enter UTS namespace (hostname etc)
        -i,--ipc[=FILE]         Enter System V IPC namespace
        -n,--net[=FILE]         Enter network namespace
        -p,--pid[=FILE]         Enter pid namespace
        -U,--user[=FILE]        Enter user namespace
        -S,--setuid UID         Set uid in entered namespace
        -G,--setgid GID         Set gid in entered namespace
        --preserve-credentials  Don't touch uids or gids
        -r,--root[=DIR]         Set root directory
        -w,--wd[=DIR]           Set working directory
        -F,--no-fork            Don't fork before exec'ing PROG

However, running `busybox nsenter -t` opens a shell in the current namespace
and `busybox nsenter -t $$` says `nsenter: can't execute '(my pid)': No such
file or directory`.
On the util-linux of my ubuntu system, `busybox nsenter -t` fails with
incorrect arguments and the latter command succeeds and changes namespace, as
expected.
I have checked this and it exists both on arm64 Android and amd64 (both
precompiled binaries from busybox.net). This makes it impossible to use
nsenter, as arguments cannot be passed correctly.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the busybox-cvs mailing list