[libdevice-modem-perl] 09/19: Change default log file location, make the file writable for group dialout, add rotation. Closes: #483847
Christoph Biedl
cbiedl at moszumanska.debian.org
Sat Nov 18 09:29:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
cbiedl pushed a commit to branch master
in repository libdevice-modem-perl.
commit 4e16a0cdb7af6f06416c1e5dddbe4ae3ed5cc938
Author: Christoph Biedl <debian.axhn at manchmal.in-ulm.de>
Date: Mon Jun 20 23:15:41 2016 +0200
Change default log file location, make the file writable for group dialout, add rotation. Closes: #483847
---
debian/README.Debian | 4 ++++
debian/libdevice-modem-perl.logrotate | 8 ++++++++
debian/libdevice-modem-perl.postinst | 21 +++++++++++++++++++++
debian/patches/log-file-location.patch | 19 +++++++++++++++++++
debian/patches/series | 1 +
5 files changed, 53 insertions(+)
diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..bf5c94d
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,4 @@
+By default, Device::Modem logs to /var/log/modem/modem.log which is
+writeable for the group dialout. Make sure the user your application
+runs as has been added to that group, or override the log file
+configuration in the Device::Modem constructor.
diff --git a/debian/libdevice-modem-perl.logrotate b/debian/libdevice-modem-perl.logrotate
new file mode 100644
index 0000000..e0f35f5
--- /dev/null
+++ b/debian/libdevice-modem-perl.logrotate
@@ -0,0 +1,8 @@
+/var/log/modem/modem.log
+{
+ rotate 7
+ daily
+ missingok
+ notifempty
+ create 664 root dialout
+}
diff --git a/debian/libdevice-modem-perl.postinst b/debian/libdevice-modem-perl.postinst
new file mode 100644
index 0000000..a764e5c
--- /dev/null
+++ b/debian/libdevice-modem-perl.postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+configure)
+ mkdir -p /var/log/modem/
+ touch /var/log/modem/modem.log
+ chgrp dialout /var/log/modem/ /var/log/modem/modem.log
+ chmod 664 /var/log/modem/modem.log
+ ;;
+abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+*)
+ echo "postinst called with unknown argument '$1'"
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+exit 0
diff --git a/debian/patches/log-file-location.patch b/debian/patches/log-file-location.patch
new file mode 100644
index 0000000..c88f1b3
--- /dev/null
+++ b/debian/patches/log-file-location.patch
@@ -0,0 +1,19 @@
+Subject: Change the logfile directory to /var/log/modem/
+Author: Christoph Biedl <debian.axhn at manchmal.in-ulm.de>
+Forwarded: no
+Last-Update: 2016-06-21
+
+ Upstream decided to change the log file directory to /tmp which
+ introduced security issues. Use /var/log/modem/ instead.
+
+--- a/lib/Device/Modem/Log/File.pm
++++ b/lib/Device/Modem/Log/File.pm
+@@ -54,7 +54,7 @@
+
+ # Provide a suitable filename default
+ sub default_filename () {
+- my $dir = '/tmp';
++ my $dir = '/var/log/modem';
+
+ # If this is windows, use the temp/tmp dirs
+ if (exists $ENV{'TEMP'} || exists $ENV{'TMP'}) {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b14c411
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+log-file-location.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdevice-modem-perl.git
More information about the Pkg-perl-cvs-commits
mailing list