Эх сурвалжийг харах

Merge pull request #213 from ares333/patch-1

Fix unix domain socket file permission
walkor 8 жил өмнө
parent
commit
fa41fdb31c
1 өөрчлөгдсөн 8 нэмэгдсэн , 0 устгасан
  1. 8 0
      Worker.php

+ 8 - 0
Worker.php

@@ -1654,6 +1654,14 @@ class Worker
 
         if ($this->transport === 'ssl') {
             stream_socket_enable_crypto($this->_mainSocket, false);
+        } elseif ($this->transport === 'unix') {
+            $socketFile = substr($address, 2);
+            if ($this->user) {
+                chown($socketFile, $this->user);
+            }
+            if ($this->group) {
+                chgrp($socketFile, $this->group);
+            }
         }
 
         // Try to open keepalive for tcp and disable Nagle algorithm.