[pve-devel] [PATCH] INotify.pm: Correct read_etc_resolv_conf search filter

damien piquet piqudam at gmail.com
Fri Mar 8 12:20:27 CET 2013


That seems a good idea.

We should also change the field name in web interface to keep it clear.

2013/3/8 Dietmar Maurer <dietmar at proxmox.com>:
>> That's what I think too. We are using search as if it was domain. In fact, domain
>> defines the domain the computer is actually on, search field defines the domain
>> where to resolve relatives names.
>>
>> I think we must not use search field when creating ssl certificates !
>
> yes, only use 'domain'
>
>> So we need to modify resolv.conf reader. Do we add domain modification in
>> web interface?
>
> yes. Maybe we just replace 'search' with 'domain'? Because 'search' is not needed
> most times and will only confuse users?
>
>>
>> 2013/3/8 Dietmar Maurer <dietmar at proxmox.com>:
>> > I just re-read 'man resolv.conf', and I think we should not merge
>> > 'domain' and 'search', and return both values instead?
>> >
>> >> diff --git a/data/PVE/INotify.pm b/data/PVE/INotify.pm index
>> >> 850668a..0d871d9 100644
>> >> --- a/data/PVE/INotify.pm
>> >> +++ b/data/PVE/INotify.pm
>> >> @@ -536,7 +536,7 @@ sub read_etc_resolv_conf {
>> >>      my $nscount = 0;
>> >>      while (my $line = <$fh>) {
>> >>       chomp $line;
>> >> -     if ($line =~ m/^(search|domain)\s+(\S+)\s*/) {
>> >> +     if ($line =~ m/^(search|domain)\s+(.+)/) {
>> >>           $res->{search} = $2;
>> >>       } elsif ($line =~
>> >> m/^nameserver\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s*/) {
>> >>           $nscount++;
>> >> --
>> >> 1.7.10.4
>> >
>
>



More information about the pve-devel mailing list