dns_name_tofilenametext() now downcases the name, which means the callers
don't need to.
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dnssec-makekeyset.c,v 1.50 2001/03/27 22:57:40 bwelling Exp $ */
|
/* $Id: dnssec-makekeyset.c,v 1.51 2001/03/27 23:43:12 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -246,7 +246,6 @@ main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
char namestr[DNS_NAME_FORMATSIZE];
|
char namestr[DNS_NAME_FORMATSIZE];
|
||||||
dns_fixedname_t fname;
|
|
||||||
isc_buffer_t namebuf;
|
isc_buffer_t namebuf;
|
||||||
|
|
||||||
key = NULL;
|
key = NULL;
|
||||||
@@ -258,11 +257,7 @@ main(int argc, char *argv[]) {
|
|||||||
rdatalist.rdclass = dst_key_class(key);
|
rdatalist.rdclass = dst_key_class(key);
|
||||||
|
|
||||||
isc_buffer_init(&namebuf, namestr, sizeof namestr);
|
isc_buffer_init(&namebuf, namestr, sizeof namestr);
|
||||||
dns_fixedname_init(&fname);
|
result = dns_name_tofilenametext(dst_key_name(key),
|
||||||
dns_name_downcase(dst_key_name(key),
|
|
||||||
dns_fixedname_name(&fname),
|
|
||||||
NULL);
|
|
||||||
result = dns_name_tofilenametext(dns_fixedname_name(&fname),
|
|
||||||
ISC_FALSE,
|
ISC_FALSE,
|
||||||
&namebuf);
|
&namebuf);
|
||||||
check_result(result, "dns_name_tofilenametext");
|
check_result(result, "dns_name_tofilenametext");
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dnssec-signzone.c,v 1.132 2001/03/27 22:57:43 bwelling Exp $ */
|
/* $Id: dnssec-signzone.c,v 1.133 2001/03/27 23:43:13 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -505,7 +505,6 @@ static void
|
|||||||
opendb(const char *prefix, dns_name_t *name, dns_rdataclass_t rdclass,
|
opendb(const char *prefix, dns_name_t *name, dns_rdataclass_t rdclass,
|
||||||
dns_db_t **dbp)
|
dns_db_t **dbp)
|
||||||
{
|
{
|
||||||
dns_fixedname_t fname;
|
|
||||||
char filename[256];
|
char filename[256];
|
||||||
isc_buffer_t b;
|
isc_buffer_t b;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
@@ -517,10 +516,7 @@ opendb(const char *prefix, dns_name_t *name, dns_rdataclass_t rdclass,
|
|||||||
isc_buffer_putstr(&b, "/");
|
isc_buffer_putstr(&b, "/");
|
||||||
}
|
}
|
||||||
isc_buffer_putstr(&b, prefix);
|
isc_buffer_putstr(&b, prefix);
|
||||||
dns_fixedname_init(&fname);
|
result = dns_name_tofilenametext(name, ISC_FALSE, &b);
|
||||||
(void)dns_name_downcase(name, dns_fixedname_name(&fname), NULL);
|
|
||||||
result = dns_name_tofilenametext(dns_fixedname_name(&fname),
|
|
||||||
ISC_FALSE, &b);
|
|
||||||
check_result(result, "dns_name_tofilenametext()");
|
check_result(result, "dns_name_tofilenametext()");
|
||||||
if (isc_buffer_availablelength(&b) == 0) {
|
if (isc_buffer_availablelength(&b) == 0) {
|
||||||
char namestr[DNS_NAME_FORMATSIZE];
|
char namestr[DNS_NAME_FORMATSIZE];
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: name.h,v 1.92 2001/03/27 22:57:47 bwelling Exp $ */
|
/* $Id: name.h,v 1.93 2001/03/27 23:43:10 bwelling Exp $ */
|
||||||
|
|
||||||
#ifndef DNS_NAME_H
|
#ifndef DNS_NAME_H
|
||||||
#define DNS_NAME_H 1
|
#define DNS_NAME_H 1
|
||||||
@@ -919,7 +919,8 @@ dns_name_tofilenametext(dns_name_t *name, isc_boolean_t omit_final_dot,
|
|||||||
isc_buffer_t *target);
|
isc_buffer_t *target);
|
||||||
/*
|
/*
|
||||||
* Convert 'name' into an alternate text format appropriate for filenames,
|
* Convert 'name' into an alternate text format appropriate for filenames,
|
||||||
* storing the result in 'target'.
|
* storing the result in 'target'. The name data is downcased, guaranteeing
|
||||||
|
* that the filename does not depend on the case of the converted name.
|
||||||
*
|
*
|
||||||
* Notes:
|
* Notes:
|
||||||
* If 'omit_final_dot' is true, then the final '.' in absolute
|
* If 'omit_final_dot' is true, then the final '.' in absolute
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: name.c,v 1.122 2001/03/27 22:57:45 bwelling Exp $ */
|
/* $Id: name.c,v 1.123 2001/03/27 23:43:09 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -1926,6 +1926,9 @@ dns_name_tofilenametext(dns_name_t *name, isc_boolean_t omit_final_dot,
|
|||||||
{
|
{
|
||||||
if (trem == 0)
|
if (trem == 0)
|
||||||
return (ISC_R_NOSPACE);
|
return (ISC_R_NOSPACE);
|
||||||
|
/* downcase */
|
||||||
|
if (c >= 0x41 && c <= 0x5A)
|
||||||
|
c += 0x20;
|
||||||
CONVERTFROMASCII(c);
|
CONVERTFROMASCII(c);
|
||||||
*tdata++ = c;
|
*tdata++ = c;
|
||||||
ndata++;
|
ndata++;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Principal Author: Brian Wellington
|
* Principal Author: Brian Wellington
|
||||||
* $Id: dst_api.c,v 1.75 2001/03/27 22:57:48 bwelling Exp $
|
* $Id: dst_api.c,v 1.76 2001/03/27 23:43:15 bwelling Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
@@ -937,7 +937,6 @@ buildfilename(dns_name_t *name, const dns_keytag_t id,
|
|||||||
const char *suffix = "";
|
const char *suffix = "";
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
dns_fixedname_t fname;
|
|
||||||
|
|
||||||
REQUIRE(out != NULL);
|
REQUIRE(out != NULL);
|
||||||
if ((type & DST_TYPE_PRIVATE) != 0)
|
if ((type & DST_TYPE_PRIVATE) != 0)
|
||||||
@@ -954,11 +953,8 @@ buildfilename(dns_name_t *name, const dns_keytag_t id,
|
|||||||
}
|
}
|
||||||
if (isc_buffer_availablelength(out) < 1)
|
if (isc_buffer_availablelength(out) < 1)
|
||||||
return (ISC_R_NOSPACE);
|
return (ISC_R_NOSPACE);
|
||||||
dns_fixedname_init(&fname);
|
|
||||||
(void)dns_name_downcase(name, dns_fixedname_name(&fname), NULL);
|
|
||||||
isc_buffer_putstr(out, "K");
|
isc_buffer_putstr(out, "K");
|
||||||
result = dns_name_tofilenametext(dns_fixedname_name(&fname),
|
result = dns_name_tofilenametext(name, ISC_FALSE, out);
|
||||||
ISC_FALSE, out);
|
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
len = 1 + 3 + 1 + 5 + strlen(suffix) + 1;
|
len = 1 + 3 + 1 + 5 + strlen(suffix) + 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user