]>
git.ipfire.org Git - thirdparty/sarg.git/blob - report.c
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 static void maketmp ( const char * user
, const char * dirname
, int debug
, int indexonly
);
30 static void maketmp_hour ( const char * user
, const char * dirname
, int indexonly
);
31 static void gravatmp_hora ( const char * dirname
, const char * user
, const char * data
, const char * hora
, const char * elap
, const char * accbytes
, int indexonly
);
32 static void gravatmpf ( const char * oldaccuser
, const char * dirname
, const char * oldurl
, long long int nacc
, long long int nbytes
, const char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
);
33 static void gravaporuser ( const char * user
, const char * dirname
, const char * url
, const char * ip
, const char * data
, const char * hora
, const char * tam
, const char * elap
, int indexonly
);
34 static void gravager ( FILE * fp_gen
, const char * user
, long long int nacc
, const char * url
, long long int nbytes
, const char * ip
, const char * hora
, const char * dia
, long long int nelap
, long long int incache
, long long int oucache
);
35 static void grava_SmartFilter ( const char * dirname
, const char * user
, const char * ip
, const char * data
, const char * hora
, const char * url
, const char * smart
);
43 char accdia
[ 11 ], acchora
[ 9 ], accuser
[ MAXLEN
], accip
[ MAXLEN
], accurl
[ MAXLEN
], accbytes
[ 12 ], accelap
[ 10 ];
44 char oldaccdia
[ 11 ], oldacchora
[ 9 ], oldaccip
[ MAXLEN
], wdir
[ MAXLEN
], per1
[ MAXLEN
];
45 char wdirname
[ MAXLEN
], oldurl
[ MAXLEN
], oldaccuser
[ MAXLEN
];
46 char olduser
[ MAXLEN
], oldmsg
[ 50 ], acccode
[ MAXLEN
/ 2 - 1 ], oldaccelap
[ 10 ], oldacccode
[ MAXLEN
/ 2 - 1 ], user
[ MAXLEN
];
47 char ipantes
[ MAXLEN
], nameantes
[ MAXLEN
];
48 char accsmart
[ MAXLEN
];
49 char crc2
[ MAXLEN
/ 2 - 1 ];
51 long long int nbytes
= 0 ;
52 long long int nelap
= 0 ;
54 long long int rtotal
= 0 ;
55 long long int incache
= 0 ;
56 long long int oucache
= 0 ;
59 struct dirent
* direntp
;
60 const char logext
[]= ".log" ;
63 struct getwordstruct gwarea
;
69 sprintf ( dirname
, "%s%s" , outdir
, period
);
70 sprintf ( wdir
, "%s%s" , outdir
, period
);
72 vrfydir ( wdir
, per1
, addr
, site
, us
, email
);
75 debugaz ( "dirname" , dirname
);
79 gperiod ( dirname
, period
);
81 if ( UserAgentLog
[ 0 ] != '\0' && email
[ 0 ] == '\0' ) useragent ();
83 sprintf ( wdirname
, "%s/sarg-general" , dirname
);
84 if (( fp_gen
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
85 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
90 strncat ( tmp
, "/sarg" , 5 );
93 while (( direntp
= readdir ( dirp
)) != NULL
) {
94 dlen
= strlen ( direntp
-> d_name
)-( sizeof ( logext
)- 1 );
96 if (( strcmp ( direntp
-> d_name
+ dlen
, logext
) != 0 ) ||
97 ( strncmp ( direntp
-> d_name
, "download.log" , 12 ) == 0 ) ||
98 ( strncmp ( direntp
-> d_name
, "denied.log" , 10 ) == 0 ) ||
99 ( strncmp ( direntp
-> d_name
, "authfail.log.unsort" , 19 ) == 0 ))
101 if ( snprintf ( tmp3
, sizeof ( tmp3
), "%s/%s" , tmp
, direntp
-> d_name
)>= sizeof ( tmp3
)) {
102 fprintf ( stderr
, "SARG: (report) directory entry too long: %s/%s \n " , tmp
, direntp
-> d_name
);
105 if (( fp_in
= MY_FOPEN ( tmp3
, "r" ))== NULL
){
106 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], tmp
);
111 if ( dlen
>= sizeof ( user
)) continue ;
112 strncpy ( user
, direntp
-> d_name
, dlen
);
118 strcpy ( wdirname
, dirname
);
119 maketmp ( user
, tmp
, debug
, indexonly
);
120 maketmp_hour ( user
, tmp
, indexonly
);
123 if ( strcmp ( Ip2Name
, "yes" ) == 0 )
124 ip2name ( u2
, sizeof ( u2
));
125 get_usertab_name ( u2
, name
, sizeof ( name
));
127 if ( dotinuser
&& strchr ( name
, '_' )) {
128 subs ( name
, sizeof ( name
), "_" , "." );
132 bzero ( html_old
, MAXLEN
);
134 while ( fgets ( buf
, sizeof ( buf
), fp_in
)!= NULL
) {
135 getword_start (& gwarea
, buf
);
136 if ( getword ( accdia
, sizeof ( accdia
),& gwarea
, ' \t ' )< 0 || getword ( acchora
, sizeof ( acchora
),& gwarea
, ' \t ' )< 0 ||
137 getword ( accuser
, sizeof ( accuser
),& gwarea
, ' \t ' )< 0 || getword ( accip
, sizeof ( accip
),& gwarea
, ' \t ' )< 0 ||
138 getword ( accurl
, sizeof ( accurl
),& gwarea
, ' \t ' )< 0 || getword ( accbytes
, sizeof ( accbytes
),& gwarea
, ' \t ' )< 0 ||
139 getword ( acccode
, sizeof ( acccode
),& gwarea
, ' \t ' )< 0 ) {
140 printf ( "SARG: Maybe you have a broken record or garbage in your %s file. \n " , tmp3
);
143 if ( strncmp ( acccode
, "TCP_DENIED/407" , 14 ) == 0 ) continue ;
144 if ( getword ( accelap
, sizeof ( accelap
),& gwarea
, ' \t ' )< 0 || getword_skip ( 20000 ,& gwarea
, ' \t ' )< 0 ||
145 getword ( accsmart
, sizeof ( accsmart
),& gwarea
, '"' )< 0 ) {
146 printf ( "SARG: Maybe you have a broken record or garbage in your %s file. \n " , tmp3
);
150 if ( accsmart
[ 0 ] != '\0' ) {
152 strcpy ( wdirname
, dirname
);
153 grava_SmartFilter ( wdirname
, accuser
, accip
, accdia
, acchora
, accurl
, accsmart
);
156 if ( strcmp ( Ip2Name
, "yes" ) == 0 ) {
157 if ( strcmp ( accip
, ipantes
) != 0 ) {
158 strcpy ( ipantes
, accip
);
159 ip2name ( accip
, sizeof ( accip
));
160 strcpy ( nameantes
, accip
);
161 } else strcpy ( accip
, nameantes
);
164 strcpy ( wdirname
, dirname
);
165 gravatmp_hora ( wdirname
, accuser
, accdia
, acchora
, accelap
, accbytes
, indexonly
);
168 strcpy ( wdirname
, dirname
);
169 gravaporuser ( accuser
, wdirname
, accurl
, accip
, accdia
, acchora
, accbytes
, accelap
, indexonly
);
173 strcpy ( oldurl
, accurl
);
174 strcpy ( oldacccode
, acccode
);
175 strcpy ( oldaccelap
, accelap
);
176 strcpy ( oldaccuser
, accuser
);
177 strcpy ( oldaccip
, accip
);
178 strcpy ( oldaccdia
, accdia
);
179 strcpy ( oldacchora
, acchora
);
183 if ( site
[ 0 ] != '\0' ) {
184 if ( strcmp ( oldaccuser
, accuser
) != 0 ){
186 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
187 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
188 gravatmp ( oldaccuser
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
189 gravager ( fp_gen
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
197 if ( strcmp ( oldurl
, accurl
) != 0 || strcmp ( oldaccuser
, accuser
) != 0 ){
199 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
200 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
201 gravatmp ( oldaccuser
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
202 gravager ( fp_gen
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
208 if ( strcmp ( oldaccuser
, accuser
) != 0 )
213 nbytes
+= my_atoll ( accbytes
);
214 nelap
+= my_atoll ( accelap
);
216 if ( strstr ( ReportType
, "site_user_time_date" ) != 0 ) {
219 strcpy ( siteind
, accurl
);
220 for ( str
= siteind
; * str
; str
++) {
221 if (* str
== '?' || * str
== '-' || * str
== '.' || * str
== ':' || * str
== '/' || * str
== ' \\ ' || * str
== '*' ||
222 * str
== ' \' ' || * str
== ' \" ' || * str
== '$' )
225 sprintf ( arqtt
, "%s/%s" , dirname
, accuser
);
226 if ( access ( arqtt
, R_OK
) != 0 )
228 sprintf ( arqtt
, "%s/%s/tt%s-%s.html" , dirname
, accuser
, accuser
, siteind
);
229 if ( strlen ( arqtt
) > 255 ) {
232 if (( fp_tt
= fopen ( arqtt
, "w" )) == 0 ) {
233 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], arqtt
);
239 if(strcmp(Privacy,"yes") == 0)
240 sprintf(httplink,"<font size=%s color=%s><href=http://%s>%s", \
241 FontSize,PrivacyStringColor,PrivacyString,PrivacyString);
243 sprintf(httplink,"<font size=%s><a href=\"http://%s\">%s</a>",FontSize,accurl,accurl);
246 sprintf ( ltext110
, "%s" , text
[ 110 ]);
247 for ( str
= ltext110
; * str
; ++ str
)
250 fprintf ( fp_tt
, "<!DOCTYPE HTML PUBLIC \" -//W3C//DTD HTML 4.01 Transitional//EN \" \" http://www.w3.org/TR/html4/loose.dtd \" > \n <html> \n <head> \n <meta http-equiv= \" Content-Type \" content= \" text/html; charset=%s \" > \n " , CharSet
);
252 fputs ( "</head> \n " , fp_tt
);
253 fprintf ( fp_tt
, "<body bgcolor= \" %s \" text= \" %s \" background= \" %s \" > \n " , BgColor
, TxColor
, BgImage
);
254 write_logo_image ( fp_tt
);
256 if ( strcmp ( IndexTree
, "date" ) == 0 )
257 show_sarg ( fp_tt
, "../../../.." );
259 show_sarg ( fp_tt
, "../.." );
261 fputs ( "<div align= \" center \" ><table cellpadding= \" 0 \" cellspacing= \" 0 \" > \n " , fp_tt
);
262 fprintf ( fp_tt
, "<tr><th class= \" title \" colspan= \" 2 \" >%s</th></tr> \n " , Title
);
264 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s</td></tr> \n " , text
[ 89 ], period
);
265 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s</td></tr> \n " , text
[ 90 ], name
);
266 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s, %s</td></tr> \n " , text
[ 104 ], UserSortField
, UserSortOrder
);
267 fprintf ( fp_tt
, "<tr><th class= \" header3 \" colspan= \" 2 \" >%s</th></tr> \n " , text
[ 32 ]);
269 fputs ( "</table></div> \n " , fp_tt
);
270 fputs ( "<div align= \" center \" ><table cellpadding= \" 0 \" cellspacing= \" 2 \" > \n " , fp_tt
);
271 fputs ( "<tr><td></td><td></td></tr>" , fp_tt
);
273 strncpy ( tmp4
, text
[ 110 ], 4 );
274 fprintf ( fp_tt
, "<tr><th class= \" header \" >%s</th><th class= \" header \" >%s</th><th class= \" header \" >%s</th></tr> \n " , text
[ 91 ], tmp4
, text
[ 110 ]+ 5 );
277 sprintf ( html
, "<tr><td class= \" data \" >%s</td><td class= \" data \" >%s</td><td class= \" data \" >%s</td></tr> \n " , accurl
, accdia
, acchora
);
279 if ( strcmp ( html
, html_old
) != 0 )
281 strcpy ( html_old
, html
);
282 } else bzero ( ltext110
, 50 );
284 strcpy ( crc2
, acccode
);
285 str
= strchr ( crc2
, '/' );
288 if ( strstr ( crc2
, "MISS" ) != 0 )
289 oucache
+= my_atoll ( accbytes
);
290 else incache
+= my_atoll ( accbytes
);
292 strcpy ( oldurl
, accurl
);
294 if ( strcmp ( accuser
, oldaccuser
) != 0 ) {
295 strcpy ( wdirname
, dirname
);
296 day_totalize ( tmp
, oldaccuser
, indexonly
);
299 strcpy ( oldaccuser
, accuser
);
300 strcpy ( oldacccode
, acccode
);
301 strcpy ( oldaccelap
, accelap
);
302 strcpy ( oldaccip
, accip
);
303 strcpy ( oldaccdia
, accdia
);
304 strcpy ( oldacchora
, acchora
);
314 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
315 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
316 strcpy ( wdirname
, dirname
);
317 if ( strlen ( oldaccuser
) == 0 )
318 strcpy ( oldaccuser
, accuser
);
319 gravatmpf ( oldaccuser
, wdirname
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
320 strcpy ( wdirname
, dirname
);
321 gravager ( fp_gen
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
323 day_totalize ( tmp
, oldaccuser
, indexonly
);
327 strcpy ( wdirname
, dirname
);
328 totalger ( wdirname
, debug
, outdir
);
330 if ( email
[ 0 ] == '\0' ) {
331 if ( strstr ( ReportType
, "downloads" ) != 0 ) download_report ();
333 if ( strlen ( DansGuardianConf
) > 0 ) {
334 strcpy ( wdirname
, dirname
);
338 strcpy ( wdirname
, dirname
);
341 strcpy ( wdirname
, dirname
);
344 if ( strstr ( ReportType
, "topsites" ) != 0 ) topsites ();
346 if ( strstr ( ReportType
, "sites_users" ) != 0 ) siteuser ();
349 strcpy ( wdirname
, dirname
);
352 if ( smartfilter
) smartfilter_report ();
354 if ( strlen ( DansGuardianConf
) > 0 ) dansguardian_report ();
358 if ( strstr ( ReportType
, "users_sites" ) != 0 ) htmlrel ();
362 if ( strncmp ( SuccessfulMsg
, "yes" , 3 ) == 0 ) fprintf ( stderr
, "SARG: %s %s \n " , text
[ 47 ], dirname
);
364 strcpy ( wdirname
, dirname
);
365 geramail ( wdirname
, debug
, outdir
, userip
, email
, TempDir
);
367 if (( strcmp ( email
, "stdout" ) != 0 ) && ( strncmp ( SuccessfulMsg
, "yes" , 3 ) == 0 ))
368 fprintf ( stderr
, "SARG: %s %s \n " , text
[ 48 ], email
);
372 strcpy ( wdirname
, dirname
);
373 index_only ( wdirname
, debug
);
377 2009-10-13(Frederic) This piece of code is never called so it is commented out for good.
378 if(strlen(email) < 0)
385 static void maketmp ( const char * user
, const char * dirname
, int debug
, int indexonly
)
390 char wdirname
[ MAXLEN
];
392 if ( indexonly
) return ;
393 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
395 strcpy ( wdirname
, tmp
);
396 strcat ( wdirname
, "/" );
397 strcat ( wdirname
, user
);
400 debuga ( "%s: %s" , text
[ 49 ], wdirname
);
403 strcat ( wdirname
, ".utmp" );
404 if (( fp_ou
= fopen ( wdirname
, "w" ))== NULL
){
405 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
414 static void maketmp_hour ( const char * user
, const char * dirname
, int indexonly
)
419 char wdirname
[ MAXLEN
];
421 if ( indexonly
) return ;
422 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
424 strcpy ( wdirname
, tmp
);
425 strcat ( wdirname
, "/" );
426 strcat ( wdirname
, user
);
428 strcat ( wdirname
, ".htmp" );
429 if (( fp_ou
= fopen ( wdirname
, "w" ))== NULL
){
430 fprintf ( stderr
, "SARG: (report-1) %s: %s - %s \n " , text
[ 45 ], wdirname
, strerror ( errno
));
439 void gravatmp ( const char * oldaccuser
, const char * oldurl
, long long int nacc
, long long int nbytes
, const char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
)
448 char wdirname
[ MAXLEN
];
450 if ( indexonly
) return ;
451 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
453 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.utmp" , tmp
, oldaccuser
)>= sizeof ( wdirname
)) {
454 fprintf ( stderr
, "SARG: Path too long %s/%s.utmp \n " , tmp
, oldaccuser
);
458 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
459 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
463 my_lltoa ( nacc
, val1
, 0 );
464 my_lltoa ( nbytes
, val2
, 0 );
465 my_lltoa ( nelap
, val3
, 0 );
466 my_lltoa ( incache
, val4
, 0 );
467 my_lltoa ( oucache
, val5
, 0 );
468 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %s \t %s \t %s \n " , val1
, val2
, oldurl
, oldmsg
, val3
, val4
, val5
);
474 fputs ( "</table> \n " , fp_tt
);
475 fputs ( "</body> \n </html> \n " , fp_tt
);
484 static void gravatmp_hora ( const char * dirname
, const char * user
, const char * data
, const char * hora
, const char * elap
, const char * bytes
, int indexonly
)
488 char wdirname
[ MAXLEN
];
490 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
492 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.htmp" , tmp
, user
)>= sizeof ( wdirname
)) {
493 fprintf ( stderr
, "SARG: Path too long %s/%s.htmp \n " , tmp
, user
);
497 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
498 fprintf ( stderr
, "SARG: (report-2) %s: %s - %s \n " , text
[ 45 ], wdirname
, strerror ( errno
));
502 if ( strcmp ( datetimeby
, "bytes" ) == 0 ) fprintf ( fp_ou
, "%s \t %s \t %s \n " , data
, hora
, bytes
);
503 else fprintf ( fp_ou
, "%s \t %s \t %s \n " , data
, hora
, elap
);
511 static void gravaporuser ( const char * user
, const char * dirname
, const char * url
, const char * ip
, const char * data
, const char * hora
, const char * tam
, const char * elap
, int indexonly
)
515 char wdirname
[ MAXLEN
];
517 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
519 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.ip" , tmp
, user
)>= sizeof ( wdirname
)) {
520 fprintf ( stderr
, "SARG: Path too long %s/%s.ip \n " , tmp
, user
);
524 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
525 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
529 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %s \t %s \n " , ip
, url
, data
, hora
, tam
, elap
);
538 static void gravatmpf ( const char * oldaccuser
, const char * dirname
, const char * oldurl
, long long int nacc
, long long int nbytes
, const char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
)
542 char wdirname
[ MAXLEN
];
544 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
546 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.utmp" , tmp
, oldaccuser
)>= sizeof ( wdirname
)) {
547 fprintf ( stderr
, "SARG: Path too long %s/%s.utmp \n " , tmp
, oldaccuser
);
551 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
552 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
556 my_lltoa ( nacc
, val1
, 0 );
557 my_lltoa ( nbytes
, val2
, 0 );
558 my_lltoa ( nelap
, val3
, 0 );
559 my_lltoa ( incache
, val4
, 0 );
560 my_lltoa ( oucache
, val5
, 0 );
561 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %s \t %s \t %s \n " , val1
, val2
, oldurl
, oldmsg
, val3
, val4
, val5
);
568 fputs ( "</table> \n " , fp_tt
);
569 fputs ( "</body> \n </html> \n " , fp_tt
);
578 static void gravager ( FILE * fp_gen
, const char * user
, long long int nacc
, const char * url
, long long int nbytes
, const char * ip
, const char * hora
, const char * dia
, long long int nelap
, long long int incache
, long long int oucache
)
580 my_lltoa ( nacc
, val1
, 0 );
581 my_lltoa ( nbytes
, val2
, 0 );
582 my_lltoa ( nelap
, val3
, 0 );
583 my_lltoa ( incache
, val4
, 0 );
584 my_lltoa ( oucache
, val5
, 0 );
585 fprintf ( fp_gen
, "%s \t %s \t %s \t %s \t %s \t %s \t %s \t %s \t %s \t %s \n " , user
, val1
, val2
, url
, ip
, hora
, dia
, val3
, val4
, val5
);
590 static void grava_SmartFilter ( const char * dirname
, const char * user
, const char * ip
, const char * data
, const char * hora
, const char * url
, const char * smart
)
594 char wdirname
[ MAXLEN
];
596 sprintf ( wdirname
, "%s/smartfilter.unsort" , dirname
);
598 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
599 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
603 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %s \t %s \n " , user
, data
, hora
, ip
, url
, smart
);
604 fputs ( "</body> \n </html> \n " , fp_tt
);