]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: namespace: remove unnecessary mode on /dev/shm mount target 7913/head
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Wed, 17 Jan 2018 12:53:26 +0000 (12:53 +0000)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Wed, 17 Jan 2018 18:04:34 +0000 (18:04 +0000)
commit8d95368210007e50df80a9d6e6b2b86010ce2585
treeaeab0a217365dc270628d2c9fff05020fd6603f5
parent45a582d5369b501743ac4dded3a481e6a589c029
core: namespace: remove unnecessary mode on /dev/shm mount target

This should have no behavioural effect; it just confused me.

All the other mount directories in this function are created as 0755.
Some of the mounts are allowed to fail - mqueue and hugepages.
If the /dev/mqueue mount target was created with the permissive mode 01777,
to match the filesystem we're trying to mount there, then a mount failure
would allow unprivileged users to write to the /dev filesystem, e.g. to
exhaust the available space.  There is no reason to allow this.

(Allowing the user read access (0755) seems a reasonable idea though, e.g. for
quicker troubleshooting.)

We do not allow failure of the /dev/shm mount, so it doesn't matter that
it is created as 01777.  But on the same grounds, we have no *reason* to
create it as any specific mode.  0755 is equally fine.

This function will be clearer by using 0755 throughout, to avoid
unintentionally implying some connection between the mode of the mount
target, and the mode of the mounted filesystem.
src/core/namespace.c