Ola Lundqvist <o...@debian.org> wrote:
Hi Hannes
What is UMASK_RELAXED?
According to /usr/sbin/cron-apt UMASK_RELAXED specifies the umask to use
for the execution of the APTCOMMAND.
I would provide a patch if needed.
That would be good. If the patch is hard to create, please describe it
to me before you provide it, in case I have comments on the function.
Attached.
Hannes
diff -Naur cron-apt-0.7.1.orig/conf/config cron-apt-0.7.1/conf/config
--- cron-apt-0.7.1.orig/conf/config 2009-08-10 07:51:14.000000000 +0200
+++ cron-apt-0.7.1/conf/config 2009-08-21 07:58:46.000000000 +0200
@@ -76,6 +76,9 @@
# when still running the script.
# TEMP="/var/log/cron-apt/temp"
+# The umask to use for APTCOMMAND.
+# UMASK="022"
+
# The logfile (for debugging). Use syslog for normal logging.
# LOG="/var/log/cron-apt/log"
diff -Naur cron-apt-0.7.1.orig/src/cron-apt cron-apt-0.7.1/src/cron-apt
--- cron-apt-0.7.1.orig/src/cron-apt 2009-04-21 06:52:29.000000000 +0200
+++ cron-apt-0.7.1/src/cron-apt 2009-08-21 07:59:51.000000000 +0200
@@ -2,6 +2,7 @@
# DocumentId: $Id: cron-apt 2622 2009-03-24 19:59:59Z ola $
#
# Copyright (C) 2002-2009 Ola Lundqvist <o...@inguza.com>
+# Copyright (C) 2009 Hannes von Haugwitz <han...@vonhaugwitz.com>
# Copyright (C) 2004-2007 Marc Haber <mh+debian-b...@zugschlus.de>
# Copyright (C) 2004,2007 Bob Proulx <b...@proulx.com>
# Copyright (C) 2004 Marc Sherman <msher...@projectile.ca>
@@ -25,6 +26,8 @@
# MA 02110-1301 USA.
#
# Changes:
+# 2009-08-21 Hannes von Haugwitz <han...@vonhaugwitz.com>
+# Added option to set the umask to use for APTCOMMAND.
# 2009-03-24 Ola Lundqvist <o...@inguza.com>
# Correction so that it do syslog instead of sending mail
# when the syslog parameter is set to changes. Thanks to
@@ -138,7 +141,6 @@
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
UMASK_TIGHT="077"
-UMASK_RELAXED="022"
umask $UMASK_TIGHT
############################# arguments #######################################
@@ -211,6 +213,7 @@
LOGMSGDIR="/etc/cron-apt/logmsg.d"
LOG="/var/log/cron-apt/log"
DIFFONCHANGES="prepend"
+UMASK="022"
MAILTO="root"
# error, always, never
SYSLOGON="upgrade"
@@ -352,7 +355,7 @@
while read LINE ; do
echo "CRON-APT LINE: $APTCOMMAND $LINE" > "$TEMP"
UMASK_SAVE=$(umask)
- umask $UMASK_RELAXED
+ umask $UMASK
$APTCOMMAND $OPTIONS $LINE >> $TEMP 2>&1
RET=$?
umask $UMASK_SAVE