Skip to content
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

Option -h for lp does not override CUPS_SERVER definition #4561

Closed
michaelrsweet opened this issue Jan 12, 2015 · 4 comments
Closed

Option -h for lp does not override CUPS_SERVER definition #4561

michaelrsweet opened this issue Jan 12, 2015 · 4 comments
Labels
duplicate This issue or pull request already exists
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.0.1
CUPS.org User: caribou

If the variable CUPS_SERVER is defined, it is not possible to override its definition by using lp -h {printserver}.

This is caused by a call to _cupsSetDefaults() in the cupsUser() function after the definition of the cups_server by -h. _cupsSetDefaults reset cups_server to the value of CUPS_SERVER without verification of the current value of cups_user.

I will try to propose a potential fix.

The issue is tracked for Ubuntu in the following bug :

http://bugs.launchpad.net/bugs/1352809

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: caribou

Sorry, the second sentence should have read "...without verification of the current value of cups_server"

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: caribou

Hello,

This is a proposed patch for the bug described above. It does a verification that the cg->server global is set or not before assigning the value of the CUPS_SERVER environment variable.

I believe that it should also be done for at least cups_encryption and cups_user that are values that can be received from lp's -E and -U switches.

If the proposed patch is acceptable, I would be more than happy to complete the fix for the two other options.

Kind regards,

...Louis Bouchard
Ubuntu developer

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Dupe of STR #4528.

@michaelrsweet
Copy link
Collaborator Author

"fix_server_env_override.patch":

--- cups/usersys.c.orig 2015-01-12 16:59:01.573908624 +0100
+++ cups/usersys.c 2015-01-13 16:10:48.924259000 +0100
@@ -844,7 +844,12 @@
*/

cups_encryption = getenv("CUPS_ENCRYPTION");

  • cups_server = getenv("CUPS_SERVER");
  • if (!cg->server[0])
  • {
  • cups_server = getenv("CUPS_SERVER");
  • }
  • else
  • cups_server = cg->server;
    #ifdef HAVE_GSSAPI
    cups_gssservicename = getenv("CUPS_GSSSERVICENAME");
    #endif /* HAVE_GSSAPI */

@michaelrsweet michaelrsweet added P0 - Unassigned (New) duplicate This issue or pull request already exists labels Mar 17, 2016
@michaelrsweet michaelrsweet added this to the Stable milestone Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

1 participant