]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Make sure they sign bit of 'ikey' is never set so the diskd IPC keys
authorwessels <>
Tue, 16 Jan 2001 05:37:10 +0000 (05:37 +0000)
committerwessels <>
Tue, 16 Jan 2001 05:37:10 +0000 (05:37 +0000)
remain positive.

src/fs/diskd/store_dir_diskd.cc

index 0bf376ee3135e5af352677435f8d4cc791395633..2bceb8e9a11cd87c94634ee4f0a2f02114c0b4a1 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: store_dir_diskd.cc,v 1.36 2001/01/12 00:37:33 wessels Exp $
+ * $Id: store_dir_diskd.cc,v 1.37 2001/01/15 22:37:10 wessels Exp $
  *
  * DEBUG: section 47    Store Directory Routines
  * AUTHOR: Duane Wessels
@@ -366,7 +366,7 @@ storeDiskdDirInit(SwapDir * sd)
     int x;
     int i;
     int rfd;
-    int ikey = (getpid() << 16) + (sd->index << 4);
+    int ikey;
     char *args[5];
     char skey1[32];
     char skey2[32];
@@ -377,6 +377,8 @@ storeDiskdDirInit(SwapDir * sd)
     "\tfor details.  Run 'squid -z' to create swap directories\n"
     "\tif needed, or if running Squid for the first time.";
 
+    ikey = (getpid() << 10) + (sd->index << 2);
+    ikey &= 0x7fffffff;
     diskdinfo->smsgid = msgget((key_t) ikey, 0700 | IPC_CREAT);
     if (diskdinfo->smsgid < 0) {
        debug(50, 0) ("storeDiskdInit: msgget: %s\n", xstrerror());