Bug 441719

Summary: HTML files and templates should be marked %config(noreplace)
Product: [Fedora] Fedora Reporter: Tim Waugh <twaugh>
Component: cupsAssignee: Tim Waugh <twaugh>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: j.s.peatfield
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.3.7-13.fc10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-25 00:18:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 438944    
Attachments:
Description Flags
My hack to cups-1.3.4+ to log but not reject bad locale none

Description Tim Waugh 2008-04-09 17:05:12 UTC
Description of problem:
The HTML files and templates in %{_datadir}/%{name}/www should probably be
marked %config(noreplace) to allow for site-local modifications.

Version-Release number of selected component (if applicable):
cups-1.3.7-1.fc8

Comment 1 Jonathan Peatfield 2008-04-10 01:03:24 UTC
Sorry for not opening a bugzilla myself, but that 

I don't suppose you want to add in a couple of patches that have already been
rejected by the upstream maintainer do you?

One is to allow old cups clients (with users having non-UTF8 locales) to submit
jobs (e.g. EL3 cups-1.1 with LANG=C etc). [ old cups clients use the charset
from the user's locale in the IPP requests but new cups servers reject all
requests which arn't using UTF8, the patch allows them but logs a warning for
each 'bad' job ]

The other is a hack we use to call external code to map usernames in ipp
requests according to the host that submitted them.  The patch adds a new
cupsd.conf option to turn this on and specify what to call.  I doubt that it
would be of much interest to anyone but this site. [ we use it to map the IPP
supplied username to who we know they authenticated to the network as (for
users' own laptops etc) ]

I promise I won't be offended if you say no.

 -- Jon


Comment 2 Tim Waugh 2008-04-10 10:13:44 UTC
For the non-UTF-8 clients issue we have actually applied such a patch (although
without a warning logged -- that would be useful to add) in Fedora 8.  I'd like
to try Fedora 9 without that; hopefully all the Fedora 9 CUPS clients convert to
UTF-8 now.  We may have to ship an update that accepts non-UTF-8 clients again
as in Fedora 8, but I'd rather stick more closely to upstream.

As for the username mapper, I am extremely wary of adding configuration options
that do not exist upstream.  Perhaps that feature could be provided by the
Kerberos support in CUPS?

Thanks for the offer.

Comment 3 Jonathan Peatfield 2008-05-02 04:17:16 UTC
Created attachment 304360 [details]
My hack to cups-1.3.4+ to log but not reject bad locale

I'd intended to include this ages ago, but other things got in the way.  Of
course the patch is a bit of a hack in that it just comments out the failure...


There are probably cleaner ways to do it.  I do want the 'log hostname' part
though or we would never know which clients are running the old versions.

Since we allow users to connect their own laptops (ha!) we can't force them to
be running anything very recent, though I suppose rejecting their print jobs
might be a big hint...

 -- Jon

Comment 4 Jonathan Peatfield 2008-05-02 04:23:04 UTC
BTW I did consider making the locale rejection (or not) something which could be
set in cupsd.conf but it didn't seem like it would get accepted upstream anyway.

Still RHEL-4 shipped with cups-1.1 and RHEL-5 with cups-1.2.4 so there will be
lots of older clients out there for a while yet.


Comment 5 Tim Waugh 2008-05-02 07:18:30 UTC
(In reply to comment #3)
> I do want the 'log hostname' part though or we would never know
> which clients are running the old versions.

Good idea.  I've added that to the patch we're carrying for Fedora 8.  That
patch isn't yet shipped, but will go out with the next Fedora 8 update for cups.

Comment 6 Fedora Update System 2008-08-03 14:00:59 UTC
cups-1.3.8-1.fc9 has been submitted as an update for Fedora 9

Comment 7 Jonathan Peatfield 2008-08-04 22:50:30 UTC
I can't see the source for cups-1.3.8-1.fc9 yet, but I was just browsing though the specfile that comes with cups-1.3.8-1.fc10.src.rpm and it doesn't seem to actually mark the templates (ie .tmpl files) as %config.

Now this may be different in the fc9 version but in case it isn't it might be worth checking.

In my previous patch we added something like:

@@ -456,6 +444,10 @@
 %{_datadir}/cups/fonts
 %{_datadir}/cups/model
 %{_datadir}/cups/templates
+# Mark all the .tmpl files as config files... (well _I_ want to edit them!) JSP
+%config(noreplace) %{_datadir}/cups/templates/*.tmpl
+%config(noreplace) %{_datadir}/cups/templates/*/*.tmpl
+#
 %{_datadir}/locale/*/*
 %{_datadir}/ppd
 %dir %attr(1770,root,lp) /var/spool/cups/tmp

Not that I am actually editing them at the moment...

BTW why do these entries get .../cups/... while in most places it is done as .../%{name}/...?

I'm currently experimenting with the recent str2101 patch since one of our users got confused by the infinite password prompting the other week...

Comment 8 Tim Waugh 2008-08-05 08:38:16 UTC
(In reply to comment #7)
> +%config(noreplace) %{_datadir}/cups/templates/*.tmpl
> +%config(noreplace) %{_datadir}/cups/templates/*/*.tmpl

Yes, I'd missing the /templates/ bits.  These lines on their own will generate 'duplicate' warnings from rpmbuild, as the previous line just naming the directory includes the those files already.

I've checked in a more complete fix.

Comment 9 Fedora Update System 2008-08-07 23:56:42 UTC
cups-1.3.8-2.fc9 has been pushed to the Fedora 9 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update cups'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F9/FEDORA-2008-7093

Comment 10 Tim Waugh 2008-08-11 11:31:42 UTC
All looks OK to me.  Jonathan?

Comment 11 Jonathan Peatfield 2008-08-11 11:58:47 UTC
I obviously am not looking in the right places 'cos I can't find the cups-1.3.8-2.fc9 srpm anywhere.

Oh, wait I just spotted it in fedora/updates/testing/9/SRPMS/ so I'll take a look shortly...

 -- Jon

Comment 12 Fedora Update System 2008-09-25 00:18:03 UTC
cups-1.3.8-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.