wok annotate sheerdns/stuff/large-subdomains.u @ rev 7982

Fix: patch two bugs in make 3.82
author Antoine Bodin <gokhlayeh@slitaz.org>
date Mon Jan 17 18:24:29 2011 +0100 (2011-01-17)
parents
children
rev   line source
pascal@2264 1 --- dir.c
pascal@2264 2 +++ dir.c
pascal@2264 3 @@ -77,16 +77,17 @@
pascal@2264 4 while (!get_file_name (buf, sizeof (buf), qtype, (unsigned char *) q)
pascal@2264 5 && (fd = open (buf, O_RDONLY)) == -1 && (q = strchr (q, '.')) && q++ && (qtype == REQ_SOA
pascal@2264 6 || qtype == REQ_NS));
pascal@2264 7 - if (fd == -1) {
pascal@2264 8 -/* try lookup "*.example.com" where asking for "nonexistant.example.com": */
pascal@2264 9 + for (i = 0; fd == -1; i++) {
pascal@2264 10 +/* try lookup "*.example.com" where asking for "nonexistant.example.com" or "any.where.example.com": */
pascal@2264 11 char *t;
pascal@2264 12 if (qtype == REQ_SOA || qtype == REQ_NS) /* probably a bad idea to wildcard these, so return */
pascal@2264 13 return NULL;
pascal@2264 14 q = t = (char *) strdup (s);
pascal@2264 15 - while (*t && *t != '.')
pascal@2264 16 + for (c = i; *t && *t != '.' || --c >= 0;)
pascal@2264 17 t++;
pascal@2264 18 - if (!*t || t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
pascal@2264 19 - || (fd = open (buf, O_RDONLY)) == -1) {
pascal@2264 20 + t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
pascal@2264 21 + || (fd = open (buf, O_RDONLY));
pascal@2264 22 + if (fd == -1 && !*++t ) {
pascal@2264 23 free (q);
pascal@2264 24 return NULL; }
pascal@2264 25 free (q); }
pascal@2264 26
pascal@2264 27 --- dir.h
pascal@2264 28 +++ dir.h
pascal@2264 29 @@ -11,4 +11,4 @@
pascal@2264 30 char **directory_lookup (int qtype, unsigned char *s);
pascal@2264 31 time_t get_mtime (int qtype, unsigned char *s);
pascal@2264 32
pascal@2264 33 -#define SHEERDNS_DIR "/var/sheerdns"
pascal@2264 34 +#define SHEERDNS_DIR "/var/sheerdns"