diff options
Diffstat (limited to 'sys-utils/setpriv.c')
-rw-r--r-- | sys-utils/setpriv.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c index 163012223..3b99a177e 100644 --- a/sys-utils/setpriv.c +++ b/sys-utils/setpriv.c @@ -781,9 +781,8 @@ int main(int argc, char **argv) errx(EXIT_FAILURE, _("--[re]gid requires --keep-groups, --clear-groups, or --groups")); - if (opts.nnp) - if (prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) == -1) - err(EXIT_FAILURE, _("disallow granting new privileges failed")); + if (opts.nnp && prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0) == -1) + err(EXIT_FAILURE, _("disallow granting new privileges failed")); if (opts.selinux_label) do_selinux_label(opts.selinux_label); @@ -820,9 +819,8 @@ int main(int argc, char **argv) err(SETPRIV_EXIT_PRIVERR, _("setgroups failed")); } - if (opts.have_securebits) - if (prctl(PR_SET_SECUREBITS, opts.securebits, 0, 0, 0) != 0) - err(SETPRIV_EXIT_PRIVERR, _("set process securebits failed")); + if (opts.have_securebits && prctl(PR_SET_SECUREBITS, opts.securebits, 0, 0, 0) != 0) + err(SETPRIV_EXIT_PRIVERR, _("set process securebits failed")); if (opts.bounding_set) { do_caps(CAPNG_BOUNDING_SET, opts.bounding_set); |