Internally, use {PATH,NAME}_MAX instead of ISC_DIR_{PATH,NAME}MAX
This commit is contained in:
@@ -476,7 +476,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir,
|
||||
uint16_t id, oldid;
|
||||
uint32_t rid, roldid;
|
||||
dns_secalg_t alg;
|
||||
char filename[ISC_DIR_NAMEMAX];
|
||||
char filename[NAME_MAX];
|
||||
isc_buffer_t fileb;
|
||||
|
||||
if (exact != NULL)
|
||||
|
||||
+2
-2
@@ -115,8 +115,8 @@ LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_day;
|
||||
LIBDNS_EXTERNAL_DATA extern unsigned int dns_zone_mkey_month;
|
||||
|
||||
static bool want_stats = false;
|
||||
static char program_name[ISC_DIR_NAMEMAX] = "named";
|
||||
static char absolute_conffile[ISC_DIR_PATHMAX];
|
||||
static char program_name[NAME_MAX] = "named";
|
||||
static char absolute_conffile[PATH_MAX];
|
||||
static char saved_command_line[512];
|
||||
static char version[512];
|
||||
static unsigned int maxsocks = 0;
|
||||
|
||||
@@ -84,7 +84,7 @@ typedef struct config_data {
|
||||
typedef struct dir_entry dir_entry_t;
|
||||
|
||||
struct dir_entry {
|
||||
char dirpath[ISC_DIR_PATHMAX];
|
||||
char dirpath[PATH_MAX];
|
||||
ISC_LINK(dir_entry_t) link;
|
||||
};
|
||||
|
||||
@@ -361,7 +361,7 @@ process_dir(isc_dir_t *dir, void *passback, config_data_t *cd,
|
||||
dlist_t *dir_list, unsigned int basedirlen)
|
||||
{
|
||||
|
||||
char tmp[ISC_DIR_PATHMAX + ISC_DIR_NAMEMAX];
|
||||
char tmp[PATH_MAX + NAME_MAX];
|
||||
int astPos;
|
||||
struct stat sb;
|
||||
isc_result_t result = ISC_R_FAILURE;
|
||||
@@ -369,7 +369,7 @@ process_dir(isc_dir_t *dir, void *passback, config_data_t *cd,
|
||||
char *type;
|
||||
char *ttlStr;
|
||||
char *data;
|
||||
char host[ISC_DIR_NAMEMAX];
|
||||
char host[NAME_MAX];
|
||||
char *tmpString;
|
||||
char *tmpPtr;
|
||||
int ttl;
|
||||
@@ -408,7 +408,7 @@ process_dir(isc_dir_t *dir, void *passback, config_data_t *cd,
|
||||
{
|
||||
if ((strlen(host) +
|
||||
strlen(tmpPtr + 1) + 2)
|
||||
> ISC_DIR_NAMEMAX)
|
||||
> NAME_MAX)
|
||||
continue;
|
||||
strcat(host, tmpPtr + 1);
|
||||
strcat(host, ".");
|
||||
@@ -416,7 +416,7 @@ process_dir(isc_dir_t *dir, void *passback, config_data_t *cd,
|
||||
}
|
||||
if ((strlen(host) +
|
||||
strlen(tmpString) + 1)
|
||||
<= ISC_DIR_NAMEMAX)
|
||||
<= NAME_MAX)
|
||||
strcat(host, tmpString);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -809,7 +809,7 @@ dns_dnssec_findzonekeys3(dns_db_t *db, dns_dbversion_t *ver,
|
||||
isc_result_t result2;
|
||||
isc_buffer_t buf;
|
||||
|
||||
isc_buffer_init(&buf, filename, ISC_DIR_NAMEMAX);
|
||||
isc_buffer_init(&buf, filename, NAME_MAX);
|
||||
result2 = dst_key_getfilename(dst_key_name(pubkey),
|
||||
dst_key_id(pubkey),
|
||||
dst_key_alg(pubkey),
|
||||
@@ -1750,7 +1750,7 @@ dns_dnssec_keylistfromrdataset(dns_name_t *origin,
|
||||
isc_result_t result2;
|
||||
isc_buffer_t buf;
|
||||
|
||||
isc_buffer_init(&buf, filename, ISC_DIR_NAMEMAX);
|
||||
isc_buffer_init(&buf, filename, NAME_MAX);
|
||||
result2 = dst_key_getfilename(dst_key_name(pubkey),
|
||||
dst_key_id(pubkey),
|
||||
dst_key_alg(pubkey),
|
||||
|
||||
+3
-3
@@ -556,7 +556,7 @@ dst_key_fromfile(dns_name_t *name, dns_keytag_t id,
|
||||
isc_mem_t *mctx, dst_key_t **keyp)
|
||||
{
|
||||
isc_result_t result;
|
||||
char filename[ISC_DIR_NAMEMAX];
|
||||
char filename[NAME_MAX];
|
||||
isc_buffer_t buf;
|
||||
dst_key_t *key;
|
||||
|
||||
@@ -570,7 +570,7 @@ dst_key_fromfile(dns_name_t *name, dns_keytag_t id,
|
||||
|
||||
key = NULL;
|
||||
|
||||
isc_buffer_init(&buf, filename, ISC_DIR_NAMEMAX);
|
||||
isc_buffer_init(&buf, filename, NAME_MAX);
|
||||
result = dst_key_getfilename(name, id, alg, type, NULL, mctx, &buf);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto out;
|
||||
@@ -1725,7 +1725,7 @@ write_public_key(const dst_key_t *key, int type, const char *directory) {
|
||||
FILE *fp;
|
||||
isc_buffer_t keyb, textb, fileb, classb;
|
||||
isc_region_t r;
|
||||
char filename[ISC_DIR_NAMEMAX];
|
||||
char filename[NAME_MAX];
|
||||
unsigned char key_array[DST_KEY_MAXSIZE];
|
||||
char text_array[DST_KEY_MAXTEXTSIZE];
|
||||
char class_array[10];
|
||||
|
||||
+1
-1
@@ -671,7 +671,7 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
|
||||
{
|
||||
FILE *fp;
|
||||
isc_result_t result;
|
||||
char filename[ISC_DIR_NAMEMAX];
|
||||
char filename[NAME_MAX];
|
||||
char buffer[MAXFIELDSIZE * 2];
|
||||
isc_fsaccess_t access;
|
||||
isc_stdtime_t when;
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#include <isc/platform.h>
|
||||
#include <isc/result.h>
|
||||
|
||||
#define ISC_DIR_NAMEMAX NAME_MAX
|
||||
#define ISC_DIR_PATHMAX PATH_MAX
|
||||
|
||||
/*% Directory Entry */
|
||||
typedef struct isc_direntry {
|
||||
char name[NAME_MAX];
|
||||
|
||||
@@ -17,20 +17,21 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <isc/lang.h>
|
||||
#include <isc/platform.h>
|
||||
#include <isc/result.h>
|
||||
|
||||
#define ISC_DIR_NAMEMAX _MAX_FNAME
|
||||
#define ISC_DIR_PATHMAX _MAX_PATH
|
||||
#define ISC_DIR_NAMEMAX NAME_MAX
|
||||
#define ISC_DIR_PATHMAX PATH_MAX
|
||||
|
||||
typedef struct {
|
||||
char name[ISC_DIR_NAMEMAX];
|
||||
char name[NAME_MAX];
|
||||
unsigned int length;
|
||||
WIN32_FIND_DATA find_data;
|
||||
} isc_direntry_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned int magic;
|
||||
char dirname[ISC_DIR_PATHMAX];
|
||||
char dirname[PATH_MAX];
|
||||
isc_direntry_t entry;
|
||||
bool entry_filled;
|
||||
HANDLE search_handle;
|
||||
|
||||
+1
-1
@@ -3000,7 +3000,7 @@ parser_complain(cfg_parser_t *pctx, bool is_warning,
|
||||
va_list args)
|
||||
{
|
||||
char tokenbuf[MAX_LOG_TOKEN + 10];
|
||||
static char where[ISC_DIR_PATHMAX + 100];
|
||||
static char where[PATH_MAX + 100];
|
||||
static char message[2048];
|
||||
int level = ISC_LOG_ERROR;
|
||||
const char *prep = "";
|
||||
|
||||
Reference in New Issue
Block a user