Sorry, I missed that an address should be able to contain a slash (used with netmask) and a % and some more stuff too if it's a scoped IPv6 address. Here's a new patch.
Thorild Selén Datorföreningen Update / Update Computer Club, Uppsala, SE ---------------------------------------------------------------------- --- rsync/access.c 2003-01-20 14:46:28.000000000 +0100 +++ rsync-new/access.c 2003-07-05 02:02:09.000000000 +0200 @@ -93,7 +93,10 @@ if (p) *p++ = '/'; if (gai) { - rprintf(FERROR,"malformed address %s\n", tok); + rprintf(FERROR, + "error matching address %s: %s\n", + tok, + gai_strerror(gai)); freeaddrinfo(resa); return 0; } @@ -192,6 +195,19 @@ return ret; } +/* Test if a string is likely to be an (IPv4 or IPv6) address */ +static int likely_address(char *s) +{ + size_t len = strlen(s); + + return ((strspn(s, "./0123456789") == len) +#ifdef INET6 + || (strspn(s, "/0123456789:ABCDEFabcdef") == len) + || strchr(s, '%') +#endif + ); +} + static int access_match(char *list, char *addr, char *host) { char *tok; @@ -203,7 +219,9 @@ if (host) strlower(host); for (tok=strtok(list2," ,\t"); tok; tok=strtok(NULL," ,\t")) { - if (match_hostname(host, tok) || match_address(addr, tok)) { + if (match_hostname(host, tok) + || (likely_address(tok) + && match_address(addr, tok))) { free(list2); return 1; } -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html