From f1334f0ca24bd6d4c12d423e95f4ea44bdba9e87 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 28 Dec 2015 09:19:11 +0100 Subject: roundcubemail: add .log suffix to log file names, and rotate them all --- roundcubemail-pr313.patch | 22 ++++++++++++++++++++++ roundcubemail.logrotate | 4 ++-- roundcubemail.spec | 15 ++++++++++++--- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 roundcubemail-pr313.patch diff --git a/roundcubemail-pr313.patch b/roundcubemail-pr313.patch new file mode 100644 index 0000000..d60e47b --- /dev/null +++ b/roundcubemail-pr313.patch @@ -0,0 +1,22 @@ +From e8e951098db781422f7ed557d97b1b218d7529de Mon Sep 17 00:00:00 2001 +From: Remi Collet +Date: Mon, 28 Dec 2015 08:47:37 +0100 +Subject: [PATCH] add .log suffix to all log file names + +--- + program/lib/Roundcube/rcube.php | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/program/lib/Roundcube/rcube.php b/program/lib/Roundcube/rcube.php +index 7388472..c2fc70f 100644 +--- a/program/lib/Roundcube/rcube.php ++++ b/program/lib/Roundcube/rcube.php +@@ -1184,7 +1184,7 @@ public static function write_log($name, $line) + } + + // try to open specific log file for writing +- $logfile = $log_dir.'/'.$name; ++ $logfile = $log_dir.'/'.$name.'.log'; + + if ($fp = @fopen($logfile, 'a')) { + fwrite($fp, $line); diff --git a/roundcubemail.logrotate b/roundcubemail.logrotate index 18e8695..e7bd821 100644 --- a/roundcubemail.logrotate +++ b/roundcubemail.logrotate @@ -1,7 +1,7 @@ -/var/log/roundcubemail/errors { +/var/log/roundcubemail/*.log { missingok su root apache notifempty size 30k - create 0660 root apache + nocreate } diff --git a/roundcubemail.spec b/roundcubemail.spec index cd7c155..ec47f75 100644 --- a/roundcubemail.spec +++ b/roundcubemail.spec @@ -19,7 +19,7 @@ %global _logdir /var/log Name: roundcubemail Version: 1.1.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Round Cube Webmail is a browser-based multilingual IMAP client Group: Applications/System @@ -48,6 +48,10 @@ Patch0: roundcubemail-1.1.1-no_swf.patch # Non-upstreamable: Adjusts config path to Fedora policy Patch1: roundcubemail-1.1.0-confpath.patch +# add .log prefix to all log file names +# see https://github.com/roundcube/roundcubemail/pull/313 +Patch2: roundcubemail-pr313.patch + BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n) %if %{with_phpfpm} @@ -140,6 +144,7 @@ CSS 2. %setup -q -n roundcubemail-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 # fix permissions and remove any .htaccess files find . -type f -print | xargs chmod a-x @@ -264,12 +269,16 @@ rm -rf %{buildroot} %if %{with_phpfpm} %config(noreplace) %{_sysconfdir}/nginx/default.d/%{name}.conf %endif -%attr(0775,root,apache) %dir /var/log/roundcubemail -%attr(0775,root,apache) %dir /var/lib/roundcubemail +%attr(0770,root,apache) %dir /var/log/roundcubemail +%attr(0770,root,apache) %dir /var/lib/roundcubemail %config(noreplace) %{_sysconfdir}/logrotate.d/roundcubemail %changelog +* Mon Dec 28 2015 Remi Collet - 1.1.4-2 +- add .log suffix to all log files, and rotate all #1269164 +- more secure permissions on /var/log and /var/lib #1269155 + * Sun Dec 27 2015 Remi Collet - 1.1.4-1 - update to 1.1.4 - raise dependency on Net_SMTP 1.7.1 -- cgit