summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjmc <>2003-08-28 10:16:38 +0000
committerjmc <>2003-08-28 10:16:38 +0000
commit1d71d09c8858fe5ff65bec02fd357b3f276e6e8b (patch)
treec5758e1b56741a1ee92c9d3481eae0f19bb84279 /src/lib
parent0e63a127c5e6f5d7db30ee252127966473dd8a0a (diff)
downloadopenbsd-1d71d09c8858fe5ff65bec02fd357b3f276e6e8b.tar.gz
openbsd-1d71d09c8858fe5ff65bec02fd357b3f276e6e8b.tar.bz2
openbsd-1d71d09c8858fe5ff65bec02fd357b3f276e6e8b.zip
tweak;
ok itojun@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/net/getnameinfo.320
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libc/net/getnameinfo.3 b/src/lib/libc/net/getnameinfo.3
index d99d98f50d..3b3a0fd290 100644
--- a/src/lib/libc/net/getnameinfo.3
+++ b/src/lib/libc/net/getnameinfo.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: getnameinfo.3,v 1.26 2003/08/28 09:47:47 itojun Exp $ 1.\" $OpenBSD: getnameinfo.3,v 1.27 2003/08/28 10:16:38 jmc Exp $
2.\" $KAME: getnameinfo.3,v 1.20 2001/01/05 13:37:37 itojun Exp $ 2.\" $KAME: getnameinfo.3,v 1.20 2001/01/05 13:37:37 itojun Exp $
3.\" 3.\"
4.\" Copyright (c) 1983, 1987, 1991, 1993 4.\" Copyright (c) 1983, 1987, 1991, 1993
@@ -283,22 +283,22 @@ and documented in
283The implementation first appeared in WIDE Hydrangea IPv6 protocol stack kit. 283The implementation first appeared in WIDE Hydrangea IPv6 protocol stack kit.
284.\" 284.\"
285.Sh CAVEATS 285.Sh CAVEATS
286.Nm 286.Fn getnameinfo
287returns both numeric and FQDN notation of the address specified in 287returns both numeric and FQDN notation of the address specified in
288.Fa sa . 288.Fa sa .
289There is no return value that indicates if the string returned in 289There is no return value that indicates if the string returned in
290.Fa host 290.Fa host
291is a result of binary to numeric-text translation (like 291is a result of binary to numeric-text translation (like
292.Xr inet_ntop 3) , 292.Xr inet_ntop 3 ) ,
293or the result of DNS reverse lookup. 293or the result of DNS reverse lookup.
294Therefore, malicious parties could set up PTR record like below: 294Therefore, malicious parties could set up a PTR record as below:
295.Bd -literal -offset indent 295.Bd -literal -offset indent
2961.0.0.127.in-addr.arpa. IN PTR 10.1.1.1 2961.0.0.127.in-addr.arpa. IN PTR 10.1.1.1
297.Ed 297.Ed
298.Pp 298.Pp
299and trick the caller of 299and trick the caller of
300.Nm 300.Fn getnameinfo
301to believe that 301into believing that
302.Fa sa 302.Fa sa
303is 303is
304.Li 10.1.1.1 304.Li 10.1.1.1
@@ -306,10 +306,10 @@ when it actually is
306.Li 127.0.0.1 . 306.Li 127.0.0.1 .
307.Pp 307.Pp
308To prevent such attacks, the use of 308To prevent such attacks, the use of
309.Li NI_NAMEREQD 309.Dv NI_NAMEREQD
310like below is recommended when you use the result of 310is recommended when you use the result of
311.Nm 311.Fn getnameinfo
312for access control purposes. 312for access control purposes:
313.Bd -literal -offset indent 313.Bd -literal -offset indent
314struct sockaddr *sa; 314struct sockaddr *sa;
315socklen_t salen; 315socklen_t salen;