previous commit - fix for previous releases

This commit is contained in:
Zdenek Dohnal 2018-12-14 12:21:27 +01:00
parent cbcd84d292
commit 27fa47b60c

View File

@ -15,7 +15,7 @@ Summary: CUPS printing system
Name: cups Name: cups
Epoch: 1 Epoch: 1
Version: 2.2.8 Version: 2.2.8
Release: 9%{?dist} Release: 10%{?dist}
License: GPLv2+ and LGPLv2+ with exceptions and AML License: GPLv2+ and LGPLv2+ with exceptions and AML
Url: http://www.cups.org/ Url: http://www.cups.org/
Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz Source0: https://github.com/apple/cups/releases/download/v%{VERSION}/cups-%{VERSION}-source.tar.gz
@ -528,16 +528,24 @@ lognames=( "error_log" "access_log" "page_log" )
message="This CUPS log has been moved into journal by default unless changes have been made in /etc/cups/cups-files.conf. Log messages can be got by \"$ journalctl -u cups -e\"" message="This CUPS log has been moved into journal by default unless changes have been made in /etc/cups/cups-files.conf. Log messages can be got by \"$ journalctl -u cups -e\""
for ((i=0;i<${#confignames[@]};i++)); for ((i=0;i<${#confignames[@]};i++));
do do
found=`grep -i "${confignames[i]} syslog" /etc/cups/cups-files.conf` found=`%{_bindir}/grep -i "${confignames[i]} syslog" /etc/cups/cups-files.conf`
if [ ! -z "$found" ] if [ ! -z "$found" ]
then then
if [ ! -f %{_localstatedir}/log/cups/${lognames[i]} ] if [ ! -f %{_localstatedir}/log/cups/${lognames[i]} ]
then then
%{_bindir}/touch %{_localstatedir}/log/cups/${lognames[i]} || : %{_bindir}/touch %{_localstatedir}/log/cups/${lognames[i]} || :
fi
perms=`%{_bindir}/ls -lah %{_localstatedir}/log/cups/${lognames[i]} | %{_bindir}/grep -v -e "\-rw-------" -e "root lp"`
if [ ! -z "$perms" ]
then
# we need to set correct permissions and ownership because of possible
# security issues
# we need to have it here, because previous CUPS releases had the bug.
# Checking permissions and ownership here fixes it.
%{_bindir}/chown root:lp %{_localstatedir}/log/cups/${lognames[i]} || : %{_bindir}/chown root:lp %{_localstatedir}/log/cups/${lognames[i]} || :
%{_bindir}/chmod 600 %{_localstatedir}/log/cups/${lognames[i]} || : %{_bindir}/chmod 600 %{_localstatedir}/log/cups/${lognames[i]} || :
fi fi
lastmessage=`%{_bindir}/tail -n 1 %{_localstatedir}/log/cups/${lognames[i]} | grep "$message"` lastmessage=`%{_bindir}/tail -n 1 %{_localstatedir}/log/cups/${lognames[i]} | %{_bindir}/grep "$message"`
if [ -z "$lastmessage" ] if [ -z "$lastmessage" ]
then then
%{_bindir}/echo $message >> %{_localstatedir}/log/cups/${lognames[i]} || : %{_bindir}/echo $message >> %{_localstatedir}/log/cups/${lognames[i]} || :
@ -757,6 +765,9 @@ rm -f %{cups_serverbin}/backend/smb
%{_mandir}/man5/ipptoolfile.5.gz %{_mandir}/man5/ipptoolfile.5.gz
%changelog %changelog
* Fri Dec 14 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.8-10
- previous commit - fix for previous releases
* Thu Dec 13 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.8-9 * Thu Dec 13 2018 Zdenek Dohnal <zdohnal@redhat.com> - 1:2.2.8-9
- logs need to have correct permissions - logs need to have correct permissions