2 * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com
4 * SARG Squid Analysis Report Generator http://sarg.sourceforge.net
7 * please look at http://sarg.sourceforge.net/donations.php
8 * ---------------------------------------------------------------------
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
26 #include "include/conf.h"
27 #include "include/defs.h"
29 extern numlist hours
, weekdays
;
34 void parmtest(char *buf
)
37 if(strstr(buf
,"background_color") != 0) {
38 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
39 printf("SARG: Maybe you have a broken record or garbage in background_color parameter.\n");
47 if(strstr(buf
,"text_color") != 0) {
48 if(strstr(buf
,"logo_text_color") == 0) {
49 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
50 printf("SARG: Maybe you have a broken record or garbage in text_color parameter.\n");
59 if(strstr(buf
,"text_bgcolor") != 0) {
60 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
61 printf("SARG: Maybe you have a broken record or garbage in text_bgcolor parameter.\n");
64 strcpy(TxBgColor
,buf
);
69 if(strstr(buf
,"title_color") != 0) {
70 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
71 printf("SARG: Maybe you have a broken record or garbage in title_color parameter.\n");
79 if(strstr(buf
,"logo_image") != 0) {
80 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
81 printf("SARG: Maybe you have a broken record or garbage in logo_image parameter.\n");
84 strcpy(LogoImage
,buf
);
89 if(strstr(buf
,"logo_text") != 0) {
90 if(strstr(buf
,"logo_text_color") == 0) {
91 if (getword(wbuf
,sizeof(wbuf
),buf
,'"')<0) {
92 printf("SARG: Maybe you have a broken record or garbage in logo_text parameter.\n");
95 if (getword(LogoText
,sizeof(LogoText
),buf
,'"')<0) {
96 printf("SARG: Maybe you have a broken record or garbage in logo_text parameter.\n");
104 if(strstr(buf
,"logo_text_color") != 0) {
105 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
106 printf("SARG: Maybe you have a broken record or garbage in logo_text_color parameter.\n");
109 strcpy(LogoTextColor
,buf
);
110 fixnone(LogoTextColor
);
114 if(strstr(buf
,"background_image") != 0) {
115 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
116 printf("SARG: Maybe you have a broken record or garbage in background_image parameter.\n");
124 if(strstr(buf
,"show_sarg_info") != 0) {
125 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
126 printf("SARG: Maybe you have a broken record or garbage in show_sarg_info parameter.\n");
129 strcpy(ShowSargInfo
,buf
);
130 fixnone(ShowSargInfo
);
134 if(strstr(buf
,"show_sarg_logo") != 0) {
135 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
136 printf("SARG: Maybe you have a broken record or garbage in show_sarg_logo parameter.\n");
139 strcpy(ShowSargLogo
,buf
);
140 fixnone(ShowSargLogo
);
144 if(strstr(buf
,"font_face") != 0) {
145 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
146 printf("SARG: Maybe you have a broken record or garbage in font_face parameter.\n");
149 strcpy(FontFace
,buf
);
154 if(strstr(buf
,"header_color") != 0) {
155 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
156 printf("SARG: Maybe you have a broken record or garbage in header_color parameter.\n");
159 strcpy(HeaderColor
,buf
);
160 fixnone(HeaderColor
);
164 if(strstr(buf
,"header_bgcolor") != 0) {
165 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
166 printf("SARG: Maybe you have a broken record or garbage in header_bgcolor parameter.\n");
169 strcpy(HeaderBgColor
,buf
);
170 fixnone(HeaderBgColor
);
174 if(strstr(buf
,"font_size") != 0) {
175 if(strstr(buf
,"header_font_size") == 0 && strstr(buf
,"title_font_size") == 0) {
176 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
177 printf("SARG: Maybe you have a broken record or garbage in font_size parameter.\n");
180 strcpy(FontSize
,buf
);
186 if(strstr(buf
,"header_font_size") != 0) {
187 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
188 printf("SARG: Maybe you have a broken record or garbage in header_font_size parameter.\n");
191 strncpy(HeaderFontSize
,buf
,sizeof(HeaderFontSize
)-1);
192 HeaderFontSize
[sizeof(HeaderFontSize
)-1]=0;
193 fixnone(HeaderFontSize
);
197 if(strstr(buf
,"title_font_size") != 0) {
198 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
199 printf("SARG: Maybe you have a broken record or garbage in title_font_size parameter.\n");
202 strcpy(TitleFontSize
,buf
);
203 fixnone(TitleFontSize
);
207 if(strstr(buf
,"image_size") != 0) {
208 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0 || getword_multisep(Width
,sizeof(Width
),buf
,' ')<0 || getword_multisep(Height
,sizeof(Height
),Height
,0)<0) {
209 printf("SARG: Maybe you have a broken record or garbage in image_size parameter.\n");
217 if(strstr(buf
,"title") != 0) {
218 if (getword(wbuf
,sizeof(wbuf
),buf
,'"')<0 || getword(Title
,sizeof(Title
),buf
,'"')<0) {
219 printf("SARG: Maybe you have a broken record or garbage in title parameter.\n");
226 if(strstr(buf
,"resolve_ip") != 0) {
227 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
228 printf("SARG: Maybe you have a broken record or garbage in resolve_ip parameter.\n");
236 if(strstr(buf
,"user_ip") != 0) {
237 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
238 printf("SARG: Maybe you have a broken record or garbage in user_ip parameter.\n");
246 if(strstr(buf
,"max_elapsed") != 0) {
247 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
248 printf("SARG: Maybe you have a broken record or garbage in max_elapsed parameter.\n");
251 strcpy(MaxElapsed
,buf
);
256 if(strstr(buf
,"date_format") != 0) {
257 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
258 printf("SARG: Maybe you have a broken record or garbage in date_format parameter.\n");
261 strncpy(DateFormat
,buf
,1);
266 if( strstr( buf
, "hours" ) != 0 ) {
267 if( getnumlist( buf
, &hours
, 24, 24 ) ) {
268 fprintf( stderr
, "Error: Invalid syntax in hours tag!\n" );
273 if( strstr( buf
, "weekdays" ) != 0 ) {
274 if( getnumlist( buf
, &weekdays
, 7, 7 ) ) {
275 fprintf( stderr
, "Error: Invalid syntax in weekdays tag!\n" );
280 if(strstr(buf
,"topuser_sort_field") != 0) {
281 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0 || getword_multisep(TopuserSortField
,sizeof(TopuserSortField
),buf
,' ')<0) {
282 printf("SARG: Maybe you have a broken record or garbage in topuser_sort_field parameter.\n");
285 strcpy(TopuserSortOrder
,buf
);
286 fixnone(TopuserSortOrder
);
290 if(strstr(buf
,"user_sort_field") != 0) {
291 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0 || getword_multisep(UserSortField
,sizeof(UserSortField
),buf
,' ')<0) {
292 printf("SARG: Maybe you have a broken record or garbage in user_sort_field parameter.\n");
295 strcpy(UserSortOrder
,buf
);
296 fixnone(UserSortOrder
);
300 if(strstr(buf
,"access_log") != 0) {
301 if(strstr(buf
,"realtime_access_log_lines") == 0) {
302 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
303 printf("SARG: Maybe you have a broken record or garbage in access_log parameter.\n");
306 strcpy(AccessLog
,buf
);
312 if(strstr(buf
,"useragent_log") != 0) {
313 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
314 printf("SARG: Maybe you have a broken record or garbage in useragent_log parameter.\n");
317 strcpy(UserAgentLog
,buf
);
318 fixnone(UserAgentLog
);
322 if(strstr(buf
,"exclude_hosts") != 0) {
323 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
324 printf("SARG: Maybe you have a broken record or garbage in exclude_hosts parameter.\n");
327 strcpy(ExcludeHosts
,buf
);
328 fixnone(ExcludeHosts
);
332 if(strstr(buf
,"exclude_codes") != 0) {
333 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
334 printf("SARG: Maybe you have a broken record or garbage in exclude_codes parameter.\n");
337 strcpy(ExcludeCodes
,buf
);
338 fixnone(ExcludeCodes
);
342 if(strstr(buf
,"exclude_users") != 0) {
343 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
344 printf("SARG: Maybe you have a broken record or garbage in exclude_users parameter.\n");
347 strcpy(ExcludeUsers
,buf
);
348 fixnone(ExcludeUsers
);
352 if(strstr(buf
,"password") != 0) {
353 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
354 printf("SARG: Maybe you have a broken record or garbage in password parameter.\n");
357 strcpy(PasswdFile
,buf
);
362 if(strstr(buf
,"temporary_dir") != 0) {
363 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
364 printf("SARG: Maybe you have a broken record or garbage in temporary_dir parameter.\n");
372 if(strstr(buf
,"report_type") != 0) {
373 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
374 printf("SARG: Maybe you have a broken record or garbage in report_type parameter.\n");
377 strcpy(ReportType
,buf
);
382 if(strstr(buf
,"output_dir") != 0) {
383 if(strstr(buf
,"output_dir_form") == 0) {
384 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
385 printf("SARG: Maybe you have a broken record or garbage in output_dir parameter.\n");
388 strcpy(OutputDir
,buf
);
394 if(strstr(buf
,"output_email") != 0) {
395 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
396 printf("SARG: Maybe you have a broken record or garbage in output_email parameter.\n");
399 strcpy(OutputEmail
,buf
);
400 fixnone(OutputEmail
);
404 if(strstr(buf
,"per_user_limit") != 0) {
405 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0 || getword_multisep(PerUserLimitFile
,sizeof(PerUserLimitFile
),buf
,' ')<0) {
406 printf("SARG: Maybe you have a broken record or garbage in per_user_limit parameter.\n");
409 strcpy(PerUserLimit
,buf
);
410 fixnone(PerUserLimitFile
);
411 fixnone(PerUserLimit
);
416 if(strstr(buf
,"lastlog") != 0) {
417 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
418 printf("SARG: Maybe you have a broken record or garbage in lastlog parameter.\n");
426 if(strstr(buf
,"remove_temp_files") != 0) {
427 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
428 printf("SARG: Maybe you have a broken record or garbage in remove_temp_files parameter.\n");
431 strcpy(RemoveTempFiles
,buf
);
432 fixnone(RemoveTempFiles
);
436 if(strstr(buf
,"replace_index") != 0) {
437 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
438 printf("SARG: Maybe you have a broken record or garbage in replace_index parameter.\n");
441 strcpy(ReplaceIndex
,buf
);
442 fixnone(ReplaceIndex
);
446 if(strstr(buf
,"index_tree") != 0) {
447 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
448 printf("SARG: Maybe you have a broken record or garbage in index_tree parameter.\n");
451 strcpy(IndexTree
,buf
);
456 if(strstr(buf
,"index") != 0) {
457 if(strstr(buf
,"index_sort_order") == 0) {
458 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
459 printf("SARG: Maybe you have a broken record or garbage in index parameter.\n");
468 if(strstr(buf
,"overwrite_report") != 0) {
469 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
470 printf("SARG: Maybe you have a broken record or garbage in overwrite_report parameter.\n");
473 strcpy(OverwriteReport
,buf
);
474 fixnone(OverwriteReport
);
478 if(strstr(buf
,"records_without_userid") != 0) {
479 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
480 printf("SARG: Maybe you have a broken record or garbage in records_without_userid parameter.\n");
483 strcpy(RecordsWithoutUser
,buf
);
484 fixnone(RecordsWithoutUser
);
488 if(strstr(buf
,"use_comma") != 0) {
489 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
490 printf("SARG: Maybe you have a broken record or garbage in use_comma parameter.\n");
493 strcpy(UseComma
,buf
);
498 if(strstr(buf
,"mail_utility") != 0) {
499 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
500 printf("SARG: Maybe you have a broken record or garbage in mail_utility parameter.\n");
503 strcpy(MailUtility
,buf
);
504 fixnone(MailUtility
);
508 if(strstr(buf
,"topsites_num") != 0) {
509 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
510 printf("SARG: Maybe you have a broken record or garbage in topsites_num parameter.\n");
513 strcpy(TopSitesNum
,buf
);
514 fixnone(TopSitesNum
);
518 if(strstr(buf
,"topuser_num") != 0) {
519 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
520 printf("SARG: Maybe you have a broken record or garbage in topuser_num parameter.\n");
523 strcpy(TopUsersNum
,buf
);
524 fixnone(TopUsersNum
);
528 if(strstr(buf
,"usertab") != 0) {
529 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
530 printf("SARG: Maybe you have a broken record or garbage in usertab parameter.\n");
533 strcpy(UserTabFile
,buf
);
534 fixnone(UserTabFile
);
538 if(strstr(buf
,"index_sort_order") != 0) {
539 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
540 printf("SARG: Maybe you have a broken record or garbage in index_sort_order parameter.\n");
543 strcpy(IndexSortOrder
,buf
);
544 fixnone(IndexSortOrder
);
548 if(strstr(buf
,"topsites_sort_order") != 0) {
549 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0 || getword_multisep(TopsitesSortField
,sizeof(TopsitesSortField
),buf
,' ')<0) {
550 printf("SARG: Maybe you have a broken record or garbage in topsites_sort_order parameter.\n");
553 strcpy(TopsitesSortType
,buf
);
554 fixnone(TopsitesSortField
);
555 fixnone(TopsitesSortType
);
559 if(strstr(buf
,"long_url") != 0) {
560 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
561 printf("SARG: Maybe you have a broken record or garbage in long_url parameter.\n");
569 if(strstr(buf
,"language") != 0) {
570 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
571 printf("SARG: Maybe you have a broken record or garbage in language parameter.\n");
574 strcpy(language
,buf
);
579 if(strstr(buf
,"dansguardian_conf") != 0) {
580 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
581 printf("SARG: Maybe you have a broken record or garbage in dansguardian_conf parameter.\n");
584 strcpy(DansGuardianConf
,buf
);
585 fixnone(DansGuardianConf
);
589 if(strstr(buf
,"squidguard_conf") != 0) {
590 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
591 printf("SARG: Maybe you have a broken record or garbage in squidguard_conf parameter.\n");
594 strcpy(SquidGuardConf
,buf
);
595 fixnone(SquidGuardConf
);
599 if(strstr(buf
,"date_time_by") != 0) {
600 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
601 printf("SARG: Maybe you have a broken record or garbage in date_time_by parameter.\n");
604 strcpy(datetimeby
,buf
);
609 if(strstr(buf
,"charset") != 0) {
610 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
611 printf("SARG: Maybe you have a broken record or garbage in charset parameter.\n");
620 if(strstr(buf
,"user_invalid_char") != 0) {
621 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,'"')<0 || getword_multisep(UserInvalidChar
,sizeof(UserInvalidChar
),buf
,'"')<0) {
622 printf("SARG: Maybe you have a broken record or garbage in user_invalid_char parameter.\n");
625 fixnone(UserInvalidChar
);
629 if(strstr(buf
,"include_users") != 0) {
630 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,'"')<0 || getword_multisep(wbuf
,sizeof(wbuf
),buf
,'"')<0) {
631 printf("SARG: Maybe you have a broken record or garbage in include_users parameter.\n");
634 sprintf(IncludeUsers
,":%s:",wbuf
);
635 fixnone(IncludeUsers
);
639 if(strstr(buf
,"exclude_string") != 0) {
640 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,'"')<0 || getword_multisep(ExcludeString
,sizeof(ExcludeString
),buf
,'"')<0) {
641 printf("SARG: Maybe you have a broken record or garbage in exclude_string parameter.\n");
644 fixnone(ExcludeString
);
648 if(strstr(buf
,"privacy") != 0) {
649 if(strstr(buf
,"privacy_string") == 0 && \
650 strstr(buf
,"privacy_string_color") == 0) {
651 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
652 printf("SARG: Maybe you have a broken record or garbage in privacy parameter.\n");
661 if(strstr(buf
,"privacy_string") != 0) {
662 if(strstr(buf
,"privacy_string_color") == 0) {
663 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,'"')<0 || getword_multisep(PrivacyString
,sizeof(PrivacyString
),buf
,'"')<0) {
664 printf("SARG: Maybe you have a broken record or garbage in privacy_string parameter.\n");
667 fixnone(PrivacyString
);
672 if(strstr(buf
,"privacy_string_color") != 0) {
673 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
674 printf("SARG: Maybe you have a broken record or garbage in privacy_string_color parameter.\n");
677 strcpy(PrivacyStringColor
,buf
);
678 fixnone(PrivacyStringColor
);
682 if(strstr(buf
,"show_successful_message") != 0) {
683 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
684 printf("SARG: Maybe you have a broken record or garbage in show_successful_message parameter.\n");
687 strcpy(SuccessfulMsg
,buf
);
688 fixnone(SuccessfulMsg
);
692 if(strstr(buf
,"show_read_statistics") != 0) {
693 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
694 printf("SARG: Maybe you have a broken record or garbage in show_read_statistics parameter.\n");
697 strcpy(ShowReadStatistics
,buf
);
698 fixnone(ShowReadStatistics
);
702 if(strstr(buf
,"topuser_fields") != 0) {
703 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
704 printf("SARG: Maybe you have a broken record or garbage in topuser_fields parameter.\n");
707 strcpy(TopUserFields
,buf
);
708 fixnone(TopUserFields
);
712 if(strstr(buf
,"bytes_in_sites_users_report") != 0) {
713 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
714 printf("SARG: Maybe you have a broken record or garbage in bytes_in_sites_users_report parameter.\n");
717 strcpy(BytesInSitesUsersReport
,buf
);
718 fixnone(BytesInSitesUsersReport
);
722 if(strstr(buf
,"user_report_fields") != 0) {
723 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
724 printf("SARG: Maybe you have a broken record or garbage in user_report_fields parameter.\n");
727 strcpy(UserReportFields
,buf
);
728 fixnone(UserReportFields
);
732 if(strstr(buf
,"bytes_in_sites_users_report") != 0) {
733 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
734 printf("SARG: Maybe you have a broken record or garbage in site_user_time_date_type parameter.\n");
737 strcpy(BytesInSitesUsersReport
,buf
);
738 fixnone(BytesInSitesUsersReport
);
742 if(strstr(buf
,"datafile ") != 0) {
743 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
744 printf("SARG: Maybe you have a broken record or garbage in datafile parameter.\n");
747 strcpy(DataFile
,buf
);
752 if(strstr(buf
,"datafile_delimiter") != 0) {
753 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0 || getword(wbuf
,sizeof(wbuf
),buf
,'"')<0 ||
754 getword(DataFileDelimiter
,sizeof(DataFileDelimiter
),buf
,'"')<0) {
755 printf("SARG: Maybe you have a broken record or garbage in datafile_delimiter parameter.\n");
758 fixnone(DataFileDelimiter
);
762 if(strstr(buf
,"datafile_fields") != 0) {
763 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
764 printf("SARG: Maybe you have a broken record or garbage in datafile_fields parameter.\n");
767 strcpy(DataFileFields
,buf
);
768 fixnone(DataFileFields
);
772 if(strstr(buf
,"datafile_url") != 0) {
773 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
774 printf("SARG: Maybe you have a broken record or garbage in datafile_url parameter.\n");
777 strcpy(DataFileUrl
,buf
);
778 fixnone(DataFileUrl
);
782 if(strstr(buf
,"parsed_output_log") != 0) {
783 if(strstr(buf
,"parsed_output_log_compress") == 0) {
784 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
785 printf("SARG: Maybe you have a broken record or garbage in parsed_output_log parameter.\n");
788 strcpy(ParsedOutputLog
,buf
);
789 fixnone(ParsedOutputLog
);
794 if(strstr(buf
,"parsed_output_log_compress") != 0) {
795 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
796 printf("SARG: Maybe you have a broken record or garbage in parsed_output_log_compress parameter.\n");
799 strcpy(ParsedOutputLogCompress
,buf
);
800 fixnone(ParsedOutputLogCompress
);
804 if(strstr(buf
,"displayed_values") != 0) {
805 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
806 printf("SARG: Maybe you have a broken record or garbage in displayed_values parameter.\n");
809 strcpy(DisplayedValues
,buf
);
810 fixnone(DisplayedValues
);
814 if(strstr(buf
,"authfail_report_limit") != 0) {
815 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
816 printf("SARG: Maybe you have a broken record or garbage in authfail_report_limit parameter.\n");
819 AuthfailReportLimit
=atoi(buf
);
823 if(strstr(buf
,"denied_report_limit") != 0) {
824 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
825 printf("SARG: Maybe you have a broken record or garbage in denied_report_limit parameter.\n");
828 DeniedReportLimit
=atoi(buf
);
832 if(strstr(buf
,"siteusers_report_limit") != 0) {
833 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
834 printf("SARG: Maybe you have a broken record or garbage in siteusers_report_limit parameter.\n");
837 SiteUsersReportLimit
=atoi(buf
);
841 if(strstr(buf
,"dansguardian_report_limit") != 0) {
842 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
843 printf("SARG: Maybe you have a broken record or garbage in dansguardian_report_limit parameter.\n");
846 DansGuardianReportLimit
=atoi(buf
);
850 if(strstr(buf
,"squidguard_report_limit") != 0) {
851 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
852 printf("SARG: Maybe you have a broken record or garbage in squidguard_report_limit parameter.\n");
855 SquidGuardReportLimit
=atoi(buf
);
859 if(strstr(buf
,"user_report_limit") != 0) {
860 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
861 printf("SARG: Maybe you have a broken record or garbage in user_report_limit parameter.\n");
864 UserReportLimit
=atoi(buf
);
868 if(strstr(buf
,"download_report_limit") != 0) {
869 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
870 printf("SARG: Maybe you have a broken record or garbage in download_report_limit parameter.\n");
873 DownloadReportLimit
=atoi(buf
);
877 if(strstr(buf
,"www_document_root") != 0) {
878 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
879 printf("SARG: Maybe you have a broken record or garbage in www_document_root parameter.\n");
882 strcpy(wwwDocumentRoot
,buf
);
883 fixnone(wwwDocumentRoot
);
887 if(strstr(buf
,"block_it") != 0) {
888 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
889 printf("SARG: Maybe you have a broken record or garbage in block_it parameter.\n");
897 if(strstr(buf
,"external_css_file") != 0) {
898 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
899 printf("SARG: Maybe you have a broken record or garbage in external_css_file parameter.\n");
902 strcpy(ExternalCSSFile
,buf
);
903 fixnone(ExternalCSSFile
);
907 if(strstr(buf
,"user_authentication") != 0) {
908 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
909 printf("SARG: Maybe you have a broken record or garbage in user_authentication parameter.\n");
912 strcpy(UserAuthentication
,buf
);
913 fixnone(UserAuthentication
);
917 if(strstr(buf
,"AuthUserFile") != 0) {
918 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
919 printf("SARG: Maybe you have a broken record or garbage in AuthUserFile parameter.\n");
922 strcpy(AuthUserFile
,buf
);
923 fixnone(AuthUserFile
);
927 if(strstr(buf
,"AuthName") != 0) {
928 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
929 printf("SARG: Maybe you have a broken record or garbage in AuthName parameter.\n");
932 strcpy(AuthName
,buf
);
937 if(strstr(buf
,"AuthType") != 0) {
938 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
939 printf("SARG: Maybe you have a broken record or garbage in AuthType parameter.\n");
942 strcpy(AuthType
,buf
);
947 if(strstr(buf
,"Require") != 0) {
948 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
949 printf("SARG: Maybe you have a broken record or garbage in Require parameter.\n");
957 if(strstr(buf
,"download_suffix") != 0) {
958 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,'"')<0 || getword_multisep(DownloadSuffix
,sizeof(DownloadSuffix
),buf
,'"')<0) {
959 printf("SARG: Maybe you have a broken record or garbage in download_suffix parameter.\n");
962 fixnone(DownloadSuffix
);
966 if(strstr(buf
,"graphs") != 0) {
967 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
968 printf("SARG: Maybe you have a broken record or garbage in graphs parameter.\n");
976 if(strstr(buf
,"graph_days_bytes_bar_color") != 0) {
977 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
978 printf("SARG: Maybe you have a broken record or garbage in graph_days_bytes_bar_color parameter.\n");
981 strcpy(GraphDaysBytesBarColor
,buf
);
982 fixnone(GraphDaysBytesBarColor
);
986 if(strstr(buf
,"squidguard_log_format") != 0) {
987 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
988 printf("SARG: Maybe you have a broken record or garbage in squidguard_log_format parameter.\n");
991 strcpy(SquidGuardLogFormat
,buf
);
992 fixnone(SquidGuardLogFormat
);
996 if(strstr(buf
,"squidguard_ignore_date") != 0) {
997 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
998 printf("SARG: Maybe you have a broken record or garbage in squidguard_ignore_date parameter.\n");
1001 strcpy(SquidguardIgnoreDate
,buf
);
1002 fixnone(SquidguardIgnoreDate
);
1006 if(strstr(buf
,"dansguardian_ignore_date") != 0) {
1007 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1008 printf("SARG: Maybe you have a broken record or garbage in dansguardian_ignore_date parameter.\n");
1011 strcpy(DansguardianIgnoreDate
,buf
);
1012 fixnone(DansguardianIgnoreDate
);
1016 if(strstr(buf
,"ulimit") != 0) {
1017 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1018 printf("SARG: Maybe you have a broken record or garbage in ulimit parameter.\n");
1026 if(strstr(buf
,"ntlm_user_format") != 0) {
1027 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1028 printf("SARG: Maybe you have a broken record or garbage in ntlm_user_format parameter.\n");
1031 strcpy(NtlmUserFormat
,buf
);
1032 fixnone(NtlmUserFormat
);
1036 if(strstr(buf
,"realtime_types") != 0) {
1037 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1038 printf("SARG: Maybe you have a broken record or garbage in realtime_types parameter.\n");
1041 strcpy(RealtimeTypes
,buf
);
1042 fixnone(RealtimeTypes
);
1046 if(strstr(buf
,"realtime_unauthenticated_records") != 0) {
1047 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1048 printf("SARG: Maybe you have a broken record or garbage in realtime_unauthenticated_records parameter.\n");
1051 strcpy(RealtimeUnauthRec
,buf
);
1052 fixnone(RealtimeUnauthRec
);
1056 if(strstr(buf
,"realtime_refresh_time") != 0) {
1057 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1058 printf("SARG: Maybe you have a broken record or garbage in realtime_refresh_time parameter.\n");
1061 realtime_refresh
=atoi(buf
);
1065 if(strstr(buf
,"realtime_access_log_lines") != 0) {
1066 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1067 printf("SARG: Maybe you have a broken record or garbage in realtime_access_log_lines parameter.\n");
1070 realtime_access_log_lines
=atoi(buf
);
1074 if(strstr(buf
,"squid24") != 0) {
1079 if(strstr(buf
,"byte_cost") != 0) {
1080 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1081 printf("SARG: Maybe you have a broken record or garbage in byte_cost parameter.\n");
1085 if (getword_multisep(wbuf
,sizeof(wbuf
),buf
,' ')<0) {
1086 printf("SARG: Maybe you have a broken record or garbage in byte_cost parameter.\n");
1089 nocost
=my_atoll(buf
);
1101 sprintf(Msg
,"Loading configuration from: %s",ConfigFile
);
1105 if ((fp_in
= fopen(ConfigFile
, "r")) == NULL
) {
1106 fprintf(stderr
, "SARG: (getconf) Cannot open file: %s\n",ConfigFile
);
1110 while (fgets(buf
, MAXLEN
, fp_in
) != NULL
) {
1111 if(strstr(buf
,"\n") != 0)
1112 buf
[strlen(buf
)-1]='\0';
1115 printf("SYSCONFDIR %s",buf
);
1117 if(strncmp(buf
,"#",1) == 0 || strlen(buf
) < 1)
1121 printf("SARG: TAG: %s\n",buf
);
1128 language_load(language
);