timemaster: set mode in ntp config to create private SHM segments.

In ntp-4.2.8p1 the segment access was made configurable with the
refclock mode option. Set the mode to 1 to create all SHM segments
with owner-only access.
master
Miroslav Lichvar 2015-02-09 14:53:06 +01:00 committed by Richard Cochran
parent a1e2a08b4e
commit e9ac26f909
2 changed files with 8 additions and 5 deletions

View File

@ -250,10 +250,12 @@ for PTP sources (\fBntp_poll\fR) to specify a subsecond interval.
The \fBntpd\fR limitations are:
.RS
Only the first two shared-memory segments created by the SHM refclock driver
in \fBntpd\fR have owner-only access. Other segments are created with world
access, possibly allowing any user on the system writing to the segments and
disrupting the synchronization.
In versions before 4.2.8p1, only the first two shared-memory segments created by
the \fBntpd\fR SHM refclock driver have owner-only access. Other segments
are created with world access, which allows any user on the system to write to
the segments and disrupt or take control over the synchronization of the clock.
In 4.2.8p1 the access was made configurable with the mode option, which is set
by \fBtimemaster\fR for owner-ownly access.
The shortest polling interval for all sources is 3 (8 seconds).

View File

@ -623,7 +623,8 @@ static void add_shm_source(int shm_segment, int poll, int dpoll, double delay,
break;
case NTPD:
string_appendf(ntp_config,
"server 127.127.28.%d minpoll %d maxpoll %d\n"
"server 127.127.28.%d minpoll %d maxpoll %d "
"mode 1\n"
"fudge 127.127.28.%d refid %s\n",
shm_segment, poll, poll, shm_segment, refid);
break;