Hello,

Martin-E��ric Race noted in my merge request that nptd was failing with
a permission denied error, which seems to come from a setpriority call.


The error is:

    ntpd: can't set priority: Permission denied

and is a result of a call as follows:

    if (setpriority(PRIO_PROCESS, 0, -20) == -1)
        warn("can't set priority");

The attached C file is a short reproducer that consistently fails when
calling setpriority. I wasn't able to debug  this quite much. setpriority
is a bit hard to follow with its inner function and several counters.

Anyway, currently I would like to get some easily spotted, obvious ideas
I may be missing  or testing, if you like, the program to see whether in
your systems also fails or I have something wrong in mine.

Michael Kelly, from the mails it seems you are also working on OpenNTPd.
Have you encountered this issue? Have a patch?

Regards,
Diego
#include <stdio.h>
#include <sys/time.h>
#include <sys/resource.h>

int main (int argc, char **argv)
{
   int err = setpriority (PRIO_PROCESS, 0, -20);
   perror ("setpriority");
   return err == -1 ? 1 : 0;
}

Reply via email to