samba-vscan/global vscan-filetype.c,1.3.2.4,1.3.2.5

[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-serv7826

Modified Files:
      Tag: VSCAN_0_3
	vscan-filetype.c 
Log Message:
strip anything after ";" (if any) for the reported file type. libmagic
reports an a text file e.g. "text/plain; charset=us-ascii" but this
info is not needed. Code currently untested!


Index: vscan-filetype.c
===================================================================
RCS file: /cvsroot/openantivirus/samba-vscan/global/vscan-filetype.c,v
retrieving revision 1.3.2.4
retrieving revision 1.3.2.5
diff -u -d -r1.3.2.4 -r1.3.2.5
--- vscan-filetype.c	24 Sep 2003 11:06:34 -0000	1.3.2.4
+++ vscan-filetype.c	26 Feb 2004 17:17:00 -0000	1.3.2.5
@@ -111,7 +111,7 @@
 		pstring ex_list;
 		pstring exclude;
 		const char* p; /* needed to avoid compiler warning */
-		pstring filetype_string;
+		pstring ft_string, filetype_string;
 
 
 		if ( !filetype_init_magic ) {
@@ -120,13 +120,14 @@
 		}
 		
 		/* get the file type */
-		pstrcpy(filetype_string, magic_file(filetype_magic, fname));
-		if ( filetype_string == NULL ) {  /* error */
+		pstrcpy(ft_string, magic_file(filetype_magic, fname));
+		if ( ft_string == NULL ) {  /* error */
 			vscan_syslog("could not get file type, %s", magic_error(filetype_magic));
 			/* error occured */
 			return -1;
 		} /* end if */ 
-		trim_string(filetype_string, " ", " ");
+		trim_string(ft_string, " ", " ");
+		filetype_string = strsep(&ft_string, ";");
 		DEBUG(1, ("file type of file %s is %s\n", fname, filetype_string));	
 
 		/* next_token modifies input list, so copy it */



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&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.