]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
* [Bug 2627] rework: reverted sense of mode bit (so default reflects previous behavio...
authorJuergen Perlinger <perlinger@ntp.org>
Mon, 26 Jan 2015 23:26:25 +0000 (00:26 +0100)
committerJuergen Perlinger <perlinger@ntp.org>
Mon, 26 Jan 2015 23:26:25 +0000 (00:26 +0100)
bk: 54c6cd21xJsvJB9_nfHF9nCv9DZFgw

ChangeLog
html/drivers/driver28.html
ntpd/refclock_shm.c

index 55c2fcbe031f96a35d4f4683f51081e159fc6d0b..836ef655831503326de616a16d1162b9537ccbd7 100644 (file)
--- 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 <stenn@ntp.org>
 
 * Start the RC for 4.2.8p1.
index df1a588fd774c4c0a77f6ff71c9043523a98cd23..efa862f5f1fc47587b104d4ad88665cf638b9f35 100644 (file)
@@ -151,8 +151,9 @@ Here is a sample showing the GPS reception fading out:
        <td align="center">0</td>
        <td align="center">1</td>
        <td align="center">1</td>
-       <td>The SHM segment is accessible by the world. (Ignored/rejected for
-       units 0 and 1!)</td>
+       <td>The SHM segment is private (mode 0600). This is the fixed
+       default for clock units 0 and 1; clock units &gt;1 are mode
+       0666 unless this bit is set for the specific unit.</td>
       </tr><tr>
        <td align="center">1-31</td>
        <td align="center">-</td>
index d528e2bf95d4f2e3ce6e85bd5c8a95fb22aba9fb..7174abdbf4cf3a4765a9b108732dd476ef7a2dd5 100644 (file)
@@ -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);