runit: fix chpst -n -N -u USER
No binary (build failed)
—
(log yok)
| @@ -463,6 +463,13 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) | |
| xchroot(root); | |
| } | |
| + | /* nice should be done before xsetuid */ |
| + | if (opt & OPT_n) { |
| + | errno = 0; |
| + | if (nice(xatoi(nicestr)) == -1) |
| + | bb_perror_msg_and_die("nice"); |
| + | } |
| + | |
| if (opt & OPT_u) { | |
| if (setgroups(1, &ugid.gid) == -1) | |
| bb_perror_msg_and_die("setgroups"); | |
| @@ -470,12 +477,6 @@ int chpst_main(int argc UNUSED_PARAM, char **argv) | |
| xsetuid(ugid.uid); | |
| } | |
| - | if (opt & OPT_n) { |
| - | errno = 0; |
| - | if (nice(xatoi(nicestr)) == -1) |
| - | bb_perror_msg_and_die("nice"); |
| - | } |
| - | |
| if (opt & OPT_0) | |
| close(STDIN_FILENO); | |
| if (opt & OPT_1) | |