[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] Time Service HOWTO in nearly final form; please review
From: |
Beat Bolli |
Subject: |
Re: [gpsd-dev] Time Service HOWTO in nearly final form; please review |
Date: |
Sat, 26 Oct 2013 18:06:25 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:24.0) Gecko/20100101 Thunderbird/24.0.1 |
On 26.10.13 17:07, Eric S. Raymond wrote:
> Beat Bolli <address@hidden>:
>> On 26.10.13 14:23, Eric S. Raymond wrote:
>>> Beat Bolli <address@hidden>:
>>>> The section that explains the differences between root vs. non-root
>>>> operation and devices on the command line vs. hotplug needs to be
>>>> adjusted now that the root privileges are dropped after setting up the
>>>> SHM segments and raising the PPS thread priority (commit
>>>> 247c5825172137f337a79a1ff2f73b4af2899f66).
>>>
>>> I'm not seeing how, sorry. Gary moved the thread interlock to avoid a
>>> race condition, and this does mean time_pps_create() will always be
>>> called with root permissions. But it appears to me that this just
>>> removes a bug that prevented the code from behaving as documented.
>>
>> But would this not imply that the hot-plugged GPS would also have access
>> to the unit 0 and 1 SHM regions?
>
> Alas, no. I should have said "always be called with root permissions
> for a command-line device". Trace the call chain: the relevant section
> of code is in ntpshm_pps(), which is called by gpsd_ppsmonitor(), which
> is called by pps_thread_activate(), which is called by the ntpshm.c entry
> point
> ntpd_link_activate().
>
> That is called by gpsd_add_device(), which can be called under one of
> two circumstances. It may be processing a command-line path, in which
> case root permissions are in effect. Or it may be called to open a path
> passed down the gpsd control socket as the result of a hotplug attempt,
> in which case root privileges will have been dropped.
Oh, I see now. Thanks for the explanation.
Beat
--
mail: echo '<address@hidden>' | tr -d '[A-S]'
pgp: 0x506A903A; 49D5 794A EA77 F907 764F D89E 304B 93CF 506A 903A
gsm: 4.7.7.6.0.7.7.9.7.1.4.e164.arpa
icbm: 47.0452 N, 7.2715 E
"It takes love over gold, and mind over matter" -- Dire Straits
signature.asc
Description: OpenPGP digital signature