From: Frederic Marchal Date: Thu, 5 Nov 2015 20:10:38 +0000 (+0100) Subject: Don't try to resolve aliased host names when creating the datafile X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08ed96f04a1b358e64f49f3e65c542ad4cb0952f;p=thirdparty%2Fsarg.git Don't try to resolve aliased host names when creating the datafile 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). --- diff --git a/datafile.c b/datafile.c index bb11b0e..23c1a22 100644 --- a/datafile.c +++ b/datafile.c @@ -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); }