I can confirm this, and I agree that the umask should be more easily
configurable by the user. Furthermore, I wonder why the default umask is
so paranoid. Should the default really be 0027? I think (the fairly
standard) 0022 should be restrictive enough for most users, although I
still agree that this should be user-configurable.

Incidentally, users who *are* paranoid (as I am) and want their
downloaded torrents to not be world-readable can still have a umask of
0022 (or even 0002 as I do) and simply have deluged download everything
into a directory that is not world-readable. Likewise, if desired, for
the config directory and the log files: just give /var/lib/deluged and
/var/log/deluged permissions of 0750 or similar.

I have attached a patch file that modifies the init-script to read the
umask from /etc/default/deluged, as the original bug reporter suggested.
In the patch I left the default umask as 0027.



diff -rupN deluge-1.3.7/debian/deluged.default deluge-1.3.7-new/debian/deluged.default
--- deluge-1.3.7/debian/deluged.default	2014-08-30 14:45:20.000000000 -0700
+++ deluge-1.3.7-new/debian/deluged.default	2014-09-01 16:12:12.000000000 -0700
@@ -3,3 +3,6 @@
 
 # change to 1 to enable daemon
 ENABLE_DELUGED=0
+
+# the umask of the deluged process
+UMASK=0027
diff -rupN deluge-1.3.7/debian/deluged.init deluge-1.3.7-new/debian/deluged.init
--- deluge-1.3.7/debian/deluged.init	2014-08-30 14:45:20.000000000 -0700
+++ deluge-1.3.7-new/debian/deluged.init	2014-09-01 16:15:22.000000000 -0700
@@ -20,7 +20,6 @@ NAME="deluged"
 DAEMON=/usr/bin/$NAME
 DAEMON_ARGS="-d -c /var/lib/deluged/config -l /var/log/deluged/daemon.log -L info"
 USER=debian-deluged
-MASK=0027
 PIDFILE=/var/run/$NAME.pid
 SCRIPTNAME=/etc/init.d/$NAME
 
@@ -53,11 +52,11 @@ do_start()
     #   1 if daemon was already running
     #   2 if daemon could not be started
     start-stop-daemon --start --background --quiet --pidfile $PIDFILE --exec $DAEMON \
-      --chuid $USER --umask $MASK --test > /dev/null \
+      --chuid $USER --umask $UMASK --test > /dev/null \
       || return 1
 
     start-stop-daemon --start --background --quiet --pidfile $PIDFILE --make-pidfile --exec $DAEMON \
-      --chuid $USER --umask $MASK -- $DAEMON_ARGS \
+      --chuid $USER --umask $UMASK -- $DAEMON_ARGS \
       || return 2
   fi
 }

Reply via email to