]>
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 ( char * dirname
, char * user
, char * data
, char * hora
, char * elap
, char * accbytes
, int indexonly
);
32 static void gravatmpf ( char * oldaccuser
, char * dirname
, char * oldurl
, long long int nacc
, long long int nbytes
, char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
);
33 static void gravaporuser ( char * user
, char * dirname
, char * url
, char * ip
, char * data
, char * hora
, char * tam
, char * elap
, int indexonly
);
34 static void gravager ( char * dirname
, char * user
, long long int nacc
, char * url
, long long int nbytes
, char * ip
, char * hora
, char * dia
, long long int nelap
, long long int incache
, long long int oucache
);
35 static void grava_SmartFilter ( char * dirname
, char * user
, char * ip
, char * data
, char * hora
, char * url
, char * smart
);
42 char accdia
[ 11 ], acchora
[ 9 ], accuser
[ MAXLEN
], accip
[ MAXLEN
], accurl
[ MAXLEN
], accbytes
[ 12 ], accelap
[ 10 ];
43 char oldaccdia
[ 11 ], oldacchora
[ 9 ], oldaccip
[ MAXLEN
], wdir
[ MAXLEN
], per1
[ MAXLEN
];
44 char wdirname
[ MAXLEN
], oldurl
[ MAXLEN
], oldaccuser
[ MAXLEN
];
45 char olduser
[ MAXLEN
], oldmsg
[ 50 ], acccode
[ MAXLEN
/ 2 - 1 ], oldaccelap
[ 10 ], oldacccode
[ MAXLEN
/ 2 - 1 ], user
[ MAXLEN
];
46 char ipantes
[ MAXLEN
], nameantes
[ MAXLEN
];
47 char accsmart
[ MAXLEN
];
48 char wcrc
[ MAXLEN
/ 2 - 1 ];
49 char crc2
[ MAXLEN
/ 2 - 1 ];
50 long long int nbytes
= 0 ;
51 long long int nelap
= 0 ;
53 long long int rtotal
= 0 ;
54 long long int incache
= 0 ;
55 long long int oucache
= 0 ;
58 struct dirent
* direntp
;
59 const char logext
[]= ".log" ;
66 sprintf ( dirname
, "%s%s" , outdir
, period
);
67 sprintf ( wdir
, "%s%s" , outdir
, period
);
69 vrfydir ( wdir
, per1
, addr
, site
, us
, email
);
72 debugaz ( "dirname" , dirname
);
76 strcpy ( wdirname
, dirname
);
79 if ( strlen ( UserAgentLog
) > 0 && email
[ 0 ] == '\0' ) useragent ();
82 strncat ( tmp
, "/sarg" , 5 );
85 while (( direntp
= readdir ( dirp
)) != NULL
) {
86 dlen
= strlen ( direntp
-> d_name
)-( sizeof ( logext
)- 1 );
88 if (( strcmp ( direntp
-> d_name
+ dlen
, logext
) != 0 ) ||
89 ( strncmp ( direntp
-> d_name
, "download.log" , 12 ) == 0 ) ||
90 ( strncmp ( direntp
-> d_name
, "denied.log" , 10 ) == 0 ) ||
91 ( strncmp ( direntp
-> d_name
, "authfail.log.unsort" , 19 ) == 0 ))
93 if ( snprintf ( tmp3
, sizeof ( tmp3
), "%s/%s" , tmp
, direntp
-> d_name
)>= sizeof ( tmp3
)) {
94 fprintf ( stderr
, "SARG: (report) directory entry too long: %s/%s \n " , tmp
, direntp
-> d_name
);
97 if (( fp_in
= fopen ( tmp3
, "r" ))== NULL
){
98 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], tmp
);
103 if ( dlen
>= sizeof ( user
)) continue ;
104 strncpy ( user
, direntp
-> d_name
, dlen
);
110 strcpy ( wdirname
, dirname
);
111 maketmp ( user
, tmp
, debug
, indexonly
);
112 maketmp_hour ( user
, tmp
, indexonly
);
115 if ( strcmp ( Ip2Name
, "yes" ) == 0 )
116 ip2name ( u2
, sizeof ( u2
));
117 get_usertab_name ( u2
, name
, sizeof ( name
));
119 if ( dotinuser
&& strstr ( name
, "_" )) {
120 str2
=( char *) subs ( name
, "_" , "." );
125 bzero ( html_old
, MAXLEN
);
127 while ( fgets ( buf
, sizeof ( buf
), fp_in
)!= NULL
) {
128 if ( getword ( accdia
, sizeof ( accdia
), buf
, ' ' )< 0 || getword ( acchora
, sizeof ( acchora
), buf
, ' ' )< 0 ||
129 getword ( accuser
, sizeof ( accuser
), buf
, ' ' )< 0 || getword ( accip
, sizeof ( accip
), buf
, ' ' )< 0 ||
130 getword ( accurl
, sizeof ( accurl
), buf
, ' ' )< 0 || getword ( accbytes
, sizeof ( accbytes
), buf
, ' ' )< 0 ||
131 getword ( acccode
, sizeof ( acccode
), buf
, ' ' )< 0 ) {
132 printf ( "SARG: Maybe you have a broken record or garbage in your %s file. \n " , tmp3
);
135 if ( strncmp ( acccode
, "TCP_DENIED/407" , 14 ) == 0 ) continue ;
136 if ( getword ( accelap
, sizeof ( accelap
), buf
, ' ' )< 0 || getword ( accsmart
, sizeof ( accsmart
), buf
, ' ' )< 0 ||
137 getword ( accsmart
, sizeof ( accsmart
), buf
, '"' )< 0 ) {
138 printf ( "SARG: Maybe you have a broken record or garbage in your %s file. \n " , tmp3
);
142 if ( strlen ( accsmart
) > 0 ) {
144 strcpy ( wdirname
, dirname
);
145 grava_SmartFilter ( wdirname
, accuser
, accip
, accdia
, acchora
, accurl
, accsmart
);
148 if ( strcmp ( Ip2Name
, "yes" ) == 0 ) {
149 if ( strcmp ( accip
, ipantes
) != 0 ) {
150 strcpy ( ipantes
, accip
);
151 ip2name ( accip
, sizeof ( accip
));
152 strcpy ( nameantes
, accip
);
153 } else strcpy ( accip
, nameantes
);
156 strcpy ( wdirname
, dirname
);
157 gravatmp_hora ( wdirname
, accuser
, accdia
, acchora
, accelap
, accbytes
, indexonly
);
160 strcpy ( wdirname
, dirname
);
161 gravaporuser ( accuser
, wdirname
, accurl
, accip
, accdia
, acchora
, accbytes
, accelap
, indexonly
);
165 strcpy ( oldurl
, accurl
);
166 strcpy ( oldacccode
, acccode
);
167 strcpy ( oldaccelap
, accelap
);
168 strcpy ( oldaccuser
, accuser
);
169 strcpy ( oldaccip
, accip
);
170 strcpy ( oldaccdia
, accdia
);
171 strcpy ( oldacchora
, acchora
);
175 if ( site
[ 0 ] != '\0' ) {
176 if ( strcmp ( oldaccuser
, accuser
) != 0 ){
178 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
179 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
180 gravatmp ( oldaccuser
, wdirname
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
181 gravager ( wdirname
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
,
190 if ( strcmp ( oldurl
, accurl
) != 0 || strcmp ( oldaccuser
, accuser
) != 0 ){
192 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
193 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
194 strcpy ( wdirname
, dirname
);
195 gravatmp ( oldaccuser
, wdirname
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
196 strcpy ( wdirname
, dirname
);
197 gravager ( wdirname
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
203 if ( strcmp ( oldaccuser
, accuser
) != 0 )
208 nbytes
+= my_atoll ( accbytes
);
209 nelap
+= my_atoll ( accelap
);
211 if ( strstr ( ReportType
, "site_user_time_date" ) != 0 ) {
214 strcpy ( siteind
, accurl
);
216 for ( z1
= 0 ; str
[ z1
]; z1
++) {
217 if ( str
[ z1
]== '?' || str
[ z1
]== '-' || str
[ z1
]== '.' || str
[ z1
]== ':' || str
[ z1
]== '/' || str
[ z1
]== ' \\ ' || str
[ z1
]== '*' ||
218 str
[ z1
]== ' \' ' || str
[ z1
]== ' \" ' || str
[ z1
]== '$' )
221 sprintf ( arqtt
, "%s/%s" , dirname
, accuser
);
222 if ( access ( arqtt
, R_OK
) != 0 )
224 sprintf ( arqtt
, "%s/%s/tt%s-%s.html" , dirname
, accuser
, accuser
, siteind
);
225 if ( strlen ( arqtt
) > 255 ) {
226 strncpy ( val7
, arqtt
, 255 );
230 if (( fp_tt
= fopen ( arqtt
, "w" )) == 0 ) {
231 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], arqtt
);
236 if ( strcmp ( Privacy
, "yes" ) == 0 )
237 sprintf ( httplink
, "<font size=%s color=%s><href=http://%s>%s" , \
238 FontSize
, PrivacyStringColor
, PrivacyString
, PrivacyString
);
240 sprintf ( httplink
, "<font size=%s><a href=http://%s>%s</A>" , FontSize
, accurl
, accurl
);
242 sprintf ( ltext110
, "%s" , text
[ 110 ]);
243 for ( s
= ltext110
; * s
; ++ s
)
246 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
);
248 fputs ( "</head> \n " , fp_tt
);
249 fprintf ( fp_tt
, "<body bgcolor=%s text=%s background='%s'> \n " , BgColor
, TxColor
, BgImage
);
250 if ( strlen ( LogoImage
) > 0 ) fprintf ( fp_tt
, "<center><table cellpadding= \" 0 \" cellspacing= \" 0 \" > \n <tr><th class= \" logo \" ><img src='%s' border=0 align=absmiddle width=%s height=%s> %s</th></tr> \n <tr><td height= \" 5 \" ></td></tr> \n </table> \n " , LogoImage
, Width
, Height
, LogoText
);
252 if ( strcmp ( IndexTree
, "date" ) == 0 )
253 show_sarg ( fp_tt
, "../../../.." );
255 show_sarg ( fp_tt
, "../.." );
257 fputs ( "<center><table cellpadding=0 cellspacing=0> \n " , fp_tt
);
258 fprintf ( fp_tt
, "<tr><th class= \" title \" colspan= \" 2 \" >%s</th></tr> \n " , Title
);
260 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s</td></tr> \n " , text
[ 89 ], period
);
261 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s</td></tr> \n " , text
[ 90 ], name
);
262 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s, %s</td></tr> \n " , text
[ 104 ], UserSortField
, UserSortOrder
);
263 fprintf ( fp_tt
, "<tr><th class= \" header3 \" colspan=2>%s</th></tr> \n " , text
[ 32 ]);
265 fputs ( "</table></center> \n " , fp_tt
);
266 fputs ( "<center><table cellpadding= \" 0 \" cellspacing= \" 2 \" > \n " , fp_tt
);
267 fputs ( "<tr><td></td><td></td></tr>" , fp_tt
);
269 strncpy ( tmp4
, text
[ 110 ], 4 );
270 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 );
273 sprintf ( html
, "<tr><td class= \" data \" >%s</td><td class= \" data \" >%s</td><td class= \" data \" >%s</td></tr> \n " , accurl
, accdia
, acchora
);
275 if ( strcmp ( html
, html_old
) != 0 )
277 strcpy ( html_old
, html
);
278 } else bzero ( ltext110
, 50 );
280 strcpy ( wcrc
, acccode
);
281 if ( getword ( crc2
, sizeof ( crc2
), wcrc
, '/' )< 0 ) {
282 printf ( "SARG: Maybe you have a broken record or garbage in your %s file. \n " , tmp3
);
286 if ( strstr ( crc2
, "MISS" ) != 0 )
287 oucache
+= my_atoll ( accbytes
);
288 else incache
+= my_atoll ( accbytes
);
290 strcpy ( oldurl
, accurl
);
292 if ( strcmp ( accuser
, oldaccuser
) != 0 ) {
293 strcpy ( wdirname
, dirname
);
294 day_totalize ( tmp
, oldaccuser
, indexonly
);
297 strcpy ( oldaccuser
, accuser
);
298 strcpy ( oldacccode
, acccode
);
299 strcpy ( oldaccelap
, accelap
);
300 strcpy ( oldaccip
, accip
);
301 strcpy ( oldaccdia
, accdia
);
302 strcpy ( oldacchora
, acchora
);
311 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
312 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
313 strcpy ( wdirname
, dirname
);
314 if ( strlen ( oldaccuser
) == 0 )
315 strcpy ( oldaccuser
, accuser
);
316 gravatmpf ( oldaccuser
, wdirname
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
317 strcpy ( wdirname
, dirname
);
318 gravager ( wdirname
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
319 strcpy ( wdirname
, dirname
);
320 day_totalize ( tmp
, oldaccuser
, indexonly
);
324 strcpy ( wdirname
, dirname
);
325 totalger ( wdirname
, debug
, outdir
);
327 if ( strlen ( email
) == 0 ) {
328 if ( strstr ( ReportType
, "downloads" ) != 0 ) download_report ();
330 if ( strlen ( DansGuardianConf
) > 0 ) {
331 strcpy ( wdirname
, dirname
);
335 strcpy ( wdirname
, dirname
);
338 strcpy ( wdirname
, dirname
);
341 if ( strstr ( ReportType
, "topsites" ) != 0 ) topsites ();
343 if ( strstr ( ReportType
, "sites_users" ) != 0 ) siteuser ();
346 strcpy ( wdirname
, dirname
);
349 if ( smartfilter
) smartfilter_report ();
351 if ( strlen ( DansGuardianConf
) > 0 ) dansguardian_report ();
355 if ( strstr ( ReportType
, "users_sites" ) != 0 ) htmlrel ();
359 if ( strncmp ( SuccessfulMsg
, "yes" , 3 ) == 0 ) fprintf ( stderr
, "SARG: %s %s \n " , text
[ 47 ], dirname
);
361 strcpy ( wdirname
, dirname
);
362 geramail ( wdirname
, debug
, outdir
, userip
, email
, TempDir
);
364 if (( strcmp ( email
, "stdout" ) != 0 ) && ( strncmp ( SuccessfulMsg
, "yes" , 3 ) == 0 ))
365 fprintf ( stderr
, "SARG: %s %s \n " , text
[ 48 ], email
);
369 strcpy ( wdirname
, dirname
);
370 index_only ( wdirname
, debug
);
373 if ( strlen ( email
) < 0 )
379 static void maketmp ( const char * user
, const char * dirname
, int debug
, int indexonly
)
384 char wdirname
[ MAXLEN
];
386 if ( indexonly
) return ;
387 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
389 strcpy ( wdirname
, tmp
);
390 strcat ( wdirname
, "/" );
391 strcat ( wdirname
, user
);
394 debuga ( "%s: %s" , text
[ 49 ], wdirname
);
397 strcat ( wdirname
, ".utmp" );
398 if (( fp_ou
= fopen ( wdirname
, "w" ))== NULL
){
399 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
408 static void maketmp_hour ( const char * user
, const char * dirname
, int indexonly
)
413 char wdirname
[ MAXLEN
];
415 if ( indexonly
) return ;
416 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
418 strcpy ( wdirname
, tmp
);
419 strcat ( wdirname
, "/" );
420 strcat ( wdirname
, user
);
422 strcat ( wdirname
, ".htmp" );
423 if (( fp_ou
= fopen ( wdirname
, "w" ))== NULL
){
424 fprintf ( stderr
, "SARG: (report-1) %s: %s - %s \n " , text
[ 45 ], wdirname
, strerror ( errno
));
433 void gravatmp ( char * oldaccuser
, char * dirname
, char * oldurl
, long long int nacc
, long long int nbytes
, char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
)
438 char wdirname
[ MAXLEN
];
440 if ( indexonly
) return ;
441 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
443 strcpy ( wdirname
, tmp
);
444 strcat ( wdirname
, "/" );
445 strcat ( wdirname
, oldaccuser
);
446 strcat ( wdirname
, ".utmp" );
448 if (( fp_ou
= fopen ( wdirname
, "a" ))== NULL
){
449 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
453 my_lltoa ( nacc
, val1
, 15 );
454 my_lltoa ( nbytes
, val2
, 15 );
455 my_lltoa ( nelap
, val3
, 15 );
456 my_lltoa ( incache
, val4
, 15 );
457 my_lltoa ( oucache
, val5
, 15 );
458 fprintf ( fp_ou
, "%s %s %s %s %s %s %s \n " , val1
, val2
, oldurl
, oldmsg
, val3
, val4
, val5
);
464 fputs ( "</table> \n " , fp_tt
);
465 fputs ( "</body> \n </html> \n " , fp_tt
);
474 static void gravatmp_hora ( char * dirname
, char * user
, char * data
, char * hora
, char * elap
, char * bytes
, int indexonly
)
479 char wdirname
[ MAXLEN
];
481 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
483 strcpy ( wdirname
, tmp
);
484 strcat ( wdirname
, "/" );
485 strcat ( wdirname
, user
);
486 strcat ( wdirname
, ".htmp" );
488 if (( fp_ou
= fopen ( wdirname
, "a" ))== NULL
){
489 fprintf ( stderr
, "SARG: (report-2) %s: %s - %s \n " , text
[ 45 ], wdirname
, strerror ( errno
));
493 if ( strcmp ( datetimeby
, "bytes" ) == 0 ) fprintf ( fp_ou
, "%s %s %s \n " , data
, hora
, bytes
);
494 else fprintf ( fp_ou
, "%s %s %s \n " , data
, hora
, elap
);
502 static void gravaporuser ( char * user
, char * dirname
, char * url
, char * ip
, char * data
, char * hora
, char * tam
, char * elap
, int indexonly
)
507 char wdirname
[ MAXLEN
];
509 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
511 strcpy ( wdirname
, tmp
);
512 strcat ( wdirname
, "/" );
513 strcat ( wdirname
, user
);
514 strcat ( wdirname
, ".ip" );
516 if (( fp_ou
= fopen ( wdirname
, "a" ))== NULL
){
517 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
521 fprintf ( fp_ou
, "%s %s %s %s %s %s \n " , ip
, url
, data
, hora
, tam
, elap
);
530 static void gravatmpf ( char * oldaccuser
, char * dirname
, char * oldurl
, long long int nacc
, long long int nbytes
, char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
)
535 char wdirname
[ MAXLEN
];
537 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
539 strcpy ( wdirname
, tmp
);
540 strcat ( wdirname
, "/" );
541 strcat ( wdirname
, oldaccuser
);
542 strcat ( wdirname
, ".utmp" );
544 if (( fp_ou
= fopen ( wdirname
, "a" ))== NULL
){
545 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
549 my_lltoa ( nacc
, val1
, 15 );
550 my_lltoa ( nbytes
, val2
, 15 );
551 my_lltoa ( nelap
, val3
, 15 );
552 my_lltoa ( incache
, val4
, 15 );
553 my_lltoa ( oucache
, val5
, 15 );
554 fprintf ( fp_ou
, "%s %s %s %s %s %s %s \n " , val1
, val2
, oldurl
, oldmsg
, val3
, val4
, val5
);
561 fputs ( "</table> \n " , fp_tt
);
562 fputs ( "</html> \n " , fp_tt
);
571 static void gravager ( char * dirname
, char * user
, long long int nacc
, char * url
, long long int nbytes
, char * ip
, char * hora
, char * dia
, long long int nelap
, long long int incache
, long long int oucache
)
577 strcat ( dirname
, "sarg-general" );
579 if (( fp_ou
= fopen ( dirname
, "a" ))== NULL
){
580 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], dirname
);
584 my_lltoa ( nacc
, val1
, 15 );
585 my_lltoa ( nbytes
, val2
, 15 );
586 my_lltoa ( nelap
, val3
, 15 );
587 my_lltoa ( incache
, val4
, 15 );
588 my_lltoa ( oucache
, val5
, 15 );
589 fprintf ( fp_ou
, "%s %s %s %s %s %s %s %s %s %s \n " , user
, val1
, val2
, url
, ip
, hora
, dia
, val3
, val4
, val5
);
596 static void grava_SmartFilter ( char * dirname
, char * user
, char * ip
, char * data
, char * hora
, char * url
, char * smart
)
601 char wdirname
[ MAXLEN
];
603 sprintf ( wdirname
, "%s/smartfilter.unsort" , dirname
);
605 if (( fp_ou
= fopen ( wdirname
, "a" ))== NULL
){
606 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
610 fprintf ( fp_ou
, "%s %s %s %s %s %s \n " , user
, data
, hora
, ip
, url
, smart
);
611 fputs ( "</body> \n </html> \n " , fp_tt
);