Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1235035

Summary: cups rpm postinstall scriptlet error
Product: Red Hat Enterprise Linux 7 Reporter: jdundas
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: qe-baseos-daemons
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.3CC: jdundas, jscotka, psklenar
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: cups-1.6.3-20.el7 Doc Type: Bug Fix
Doc Text:
Cause: Some cupsd.conf and cups-files.conf configuration directives have names that are themselves a prefix for another configuration directive, for example PageLog and PageLogFormat, and AccessLog and AccessLogLevel. The post-install script for cups alters cupsd.conf and cups-files.conf if it finds configuration directives in cupsd.conf that should now be in cups-files.conf, such as PageLog and AccessLog. However, that check would also move configuration directives that had longer names starting with the same keyword, such as PageLogFormat and AccessLogLevel. Consequence: The CUPS scheduler would log an error and fail to start. Fix: The post-install script has been adjusted so that only exactly-matching keywords are moved. It also comments out PageLogFormat and AccessLogLevel configuration directives if they are found in cups-files.conf. Result: The CUPS scheduler now starts without error.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 12:10:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jdundas 2015-06-23 20:17:12 UTC
Description of problem:

Updating the cups package can break the configuration files for cups, and then when the post-install script tries to restart cups upon update the service fails to start.  A post-install scriptlet in the RPM moves a configuration setting that it should not causing the daemon to not start due to configuration error.

Version-Release number of selected component (if applicable):

cups-1.6.3-17.el7_1.1.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Configure cups to run as a network print server
2. set AccessLogLevel all in cupsd.conf (for say, some basic page accounting)
3. update cups

Actual results:
updating cups moves the AccessLogLevel paraemeter into cups-files.conf, which the daemon reads as a configuration error and fails to start.

Expected results:
cups daemon is restarted after update

Additional info:

When extracted via rpm, the first post install scriptlet contains:
-- BEGIN PASTE --
# Deal with config migration due to CVE-2012-5519 (STR #4223)
IN=/etc/cups/cupsd.conf
OUT=/etc/cups/cups-files.conf
copiedany=no
for keyword in AccessLog CacheDir ConfigFilePerm        \
    DataDir DocumentRoot ErrorLog FatalErrors           \
    FileDevice FontPath Group LogFilePerm               \
    LPDConfigFile PageLog Printcap PrintcapFormat       \
    RemoteRoot RequestRoot ServerBin ServerCertificate  \
    ServerKey ServerRoot SMBConfigFile StateDir         \
    SystemGroup SystemGroupAuthKey TempDir User; do
    if ! [ -f "$IN" ] || ! /bin/grep -iq ^$keyword "$IN"; then continue; fi
    copy=yes
    if /bin/grep -iq ^$keyword "$OUT"; then
        if [ "`/bin/grep -i ^$keyword "$IN"`" ==        \
             "`/bin/grep -i ^$keyword "$OUT"`" ]; then
            copy=no
        else
            /bin/sed -i -e "s,^$keyword,#$keyword,i" "$OUT" || :
        fi
    fi
    if [ "$copy" == "yes" ]; then
        if [ "$copiedany" == "no" ]; then
            (cat >> "$OUT" <<EOF
-- END PASTE --

the first 'keyword' in the for clause will also grab the AccessLogLevel parameter if it is set in cupsd.conf, remove it, and improperly place it in cups-files.conf .

Comment 6 errata-xmlrpc 2015-11-19 12:10:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2386.html