Bug 441719 - HTML files and templates should be marked %config(noreplace)
HTML files and templates should be marked %config(noreplace)
Product: Fedora
Classification: Fedora
Component: cups (Show other bugs)
All Linux
low Severity low
: ---
: ---
Assigned To: Tim Waugh
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks: F10Target
  Show dependency treegraph
Reported: 2008-04-09 13:05 EDT by Tim Waugh
Modified: 2008-09-24 20:18 EDT (History)
1 user (show)

See Also:
Fixed In Version: 1.3.7-13.fc10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-09-24 20:18:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
My hack to cups-1.3.4+ to log but not reject bad locale (1.32 KB, patch)
2008-05-02 00:17 EDT, Jonathan Peatfield
no flags Details | Diff

  None (edit)
Description Tim Waugh 2008-04-09 13:05:12 EDT
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):
Comment 1 Jonathan Peatfield 2008-04-09 21:03:24 EDT
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 06:13:44 EDT
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 00:17:16 EDT
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 00:23:04 EDT
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 03:18:30 EDT
(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 10:00:59 EDT
cups-1.3.8-1.fc9 has been submitted as an update for Fedora 9
Comment 7 Jonathan Peatfield 2008-08-04 18:50:30 EDT
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 @@
+# 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
 %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 04:38:16 EDT
(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 19:56:42 EDT
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 07:31:42 EDT
All looks OK to me.  Jonathan?
Comment 11 Jonathan Peatfield 2008-08-11 07:58:47 EDT
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-24 20:18:03 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.