[launchd-dev] Understanding sockpathmode

Gian Luca Gaiba g.gaiba at performer.it
Wed Aug 31 04:23:45 PDT 2011


OK Man

now that's perfectly clear!!!
thanx a lot

see ya
Gian Luca

On Aug 30, 2011, at August 30, 201112:09 PM, Quinn The Eskimo! wrote:

> 
> On 30 Aug 2011, at 10:44, Gian Luca Gaiba wrote:
> 
>> what actually means sockpathmode in property list?
> 
> It's used for UNIX domain (AF_UNIX) sockets.  It controls the access mode (permissions) of the socket, which in turn controls who is allowed to connect to it.  For example, the "com.apple.mDNSResponder" job has the following items in its launchd property list file:
> 
>    <key>SockPathName</key>
>    <string>/var/run/mDNSResponder</string>
>    <key>SockPathMode</key>
>    <integer>438</integer>
> 
> This causes launchd to create a listening UNIX domain socket with the path "/var/run/mDNSResponder" and the permissions of 0666 (octal 0666 is equal to decimal 438).  You can see this socket in the file system:
> 
> $ ls -l /var/run/mDNSResponder
> srw-rw-rw-  1 root  daemon  0 18 Aug 20:55 /var/run/mDNSResponder
> 
> Note that the permisions, rw-rw-rw-, is equal to 0666, meaning that the owner (root), anyone in the owning group (daemon), and indeed anyone on the system is allowed to connect to that socket.
> 
> Finally, be aware that this value is not relevant for TCP/IP sockets.
> 
> S+E
> --
> Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
> 
> 
> _______________________________________________
> launchd-dev mailing list
> launchd-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev
> 



More information about the launchd-dev mailing list