From: Juergen Perlinger Date: Mon, 26 Jan 2015 23:26:25 +0000 (+0100) Subject: * [Bug 2627] rework: reverted sense of mode bit (so default reflects previous behavio... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d54a79f04470c51746a77071fcc6fbdb5b99d042;p=thirdparty%2Fntp.git * [Bug 2627] rework: reverted sense of mode bit (so default reflects previous behaviour) and updated ducumentation. bk: 54c6cd21xJsvJB9_nfHF9nCv9DZFgw --- diff --git a/ChangeLog b/ChangeLog index 55c2fcbe0..836ef6558 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ --- +* [Bug 2627] shm refclock allows only two units with owner-only access + rework: reverted sense of mode bit (so default reflects previous + behaviour) and updated ducumentation. +--- (4.2.8p1-RC1) 2015/01/24 Released by Harlan Stenn * Start the RC for 4.2.8p1. diff --git a/html/drivers/driver28.html b/html/drivers/driver28.html index df1a588fd..efa862f5f 100644 --- a/html/drivers/driver28.html +++ b/html/drivers/driver28.html @@ -151,8 +151,9 @@ Here is a sample showing the GPS reception fading out: 0 1 1 - The SHM segment is accessible by the world. (Ignored/rejected for - units 0 and 1!) + The SHM segment is private (mode 0600). This is the fixed + default for clock units 0 and 1; clock units >1 are mode + 0666 unless this bit is set for the specific unit. 1-31 - diff --git a/ntpd/refclock_shm.c b/ntpd/refclock_shm.c index d528e2bf9..7174abdbf 100644 --- a/ntpd/refclock_shm.c +++ b/ntpd/refclock_shm.c @@ -53,7 +53,7 @@ /* * Mode flags */ -#define MODE_PUBLIC 0x0001 +#define SHM_MODE_PRIVATE 0x0001 /* * Function prototypes @@ -216,12 +216,7 @@ shm_start( pp->io.datalen = 0; pp->io.fd = -1; - up->forall = (peer->ttl & MODE_PUBLIC) != 0; - if (up->forall && unit < 2) { - msyslog(LOG_WARNING, "SHM: public mode ignored for unit %d", - unit); - up->forall = FALSE; - } + up->forall = (unit >= 2) && !(peer->ttl & SHM_MODE_PRIVATE); up->shm = getShmTime(unit, up->forall);