samba-vscan/global vscan-filetype.c,1.3.2.6,1.3.2.7

Rainer Link <[email protected]>
Newsgroups gmane.comp.security.virus.openantivirus.cvs
Message-ID <[email protected]>
Update of /cvsroot/openantivirus/samba-vscan/global
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11872

Modified Files:
      Tag: VSCAN_0_3
	vscan-filetype.c 
Log Message:
increased debug level


Index: vscan-filetype.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/global/vscan-filetype.c,v
retrieving revision 1.3.2.6
retrieving revision 1.3.2.7
diff -u -d -r1.3.2.6 -r1.3.2.7
--- vscan-filetype.c	27 Feb 2004 09:27:29 -0000	1.3.2.6
+++ vscan-filetype.c	3 Apr 2004 17:50:26 -0000	1.3.2.7
@@ -3,15 +3,13 @@
  * Determines the file type by using libmagic. Used to skip scanning of
  * certain file types (user setting)
  *
- * Copyright (c) Rainer Link, 2003
+ * Copyright (c) Rainer Link, 2003-2004
  *	         OpenAntiVirus.org <rainer-pBPPa8WU5k41Tgt60Rntydi2O/[email protected]>
  *
  * This module is used to detected the MIME-type of a file by using 
  * libmagic. It then decides whether a file must be scanned or not
  * depending on the exclude file type setting.
  *
- * 			THIS IS WORK-IN-PROGRESS!
- *
  * This software is licensed under the GNU General Public License (GPL)
  * See: http://www.gnu.org/copyleft/gpl.html
  *
@@ -48,32 +46,32 @@
 	trim_string(filetype_excludelist, " ", " ");
 	
 	if ( strlen(filetype_excludelist) > 0 ) {
-		DEBUG(1, ("exclude list is: '%s'\n", filetype_excludelist)); 
+		DEBUG(5, ("exclude list is: '%s'\n", filetype_excludelist)); 
 		
 		/* initialise libmagic */
-		DEBUG(1, ("initialise libmagic\n"));
+		DEBUG(5, ("initialise libmagic\n"));
 	
 		flags |= MAGIC_MIME;
-		DEBUG(1, ("magic flags: %d\n", flags));
+		DEBUG(5, ("magic flags: %d\n", flags));
 
 		filetype_magic = magic_open(flags);
 		if ( filetype_magic == NULL ) {
 			/* FIXME: probably we shouln't use vscan_syslog here */
 				vscan_syslog("could not initialise libmagic");
 		} else {
-			DEBUG(1, ("loading magic\n"));
+			DEBUG(5, ("loading magic\n"));
 			/* NULL = load default file, probably we need another user 
 			 * setting here to specifiy alternative magic files
 			 */
 			if ( magic_load(filetype_magic, NULL) != 0 ) {	/* error */
 				vscan_syslog("%s", magic_error(filetype_magic));
 			} else {
-				DEBUG(1, ("libmagic init and loading was successfull\n"));
+				DEBUG(5, ("libmagic init and loading was successfull\n"));
 				filetype_init_magic = True;
 			} /* end if */
 		} /* end if */		
 	} else {
-		DEBUG(1, ("exclude list is empty - nothing to do\n"));	
+		DEBUG(5, ("exclude list is empty - nothing to do\n"));	
 	} /* end if */
 
 	return filetype_init_magic;
@@ -116,7 +114,7 @@
 		
 
 		if ( !filetype_init_magic ) {
-			DEBUG(1, ("libmagic init has failed or exclude list is empty - feature disabled\n"));
+			DEBUG(5, ("libmagic init has failed or exclude list is empty - feature disabled\n"));
 			return -1;
 		}
 		
@@ -131,7 +129,7 @@
 		/* hack alert ... */
 		p_ft = ft_string;
 		pstrcpy(filetype_string, strsep(&p_ft, ";"));
-		DEBUG(1, ("file type of file %s is %s\n", fname, filetype_string));	
+		DEBUG(5, ("file type of file %s is %s\n", fname, filetype_string));	
 
 		/* next_token modifies input list, so copy it */
 		pstrcpy(ex_list, filetype_excludelist);
@@ -141,17 +139,17 @@
 
 		while ( next_token(&p, exclude, ";", sizeof(exclude)) ) {
 			trim_string(exclude, " ", " ");
-			DEBUG(1, ("current exclude type is: '%s'\n", exclude));
+			DEBUG(5, ("current exclude type is: '%s'\n", exclude));
 			if ( StrCaseCmp(exclude, filetype_string) == 0 ) {
 				/* file type is in exlude list */
-				DEBUG(1, ("file type '%s' is in exclude list\n", exclude));
+				DEBUG(5, ("file type '%s' is in exclude list\n", exclude));
 				/* advise to skip scanning of file */
 				return 1;
 			} /* end if */
 		} /* end while */
 
 		/* file must be scanned */
-		DEBUG(1, ("no match - file must be scanned\n"));
+		DEBUG(5, ("no match - file must be scanned\n"));
 		return 0;
 }
 
@@ -159,7 +157,7 @@
 
 BOOL filetype_init (int flags, pstring exclude_list)
 {
-	DEBUG(4,("Sorry, samba-vscan filetype support is not compiled in\n"));
+	DEBUG(5,("Sorry, samba-vscan filetype support is not compiled in\n"));
 	return True;
 }
 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.