proposal for file: uri standard

Alexander Larsson alexl at redhat.com
Fri Apr 9 23:19:05 EEST 2004


On Wed, 2004-04-07 at 17:22, John Dennis wrote:
> I assume the issue here is whether the hostname is FQDN (Fully Qualified
> Domain Name). gethostname may or may not return a FQDN. It is not a
> misconfiguration or error if the name returned by gethostname is not
> FQDN. Further it is not an error (but bad practice) for the returned
> hostname to not match the DNS name of the host (this can occur if you
> call sethostname). Using gethostbyname should return the DNS FQDN, which
> is much more canonical and I think is more in line with the desired
> result.

What would you pass to gethostbyname? What if the machine in question
has no real FQDN that makes sense (as is the case for many non-syadmined
machines with e.g. dialup connections)? What if you have several
interfaces with different names on?

The number one priority is to get a name that is unique for all apps
generating the hostname for the uri so that strcmp() works to detect if
the hostname in a uri is from the same host. Everything else is just
gravy, which on a well configured system will allow you to do some magic
to handle files on remote machines.

> Just as a nit, and I'm not 100% sure about this, if some has reset the
> hostname I'm not sure passing that to gethostbyname will do the right
> thing, it might be better to call gethostbyaddr. But that's a real
> corner case and I wouldn't lose sleep over it. I think the real issue is
> that its not unusual for gethostname to return a hostname without its
> domain information.

Frequently machines that do this also have no sane fqdn. Its also not
insane to assume that fancy handling of remote hosts in file:// uris
only work well if you set up gethostname() on the remote machine to
return a fqdn.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a maverick drug-addicted messiah on the edge. She's a supernatural punk 
politician who dreams of becoming Elvis. They fight crime! 





More information about the xdg mailing list