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

cups_finalize_client_conf checks the DOMAINSOCKET for execution bit #4679

Closed
michaelrsweet opened this issue Jul 18, 2015 · 2 comments
Closed

Comments

@michaelrsweet
Copy link
Collaborator

Version: 2.1-current
CUPS.org User: odyx

Yves-Alexis Perez reported that since 2.x, cups clients don't connect to the correct socket: https://bugs.debian.org/792730.

I've tried to debug this, and my analysis is that since 2.x, lpstat -H reports localhost:631 instead of /var/run/cups/cups.sock , even with the socket file as follows in both 1.7 and 2.0:

srw-rw-rw- 1 root root 0 jui 18 12:36 /var/run/cups/cups.sock

I've traced this to be correctible by changing the access checks in cups_finalize_client_conf, with the attached patch.

Does this make sense?

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

Pretty sure exec/search bit should be set on domain sockets, but read/write is enough for this check.

@michaelrsweet
Copy link
Collaborator Author

"fix_local_domainsocket_access_checking.patch":

Description: In absence of client.conf configuration, the default domain socket
(/var/run/cups/cups.sock) will get checked for read, write and execution bits,
but the latter doesn't make sense
Author: Didier Raboud odyx@debian.org
Origin: vendor
Bug-Debian: https://bugs.debian.org/792730
Last-Update: 2015-07-18
--- a/cups/usersys.c
+++ b/cups/usersys.c
@@ -1017,7 +1017,7 @@
struct stat sockinfo; /* Domain socket information */

 if (!stat(CUPS_DEFAULT_DOMAINSOCKET, &sockinfo) &&
  • (sockinfo.st_mode & S_IRWXO) == S_IRWXO)
  • (sockinfo.st_mode & (S_IROTH | S_IWOTH) ) == (S_IROTH | S_IWOTH))
    cups_set_server_name(cc, CUPS_DEFAULT_DOMAINSOCKET);
    else
    #endif /* CUPS_DEFAULT_DOMAINSOCKET */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant