renice: add comment about getpwnam/NOFORK interaction
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 14 Jan 2018 18:40:00 +0000 (19:40 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 14 Jan 2018 18:40:00 +0000 (19:40 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
util-linux/renice.c

index 65a80001b14d4e032b847722669004b5a390e902..46704591f1a514be42c148d53e72abc7b5404bb9 100644 (file)
@@ -6,7 +6,6 @@
  *
  * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
-
 /* Notes:
  *   Setting an absolute priority was obsoleted in SUSv2 and removed
  *   in SUSv3.  However, the common linux version of renice does
@@ -95,6 +94,7 @@ int renice_main(int argc UNUSED_PARAM, char **argv)
                /* Process an ID arg. */
                if (which == PRIO_USER) {
                        struct passwd *p;
+                       /* NB: use of getpwnam makes it risky to be NOFORK, switch to getpwnam_r? */
                        p = getpwnam(arg);
                        if (!p) {
                                bb_error_msg("unknown user %s", arg);