Mailing List archive

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

[vdr] Re: system time synchronisation using vdr



On Sun, Oct 10, 2004 at 05:57:51AM +0200, Udo Richter wrote:
> Bernd Juraschek wrote:
> >Now I've switched to getting the time using ntpd. But I wonder why the ntp
> >daemon can set the time. This program is also using stime() and runs as
> >user ntp on my gentoo system.
> 
> Just an idea how they may have done it:
> 
> Ntpd starts as root, and probably does a fork before switching to ntp 
> user. That way most parts (esp network) can run as user ntp, and 
> privileged stuff like setting the system clock can be done by the root 
> parent process. Communication between these two processes can be easily 
> handled by a pipe or simillar.

It's much easier. Ntpd call prctl() before calling setuid(). This way the
process keeps the capability to change the time. Perhaps it's possible to
reset all other capabilities.

I've created a patch for vdr-1.3.12, but I don't now the right place to
call my SetUser() because vdr is doing some actions during the argument
parsing. It's better to move this code after the argument parsing. I will
post my patch if I have done this.

Greetings,
Bernd

-- 
Steal my cash, car and TV - but leave the computer!
        -- Soenke Lange <soenke@escher.north.de>




Home | Main Index | Thread Index