Some url in a squidGuard log don't start with a scheme:// and may not
even contain a path. Those bare minimum url are not parsed correctly
by the redirector_log_format suggested in sarg.conf.
To parse those log entries correctly, we grab the whole url in the
buffer and strip it down to keep the host name.
}
strcpy(user,res);
} else if(strcmp(leks,"url") == 0) {
- if (strlen(res)>=sizeof(full_url)) {
- debuga(_("URL too long in redirector log file %s\n"),wentp);
- RedirectorErrors++;
- return;
- }
- strcpy(full_url,res);
+ /*
+ * Don't worry about the url being truncated as we only keep the host name
+ * any way...
+ */
+ safe_strcpy(full_url,res,sizeof(full_url));
}
}
}
# Format string for web proxy redirector logs.
# This option was named squidguard_log_format before sarg 2.3.
# REJIK #year#-#mon#-#day# #hour# #list#:#tmp# #ip# #user# #tmp#/#tmp#/#url#/#end#
-# SQUIDGUARD #year#-#mon#-#day# #hour# #tmp#/#list#/#tmp#/#tmp#/#url#/#tmp# #ip#/#tmp# #user# #end#
-#redirector_log_format #year#-#mon#-#day# #hour# #tmp#/#list#/#tmp#/#tmp#/#url#/#tmp# #ip#/#tmp# #user# #end#
+# SQUIDGUARD #year#-#mon#-#day# #hour# #tmp#/#list#/#tmp# #url# #ip#/#tmp# #user# #end#
+#redirector_log_format #year#-#mon#-#day# #hour# #tmp#/#list#/#tmp# #url# #ip#/#tmp# #user# #end#
# TAG: show_sarg_info yes|no
# shows sarg information and site path on each report bottom