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

Location and printer name case sensitivity #700

Closed
michaelrsweet opened this issue May 5, 2004 · 4 comments

Comments

@michaelrsweet
Copy link
Collaborator

commented May 5, 2004

Version: 1.1.19
CUPS.org User: adji.df.uba

I'm using cups-1.1.19-1 and have a printer named /printers/MyPrinter. As I want users to authenticate with Basic Auth to use it, I have a location entry in /etc/cupsd.conf:
<Location /printers/MyPrinter>
AuthType Basic
AuthClass User
Order Deny,Allow
Deny From All
Allow From 192.168.2.*

If a user tries to print to "MyPrinter" (using capital letters) lpr ask for a username/password, but if he uses the name myprinter (in lower case) the job is printed without asking for username and password.
Is it a known bug ? How can i solve it....

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented May 13, 2004

CUPS.org User: mike

Confirmed this problem; will post a patch shortly...

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented May 13, 2004

CUPS.org User: mike

Please try the attached patch and let me know how it works for you...

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented May 13, 2004

CUPS.org User: mike

Fixed in CVS - the anonymous CVS repository will be updated at midnight EST.

@michaelrsweet

This comment has been minimized.

Copy link
Collaborator Author

commented May 26, 2004

"str700.patch":

Index: auth.c

RCS file: /development/cvs/cups/scheduler/auth.c,v
retrieving revision 1.71
diff -u -r1.71 auth.c
--- auth.c 25 Feb 2004 20:14:53 -0000 1.71
+++ auth.c 13 May 2004 14:01:21 -0000
@@ -713,13 +713,35 @@
LogMessage(L_DEBUG2, "FindBest: Location %s Limit %x",
loc->location, loc->limit);

  • if (loc->length > bestlen &&
  •    strncmp(uri, loc->location, loc->length) == 0 &&
    
  • loc->location[0] == '/' &&
  • (limit & loc->limit) != 0)
  • if (!strncmp(uri, "/printers/", 10) ||!strncmp(uri, "/classes/", 9))
    {
  •  best    = loc;
    
  •  bestlen = loc->length;
    
  • /*
    
  •  \* Use case-insensitive comparison for queue names...
    
  •  */
    
  •  if (loc->length > bestlen &&
    
  •      strncasecmp(uri, loc->location, loc->length) == 0 &&
    
  • loc->location[0] == '/' &&
    
  • (limit & loc->limit) != 0)
    
  •  {
    
  • best = loc;
  • bestlen = loc->length;
  •  }
    
  • }
  • else
  • {
  • /*
    
  •  \* Use case-sensitive comparison for other URIs...
    
  •  */
    
  •  if (loc->length > bestlen &&
    
  •      strncmp(uri, loc->location, loc->length) == 0 &&
    
  • loc->location[0] == '/' &&
    
  • (limit & loc->limit) != 0)
    
  •  {
    
  • best = loc;
  • bestlen = loc->length;
  •  }
    
    }
    }
@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
Projects
None yet
1 participant
You can’t perform that action at this time.