[systemd-devel] x bits set on /run/systemd/private, any particular reason?

Lennart Poettering lennart at poettering.net
Fri Jun 24 18:31:31 UTC 2016


On Fri, 24.06.16 11:24, Hoyer, Marko (ADITG/SW2) (mhoyer at de.adit-jv.com) wrote:

> Hi,
> 
> I'm not an expert on Linux access right management but I'm wondering
> why systemd's private socket (/run/systemd/private) has the x bits
> set. Did it happen accidently?

We don't do that explicitly. That's simply what the kernel does if you
invoke bind(). Compare:

<snip>
$ socat UNIX-LISTEN:/tmp/fffffff -
^Z
[1]+  Stopped                 socat UNIX-LISTEN:/tmp/fffffff -
$ stat /tmp/fffffff
  File: '/tmp/fffffff'
  Size: 0             Blocks: 0          IO Block: 4096   socket
Device: 2bh/43d     Inode: 3604282     Links: 1
Access: (0775/srwxrwxr-x)  Uid: ( 1000/ lennart)   Gid: ( 1000/ lennart)
Context: unconfined_u:object_r:user_tmp_t:s0
Access: 2016-06-24 20:28:56.692037876 +0200
Modify: 2016-06-24 20:28:56.692037876 +0200
Change: 2016-06-24 20:28:56.692037876 +0200
 Birth: -
$ fg
socat UNIX-LISTEN:/tmp/fffffff -
^C
</snip>

And this doesn't matter much as the x bit has no real effect on
AF_UNIX sockets. (much like i has no effect on fifos or symlinks).

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list