diff options
author | Wayne Davison <wayned@samba.org> | 2003-07-05 07:39:57 +0000 |
---|---|---|
committer | Wayne Davison <wayned@samba.org> | 2003-07-05 07:39:57 +0000 |
commit | 70a6051cf12ffe4984f2ccb8147877c587cca564 (patch) | |
tree | 3e89d3b2e6dbbdf66e30b2296033bbfa470dd521 /access.c | |
parent | 7a1f46b6ac5a33f1093727aa462b334de783df25 (diff) | |
download | rsync-70a6051cf12ffe4984f2ccb8147877c587cca564.tar.gz rsync-70a6051cf12ffe4984f2ccb8147877c587cca564.tar.bz2 rsync-70a6051cf12ffe4984f2ccb8147877c587cca564.zip |
Restored an isdigit() check in the match_address() function, but check
the last character in the hostname, not the first.
Diffstat (limited to 'access.c')
-rw-r--r-- | access.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -79,6 +79,11 @@ static int match_address(char *addr, char *tok) p = strchr(tok,'/'); if (p) *p = 0; + /* skip if last char is not a digit (i.e. not an address) */ + /* (don't check first char - might be 11.22.33.44.an.isp) */ + if (!*tok) return 0; /* nothing to check */ + if (!isdigit(*(unsigned char*)tok+strlen(tok)-1)) return 0; + memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; |