]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Allows quoting of : (as \:) in hosts.hfaxd file for IPv6 addresses
authorAidan Van Dyk <aidan@ifax.com>
Fri, 16 Jan 2009 18:59:46 +0000 (18:59 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Fri, 16 Jan 2009 18:59:46 +0000 (18:59 +0000)
This permits to specify an exact IPv6 address (or address-range) to accept
without needing a much complicated regex using ranges.

hfaxd/User.c++

index 8dc955295ac63714f459ca091586cd79f256df7c..a5ece5edad8518621d71bf33a0d402adc372ff07 100644 (file)
@@ -157,7 +157,10 @@ HylaFAXServer::checkuserHosts(FILE* db, const char* name)
        char* cp;
        bool userandhost = false;
        for (cp = line; *cp && *cp != ':'; cp++)
-           if (*cp == '@') userandhost = true;
+           if (*cp == '\\' && *(cp+1)) // skip check of next char unless it's end of string
+               cp++;
+           else if (*cp == '@')
+               userandhost = true;
 
        const char* base = &line[line[0] == '!'];
        fxStr pattern(base, cp-base);