setpriv: new applet
authorAssaf Gordon <assafgordon@gmail.com>
Wed, 14 Jun 2017 09:46:52 +0000 (11:46 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Wed, 14 Jun 2017 09:46:52 +0000 (11:46 +0200)
commit62d1e98fbd0cc1b008237411d8b2ddc20d3e55a7
tree1e9dd4cd82be5032c51dbc0fa8074ce642951474
parent2f24d30d0133f81cf3e0639746039a8ed58426e9
setpriv: new applet

Add a minimal 'setpriv' implementation supporting the NO_NEW_PRIVS bit.
Typical usage:

    $ busybox setpriv sudo uname
    Linux
    $ busybox setpriv --nnp sudo uname
    sudo: effective uid is not 0, is /usr/bin/sudo on a file system with
    the 'nosuid' option set or an NFS file system without root privileges?

function                                             old     new   delta
packed_usage                                       31580   31685    +105
setpriv_main                                           -      87     +87
prctl                                                  -      53     +53
static.setpriv_longopts                                -      22     +22
applet_names                                        2620    2628      +8
applet_main                                         1516    1520      +4
------------------------------------------------------------------------------
(add/remove: 5/0 grow/shrink: 3/0 up/down: 279/0)             Total: 279 bytes

Signed-off-by: Assaf Gordon <assafgordon@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/setpriv.c [new file with mode: 0644]