Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] Submitter DNS name resolution and forgery detection

2013-08-15 by Hajimu UMEMOTO

Hi,

>>>>> On Thu, 15 Aug 2013 16:14:51 +0200
>>>>> manu@... said:

> Jim Klimov <jimklimov@...> wrote:
>
> Addon to previous review: I do not quite see how this routine does
> NOT change the original string in addr in case of any lookup errors?
> Did I miss something (i.e. maybe getnameinfo() does not modify it
> upon failure - always on all platforms)?

manu> Good question. Anyone has an experience of that?

If NI_NAMEREQD is not specified, getnameinfo(3) copies a result on
success, and copies a numeric form of the node's address on fail.
AFAIK, if NI_NAMEREQD is specified, getnameinfo(3) on BSDs copies a
result only on success, and doesn't touch addr on fail.  However, I'm
not sure if there is such implementation that changes addr on fail.
POSIX says only on success:

    Upon successful completion, getnameinfo() shall return the node
    and service names, if requested, in the buffers provided. The
    returned names are always null-terminated strings.

Sincerely,

--
Hajimu UMEMOTO
ume@...  ume@{,jp.}FreeBSD.org
http://www.mahoroba.org/~ume/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.