diff options
author | ray <> | 2007-05-10 02:14:35 +0000 |
---|---|---|
committer | ray <> | 2007-05-10 02:14:35 +0000 |
commit | 09a3319504b2620fcd05dbd9ab7b2918bb2f9699 (patch) | |
tree | acafa9749ac3f0dddea8e60d3e77d7dbf9a39cfb /src | |
parent | 9dcb876ffed39cc9b5e7ca91d7960109ea2c246c (diff) | |
download | openbsd-09a3319504b2620fcd05dbd9ab7b2918bb2f9699.tar.gz openbsd-09a3319504b2620fcd05dbd9ab7b2918bb2f9699.tar.bz2 openbsd-09a3319504b2620fcd05dbd9ab7b2918bb2f9699.zip |
Use syslog_r instead of syslog in getaddrinfo. Slowly making
getaddrinfo reentrant.
OK millert@ and deraadt@.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/net/getaddrinfo.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/libc/net/getaddrinfo.c b/src/lib/libc/net/getaddrinfo.c index 21f2094bfd..10a983afcf 100644 --- a/src/lib/libc/net/getaddrinfo.c +++ b/src/lib/libc/net/getaddrinfo.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getaddrinfo.c,v 1.61 2007/02/18 19:03:11 ray Exp $ */ | 1 | /* $OpenBSD: getaddrinfo.c,v 1.62 2007/05/10 02:14:35 ray Exp $ */ |
2 | /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ | 2 | /* $KAME: getaddrinfo.c,v 1.31 2000/08/31 17:36:43 itojun Exp $ */ |
3 | 3 | ||
4 | /* | 4 | /* |
@@ -1065,11 +1065,14 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, | |||
1065 | continue; | 1065 | continue; |
1066 | } | 1066 | } |
1067 | } else if (type != qtype) { | 1067 | } else if (type != qtype) { |
1068 | if (type != T_KEY && type != T_SIG) | 1068 | if (type != T_KEY && type != T_SIG) { |
1069 | syslog(LOG_NOTICE|LOG_AUTH, | 1069 | struct syslog_data sdata = SYSLOG_DATA_INIT; |
1070 | |||
1071 | syslog_r(LOG_NOTICE|LOG_AUTH, &sdata, | ||
1070 | "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", | 1072 | "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"", |
1071 | qname, p_class(C_IN), p_type(qtype), | 1073 | qname, p_class(C_IN), p_type(qtype), |
1072 | p_type(type)); | 1074 | p_type(type)); |
1075 | } | ||
1073 | cp += n; | 1076 | cp += n; |
1074 | continue; /* XXX - had_error++ ? */ | 1077 | continue; /* XXX - had_error++ ? */ |
1075 | } | 1078 | } |
@@ -1077,7 +1080,9 @@ getanswer(const querybuf *answer, int anslen, const char *qname, int qtype, | |||
1077 | case T_A: | 1080 | case T_A: |
1078 | case T_AAAA: | 1081 | case T_AAAA: |
1079 | if (strcasecmp(canonname, bp) != 0) { | 1082 | if (strcasecmp(canonname, bp) != 0) { |
1080 | syslog(LOG_NOTICE|LOG_AUTH, | 1083 | struct syslog_data sdata = SYSLOG_DATA_INIT; |
1084 | |||
1085 | syslog_r(LOG_NOTICE|LOG_AUTH, &sdata, | ||
1081 | AskedForGot, canonname, bp); | 1086 | AskedForGot, canonname, bp); |
1082 | cp += n; | 1087 | cp += n; |
1083 | continue; /* XXX - had_error++ ? */ | 1088 | continue; /* XXX - had_error++ ? */ |