浏览代码

Merge remote-tracking branch 'intrigeri/bug12751-systemd-filesystem-sandbox'

Nick Mathewson 9 年之前
父节点
当前提交
f58cdb3be7
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 5 0
      changes/bug12751-systemd-filesystem-sandbox
  2. 3 0
      contrib/dist/tor.service.in

+ 5 - 0
changes/bug12751-systemd-filesystem-sandbox

@@ -0,0 +1,5 @@
+  o Distribution:
+    - systemd unit file: only allow tor to write to /var/lib/tor
+      and /var/log/tor. The rest of the filesystem is accessible
+      for reading only.
+      Patch by intrigeri; resolves ticket 12751.

+ 3 - 0
contrib/dist/tor.service.in

@@ -19,6 +19,9 @@ PrivateTmp = yes
 DeviceAllow = /dev/null rw
 DeviceAllow = /dev/urandom r
 InaccessibleDirectories = /home
+ReadOnlyDirectories = /
+ReadWriteDirectories = @LOCALSTATEDIR@/lib/tor
+ReadWriteDirectories = @LOCALSTATEDIR@/log/tor
 
 [Install]
 WantedBy = multi-user.target