Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
a009d03a
Commit
a009d03a
authored
Oct 03, 2017
by
Mark Andrews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4748. [cleanup] Sprintf to snprintf coversions. [RT #46132]
parent
7cb14b61
Changes
55
Hide whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
179 additions
and
146 deletions
+179
-146
CHANGES
CHANGES
+2
-0
bin/dnssec/dnssec-signzone.c
bin/dnssec/dnssec-signzone.c
+5
-4
bin/named/server.c
bin/named/server.c
+5
-7
bin/named/statschannel.c
bin/named/statschannel.c
+2
-2
bin/tests/nsecify.c
bin/tests/nsecify.c
+1
-1
bin/tests/rwlock_test.c
bin/tests/rwlock_test.c
+1
-1
bin/tests/sock_test.c
bin/tests/sock_test.c
+2
-2
lib/dns/dst_api.c
lib/dns/dst_api.c
+3
-2
lib/dns/gssapictx.c
lib/dns/gssapictx.c
+6
-2
lib/dns/private.c
lib/dns/private.c
+1
-1
lib/dns/rdata.c
lib/dns/rdata.c
+1
-1
lib/dns/rdata/any_255/tsig_250.c
lib/dns/rdata/any_255/tsig_250.c
+4
-4
lib/dns/rdata/ch_3/a_1.c
lib/dns/rdata/ch_3/a_1.c
+1
-1
lib/dns/rdata/generic/afsdb_18.c
lib/dns/rdata/generic/afsdb_18.c
+1
-1
lib/dns/rdata/generic/cert_37.c
lib/dns/rdata/generic/cert_37.c
+1
-1
lib/dns/rdata/generic/csync_62.c
lib/dns/rdata/generic/csync_62.c
+2
-2
lib/dns/rdata/generic/ds_43.c
lib/dns/rdata/generic/ds_43.c
+3
-3
lib/dns/rdata/generic/hip_55.c
lib/dns/rdata/generic/hip_55.c
+1
-1
lib/dns/rdata/generic/ipseckey_45.c
lib/dns/rdata/generic/ipseckey_45.c
+3
-3
lib/dns/rdata/generic/key_25.c
lib/dns/rdata/generic/key_25.c
+5
-4
lib/dns/rdata/generic/keydata_65533.c
lib/dns/rdata/generic/keydata_65533.c
+5
-4
lib/dns/rdata/generic/l32_105.c
lib/dns/rdata/generic/l32_105.c
+1
-1
lib/dns/rdata/generic/l64_106.c
lib/dns/rdata/generic/l64_106.c
+6
-6
lib/dns/rdata/generic/loc_29.c
lib/dns/rdata/generic/loc_29.c
+27
-17
lib/dns/rdata/generic/lp_107.c
lib/dns/rdata/generic/lp_107.c
+1
-1
lib/dns/rdata/generic/mx_15.c
lib/dns/rdata/generic/mx_15.c
+1
-1
lib/dns/rdata/generic/naptr_35.c
lib/dns/rdata/generic/naptr_35.c
+2
-2
lib/dns/rdata/generic/nid_104.c
lib/dns/rdata/generic/nid_104.c
+6
-6
lib/dns/rdata/generic/nsec3_50.c
lib/dns/rdata/generic/nsec3_50.c
+3
-3
lib/dns/rdata/generic/nsec3param_51.c
lib/dns/rdata/generic/nsec3param_51.c
+3
-3
lib/dns/rdata/generic/nxt_30.c
lib/dns/rdata/generic/nxt_30.c
+2
-1
lib/dns/rdata/generic/opt_41.c
lib/dns/rdata/generic/opt_41.c
+1
-1
lib/dns/rdata/generic/rrsig_46.c
lib/dns/rdata/generic/rrsig_46.c
+6
-6
lib/dns/rdata/generic/rt_21.c
lib/dns/rdata/generic/rt_21.c
+1
-1
lib/dns/rdata/generic/sig_24.c
lib/dns/rdata/generic/sig_24.c
+5
-5
lib/dns/rdata/generic/sink_40.c
lib/dns/rdata/generic/sink_40.c
+1
-1
lib/dns/rdata/generic/soa_6.c
lib/dns/rdata/generic/soa_6.c
+1
-1
lib/dns/rdata/generic/sshfp_44.c
lib/dns/rdata/generic/sshfp_44.c
+2
-2
lib/dns/rdata/generic/tkey_249.c
lib/dns/rdata/generic/tkey_249.c
+6
-6
lib/dns/rdata/generic/tlsa_52.c
lib/dns/rdata/generic/tlsa_52.c
+3
-3
lib/dns/rdata/generic/uri_256.c
lib/dns/rdata/generic/uri_256.c
+2
-2
lib/dns/rdata/in_1/a6_38.c
lib/dns/rdata/in_1/a6_38.c
+1
-1
lib/dns/rdata/in_1/kx_36.c
lib/dns/rdata/in_1/kx_36.c
+1
-1
lib/dns/rdata/in_1/nsap_22.c
lib/dns/rdata/in_1/nsap_22.c
+1
-1
lib/dns/rdata/in_1/px_26.c
lib/dns/rdata/in_1/px_26.c
+1
-1
lib/dns/rdata/in_1/wks_11.c
lib/dns/rdata/in_1/wks_11.c
+3
-2
lib/isc/httpd.c
lib/isc/httpd.c
+16
-10
lib/isc/inet_ntop.c
lib/isc/inet_ntop.c
+6
-3
lib/isc/log.c
lib/isc/log.c
+7
-4
lib/isc/mem.c
lib/isc/mem.c
+1
-1
lib/isc/task.c
lib/isc/task.c
+1
-1
lib/isc/unix/ifiter_ioctl.c
lib/isc/unix/ifiter_ioctl.c
+2
-1
lib/isc/unix/socket.c
lib/isc/unix/socket.c
+1
-1
lib/isc/win32/socket.c
lib/isc/win32/socket.c
+1
-1
lib/isccfg/parser.c
lib/isccfg/parser.c
+2
-2
No files found.
CHANGES
View file @
a009d03a
4748. [cleanup] Sprintf to snprintf coversions. [RT #46132]
4747. [func] Synthesis of responses from DNSSEC-verified records.
Stage 3 - synthesize NODATA responses. [RT #40138]
...
...
bin/dnssec/dnssec-signzone.c
View file @
a009d03a
...
...
@@ -2813,7 +2813,7 @@ writeset(const char *prefix, dns_rdatatype_t type) {
if
(
filename
==
NULL
)
fatal
(
"out of memory"
);
if
(
dsdir
!=
NULL
)
sprintf
(
filename
,
"%s/"
,
dsdir
);
s
n
printf
(
filename
,
filenamelen
,
"%s/"
,
dsdir
);
else
filename
[
0
]
=
0
;
strlcat
(
filename
,
prefix
,
filenamelen
);
...
...
@@ -3490,12 +3490,13 @@ main(int argc, char *argv[]) {
origin
=
file
;
if
(
output
==
NULL
)
{
size_t
size
;
free_output
=
ISC_TRUE
;
output
=
isc_mem_allocate
(
mctx
,
strlen
(
file
)
+
strlen
(
".signed"
)
+
1
);
size
=
strlen
(
file
)
+
strlen
(
".signed"
)
+
1
;
output
=
isc_mem_allocate
(
mctx
,
size
);
if
(
output
==
NULL
)
fatal
(
"out of memory"
);
sprintf
(
output
,
"%s.signed"
,
file
);
s
n
printf
(
output
,
size
,
"%s.signed"
,
file
);
}
if
(
inputformatstr
!=
NULL
)
{
...
...
bin/named/server.c
View file @
a009d03a
...
...
@@ -1790,8 +1790,8 @@ dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
unsigned int prefixlen, const char *server,
const char *contact)
{
char
*cp
;
char
reverse[48+sizeof("ip6.arpa
.")];
char
reverse[48+sizeof("ip6.arpa.")] = { 0 }
;
char
buf[sizeof("x.x
.")];
const char *dns64_dbtype[4] = { "_dns64", "dns64", ".", "." };
const char *sep = ": view ";
const char *viewname = view->name;
...
...
@@ -1814,15 +1814,13 @@ dns64_reverse(dns_view_t *view, isc_mem_t *mctx, isc_netaddr_t *na,
/*
* Construct the reverse name of the zone.
*/
cp = reverse;
s6 = na->type.in6.s6_addr;
while (prefixlen > 0) {
prefixlen -= 8;
sprintf(
cp
, "%x.%x.", s6[prefixlen/8] & 0xf,
(s6[prefixlen/8] >> 4) & 0xf);
cp += 4
;
s
n
printf(
buf, sizeof(buf)
, "%x.%x.", s6[prefixlen/8] & 0xf,
(s6[prefixlen/8] >> 4) & 0xf);
strlcat(reverse, buf, sizeof(reverse))
;
}
strlcat(reverse, "ip6.arpa.", sizeof(reverse));
/*
...
...
bin/named/statschannel.c
View file @
a009d03a
...
...
@@ -1270,8 +1270,8 @@ rdatasetstats_dump(dns_rdatastatstype_t type, isc_uint64_t val, void *arg) {
case
isc_statsformat_json
:
#ifdef HAVE_JSON
zoneobj
=
(
json_object
*
)
dumparg
->
arg
;
sprintf
(
buf
,
"%s%s%s"
,
stale
?
"#"
:
"
"
,
nxrrset
?
"!"
:
""
,
typestr
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%s%s%s
"
,
stale
?
"#"
:
""
,
nxrrset
?
"!"
:
""
,
typestr
);
obj
=
json_object_new_int64
(
val
);
if
(
obj
==
NULL
)
return
;
...
...
bin/tests/nsecify.c
View file @
a009d03a
...
...
@@ -179,7 +179,7 @@ nsecify(char *filename) {
len
=
strlen
(
filename
);
if
(
len
+
4
+
1
>
sizeof
(
newfilename
))
fatal
(
"filename too long"
);
sprintf
(
newfilename
,
"%s.new"
,
filename
);
s
n
printf
(
newfilename
,
sizeof
(
newfilename
),
"%s.new"
,
filename
);
result
=
dns_db_dump
(
db
,
NULL
,
newfilename
);
check_result
(
result
,
"dns_db_dump"
);
dns_db_detach
(
&
db
);
...
...
bin/tests/rwlock_test.c
View file @
a009d03a
...
...
@@ -109,7 +109,7 @@ main(int argc, char *argv[]) {
RUNTIME_CHECK
(
isc_rwlock_init
(
&
lock
,
5
,
10
)
==
ISC_R_SUCCESS
);
for
(
i
=
0
;
i
<
nworkers
;
i
++
)
{
sprintf
(
name
,
"%02u"
,
i
);
s
n
printf
(
name
,
sizeof
(
name
),
"%02u"
,
i
);
dupname
=
strdup
(
name
);
RUNTIME_CHECK
(
dupname
!=
NULL
);
if
(
i
!=
0
&&
i
%
3
==
0
)
...
...
bin/tests/sock_test.c
View file @
a009d03a
...
...
@@ -102,8 +102,8 @@ my_recv(isc_task_t *task, isc_event_t *event) {
*/
if
(
strcmp
(
event
->
ev_arg
,
"so2"
)
!=
0
)
{
region
=
dev
->
region
;
sprintf
(
buf
,
"
\r\n
Received: %.*s
\r\n\r\n
"
,
(
int
)
dev
->
n
,
(
char
*
)
region
.
base
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"
\r\n
Received: %.*s
\r\n\r\n
"
,
(
int
)
dev
->
n
,
(
char
*
)
region
.
base
);
region
.
base
=
isc_mem_get
(
mctx
,
strlen
(
buf
)
+
1
);
if
(
region
.
base
!=
NULL
)
{
region
.
length
=
strlen
(
buf
)
+
1
;
...
...
lib/dns/dst_api.c
View file @
a009d03a
...
...
@@ -1878,8 +1878,9 @@ buildfilename(dns_name_t *name, dns_keytag_t id,
len
=
1
+
3
+
1
+
5
+
strlen
(
suffix
)
+
1
;
if
(
isc_buffer_availablelength
(
out
)
<
len
)
return
(
ISC_R_NOSPACE
);
sprintf
((
char
*
)
isc_buffer_used
(
out
),
"+%03d+%05d%s"
,
alg
,
id
,
suffix
);
snprintf
((
char
*
)
isc_buffer_used
(
out
),
(
int
)
isc_buffer_availablelength
(
out
),
"+%03d+%05d%s"
,
alg
,
id
,
suffix
);
isc_buffer_add
(
out
,
len
);
return
(
ISC_R_SUCCESS
);
...
...
lib/dns/gssapictx.c
View file @
a009d03a
...
...
@@ -695,10 +695,14 @@ dst_gssapi_acceptctx(gss_cred_id_t cred,
*/
const
char
*
old
=
getenv
(
"KRB5_KTNAME"
);
if
(
old
==
NULL
||
strcmp
(
old
,
gssapi_keytab
)
!=
0
)
{
char
*
kt
=
malloc
(
strlen
(
gssapi_keytab
)
+
13
);
size_t
size
;
char
*
kt
;
size
=
strlen
(
gssapi_keytab
)
+
13
;
kt
=
malloc
(
size
);
if
(
kt
==
NULL
)
return
(
ISC_R_NOMEMORY
);
sprintf
(
kt
,
"KRB5_KTNAME=%s"
,
gssapi_keytab
);
s
n
printf
(
kt
,
size
,
"KRB5_KTNAME=%s"
,
gssapi_keytab
);
if
(
putenv
(
kt
)
!=
0
)
return
(
ISC_R_NOMEMORY
);
}
...
...
lib/dns/private.c
View file @
a009d03a
...
...
@@ -351,7 +351,7 @@ dns_private_totext(dns_rdata_t *private, isc_buffer_t *buf) {
isc_buffer_putstr
(
buf
,
"Signing with "
);
dns_secalg_format
(
alg
,
algbuf
,
sizeof
(
algbuf
));
sprintf
(
keybuf
,
"key %d/%s"
,
keyid
,
algbuf
);
s
n
printf
(
keybuf
,
sizeof
(
keybuf
),
"key %d/%s"
,
keyid
,
algbuf
);
isc_buffer_putstr
(
buf
,
keybuf
);
}
else
return
(
ISC_R_NOTFOUND
);
...
...
lib/dns/rdata.c
View file @
a009d03a
...
...
@@ -522,7 +522,7 @@ typemap_totext(isc_region_t *sr, dns_rdata_textctx_t *tctx,
RETERR
(
dns_rdatatype_totext
(
t
,
target
));
}
else
{
char
buf
[
sizeof
(
"TYPE65535"
)];
sprintf
(
buf
,
"TYPE%u"
,
t
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"TYPE%u"
,
t
);
RETERR
(
str_totext
(
buf
,
target
));
}
}
...
...
lib/dns/rdata/any_255/tsig_250.c
View file @
a009d03a
...
...
@@ -174,7 +174,7 @@ totext_any_tsig(ARGS_TOTEXT) {
*/
n
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u "
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
@@ -182,7 +182,7 @@ totext_any_tsig(ARGS_TOTEXT) {
*/
n
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u"
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
@@ -210,7 +210,7 @@ totext_any_tsig(ARGS_TOTEXT) {
*/
n
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u "
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
@@ -225,7 +225,7 @@ totext_any_tsig(ARGS_TOTEXT) {
*/
n
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
" %u "
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
" %u "
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
lib/dns/rdata/ch_3/a_1.c
View file @
a009d03a
...
...
@@ -80,7 +80,7 @@ totext_ch_a(ARGS_TOTEXT) {
sub
=
name_prefix
(
&
name
,
tctx
->
origin
,
&
prefix
);
RETERR
(
dns_name_totext
(
&
prefix
,
sub
,
target
));
sprintf
(
buf
,
"%o"
,
addr
);
/* note octal */
s
n
printf
(
buf
,
sizeof
(
buf
),
"%o"
,
addr
);
/* note octal */
RETERR
(
str_totext
(
" "
,
target
));
return
(
str_totext
(
buf
,
target
));
}
...
...
lib/dns/rdata/generic/afsdb_18.c
View file @
a009d03a
...
...
@@ -77,7 +77,7 @@ totext_afsdb(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
region
);
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u "
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
dns_name_fromregion
(
&
name
,
&
region
);
sub
=
name_prefix
(
&
name
,
tctx
->
origin
,
&
prefix
);
...
...
lib/dns/rdata/generic/cert_37.c
View file @
a009d03a
...
...
@@ -85,7 +85,7 @@ totext_cert(ARGS_TOTEXT) {
*/
n
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u "
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
lib/dns/rdata/generic/csync_62.c
View file @
a009d03a
...
...
@@ -56,14 +56,14 @@ totext_csync(ARGS_TOTEXT) {
num
=
uint32_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
4
);
sprintf
(
buf
,
"%lu"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%lu"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
num
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%lu"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%lu"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
return
(
typemap_totext
(
&
sr
,
NULL
,
target
));
...
...
lib/dns/rdata/generic/ds_43.c
View file @
a009d03a
...
...
@@ -111,7 +111,7 @@ generic_totext_ds(ARGS_TOTEXT) {
*/
n
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u "
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
@@ -119,7 +119,7 @@ generic_totext_ds(ARGS_TOTEXT) {
*/
n
=
uint8_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
1
);
sprintf
(
buf
,
"%u "
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
@@ -127,7 +127,7 @@ generic_totext_ds(ARGS_TOTEXT) {
*/
n
=
uint8_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
1
);
sprintf
(
buf
,
"%u"
,
n
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
n
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
lib/dns/rdata/generic/hip_55.c
View file @
a009d03a
...
...
@@ -140,7 +140,7 @@ totext_hip(ARGS_TOTEXT) {
/*
* Algorithm
*/
sprintf
(
buf
,
"%u "
,
algorithm
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
algorithm
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
lib/dns/rdata/generic/ipseckey_45.c
View file @
a009d03a
...
...
@@ -134,7 +134,7 @@ totext_ipseckey(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
region
);
num
=
uint8_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
1
);
sprintf
(
buf
,
"%u "
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
@@ -142,7 +142,7 @@ totext_ipseckey(ARGS_TOTEXT) {
*/
gateway
=
uint8_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
1
);
sprintf
(
buf
,
"%u "
,
gateway
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
gateway
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
@@ -150,7 +150,7 @@ totext_ipseckey(ARGS_TOTEXT) {
*/
num
=
uint8_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
1
);
sprintf
(
buf
,
"%u "
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
/*
...
...
lib/dns/rdata/generic/key_25.c
View file @
a009d03a
...
...
@@ -85,7 +85,7 @@ generic_totext_key(ARGS_TOTEXT) {
/* flags */
flags
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u"
,
flags
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
flags
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
if
((
flags
&
DNS_KEYFLAG_KSK
)
!=
0
)
{
...
...
@@ -98,14 +98,14 @@ generic_totext_key(ARGS_TOTEXT) {
/* protocol */
sprintf
(
buf
,
"%u"
,
sr
.
base
[
0
]);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
sr
.
base
[
0
]);
isc_region_consume
(
&
sr
,
1
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
/* algorithm */
algorithm
=
sr
.
base
[
0
];
sprintf
(
buf
,
"%u"
,
algorithm
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
algorithm
);
isc_region_consume
(
&
sr
,
1
);
RETERR
(
str_totext
(
buf
,
target
));
...
...
@@ -161,7 +161,8 @@ generic_totext_key(ARGS_TOTEXT) {
RETERR
(
str_totext
(
algbuf
,
target
));
RETERR
(
str_totext
(
" ; key id = "
,
target
));
dns_rdata_toregion
(
rdata
,
&
tmpr
);
sprintf
(
buf
,
"%u"
,
dst_region_computeid
(
&
tmpr
,
algorithm
));
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
dst_region_computeid
(
&
tmpr
,
algorithm
));
RETERR
(
str_totext
(
buf
,
target
));
}
return
(
ISC_R_SUCCESS
);
...
...
lib/dns/rdata/generic/keydata_65533.c
View file @
a009d03a
...
...
@@ -122,7 +122,7 @@ totext_keydata(ARGS_TOTEXT) {
/* flags */
flags
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u"
,
flags
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
flags
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
if
((
flags
&
DNS_KEYFLAG_KSK
)
!=
0
)
{
...
...
@@ -134,14 +134,14 @@ totext_keydata(ARGS_TOTEXT) {
keyinfo
=
"ZSK"
;
/* protocol */
sprintf
(
buf
,
"%u"
,
sr
.
base
[
0
]);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
sr
.
base
[
0
]);
isc_region_consume
(
&
sr
,
1
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
/* algorithm */
algorithm
=
sr
.
base
[
0
];
sprintf
(
buf
,
"%u"
,
algorithm
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
algorithm
);
isc_region_consume
(
&
sr
,
1
);
RETERR
(
str_totext
(
buf
,
target
));
...
...
@@ -184,7 +184,8 @@ totext_keydata(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
tmpr
);
/* Skip over refresh, addhd, and removehd */
isc_region_consume
(
&
tmpr
,
12
);
sprintf
(
buf
,
"%u"
,
dst_region_computeid
(
&
tmpr
,
algorithm
));
snprintf
(
buf
,
sizeof
(
buf
),
"%u"
,
dst_region_computeid
(
&
tmpr
,
algorithm
));
RETERR
(
str_totext
(
buf
,
target
));
if
((
tctx
->
flags
&
DNS_STYLEFLAG_MULTILINE
)
!=
0
)
{
...
...
lib/dns/rdata/generic/l32_105.c
View file @
a009d03a
...
...
@@ -62,7 +62,7 @@ totext_l32(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
region
);
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
...
...
lib/dns/rdata/generic/l64_106.c
View file @
a009d03a
...
...
@@ -56,16 +56,16 @@ totext_l64(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
region
);
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
sprintf
(
buf
,
"%x:%x:%x:%x"
,
region
.
base
[
0
]
<<
8
|
region
.
base
[
1
],
region
.
base
[
2
]
<<
8
|
region
.
base
[
3
],
region
.
base
[
4
]
<<
8
|
region
.
base
[
5
],
region
.
base
[
6
]
<<
8
|
region
.
base
[
7
]);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%x:%x:%x:%x"
,
region
.
base
[
0
]
<<
8
|
region
.
base
[
1
],
region
.
base
[
2
]
<<
8
|
region
.
base
[
3
],
region
.
base
[
4
]
<<
8
|
region
.
base
[
5
],
region
.
base
[
6
]
<<
8
|
region
.
base
[
7
]);
return
(
str_totext
(
buf
,
target
));
}
...
...
lib/dns/rdata/generic/loc_29.c
View file @
a009d03a
...
...
@@ -478,22 +478,31 @@ totext_loc(ARGS_TOTEXT) {
size
=
sr
.
base
[
1
];
INSIST
((
size
&
0x0f
)
<
10
&&
(
size
>>
4
)
<
10
);
if
((
size
&
0x0f
)
>
1
)
sprintf
(
sbuf
,
"%lum"
,
(
size
>>
4
)
*
poweroften
[(
size
&
0x0f
)
-
2
]);
else
sprintf
(
sbuf
,
"0.%02lum"
,
(
size
>>
4
)
*
poweroften
[(
size
&
0x0f
)]);
if
((
size
&
0x0f
)
>
1
)
{
snprintf
(
sbuf
,
sizeof
(
sbuf
),
"%lum"
,
(
size
>>
4
)
*
poweroften
[(
size
&
0x0f
)
-
2
]);
}
else
{
snprintf
(
sbuf
,
sizeof
(
sbuf
),
"0.%02lum"
,
(
size
>>
4
)
*
poweroften
[(
size
&
0x0f
)]);
}
hp
=
sr
.
base
[
2
];
INSIST
((
hp
&
0x0f
)
<
10
&&
(
hp
>>
4
)
<
10
);
if
((
hp
&
0x0f
)
>
1
)
sprintf
(
hbuf
,
"%lum"
,
(
hp
>>
4
)
*
poweroften
[(
hp
&
0x0f
)
-
2
]);
else
sprintf
(
hbuf
,
"0.%02lum"
,
(
hp
>>
4
)
*
poweroften
[(
hp
&
0x0f
)]);
if
((
hp
&
0x0f
)
>
1
)
{
snprintf
(
hbuf
,
sizeof
(
hbuf
),
"%lum"
,
(
hp
>>
4
)
*
poweroften
[(
hp
&
0x0f
)
-
2
]);
}
else
{
snprintf
(
hbuf
,
sizeof
(
hbuf
),
"0.%02lum"
,
(
hp
>>
4
)
*
poweroften
[(
hp
&
0x0f
)]);
}
vp
=
sr
.
base
[
3
];
INSIST
((
vp
&
0x0f
)
<
10
&&
(
vp
>>
4
)
<
10
);
if
((
vp
&
0x0f
)
>
1
)
sprintf
(
vbuf
,
"%lum"
,
(
vp
>>
4
)
*
poweroften
[(
vp
&
0x0f
)
-
2
]);
else
sprintf
(
vbuf
,
"0.%02lum"
,
(
vp
>>
4
)
*
poweroften
[(
vp
&
0x0f
)]);
if
((
vp
&
0x0f
)
>
1
)
{
snprintf
(
vbuf
,
sizeof
(
vbuf
),
"%lum"
,
(
vp
>>
4
)
*
poweroften
[(
vp
&
0x0f
)
-
2
]);
}
else
{
snprintf
(
vbuf
,
sizeof
(
vbuf
),
"0.%02lum"
,
(
vp
>>
4
)
*
poweroften
[(
vp
&
0x0f
)]);
}
isc_region_consume
(
&
sr
,
4
);
latitude
=
uint32_fromregion
(
&
sr
);
...
...
@@ -542,11 +551,12 @@ totext_loc(ARGS_TOTEXT) {
altitude
-=
10000000
;
}
sprintf
(
buf
,
"%d %d %d.%03d %s %d %d %d.%03d %s %s%ld.%02ldm %s %s %s"
,
d1
,
m1
,
s1
,
fs1
,
north
?
"N"
:
"S"
,
d2
,
m2
,
s2
,
fs2
,
east
?
"E"
:
"W"
,
below
?
"-"
:
""
,
altitude
/
100
,
altitude
%
100
,
sbuf
,
hbuf
,
vbuf
);
snprintf
(
buf
,
sizeof
(
buf
),
"%d %d %d.%03d %s %d %d %d.%03d %s %s%ld.%02ldm %s %s %s"
,
d1
,
m1
,
s1
,
fs1
,
north
?
"N"
:
"S"
,
d2
,
m2
,
s2
,
fs2
,
east
?
"E"
:
"W"
,
below
?
"-"
:
""
,
altitude
/
100
,
altitude
%
100
,
sbuf
,
hbuf
,
vbuf
);
return
(
str_totext
(
buf
,
target
));
}
...
...
lib/dns/rdata/generic/lp_107.c
View file @
a009d03a
...
...
@@ -61,7 +61,7 @@ totext_lp(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
region
);
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
...
...
lib/dns/rdata/generic/mx_15.c
View file @
a009d03a
...
...
@@ -101,7 +101,7 @@ totext_mx(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
region
);
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
...
...
lib/dns/rdata/generic/naptr_35.c
View file @
a009d03a
...
...
@@ -200,7 +200,7 @@ totext_naptr(ARGS_TOTEXT) {
*/
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
...
...
@@ -209,7 +209,7 @@ totext_naptr(ARGS_TOTEXT) {
*/
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
...
...
lib/dns/rdata/generic/nid_104.c
View file @
a009d03a
...
...
@@ -56,16 +56,16 @@ totext_nid(ARGS_TOTEXT) {
dns_rdata_toregion
(
rdata
,
&
region
);
num
=
uint16_fromregion
(
&
region
);
isc_region_consume
(
&
region
,
2
);
sprintf
(
buf
,
"%u"
,
num
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u"
,
num
);
RETERR
(
str_totext
(
buf
,
target
));
RETERR
(
str_totext
(
" "
,
target
));
sprintf
(
buf
,
"%x:%x:%x:%x"
,
region
.
base
[
0
]
<<
8
|
region
.
base
[
1
],
region
.
base
[
2
]
<<
8
|
region
.
base
[
3
],
region
.
base
[
4
]
<<
8
|
region
.
base
[
5
],
region
.
base
[
6
]
<<
8
|
region
.
base
[
7
]);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%x:%x:%x:%x"
,
region
.
base
[
0
]
<<
8
|
region
.
base
[
1
],
region
.
base
[
2
]
<<
8
|
region
.
base
[
3
],
region
.
base
[
4
]
<<
8
|
region
.
base
[
5
],
region
.
base
[
6
]
<<
8
|
region
.
base
[
7
]);
return
(
str_totext
(
buf
,
target
));
}
...
...
lib/dns/rdata/generic/nsec3_50.c
View file @
a009d03a
...
...
@@ -115,19 +115,19 @@ totext_nsec3(ARGS_TOTEXT) {
/* Hash */
hash
=
uint8_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
1
);
sprintf
(
buf
,
"%u "
,
hash
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
hash
);
RETERR
(
str_totext
(
buf
,
target
));
/* Flags */
flags
=
uint8_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
1
);
sprintf
(
buf
,
"%u "
,
flags
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
flags
);
RETERR
(
str_totext
(
buf
,
target
));
/* Iterations */
iterations
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u "
,
iterations
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
iterations
);
RETERR
(
str_totext
(
buf
,
target
));
/* Salt */
...
...
lib/dns/rdata/generic/nsec3param_51.c
View file @
a009d03a
...
...
@@ -109,13 +109,13 @@ totext_nsec3param(ARGS_TOTEXT) {
iterations
=
uint16_fromregion
(
&
sr
);
isc_region_consume
(
&
sr
,
2
);
sprintf
(
buf
,
"%u "
,
hash
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
hash
);
RETERR
(
str_totext
(
buf
,
target
));
sprintf
(
buf
,
"%u "
,
flags
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
flags
);
RETERR
(
str_totext
(
buf
,
target
));
sprintf
(
buf
,
"%u "
,
iterations
);
s
n
printf
(
buf
,
sizeof
(
buf
),
"%u "
,
iterations
);
RETERR
(
str_totext
(
buf
,
target
));
j
=
uint8_fromregion
(
&
sr
);
...
...
lib/dns/rdata/generic/nxt_30.c