-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adminutil functions break browsing #1993
Comments
CUPS.org User: mike Not sure there is anything we can do about this; the convenience functions specifically override the BrowseAllow/BrowseDeny/BrowseOrder directives on purpose. FWIW, the following:
is the same as:
If you can supply a complete example cupsd.conf file, we'll look at at least making sure that the rewritten cupsd.conf is still usable. |
CUPS.org User: twaugh.redhat Attached. |
CUPS.org User: mike Tim, is that file the "before" or "after" version? The BrowseOrder line is "deny.allow", which isn't technically valid because you have a period (.) instead of a comma (,) separating the words. Anyways, cupsd will still understand it but the end result is the same as "allow all" since there are no deny lines and the default for "deny,allow" is to allow, then process deny lines, and lastly process allow lines. |
CUPS.org User: twaugh.redhat The before version, and I must have accidentally changed the ',' to a '.' (sorry). |
CUPS.org User: twaugh.redhat This problem boils down to the fact that there is no way to alter only one of the advertised server settings -- instead, all must be set. So if I want to diagnose a user problem, I can't ask the user to go to the web interface and turn on server debug logging (CUPS_SERVER_DEBUG_LOGGING) because that will destroy the rest of the config file tweaks they may have made. |
CUPS.org User: mike I'll see if we can do optimizations, at least for the debug toggle. However, any changes will strip the comments from the config file, even if the "content" lines aren't changed... |
CUPS.org User: mike The attached patch seems to provide the functionality you want, looking at the existing cupsd.conf file to determine whether a change has occurred and assuming no change for options that are omitted from the array you pass in... Let me know if you have any issues with this change... |
CUPS.org User: twaugh.redhat It's good, and definitely the right approach. I think there might be one or two bugs in there though. I started with:
I set 'save debugging information', and ended up with these changes: --- /etc/cups/cupsd.conf.orig 2007-02-09 18:07:32.000000000 +0000
I think it's because 'remote_admin' gets set to -1 meaning 'no change', but the 'Location' processing code only compares 'remote_admin > 0':
|
CUPS.org User: mike Attached is a supplemental patch that seems to fix the loss of the Order, Allow, and Deny directives. Let me know if you see any other problems. |
CUPS.org User: twaugh.redhat Works very well here. Thanks! |
"cupsd.conf": MaxLogSize 2000000000 Show general information in error_log.LogLevel info Allow remote accessPort 631 Enable printer sharing and shared printers.Browsing On Allow shared printing and remote administration...Order allow,deny Allow remote administration...Order allow,deny Allow remote access to the configuration files...Order allow,deny |
"str1993.patch": Index: adminutil.c--- adminutil.c (revision 6237)
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings,
if ((val = cupsGetOption(CUPS_SERVER_REMOTE_PRINTERS, num_settings,
if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings,
if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings,
/*
while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum))
@@ -1252,13 +1354,13 @@
@@ -1268,7 +1370,7 @@
@@ -1286,23 +1388,23 @@
|
"str1993p2.patch": Index: adminutil.c--- adminutil.c (revision 6253)
|
Version: 1.2.4
CUPS.org User: twaugh.redhat
STR #1992 probably wouldn't be such a problem if the configuration could be adjusted without having 'BrowseOrder' reset to 'allow,deny' whenever the adminutil functions are used.
Start with a cupsd.conf file with 'BrowseOrder deny,allow' and 'BrowseAllow @Local' in.
Visit http://localhost:631/admin
Toggle 'Save debugging information for troubleshooting'
Click 'Change Settings'
cupsd.conf now has 'BrowseOrder allow,deny'.
The text was updated successfully, but these errors were encountered: