wok-next view sheerdns/stuff/large-subdomains.u @ rev 10740
locale-*: we dont need compile rules any more since core pkgs are in slitaz-i18n bdeps
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Mon May 30 01:12:54 2011 +0200 (2011-05-30) |
parents | |
children |
line source
1 --- dir.c
2 +++ dir.c
3 @@ -77,16 +77,17 @@
4 while (!get_file_name (buf, sizeof (buf), qtype, (unsigned char *) q)
5 && (fd = open (buf, O_RDONLY)) == -1 && (q = strchr (q, '.')) && q++ && (qtype == REQ_SOA
6 || qtype == REQ_NS));
7 - if (fd == -1) {
8 -/* try lookup "*.example.com" where asking for "nonexistant.example.com": */
9 + for (i = 0; fd == -1; i++) {
10 +/* try lookup "*.example.com" where asking for "nonexistant.example.com" or "any.where.example.com": */
11 char *t;
12 if (qtype == REQ_SOA || qtype == REQ_NS) /* probably a bad idea to wildcard these, so return */
13 return NULL;
14 q = t = (char *) strdup (s);
15 - while (*t && *t != '.')
16 + for (c = i; *t && *t != '.' || --c >= 0;)
17 t++;
18 - if (!*t || t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
19 - || (fd = open (buf, O_RDONLY)) == -1) {
20 + t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
21 + || (fd = open (buf, O_RDONLY));
22 + if (fd == -1 && !*++t ) {
23 free (q);
24 return NULL; }
25 free (q); }
27 --- dir.h
28 +++ dir.h
29 @@ -11,4 +11,4 @@
30 char **directory_lookup (int qtype, unsigned char *s);
31 time_t get_mtime (int qtype, unsigned char *s);
33 -#define SHEERDNS_DIR "/var/sheerdns"
34 +#define SHEERDNS_DIR "/var/sheerdns"