Mailing List archive

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

[vdr] system time synchronisation using vdr



Hi,

I'm running vdr as user vdr. This way vdr isn't permitted to set the system
time.

Looking into the vdr sources I've found that vdr is using stime(). I have
thought that this call is only permitted for programms running with the
effective user id 0.

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.

The only difference I've found is that vdr will be started with su and
ntpd calls set(e)uid() to change to user ntp. Digging into the kernel
sources for the stime() implementation shows the kernel makes no check
for the user id but checks the process capabilities to allow setting the
time.

May be running su resets the needed capability and changing the user id
calling set(e)uid() preserves the process capabilities? May be implementing
the user change inside vdr is a solution?

Happy weekend,
Bernd

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




Home | Main Index | Thread Index