* [patch] Underscore in hostnames
@ 2006-12-07 23:22 Fabio Olive Leite
2006-12-11 3:56 ` Ian Kent
0 siblings, 1 reply; 11+ messages in thread
From: Fabio Olive Leite @ 2006-12-07 23:22 UTC (permalink / raw)
To: autofs
Hi all,
Even though underscores are not really valid in hostnames, many people
use them and they seem to be tolerated in many places. So I propose
the one-liner below to see what you think.
This one-liner adds underscore as a valid hostname character for NFS
mounts.
Signed-off-by: Fabio Olive Leite <fleite@redhat.com>
---
parse_sun.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/parse_sun.c b/modules/parse_sun.c
index 6f10a4f..c849ff3 100644
--- a/modules/parse_sun.c
+++ b/modules/parse_sun.c
@@ -691,7 +691,7 @@ static int validate_location(char *loc)
if (check_colon(ptr)) {
while (*ptr && *ptr != ':') {
if (!(isalnum(*ptr) ||
- *ptr == '-' || *ptr == '.' ||
+ *ptr == '-' || *ptr == '.' || *ptr == '_' ||
*ptr == ',' || *ptr == '(' || *ptr == ')'))
return 0;
ptr++;
Kind regards,
Fábio
--
ex sed lex awk yacc, e pluribus unix, amem
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-07 23:22 [patch] Underscore in hostnames Fabio Olive Leite
@ 2006-12-11 3:56 ` Ian Kent
2006-12-11 12:05 ` Fabio Olive Leite
0 siblings, 1 reply; 11+ messages in thread
From: Ian Kent @ 2006-12-11 3:56 UTC (permalink / raw)
To: Fabio Olive Leite; +Cc: autofs
On Thu, 2006-12-07 at 21:22 -0200, Fabio Olive Leite wrote:
> Hi all,
>
> Even though underscores are not really valid in hostnames, many people
> use them and they seem to be tolerated in many places. So I propose
> the one-liner below to see what you think.
Not valid at all.
And they are tolerated because the admin explicitly configures DNS to
violate the RFC.
>
> This one-liner adds underscore as a valid hostname character for NFS
> mounts.
I'm not keen on this in the core package.
We could create a contrib directory and put it there and add something
to the README.
>
> Signed-off-by: Fabio Olive Leite <fleite@redhat.com>
> ---
>
> parse_sun.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/parse_sun.c b/modules/parse_sun.c
> index 6f10a4f..c849ff3 100644
> --- a/modules/parse_sun.c
> +++ b/modules/parse_sun.c
> @@ -691,7 +691,7 @@ static int validate_location(char *loc)
> if (check_colon(ptr)) {
> while (*ptr && *ptr != ':') {
> if (!(isalnum(*ptr) ||
> - *ptr == '-' || *ptr == '.' ||
> + *ptr == '-' || *ptr == '.' || *ptr == '_' ||
> *ptr == ',' || *ptr == '(' || *ptr == ')'))
> return 0;
> ptr++;
>
> Kind regards,
> Fábio
_______________________________________________
autofs mailing list
autofs@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/autofs
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 3:56 ` Ian Kent
@ 2006-12-11 12:05 ` Fabio Olive Leite
2006-12-11 14:16 ` Jeff Moyer
0 siblings, 1 reply; 11+ messages in thread
From: Fabio Olive Leite @ 2006-12-11 12:05 UTC (permalink / raw)
To: autofs
On Mon, Dec 11, 2006 at 12:56:31PM +0900, Ian Kent wrote:
>
> Not valid at all.
> And they are tolerated because the admin explicitly configures DNS to
> violate the RFC.
The sad thing is that mount(1) does no such validation, and allows one
to mount an NFS export on a hostname containing underscores just fine.
So we can end up in a situation where automount does not allow the
user to configure a working NFS mount she has.
Regards,
Fábio
--
ex sed lex awk yacc, e pluribus unix, amem
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 12:05 ` Fabio Olive Leite
@ 2006-12-11 14:16 ` Jeff Moyer
2006-12-11 15:34 ` Ian Kent
0 siblings, 1 reply; 11+ messages in thread
From: Jeff Moyer @ 2006-12-11 14:16 UTC (permalink / raw)
To: autofs
==> On Mon, 11 Dec 2006 10:05:07 -0200, Fabio Olive Leite <fleite@redhat.com> said:
Fabio> On Mon, Dec 11, 2006 at 12:56:31PM +0900, Ian Kent wrote:
Fabio> >
Fabio> > Not valid at all.
Fabio> > And they are tolerated because the admin explicitly configures DNS to
Fabio> > violate the RFC.
Fabio> The sad thing is that mount(1) does no such validation, and allows one
Fabio> to mount an NFS export on a hostname containing underscores just fine.
Fabio> So we can end up in a situation where automount does not allow the
Fabio> user to configure a working NFS mount she has.
Yes, and when coupled with the fact that some other vendors' products
allow this sort of thing by default, I think we may have to support
it. I'm a big fan of sticking to the RFC's, but in this case, I think
we should make an exception.
-Jeff
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 14:16 ` Jeff Moyer
@ 2006-12-11 15:34 ` Ian Kent
2006-12-11 15:57 ` Peter Staubach
0 siblings, 1 reply; 11+ messages in thread
From: Ian Kent @ 2006-12-11 15:34 UTC (permalink / raw)
To: Jeff Moyer; +Cc: autofs
On Mon, 2006-12-11 at 09:16 -0500, Jeff Moyer wrote:
> ==> On Mon, 11 Dec 2006 10:05:07 -0200, Fabio Olive Leite <fleite@redhat.com> said:
>
> Fabio> On Mon, Dec 11, 2006 at 12:56:31PM +0900, Ian Kent wrote:
> Fabio> >
> Fabio> > Not valid at all.
> Fabio> > And they are tolerated because the admin explicitly configures DNS to
> Fabio> > violate the RFC.
>
> Fabio> The sad thing is that mount(1) does no such validation, and allows one
> Fabio> to mount an NFS export on a hostname containing underscores just fine.
> Fabio> So we can end up in a situation where automount does not allow the
> Fabio> user to configure a working NFS mount she has.
>
> Yes, and when coupled with the fact that some other vendors' products
> allow this sort of thing by default, I think we may have to support
> it. I'm a big fan of sticking to the RFC's, but in this case, I think
> we should make an exception.
Ya .. I reality I don't feel as strongly as I made out.
I did want to see if there was anyone else that did have an opinion
though.
I'll merge the patch unless anyone else feels strongly against it.
Ian
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 15:34 ` Ian Kent
@ 2006-12-11 15:57 ` Peter Staubach
2006-12-11 16:17 ` Jeff Moyer
2006-12-11 16:20 ` Ian Kent
0 siblings, 2 replies; 11+ messages in thread
From: Peter Staubach @ 2006-12-11 15:57 UTC (permalink / raw)
To: Ian Kent; +Cc: autofs
Ian Kent wrote:
> On Mon, 2006-12-11 at 09:16 -0500, Jeff Moyer wrote:
>
>> ==> On Mon, 11 Dec 2006 10:05:07 -0200, Fabio Olive Leite <fleite@redhat.com> said:
>>
>> Fabio> On Mon, Dec 11, 2006 at 12:56:31PM +0900, Ian Kent wrote:
>> Fabio> >
>> Fabio> > Not valid at all.
>> Fabio> > And they are tolerated because the admin explicitly configures DNS to
>> Fabio> > violate the RFC.
>>
>> Fabio> The sad thing is that mount(1) does no such validation, and allows one
>> Fabio> to mount an NFS export on a hostname containing underscores just fine.
>> Fabio> So we can end up in a situation where automount does not allow the
>> Fabio> user to configure a working NFS mount she has.
>>
>> Yes, and when coupled with the fact that some other vendors' products
>> allow this sort of thing by default, I think we may have to support
>> it. I'm a big fan of sticking to the RFC's, but in this case, I think
>> we should make an exception.
>>
>
> Ya .. I reality I don't feel as strongly as I made out.
>
> I did want to see if there was anyone else that did have an opinion
> though.
>
> I'll merge the patch unless anyone else feels strongly against it.
Do we know which other vendors products support '_' as a valid character
in a hostname?
I might be more in favor of fixing the NFS mount code than modifying
autofs in this fashion.
Thanx...
ps
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 15:57 ` Peter Staubach
@ 2006-12-11 16:17 ` Jeff Moyer
2006-12-11 16:58 ` Fabio Olive Leite
2006-12-11 16:20 ` Ian Kent
1 sibling, 1 reply; 11+ messages in thread
From: Jeff Moyer @ 2006-12-11 16:17 UTC (permalink / raw)
To: Peter Staubach; +Cc: autofs, Ian Kent
==> On Mon, 11 Dec 2006 10:57:11 -0500, Peter Staubach <staubach@redhat.com> said:
Peter> I might be more in favor of fixing the NFS mount code than modifying
Peter> autofs in this fashion.
If you want to disallow this, then surely it is best to simply "fix"
the name resolution routines in libc. At this point, however, that
could be viewed as a regression.
-Jeff
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 15:57 ` Peter Staubach
2006-12-11 16:17 ` Jeff Moyer
@ 2006-12-11 16:20 ` Ian Kent
1 sibling, 0 replies; 11+ messages in thread
From: Ian Kent @ 2006-12-11 16:20 UTC (permalink / raw)
To: Peter Staubach; +Cc: autofs
On Mon, 2006-12-11 at 10:57 -0500, Peter Staubach wrote:
> Ian Kent wrote:
> > On Mon, 2006-12-11 at 09:16 -0500, Jeff Moyer wrote:
> >
> >> ==> On Mon, 11 Dec 2006 10:05:07 -0200, Fabio Olive Leite <fleite@redhat.com> said:
> >>
> >> Fabio> On Mon, Dec 11, 2006 at 12:56:31PM +0900, Ian Kent wrote:
> >> Fabio> >
> >> Fabio> > Not valid at all.
> >> Fabio> > And they are tolerated because the admin explicitly configures DNS to
> >> Fabio> > violate the RFC.
> >>
> >> Fabio> The sad thing is that mount(1) does no such validation, and allows one
> >> Fabio> to mount an NFS export on a hostname containing underscores just fine.
> >> Fabio> So we can end up in a situation where automount does not allow the
> >> Fabio> user to configure a working NFS mount she has.
> >>
> >> Yes, and when coupled with the fact that some other vendors' products
> >> allow this sort of thing by default, I think we may have to support
> >> it. I'm a big fan of sticking to the RFC's, but in this case, I think
> >> we should make an exception.
> >>
> >
> > Ya .. I reality I don't feel as strongly as I made out.
> >
> > I did want to see if there was anyone else that did have an opinion
> > though.
> >
> > I'll merge the patch unless anyone else feels strongly against it.
>
> Do we know which other vendors products support '_' as a valid character
> in a hostname?
Bind can be configured to allow it, as you probably know, but the
default has been to not allow it for several years now.
I guess that many sites that have Windows machines with '_' in host
names configure DNS to allow them or they probably use the Windows DNS.
Ian
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 16:17 ` Jeff Moyer
@ 2006-12-11 16:58 ` Fabio Olive Leite
2006-12-13 3:03 ` Ian Kent
0 siblings, 1 reply; 11+ messages in thread
From: Fabio Olive Leite @ 2006-12-11 16:58 UTC (permalink / raw)
To: autofs
On Mon, Dec 11, 2006 at 11:17:31AM -0500, Jeff Moyer wrote:
>
> If you want to disallow this, then surely it is best to simply "fix"
> the name resolution routines in libc. At this point, however, that
> could be viewed as a regression.
Even though I do my own RFC evangelizing at times, I can't help but
think: why limit automount with a hostname validation routine when
automount is *not* the authoritative entity that decides what is a
valid hostname? Will you want to patch automount again whenever the
RFCs get updated?
automount should regard the hostname as a string, and if it can be
resolved, great. If it cannot, complain in the logs and exit. But it
should not enforce validation on top of something that can be
redefined under its feet anytime in the future.
Will you also include validation for bracketed IPv6 literals? And
whatever comes next?
Two additional cents...
Fábio
--
ex sed lex awk yacc, e pluribus unix, amem
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-11 16:58 ` Fabio Olive Leite
@ 2006-12-13 3:03 ` Ian Kent
2006-12-13 13:26 ` Peter Staubach
0 siblings, 1 reply; 11+ messages in thread
From: Ian Kent @ 2006-12-13 3:03 UTC (permalink / raw)
To: Fabio Olive Leite; +Cc: autofs
On Mon, 2006-12-11 at 14:58 -0200, Fabio Olive Leite wrote:
> On Mon, Dec 11, 2006 at 11:17:31AM -0500, Jeff Moyer wrote:
> >
> > If you want to disallow this, then surely it is best to simply "fix"
> > the name resolution routines in libc. At this point, however, that
> > could be viewed as a regression.
I've thought more about this and Peter certainly has a valid concern.
However, I think that the decision as to whether a host name may contain
an "_" is the responsibility of the service that resolves names, such as
FNS, and not of an application that uses the names. If the name resolves
I think we should just use it.
So I'm going to add the original patch when I get a chance..
>
> Even though I do my own RFC evangelizing at times, I can't help but
> think: why limit automount with a hostname validation routine when
> automount is *not* the authoritative entity that decides what is a
> valid hostname? Will you want to patch automount again whenever the
> RFCs get updated?
>
> automount should regard the hostname as a string, and if it can be
> resolved, great. If it cannot, complain in the logs and exit. But it
> should not enforce validation on top of something that can be
> redefined under its feet anytime in the future.
>
> Will you also include validation for bracketed IPv6 literals? And
> whatever comes next?
Basically, yes.
I want input validation and will have to deal with it as and when
needed.
Ian
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [patch] Underscore in hostnames
2006-12-13 3:03 ` Ian Kent
@ 2006-12-13 13:26 ` Peter Staubach
0 siblings, 0 replies; 11+ messages in thread
From: Peter Staubach @ 2006-12-13 13:26 UTC (permalink / raw)
To: Ian Kent; +Cc: autofs
Ian Kent wrote:
> On Mon, 2006-12-11 at 14:58 -0200, Fabio Olive Leite wrote:
>
>> On Mon, Dec 11, 2006 at 11:17:31AM -0500, Jeff Moyer wrote:
>>
>>> If you want to disallow this, then surely it is best to simply "fix"
>>> the name resolution routines in libc. At this point, however, that
>>> could be viewed as a regression.
>>>
>
> I've thought more about this and Peter certainly has a valid concern.
>
> However, I think that the decision as to whether a host name may contain
> an "_" is the responsibility of the service that resolves names, such as
> FNS, and not of an application that uses the names. If the name resolves
> I think we should just use it.
>
>
This sounds very reasonable to me.
ps
> So I'm going to add the original patch when I get a chance..
>
>
>> Even though I do my own RFC evangelizing at times, I can't help but
>> think: why limit automount with a hostname validation routine when
>> automount is *not* the authoritative entity that decides what is a
>> valid hostname? Will you want to patch automount again whenever the
>> RFCs get updated?
>>
>> automount should regard the hostname as a string, and if it can be
>> resolved, great. If it cannot, complain in the logs and exit. But it
>> should not enforce validation on top of something that can be
>> redefined under its feet anytime in the future.
>>
>> Will you also include validation for bracketed IPv6 literals? And
>> whatever comes next?
>>
>
> Basically, yes.
> I want input validation and will have to deal with it as and when
> needed.
>
> Ian
>
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs
>
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2006-12-13 13:26 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-07 23:22 [patch] Underscore in hostnames Fabio Olive Leite
2006-12-11 3:56 ` Ian Kent
2006-12-11 12:05 ` Fabio Olive Leite
2006-12-11 14:16 ` Jeff Moyer
2006-12-11 15:34 ` Ian Kent
2006-12-11 15:57 ` Peter Staubach
2006-12-11 16:17 ` Jeff Moyer
2006-12-11 16:58 ` Fabio Olive Leite
2006-12-13 3:03 ` Ian Kent
2006-12-13 13:26 ` Peter Staubach
2006-12-11 16:20 ` Ian Kent
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.