[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: Bug in runit: chpst -n -N -u <user> doesn't work
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2017-03-13 21:36:09
Message-ID: CAK1hOcP8jh9=nhjRYjXKgm3ErUvniBJ1fUEpWBhvej-G8Bu7aQ () mail ! gmail ! com
[Download RAW message or body]

Applied, thanks.

(Deweloper <deweloper@wp.pl> is not an acceptable name for git authorship...)

On Thu, Mar 2, 2017 at 11:05 PM, Deweloper <deweloper@wp.pl> wrote:
> Hi,
> 
> busybox's chpst first switches user/group and then tries to call nice().
> Once the root priviledges are dropped, process priority can only be lowered. So \
> negative nice values don't work anymore. Upstream version of chpst correctly calls \
> nice() before switching user. 
> --
> 
> --- busybox-1.26.2/runit/chpst.c~       2017-03-02 22:09:36.000000000 +0100
> +++ busybox-1.26.2/runit/chpst.c        2017-03-02 22:15:50.222049716 +0100
> @@ -462,6 +462,12 @@
> xchroot(root);
> }
> 
> +       if (opt & OPT_n) {
> +               errno = 0;
> +               if (nice(xatoi(nicestr)) == -1)
> +                       bb_perror_msg_and_die("nice");
> +       }
> +
> if (opt & OPT_u) {
> int rv = strchr(set_user, ':') ? setgroups(1, &ugid.gid) : initgroups(set_user, \
> ugid.gid); if (rv == -1)
> @@ -470,12 +476,6 @@
> 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)
> 
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic