]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Allow to set only permission bits with perm option
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 29 Jan 2010 08:50:51 +0000 (09:50 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 29 Jan 2010 08:50:51 +0000 (09:50 +0100)
refclock_shm.c

index ed0c3d089674447bdeb629ae350e1608e528dae7..083a06cee02283387ee9ed7f5ef014d40932c42d 100644 (file)
@@ -62,7 +62,7 @@ static int shm_initialise(RCL_Instance instance) {
 
   param = atoi(RCL_GetDriverParameter(instance));
   s = RCL_GetDriverOption(instance, "perm");
-  perm = s ? strtol(s, NULL, 8) : 0600;
+  perm = s ? strtol(s, NULL, 8) & 0777 : 0600;
 
   id = shmget(SHMKEY + param, sizeof (struct shmTime), IPC_CREAT | perm);
   if (id == -1) {