tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: /dev/clockctl, O_CLOEXEC and forking



Alexander Nasonov wrote:
> Christos Zoulas wrote:
> > After fork it would work fine, after exec, not so much as the name implies :-)
> 
> Ah, you're right. 'step-systime: Bad file descriptor' messages in syslog
> confused me.

It was a pilot error.

> > Nevertheless
> > we should not be exposing new API's here... We should arrange so that
> > things just work. In this case, you could just call adjtime with a 0
> > delta perhaps instead...
> 
> I don't like adding new public functions either but those functions
> can be useful (if they are made hidden) because they avoid code
> repetition and hide __clockctl_fd global variable.
> 
> I don't think adjtime will work because ntpd still runs as root and
> it can't drop to an unprivileged user before it calls chroot(2).

I don't see how my issue can be fixed without either adding a new
public function (and calling it from ntpd) or changing ntpd code
to access /dev/clockctl directly.

-- 
Alex


Home | Main Index | Thread Index | Old Index