[Freeciv-Dev] [bug #16509] Blank hostname

2010-11-19 Thread pepeto

Update of bug #16509 (project freeciv):

  Status:  Ready For Test => Fixed  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-11-17 Thread pepeto

Update of bug #16509 (project freeciv):

  Status:None => Ready For Test 

___

Additional Item Attachment:

File name: trunk_S2_3_S2_2_blank_hostname.diff Size:1 KB


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-11-03 Thread pepeto

Update of bug #16509 (project freeciv):

 Assigned to:   cazfi => pepeto 
 Planned Release: => 2.2.4, 2.3.0   

___

Follow-up Comment #8:

I will take care of it, just checking for blank strings...


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-09-23 Thread pepeto

Follow-up Comment #7, bug #16509 (project freeciv):

> If the manual page is correct, then Ubuntu getnameinfo() returns
> the numerical address if there is no name. So NI_NAMEREQD would
> not fix this bug, because getnameinfo() provides a numerical
> address, not an empty string.

However, NI_NUMERICHOST is not set the flag of the calling getnameinfo() in
this code. NI_NUMERICSERV is used instead. Maybe this is the error?


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-09-23 Thread pepeto

Follow-up Comment #6, bug #16509 (project freeciv):

>> Do you have an other idea how a connection can get an empty
>> hostname?
>
> * A pointer bug, that drops the name in the wrong buffer?

It is not the case here. 

> * A buffer size that is too small? (But this would probably
> cause a truncated name instead of an empty name.)

It is using NI_MAXHOST, so it's probably not the case here.

> * A bad DNS server that provides "" as name for some address?

I really doubt about it...


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-09-22 Thread George Koehler

Follow-up Comment #5, bug #16509 (project freeciv):

I found an Ubuntu getnameinfo(3) at
http://manpages.ubuntu.com/manpages/maverick/en/man3/getnameinfo.3.html

Further down, it says:



NI_NUMERICHOST
  If  set,  then  the  numeric  form  of the hostname is
returned.
  (When not set, this will still happen in case  the  node's 
name
  cannot be determined.)



If the manual page is correct, then Ubuntu getnameinfo() returns the
numerical address if there is no name. So NI_NAMEREQD would not fix this bug,
because getnameinfo() provides a numerical address, not an empty string.

There is no harm to add NI_NAMEREQD to the code, whether or not it fixes this
bug.

> Do you have an other idea how a connection can get an empty hostname?

* A pointer bug, that drops the name in the wrong buffer?
* A buffer size that is too small? (But this would probably cause a truncated
name instead of an empty name.)
* A bad DNS server that provides "" as name for some address?

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-09-14 Thread pepeto

Follow-up Comment #4, bug #16509 (project freeciv):

On my ubuntu 10.04, I get:

   NI_NAMEREQD
  If  set,  then  an  error  is returned if the hostname cannot
be
  determined.


Which seems quite different. It doesn't mention to return the numerical
address.

> We can use NI_NAMEREQD because there is no reason to get the
> numeric address again; but NI_NAMEREQD would not solve this
> bug. Or would it?

If getnameinfo() doesn't return 0, it would force the server to use the
numerical address got with inet_ntop(). So it probably would fix the bug.
However, I don't know how to reproduce to test.

Do you have an other idea how a connection can get an empty hostname?


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-09-13 Thread George Koehler

Follow-up Comment #3, bug #16509 (project freeciv):

I believe that file #10015, which adds NI_NAMEREQD to getnameinfo(), would
not fix this bug.

>From OpenBSD 'man getnameinfo':



 NI_NAMEREQD   A name is required.  If the host name cannot be found
   in DNS and this flag is set, a non-zero error code is
   returned.  If the host name is not found and the flag
   is not set, the address is returned in numeric form.



If there is no host name, getnameinfo() provides a numeric address. With
NI_NAMEREQD, getnameinfo() would fail. When it fails, Freeciv uses the
numeric adddress from the earlier call to inet_ntop(). The entire effect of
file #10015 would be to use the numeric address instead of the numeric
address.

We can use NI_NAMEREQD because there is no reason to get the numeric address
again; but NI_NAMEREQD would not solve this bug. Or would it?

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-08-25 Thread pepeto

Follow-up Comment #2, bug #16509 (project freeciv):

Supposed fix attached.


(file #10015)
___

Additional Item Attachment:

File name: trunk_S2_2_NI_NAMEREQD.diffSize:0 KB


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-08-22 Thread pepeto

Update of bug #16509 (project freeciv):

 Assigned to:None => cazfi  

___

Follow-up Comment #1:

Probably, we should set the flag NI_NAMEREQD to the call to getnameinfo(),
else if the hostname of the address cannot be resolved, getnameinfo() would
return 0, if I understand correctly the man pages.


___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #16509] Blank hostname

2010-08-21 Thread pepeto

URL:
  

 Summary: Blank hostname
 Project: Freeciv
Submitted by: pepeto
Submitted on: samedi 21.08.2010 à 22:17
Category: general
Severity: 3 - Normal
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 2.2.2
 Discussion Lock: Any
Operating System: None
 Planned Release: 

___

Details:

I have noticed that the hostname could be blank. I don't know the reason, but
it makes lines like:

M.Koray Ak has connected from .
/list: M.Koray Ak from  (player M.Koray Ak) command access level basic
/list: M.Koray Ak (user M.Koray Ak, Human, Team 2, not ready) 1 connection:
/list:   M.Koray Ak from  (command access level basic), bufsize=63kb






___

Reply to this item at:

  

___
  Message posté via/par Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev