--- src/bin/named/db_defs.h.orig Thu Nov 14 21:22:24 2002 +++ src/bin/named/db_defs.h Wed Jan 1 01:28:28 2003 @@ -212,8 +212,7 @@ #define HASHMASK 0x1f #define HASHROTATE(v) \ (((v) << HASHSHIFT) | ((v) >> ((sizeof(v) * 8) - HASHSHIFT))) -#define HASHLOWER(c) ((isascii(c) && isupper(c)) ? tolower(c) : (c)) -#define HASHIMILATE(v,c) ((v) = (HASHROTATE(v)) + (HASHLOWER(c) & HASHMASK)) +#define HASHIMILATE(v,c) ((v) = (HASHROTATE(v)) + (c & HASHMASK)) #define TSIG_BUF_SIZE 640 #define TSIG_SIG_SIZE 20 --- src/bin/named/db_func.h.orig Mon Jun 18 22:42:51 2001 +++ src/bin/named/db_func.h Wed Jan 1 01:28:28 2003 @@ -94,7 +94,7 @@ */ /* ++from db_update.c++ */ -int db_update(const char *name, +int db_update(const u_char *name, struct databuf *odp, struct databuf *newdp, struct databuf **savedpp, @@ -154,7 +154,7 @@ int servicenumber(const char *); int protocolnumber(const char *); int get_class(const char *); -u_int nhash(const char *); +u_int nhash(const u_char *); const char * protocolname(int); const char * servicename(u_int16_t, const char *); struct databuf * rm_datum(struct databuf *, @@ -173,8 +173,8 @@ /* --from db_glue.c-- */ /* ++from db_lookup.c++ */ -struct namebuf * nlookup(const char *, struct hashbuf **, - const char **, int); +struct namebuf * nlookup(const u_char *, struct hashbuf **, + const u_char **, int); struct namebuf * np_parent(struct namebuf *); int match(struct databuf *, int, int), nxtmatch(const char *, struct databuf *, @@ -204,7 +204,7 @@ /* ++from db_tsig.c++ */ const char * tsig_alg_name(int value); -int tsig_alg_value(char *name); +int tsig_alg_value(u_char *name); struct dst_key * tsig_key_from_addr(struct in_addr addr); struct tsig_record * new_tsig(struct dst_key *key, u_char *sig, int siglen); void free_tsig(struct tsig_record *tsig); --- src/bin/named/db_glue.c.orig Sat May 18 09:02:54 2002 +++ src/bin/named/db_glue.c Wed Jan 1 01:28:28 2003 @@ -429,13 +429,21 @@ * this logic is intended to produce the same result as nlookup()'s. */ u_int -nhash(const char *name) { +nhash(const u_char *name) { u_char ch; u_int hval; hval = 0; while ((ch = (u_char)*name++) != (u_char)'\0') - HASHIMILATE(hval, ch); + if (ch > '~') { + HASHIMILATE(hval, ch); + ch = (u_char)*name++; + if (ch == (u_char)'\0') break; + HASHIMILATE(hval, ch); + } + else { + HASHIMILATE(hval, tolower(ch)); + } return (hval); } --- src/bin/named/db_lookup.c.orig Mon Jun 18 22:42:55 2001 +++ src/bin/named/db_lookup.c Wed Jan 1 01:28:28 2003 @@ -105,17 +105,26 @@ * NULL otherwise. If 'insert', insert name into tables. * Wildcard lookups are handled. */ + +int is8bit(const u_char *name) { + while (*name) { + if (*name++>0x80) return 1; + } + return 0; +} + struct namebuf * -nlookup(const char *name, struct hashbuf **htpp, - const char **fname, int insert) +nlookup(const u_char *name, struct hashbuf **htpp, + const u_char **fname, int insert) { struct namebuf *np; - const char *cp; + const u_char *cp; int c; u_int hval; struct hashbuf *htp; struct namebuf *parent = NULL; int escaped = 0; + int isbig5=0; htp = *htpp; hval = 0; @@ -139,8 +148,20 @@ *htpp = htp; break; } + if (isbig5) { + HASHIMILATE(hval, c); + isbig5 = 0; + } + else { + if (isascii(c)) { + HASHIMILATE(hval, tolower(c)); + } + else { + isbig5 = 1; + HASHIMILATE(hval, c); + } + } - HASHIMILATE(hval, c); if (escaped) escaped = 0; else if (c == '\\') @@ -190,7 +211,7 @@ hashtab = *htpp; } else { fcachetab = *htpp; - } + } } else parent->n_hash = *htpp; --- src/bin/named/db_tsig.c.orig Tue May 21 10:34:32 2002 +++ src/bin/named/db_tsig.c Wed Jan 1 01:28:28 2003 @@ -119,7 +119,7 @@ } int -tsig_alg_value(char *name) { +tsig_alg_value(u_char *name) { if (ns_samename(name, TSIG_ALG_MD5) == 1 || strcasecmp(name, TSIG_ALG_MD5_SHORT) == 0) return (KEY_HMAC_MD5); --- src/bin/named/db_update.c.orig Thu Oct 25 07:53:09 2001 +++ src/bin/named/db_update.c Wed Jan 1 01:28:28 2003 @@ -211,7 +211,7 @@ * vix, 21jul94 */ int -db_update(const char *name, +db_update(const u_char *name, struct databuf *odp, struct databuf *newdp, struct databuf **savedpp, int flags, struct hashbuf *htp, struct sockaddr_in from) @@ -221,7 +221,7 @@ int zn, isHintNS; int check_ttl = 0; int deleted_something = 0; - const char *fname; + const u_char *fname; #ifdef BIND_UPDATE int found_other_ns = 0; struct databuf *tmpdp; @@ -851,8 +851,8 @@ case T_MG: case T_MR: /* Only a domain name */ - if (ns_samename((const char *)dp1->d_data, - (const char *)dp2->d_data) == 1) + if (ns_samename((const u_char *)dp1->d_data, + (const u_char *)dp2->d_data) == 1) return (0); else return (1); @@ -874,8 +874,8 @@ case T_NXT: /* First a domain name, then binary data */ - if (ns_samename((const char *)dp1->d_data, - (const char *)dp2->d_data) != 1) + if (ns_samename((const u_char *)dp1->d_data, + (const u_char *)dp2->d_data) != 1) return (1); len = strlen((const char *)dp1->d_data)+1; return (memcmp(dp1->d_data + len, @@ -904,12 +904,12 @@ case T_SOA: case T_MINFO: case T_RP: - if (ns_samename((const char *)dp1->d_data, - (const char *)dp2->d_data) != 1) + if (ns_samename((const u_char *)dp1->d_data, + (const u_char *)dp2->d_data) != 1) return (1); cp1 = dp1->d_data + strlen((const char *)dp1->d_data) + 1; cp2 = dp2->d_data + strlen((const char *)dp2->d_data) + 1; - if (ns_samename((const char *)cp1, (const char *)cp2) != 1) + if (ns_samename((const u_char *)cp1, (const u_char *)cp2) != 1) return (1); if (dp1->d_type != T_SOA) return (0); @@ -952,7 +952,7 @@ cp1 += t1; cp2 += t2; /* Replacement */ - if (ns_samename((const char *)cp1, (const char *)cp2) != 1) + if (ns_samename((const u_char *)cp1, (const u_char *)cp2) != 1) return (1); /* they all checked out! */ @@ -973,7 +973,7 @@ if (*cp1++ != *cp2++ || *cp1++ != *cp2++) /* port */ return (1); } - if (ns_samename((const char *)cp1, (const char *)cp2) != 1) + if (ns_samename((const u_char *)cp1, (const u_char *)cp2) != 1) return (1); return (0); @@ -982,11 +982,11 @@ cp2 = dp2->d_data; if (*cp1++ != *cp2++ || *cp1++ != *cp2++) /* cmp prio */ return (1); - if (ns_samename((const char *)cp1, (const char *)cp2) != 1) + if (ns_samename((const u_char *)cp1, (const u_char *)cp2) != 1) return (1); cp1 += strlen((const char *)cp1) + 1; cp2 += strlen((const char *)cp2) + 1; - if (ns_samename((const char *)cp1, (const char *)cp2) != 1) + if (ns_samename((const u_char *)cp1, (const u_char *)cp2) != 1) return (1); return (0); --- src/bin/named/ns_config.c.orig Fri May 24 11:04:59 2002 +++ src/bin/named/ns_config.c Wed Jan 1 01:28:28 2003 @@ -434,7 +434,7 @@ memset(zp, 0, sizeof (struct zoneinfo)); zp->z_origin = name; zp->z_class = class; - zp->z_checknames = not_set; + zp->z_checknames = ignore; if (server_options->flags & OPTION_MAINTAIN_IXFR_BASE) zp->z_maintain_ixfr_base = 1; else --- src/bin/named/ns_parseutil.c.orig Mon Jun 18 22:43:19 2001 +++ src/bin/named/ns_parseutil.c Wed Jan 1 01:28:28 2003 @@ -107,16 +107,26 @@ * and Ullman, Addison-Wesley, 1986, ISBN 0-201-10088-6. */ static int -symbol_hash(const char *key, int prime) { - const char *s; +symbol_hash(const u_char *key, int prime) { + const u_char *s; unsigned int h = 0; unsigned int g; int c; + int isbig5=0; for (s = key; *s != '\0'; s++) { c = *s; - if (isascii(c) && isupper(c)) - c = tolower(c); + if (isbig5) { + isbig5=0; + } + else { + if (isascii(c)) { + c = tolower(c); + } + else { + isbig5=1; + } + } h = ( h << 4 ) + c; if ((g = ( h & 0xf0000000 )) != 0) { h = h ^ (g >> 24); --- src/bin/named/ns_resp.c.orig Thu Nov 14 21:39:13 2002 +++ src/bin/named/ns_resp.c Wed Jan 1 01:28:28 2003 @@ -191,7 +191,7 @@ static int related_additional(char *); static void freestr_maybe(char **); static enum ordering match_order(const struct namebuf *, int, int); -static int match_name(const struct namebuf *, const char *, size_t); +static int match_name(const struct namebuf *, const u_char *, size_t); #define MAX_RELATED 100 @@ -4086,7 +4086,7 @@ * value of 0 is of interest. */ static int -match_name(const struct namebuf *np, const char *name, size_t namelen) +match_name(const struct namebuf *np, const u_char *name, size_t namelen) { int matched ; @@ -4102,7 +4102,7 @@ if (matched > 0) { int labellen = NAMELEN(*np); char pch; - const char *start; + const u_char *start; if (labellen > matched) { return -1; --- src/bin/named/ns_update.c.orig Sat May 18 09:02:59 2002 +++ src/bin/named/ns_update.c Wed Jan 1 01:28:28 2003 @@ -1775,7 +1775,7 @@ while (cp < end) { if ((n = *cp++) != '\0') { for (j = n; j > 0 && cp < end; j--) - if ((*cp < ' ') || (*cp > '~')) { + if (*cp < ' ') { fprintf(fp, "\\%03d", *cp++); } else if (*cp == '\\' || *cp =='"') { putc('\\', fp); --- src/bin/named/version.c.orig Sat Jan 2 14:05:14 1999 +++ src/bin/named/version.c Wed Jan 1 01:28:28 2003 @@ -8,7 +8,7 @@ char rcsid[] = "$Id: version.c,v 8.3 1999/01/02 06:05:14 vixie Exp $"; #endif /* not lint */ -char Version[] = "named %VERSION% %WHEN%\n\t%WHOANDWHERE%"; +char Version[] = "multi lingual named %VERSION% %WHEN%\n\t%WHOANDWHERE%"; char ShortVersion[] = "%VERSION%"; #ifdef COMMENT --- src/bin/nslookup/commands.c.orig Fri Sep 5 08:45:01 2003 +++ src/bin/nslookup/commands.c Wed Jan 28 09:21:56 2004 @@ -283,27 +283,28 @@ *yy_cp = '\0'; \ yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 21 -#define YY_END_OF_BUFFER 22 -static yyconst short int yy_accept[158] = +#define YY_NUM_RULES 18 +#define YY_END_OF_BUFFER 19 +static yyconst short int yy_accept[162] = { 0, - 0, 0, 22, 21, 20, 21, 21, 18, 21, 21, - 21, 21, 21, 21, 21, 21, 0, 19, 0, 18, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, - 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 19, 18, 17, 18, 18, 15, 18, 18, + 18, 18, 18, 18, 18, 18, 0, 16, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 14, 0, 3, 0, - 0, 12, 0, 8, 0, 0, 0, 0, 0, 4, + 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 11, 0, 0, 11, 0, 16, 0, - - 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 8, 0, 0, 10, 0, 0, 0, 0, 6, - 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 5, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, + 0, 0, 0, 14, 0, 3, 0, 0, 12, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, + 0, 0, 11, 0, 6, 0, 0, 0, 0, 0, + + 8, 0, 0, 0, 0, 0, 0, 0, 0, 7, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, - 0, 5, 0, 7, 0, 9, 0 + 0, 5, 0, 0, 7, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 7, 0, 2, 0, 5, + 0 } ; static yyconst int yy_ec[256] = @@ -345,125 +346,117 @@ 1, 1, 1, 1, 1, 1 } ; -static yyconst short int yy_base[187] = +static yyconst short int yy_base[184] = { 0, - 445, 0, 447, 565, 565, 443, 26, 565, 52, 54, - 61, 49, 46, 48, 47, 54, 433, 565, 0, 565, - 401, 74, 0, 62, 67, 58, 63, 70, 96, 565, - 394, 83, 565, 74, 87, 90, 106, 89, 88, 132, - 141, 68, 97, 96, 150, 69, 95, 99, 128, 124, - 565, 159, 168, 126, 0, 161, 153, 170, 196, 203, - 111, 181, 162, 227, 236, 143, 565, 245, 565, 156, - 178, 565, 183, 565, 254, 189, 191, 183, 198, 565, - 186, 263, 272, 281, 208, 0, 214, 213, 290, 299, - 197, 223, 307, 565, 314, 239, 565, 256, 565, 323, - - 565, 332, 417, 341, 350, 285, 359, 368, 377, 386, - 389, 565, 396, 405, 565, 414, 423, 432, 435, 565, - 442, 451, 265, 0, 274, 565, 454, 461, 464, 471, - 474, 565, 481, 490, 283, 565, 499, 310, 502, 509, - 518, 316, 521, 565, 528, 537, 334, 0, 546, 555, - 343, 565, 352, 565, 370, 565, 565, 417, 408, 401, - 400, 399, 389, 382, 381, 380, 373, 362, 355, 346, - 337, 326, 319, 302, 293, 277, 268, 259, 230, 223, - 221, 201, 188, 146, 137, 119 + 408, 0, 399, 500, 500, 391, 26, 500, 52, 54, + 61, 49, 46, 48, 47, 54, 380, 500, 0, 500, + 350, 74, 0, 62, 67, 58, 63, 70, 83, 343, + 89, 500, 78, 76, 80, 96, 79, 85, 122, 77, + 86, 89, 130, 91, 90, 93, 118, 144, 124, 0, + 136, 116, 138, 146, 163, 500, 169, 193, 129, 155, + 124, 202, 157, 500, 171, 500, 141, 183, 500, 205, + 212, 173, 180, 154, 215, 221, 165, 222, 500, 204, + 230, 232, 238, 258, 356, 240, 267, 246, 500, 224, + 225, 186, 500, 276, 500, 285, 195, 294, 252, 303, + + 500, 312, 315, 254, 321, 328, 337, 346, 349, 500, + 355, 357, 363, 370, 379, 260, 382, 287, 388, 500, + 395, 398, 405, 414, 296, 0, 417, 500, 424, 323, + 433, 330, 436, 500, 443, 339, 452, 365, 0, 461, + 372, 500, 470, 473, 500, 390, 480, 407, 0, 426, + 500, 489, 445, 0, 492, 500, 454, 500, 463, 500, + 500, 360, 349, 342, 333, 326, 315, 306, 299, 290, + 270, 263, 256, 251, 243, 235, 215, 205, 198, 168, + 142, 133, 120 } ; -static yyconst short int yy_def[187] = +static yyconst short int yy_def[184] = { 0, - 158, 157, 157, 157, 157, 159, 157, 157, 160, 159, - 160, 11, 11, 11, 11, 11, 159, 157, 7, 157, - 11, 159, 11, 11, 11, 11, 11, 11, 161, 157, - 11, 159, 157, 11, 11, 11, 11, 11, 11, 162, - 163, 11, 11, 11, 164, 11, 11, 11, 11, 159, - 157, 162, 163, 53, 53, 11, 11, 11, 165, 159, - 11, 11, 11, 166, 167, 159, 157, 161, 157, 11, - 68, 157, 159, 157, 165, 159, 159, 11, 68, 157, - 11, 168, 169, 167, 84, 84, 11, 84, 170, 171, - 11, 11, 159, 157, 168, 159, 157, 159, 157, 172, - - 157, 173, 84, 174, 175, 11, 176, 177, 178, 173, - 159, 157, 174, 179, 157, 175, 180, 181, 159, 157, - 177, 178, 122, 122, 159, 157, 159, 182, 159, 183, - 159, 157, 181, 184, 159, 157, 185, 159, 159, 182, - 186, 159, 159, 157, 183, 184, 146, 146, 185, 186, - 159, 157, 159, 157, 159, 157, 0, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157 + 162, 161, 161, 161, 161, 163, 161, 161, 164, 163, + 164, 11, 11, 11, 11, 11, 163, 161, 7, 161, + 11, 163, 11, 11, 11, 11, 11, 11, 163, 11, + 163, 161, 11, 11, 11, 11, 11, 11, 165, 11, + 11, 11, 166, 11, 11, 11, 11, 165, 48, 48, + 11, 11, 11, 166, 166, 161, 166, 167, 11, 11, + 11, 168, 163, 161, 163, 161, 11, 163, 161, 166, + 167, 166, 166, 71, 71, 71, 11, 163, 161, 11, + 168, 11, 166, 169, 71, 166, 170, 166, 161, 11, + 11, 163, 161, 171, 161, 172, 166, 169, 173, 170, + + 161, 174, 173, 11, 175, 176, 177, 172, 166, 161, + 173, 173, 173, 174, 178, 173, 179, 175, 175, 161, + 180, 163, 176, 177, 124, 124, 166, 161, 181, 173, + 178, 179, 179, 161, 182, 175, 180, 137, 137, 183, + 163, 161, 181, 173, 161, 179, 182, 147, 147, 175, + 161, 183, 152, 152, 173, 161, 179, 161, 163, 161, + 0, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161 } ; -static yyconst short int yy_nxt[592] = +static yyconst short int yy_nxt[527] = { 0, 6, 7, 8, 9, 6, 6, 6, 10, 9, 9, 9, 11, 12, 9, 13, 9, 14, 9, 9, 9, 9, 15, 16, 9, 9, 9, 17, 19, 20, 21, 17, 17, 17, 22, 21, 21, 21, 23, 24, 21, 25, 21, 26, 21, 21, 21, 21, 27, 28, 21, - 21, 21, 17, 29, 30, 32, 33, 36, 17, 17, - 17, 17, 29, 30, 35, 39, 38, 17, 17, 17, - 37, 31, 31, 31, 31, 32, 33, 35, 36, 31, - 37, 39, 38, 31, 32, 33, 34, 31, 31, 42, - 61, 56, 31, 31, 31, 31, 17, 29, 30, 31, - - 17, 17, 41, 17, 17, 43, 44, 45, 47, 48, - 57, 49, 31, 31, 31, 31, 58, 46, 62, 150, - 31, 31, 31, 63, 31, 50, 51, 66, 67, 64, - 65, 31, 17, 50, 51, 78, 31, 149, 17, 17, - 17, 17, 53, 18, 66, 67, 147, 55, 17, 17, - 17, 45, 30, 31, 60, 17, 41, 17, 17, 17, - 50, 51, 68, 69, 70, 17, 17, 17, 17, 53, - 18, 71, 72, 81, 17, 17, 17, 87, 31, 71, - 72, 31, 79, 80, 73, 74, 31, 31, 145, 88, - 89, 18, 90, 18, 91, 31, 17, 73, 74, 79, - - 80, 140, 17, 17, 17, 18, 31, 92, 31, 98, - 99, 31, 76, 76, 102, 100, 101, 76, 106, 103, - 76, 133, 31, 130, 107, 76, 77, 17, 64, 30, - 128, 83, 83, 41, 17, 17, 17, 84, 18, 31, - 96, 97, 86, 17, 17, 17, 68, 69, 31, 17, - 17, 41, 17, 17, 17, 73, 74, 98, 99, 123, - 17, 17, 17, 17, 93, 94, 135, 136, 121, 17, - 17, 17, 17, 96, 97, 125, 126, 118, 17, 17, - 17, 17, 84, 18, 135, 136, 117, 17, 17, 17, - 17, 89, 18, 116, 17, 17, 17, 17, 17, 17, - - 90, 18, 113, 17, 17, 17, 17, 17, 93, 94, - 31, 137, 18, 65, 17, 93, 94, 141, 18, 110, - 17, 17, 17, 17, 100, 101, 108, 17, 17, 109, - 17, 17, 17, 102, 18, 151, 152, 105, 17, 17, - 17, 17, 111, 112, 151, 152, 104, 17, 17, 17, - 17, 114, 115, 153, 154, 83, 17, 17, 17, 17, - 107, 30, 95, 17, 17, 41, 17, 17, 17, 119, - 120, 155, 156, 85, 17, 17, 17, 17, 122, 18, - 82, 75, 59, 124, 17, 17, 17, 125, 126, 54, - 111, 112, 17, 17, 17, 127, 17, 111, 112, 52, - - 40, 31, 17, 17, 17, 17, 114, 115, 17, 17, - 17, 129, 17, 17, 17, 114, 115, 4, 102, 31, - 17, 17, 17, 17, 117, 30, 31, 17, 17, 41, - 17, 17, 17, 131, 132, 18, 119, 120, 17, 17, - 17, 134, 17, 119, 120, 18, 157, 5, 17, 17, - 17, 17, 122, 18, 157, 137, 18, 17, 17, 17, - 138, 17, 139, 115, 157, 141, 18, 17, 17, 17, - 142, 17, 143, 144, 157, 131, 132, 17, 17, 17, - 65, 17, 131, 132, 157, 157, 157, 17, 17, 17, - 17, 146, 18, 157, 157, 157, 148, 17, 17, 17, - - 137, 18, 157, 139, 115, 17, 17, 17, 129, 17, - 139, 115, 157, 157, 157, 17, 17, 17, 17, 141, - 18, 157, 143, 144, 17, 17, 17, 65, 17, 143, - 144, 157, 157, 157, 17, 17, 17, 17, 146, 18, - 157, 157, 157, 17, 17, 17, 17, 153, 154, 157, - 157, 157, 17, 17, 17, 17, 155, 156, 157, 157, - 157, 17, 17, 17, 3, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157 - + 21, 21, 17, 29, 18, 31, 32, 35, 17, 17, + 17, 17, 29, 18, 34, 38, 37, 17, 17, 17, + 36, 30, 30, 30, 30, 31, 32, 34, 35, 30, + 36, 38, 37, 30, 29, 18, 33, 30, 30, 39, + 31, 32, 30, 40, 41, 30, 42, 43, 45, 52, + + 51, 30, 30, 30, 30, 30, 46, 44, 47, 53, + 30, 30, 59, 60, 30, 30, 30, 61, 30, 62, + 153, 30, 17, 48, 18, 63, 64, 67, 50, 17, + 17, 55, 56, 148, 57, 80, 58, 65, 66, 68, + 69, 30, 143, 30, 17, 48, 18, 70, 56, 30, + 17, 17, 17, 77, 30, 74, 78, 79, 63, 64, + 83, 30, 82, 30, 55, 56, 30, 57, 138, 71, + 70, 56, 65, 66, 86, 56, 90, 39, 72, 72, + 30, 87, 56, 72, 68, 69, 72, 92, 93, 39, + 30, 72, 73, 54, 74, 56, 96, 56, 132, 76, + + 54, 54, 17, 62, 18, 131, 70, 56, 39, 17, + 17, 83, 54, 84, 56, 125, 88, 89, 85, 54, + 54, 54, 74, 78, 79, 91, 105, 54, 39, 30, + 17, 92, 93, 94, 95, 123, 17, 17, 17, 96, + 56, 86, 56, 118, 97, 104, 83, 88, 89, 30, + 30, 114, 83, 111, 101, 117, 99, 30, 54, 84, + 56, 115, 101, 108, 83, 54, 54, 99, 100, 101, + 106, 99, 99, 103, 99, 99, 17, 94, 95, 30, + 17, 17, 107, 17, 17, 54, 96, 56, 136, 120, + 102, 83, 54, 54, 54, 109, 110, 141, 142, 98, + + 54, 54, 54, 99, 100, 101, 81, 99, 99, 112, + 99, 99, 99, 113, 101, 75, 115, 101, 99, 99, + 99, 116, 119, 120, 129, 101, 54, 121, 17, 122, + 95, 146, 134, 49, 17, 17, 17, 17, 124, 18, + 136, 120, 30, 126, 17, 17, 54, 127, 128, 17, + 109, 110, 54, 54, 54, 83, 111, 101, 129, 101, + 4, 112, 54, 130, 113, 101, 150, 151, 30, 112, + 99, 113, 101, 141, 142, 30, 99, 99, 99, 99, + 115, 101, 18, 133, 134, 112, 99, 99, 135, 119, + 120, 146, 134, 18, 121, 118, 137, 120, 161, 122, + + 95, 139, 118, 118, 140, 17, 122, 95, 157, 158, + 5, 17, 17, 17, 17, 124, 18, 161, 127, 128, + 17, 17, 17, 83, 99, 129, 101, 150, 151, 161, + 112, 99, 99, 99, 144, 145, 161, 133, 134, 99, + 99, 99, 135, 132, 147, 134, 159, 160, 161, 149, + 132, 132, 118, 137, 120, 157, 158, 161, 118, 118, + 118, 17, 152, 18, 159, 160, 161, 154, 17, 17, + 99, 155, 156, 161, 144, 145, 99, 99, 99, 112, + 132, 147, 134, 161, 161, 161, 132, 132, 132, 17, + 152, 18, 161, 155, 156, 17, 17, 17, 112, 3, + + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161 } ; -static yyconst short int yy_chk[592] = +static yyconst short int yy_chk[527] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -473,64 +466,56 @@ 7, 7, 9, 9, 9, 10, 10, 13, 9, 9, 9, 11, 11, 11, 12, 16, 15, 11, 11, 11, 14, 13, 15, 14, 12, 22, 22, 24, 25, 16, - 26, 28, 27, 26, 32, 32, 11, 24, 27, 34, - 46, 42, 25, 42, 46, 28, 29, 29, 29, 34, - - 29, 29, 29, 29, 29, 35, 36, 37, 38, 39, - 43, 39, 35, 39, 38, 36, 44, 37, 47, 186, - 47, 44, 43, 48, 48, 50, 50, 54, 54, 49, - 50, 37, 40, 40, 40, 61, 61, 185, 40, 40, - 40, 41, 41, 41, 66, 66, 184, 41, 41, 41, - 45, 45, 45, 49, 45, 45, 45, 45, 45, 52, - 52, 52, 56, 56, 57, 52, 52, 52, 53, 53, - 53, 58, 58, 63, 53, 53, 53, 70, 57, 71, - 71, 70, 62, 62, 73, 73, 56, 63, 183, 73, - 76, 76, 77, 77, 78, 58, 59, 59, 59, 79, - - 79, 182, 59, 59, 59, 60, 62, 81, 78, 85, - 85, 81, 60, 60, 88, 87, 87, 60, 91, 88, - 60, 181, 91, 180, 92, 60, 60, 64, 64, 64, - 179, 64, 64, 64, 64, 64, 65, 65, 65, 87, - 96, 96, 65, 65, 65, 68, 68, 68, 92, 68, - 68, 68, 68, 68, 75, 75, 75, 98, 98, 178, - 75, 75, 75, 82, 82, 82, 123, 123, 177, 82, - 82, 82, 83, 83, 83, 125, 125, 176, 83, 83, - 83, 84, 84, 84, 135, 135, 106, 84, 84, 84, - 89, 89, 89, 175, 89, 89, 89, 89, 89, 90, - - 90, 90, 174, 90, 90, 90, 90, 90, 93, 93, - 106, 138, 138, 93, 95, 95, 95, 142, 142, 173, - 95, 95, 95, 100, 100, 100, 172, 100, 100, 100, - 100, 100, 102, 102, 102, 147, 147, 171, 102, 102, - 102, 104, 104, 104, 151, 151, 170, 104, 104, 104, - 105, 105, 105, 153, 153, 169, 105, 105, 105, 107, - 107, 107, 168, 107, 107, 107, 107, 107, 108, 108, - 108, 155, 155, 167, 108, 108, 108, 109, 109, 109, - 166, 165, 164, 109, 109, 109, 110, 110, 110, 163, - 111, 111, 110, 110, 110, 111, 113, 113, 113, 162, - - 161, 160, 113, 113, 113, 114, 114, 114, 159, 114, - 114, 114, 114, 114, 116, 116, 116, 158, 103, 31, - 116, 116, 116, 117, 117, 117, 21, 117, 117, 117, - 117, 117, 118, 118, 118, 17, 119, 119, 118, 118, - 118, 119, 121, 121, 121, 6, 3, 1, 121, 121, - 121, 122, 122, 122, 0, 127, 127, 122, 122, 122, - 127, 128, 128, 128, 0, 129, 129, 128, 128, 128, - 129, 130, 130, 130, 0, 131, 131, 130, 130, 130, - 131, 133, 133, 133, 0, 0, 0, 133, 133, 133, - 134, 134, 134, 0, 0, 0, 134, 134, 134, 137, - - 137, 137, 0, 139, 139, 137, 137, 137, 139, 140, - 140, 140, 0, 0, 0, 140, 140, 140, 141, 141, - 141, 0, 143, 143, 141, 141, 141, 143, 145, 145, - 145, 0, 0, 0, 145, 145, 145, 146, 146, 146, - 0, 0, 0, 146, 146, 146, 149, 149, 149, 0, - 0, 0, 149, 149, 149, 150, 150, 150, 0, 0, - 0, 150, 150, 150, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157 + 26, 28, 27, 26, 29, 29, 11, 24, 27, 29, + 31, 31, 25, 33, 34, 28, 35, 36, 37, 41, + 40, 34, 40, 33, 37, 35, 38, 36, 38, 42, + 38, 41, 44, 45, 42, 45, 44, 46, 46, 47, + 183, 36, 39, 39, 39, 49, 49, 52, 39, 39, + 39, 43, 43, 182, 43, 61, 43, 51, 51, 53, + 53, 52, 181, 47, 48, 48, 48, 54, 54, 61, + 48, 48, 48, 59, 59, 74, 60, 60, 63, 63, + 74, 51, 67, 53, 55, 55, 67, 55, 180, 55, + 57, 57, 65, 65, 72, 72, 77, 65, 57, 57, + 60, 73, 73, 57, 68, 68, 57, 92, 92, 68, + 77, 57, 57, 58, 58, 58, 97, 97, 179, 58, + + 58, 58, 62, 62, 62, 178, 70, 70, 62, 62, + 62, 70, 71, 71, 71, 177, 75, 75, 71, 71, + 71, 75, 76, 78, 78, 80, 91, 76, 78, 80, + 81, 81, 81, 82, 82, 176, 81, 81, 81, 83, + 83, 86, 86, 175, 83, 90, 86, 88, 88, 90, + 91, 174, 88, 99, 99, 104, 173, 82, 84, 84, + 84, 116, 116, 172, 84, 84, 84, 87, 87, 87, + 171, 87, 87, 87, 87, 87, 94, 94, 94, 104, + 94, 94, 94, 94, 94, 96, 96, 96, 118, 118, + 170, 96, 96, 96, 98, 98, 98, 125, 125, 169, + + 98, 98, 98, 100, 100, 100, 168, 100, 100, 100, + 100, 100, 102, 102, 102, 167, 103, 103, 102, 102, + 102, 103, 105, 105, 130, 130, 166, 105, 106, 106, + 106, 132, 132, 165, 106, 106, 106, 107, 107, 107, + 136, 136, 164, 107, 107, 107, 108, 108, 108, 163, + 109, 109, 108, 108, 108, 109, 111, 111, 112, 112, + 162, 111, 85, 112, 113, 113, 138, 138, 30, 113, + 114, 114, 114, 141, 141, 21, 114, 114, 114, 115, + 115, 115, 17, 117, 117, 115, 115, 115, 117, 119, + 119, 146, 146, 6, 119, 121, 121, 121, 3, 122, + + 122, 121, 121, 121, 122, 123, 123, 123, 148, 148, + 1, 123, 123, 123, 124, 124, 124, 0, 127, 127, + 124, 124, 124, 127, 129, 129, 129, 150, 150, 0, + 129, 129, 129, 131, 131, 131, 0, 133, 133, 131, + 131, 131, 133, 135, 135, 135, 153, 153, 0, 135, + 135, 135, 137, 137, 137, 157, 157, 0, 137, 137, + 137, 140, 140, 140, 159, 159, 0, 140, 140, 140, + 143, 143, 143, 0, 144, 144, 143, 143, 143, 144, + 147, 147, 147, 0, 0, 0, 147, 147, 147, 152, + 152, 152, 0, 155, 155, 152, 152, 152, 155, 161, + + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, + 161, 161, 161, 161, 161, 161 } ; static yy_state_type yy_last_accepting_state; @@ -800,7 +785,7 @@ YY_DECL { register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; + register char *yy_cp = NULL, *yy_bp = NULL; register int yy_act; #line 110 "commands.l" @@ -856,13 +841,13 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 158 ) + if ( yy_current_state >= 162 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 565 ); + while ( yy_base[yy_current_state] != 500 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1069,66 +1054,26 @@ } YY_BREAK case 15: -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ -yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP #line 193 "commands.l" { - LookupHost((char*)yytext, 0); return(1); } YY_BREAK case 16: -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ -yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP #line 197 "commands.l" { - /* - * 0 == output to stdout - * 1 == output to file - */ - LookupHostWithServer((char*)yytext, 1); + LookupHost(yytext, 0); return(1); } YY_BREAK case 17: -*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ -yy_c_buf_p = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP #line 205 "commands.l" -{ - LookupHostWithServer((char*)yytext, 0); - return(1); - } +{; } YY_BREAK case 18: YY_RULE_SETUP #line 209 "commands.l" -{ - return(1); - } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 212 "commands.l" -{ - printf("Unrecognized command: %s", - (char*)yytext); - return(1); - } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 217 "commands.l" -{ ; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 218 "commands.l" ECHO; YY_BREAK case YY_STATE_EOF(INITIAL): @@ -1423,7 +1368,7 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 158 ) + if ( yy_current_state >= 162 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -1458,11 +1403,11 @@ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 158 ) + if ( yy_current_state >= 162 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 157); + yy_is_jam = (yy_current_state == 161); return yy_is_jam ? 0 : yy_current_state; } @@ -2018,5 +1963,5 @@ return 0; } #endif -#line 218 "commands.l" +#line 202 "commands.l" --- src/bin/nslookup/res.h.orig Tue Apr 9 13:55:22 2002 +++ src/bin/nslookup/res.h Wed Jan 1 01:28:28 2003 @@ -191,7 +191,7 @@ extern void PrintHostInfo(); extern void FreeHostInfoPtr(); extern FILE *OpenFile(); -extern int pickString(const char *, char *, size_t); +extern int pickString(const u_char *, u_char *, size_t); extern int GetHostInfoByName(union res_sockaddr_union *, int, int, const char *, HostInfo *, Boolean, Boolean); extern int GetHostDomain(union res_sockaddr_union *, int, int, --- src/bin/nslookup/subr.c.orig Tue Apr 9 13:55:24 2002 +++ src/bin/nslookup/subr.c Wed Jan 1 01:28:28 2003 @@ -516,9 +516,9 @@ */ int -pickString(const char *src, char *dest, size_t dest_size) { - const char *start; - const char *end ; +pickString(const u_char *src, u_char *dest, size_t dest_size) { + const u_char *start; + const u_char *end ; size_t sublen ; if (dest_size == 0 || dest == NULL || src == NULL) --- src/include/arpa/nameser.h.orig Tue Apr 30 11:43:53 2002 +++ src/include/arpa/nameser.h Wed Jan 1 01:28:28 2003 @@ -563,8 +563,8 @@ ns_tcp_tsig_state *)); int ns_samedomain __P((const char *, const char *)); int ns_subdomain __P((const char *, const char *)); -int ns_makecanon __P((const char *, char *, size_t)); -int ns_samename __P((const char *, const char *)); +int ns_makecanon __P((const u_char *, u_char *, size_t)); +int ns_samename __P((const u_char *, const u_char *)); __END_DECLS #ifdef BIND_4_COMPAT --- src/include/resolv.h.orig Fri May 31 14:05:29 2002 +++ src/include/resolv.h Wed Jan 1 01:28:28 2003 @@ -393,10 +393,10 @@ #define res_setservers __res_setservers #define res_getservers __res_getservers __BEGIN_DECLS -int res_hnok __P((const char *)); +int res_hnok __P((const u_char *)); int res_ownok __P((const char *)); int res_mailok __P((const char *)); -int res_dnok __P((const char *)); +int res_dnok __P((const u_char *)); int sym_ston __P((const struct res_sym *, const char *, int *)); const char * sym_ntos __P((const struct res_sym *, int, int *)); const char * sym_ntop __P((const struct res_sym *, int, int *)); --- src/lib/bsd/strcasecmp.c.orig Thu Oct 14 00:39:21 1999 +++ src/lib/bsd/strcasecmp.c Wed Jan 1 01:28:28 2003 @@ -1,5 +1,5 @@ #if defined(LIBC_SCCS) && !defined(lint) -static const char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; +static const char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; static const char rcsid[] = "$Id: strcasecmp.c,v 8.5 1999/10/13 16:39:21 vixie Exp $"; #endif /* LIBC_SCCS and not lint */ @@ -46,9 +46,22 @@ #include "port_after.h" -#ifndef NEED_STRCASECMP +/* Added by sinica + * check big5 code */ +int +ischinese(int ch1,int ch2) { + if (! (((ch1>=0xa1) && (ch1<=0xfe)) || + ((ch1>=0x8e) && (ch1<=0xa0)) || + ((ch1>=0x81) && (ch1<=0x8d))) ) return 0; + if (! (((ch2>=0x40) && (ch2<=0x7e)) || + ((ch2>=0xa1) && (ch2<=0xfe))) ) return 0; + return 1; +} + +/* Marked by sinica */ +/* #ifndef NEED_STRCASECMP int __strcasecmp_unneeded__; -#else +#else */ /* * This array is designed for mapping upper and lower case letter @@ -96,10 +109,27 @@ *us1 = (const u_char *)s1, *us2 = (const u_char *)s2; - while (cm[*us1] == cm[*us2++]) +/* Marked by sinica */ +/* while (cm[*us1] == cm[*us2++]) if (*us1++ == '\0') - return (0); - return (cm[*us1] - cm[*--us2]); + return (0); + return (cm[*us1] - cm[*--us2]); */ +/* Added by sinica */ + if (*us1=='\0' && *us2=='\0') return 0; + while (cm[*us1] == cm[*us2]) { + if (ischinese(*us1, *(us1+1))) { + if (*(us1+1) == *(us2+1)) { + us1++; + us2++; + } else { + return (*(us1+1)-*(us2+1)); + } + } + us1++; + us2++; + if (*us1=='\0' && *us2=='\0') return 0; + } + return (cm[*us1] - cm[*us2]); } int @@ -110,13 +140,30 @@ *us2 = (const u_char *)s2; do { - if (cm[*us1] != cm[*us2++]) +/* Marked by sinica */ +/* if (cm[*us1] != cm[*us2++]) return (cm[*us1] - cm[*--us2]); if (*us1++ == '\0') - break; + break; */ +/* Add by sinica */ + if (cm[*us1] != cm[*us2]) + return (cm[*us1] - cm[*us2]); + if (ischinese(*us1, *(us1+1))) { + if (*(us1+1) == *(us2+1)) { + us1++; + us2++; + --n; + } else { + return (*(us1+1)-*(us2+1)); + } + } + us1++; + us2++; + if (*us1 == '\0') break; } while (--n != 0); } return (0); } -#endif /*NEED_STRCASECMP*/ +/* Marked by sinica */ +/* #endif NEED_STRCASECMP*/ --- src/lib/nameser/ns_name.c.orig Thu Nov 14 21:32:08 2002 +++ src/lib/nameser/ns_name.c Wed Jan 1 01:28:28 2003 @@ -149,7 +149,7 @@ } *dn++ = '\\'; *dn++ = (char)c; - } else if (!printable(c)) { + } else if (c < ' ') { if (dn + 3 >= eom) { errno = EMSGSIZE; return (-1); --- src/lib/nameser/ns_samedomain.c.orig Fri Nov 15 06:36:46 2002 +++ src/lib/nameser/ns_samedomain.c Wed Jan 1 01:28:28 2003 @@ -163,7 +163,7 @@ */ int -ns_makecanon(const char *src, char *dst, size_t dstsize) { +ns_makecanon(const u_char *src, u_char *dst, size_t dstsize) { size_t n = strlen(src); if (n + sizeof "." > dstsize) { @@ -193,8 +193,8 @@ */ int -ns_samename(const char *a, const char *b) { - char ta[NS_MAXDNAME], tb[NS_MAXDNAME]; +ns_samename(const u_char *a, const u_char *b) { + u_char ta[NS_MAXDNAME], tb[NS_MAXDNAME]; if (ns_makecanon(a, ta, sizeof ta) < 0 || ns_makecanon(b, tb, sizeof tb) < 0) --- src/lib/resolv/res_comp.c.orig Thu Oct 14 00:39:39 1999 +++ src/lib/resolv/res_comp.c Wed Jan 1 01:28:28 2003 @@ -144,16 +144,16 @@ #define bslashchar(c) ((c) == 0x5c) #define periodchar(c) ((c) == PERIOD) #define asterchar(c) ((c) == 0x2a) -#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \ - || ((c) >= 0x61 && (c) <= 0x7a)) +#define alphachar(c) (1) #define digitchar(c) ((c) >= 0x30 && (c) <= 0x39) #define borderchar(c) (alphachar(c) || digitchar(c)) #define middlechar(c) (borderchar(c) || hyphenchar(c)) -#define domainchar(c) ((c) > 0x20 && (c) < 0x7f) +#define domainchar(c) ((c) > 0x20 && (c) <= 0xfe) + int -res_hnok(const char *dn) { +res_hnok(const u_char *dn) { int ppch = '\0', pch = PERIOD, ch = *dn++; while (ch != '\0') { @@ -224,7 +224,7 @@ * recommendations. */ int -res_dnok(const char *dn) { +res_dnok(const u_char *dn) { int ch; while ((ch = *dn++) != '\0')