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

URI rewrite for nodomain hosts #1266

Closed
michaelrsweet opened this issue Sep 9, 2005 · 1 comment
Closed

URI rewrite for nodomain hosts #1266

michaelrsweet opened this issue Sep 9, 2005 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2-feature
CUPS.org User: rafal

with the following configuration:

------------------/etc/cups/cupsd.conf----------------
ServerName model.home.net
------------------bash---------------------------
anonymous@model:$ hostname
model
anonymous@model:
$ dnsdomainname
home.net
anonyous@model:$ host model
model.home.net has address 192.168.1.111
-------------/etc/cups/cupsd.conf-------------
| <Location /admin> is:
| Order Deny,Allow
| Deny From All
| Allow From 127.0.0.1
+----------------------------------------------
--------------test.c------------
main() {
if (getdomainname(buff, BSIZE) == 0) {
printf("%s\n", buff);
}
}
-----------------------bash------------
anonymous@model:
/work/tmp$ ./a.out
(none)
----------------t.c------------------
main() {
if (gethostname(buff, BSIZE) == 0) {
printf("%s\n", buff);
}

}

anonymous@model:~/work/tmp$ ./a.out

model

It is NOT possible (due to the above "Deny From All" ACL) to access locations (and thus do administrative tasks) on model's local printers, since {admin_uri} substitution on page provide FQDN of "model.home.net" for those printers. CUPSD assumes those printers are remote to it because gethostname() on model returns none-FQDN. Consequently CUPSD puts complete URI for those printers and this break the above ACL.

Still, the quoted above ACL is security-correct and thus is the default for Debian installations - it should not be adjusted to contain host's local interfaces (like 192.168.1.111 in case of "model" above).

So, I'd like to request that: "When {*_uri} substitution gets none-FQDN hostname from gethostname(), it should proceede with resolver functions to get FQDN of the server host.". Such implementation is suggested in hostname command manpage.

Some more elaborated diagnostic and reasoning may be found on CUPS newsgroup thread containing message:
http://www.cups.org/newsgroups.php?gcups.bugs+v:2651

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

Added a new httpGetHostname() function to the CUPS API, and use it to set both the default ServerName for cupsd.conf and the web interface stuff.

@michaelrsweet michaelrsweet added the enhancement New feature or request label 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
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant