]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Don't try to resolve aliased host names when creating the datafile
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 5 Nov 2015 20:10:38 +0000 (21:10 +0100)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Thu, 5 Nov 2015 20:10:38 +0000 (21:10 +0100)
If a host name has been previously replaced by an alias, there is no point
in trying to convert the host name into an IP address if datafile_url is
set to ip (the default value).

datafile.c

index bb11b0ebe13b5e5970598e931fcd850e2bbcd15c..23c1a22af7a861f4eba1aa09b573e3033f34ebfb 100644 (file)
@@ -229,7 +229,7 @@ static void saverecs(FILE *fp_ou, const struct userinfostruct *uinfo, long long
        }
        if((DataFileFields & DATA_FIELD_URL) != 0) {
                url_hostname(url,name,sizeof(name));
-               if (DataFileUrl == DATAFILEURL_IP) name2ip(name,sizeof(name));
+               if (DataFileUrl == DATAFILEURL_IP && name[0]!=ALIAS_PREFIX) name2ip(name,sizeof(name));
                fputs(name,fp_ou);
                fputc(DataFileDelimiter[0],fp_ou);
        }