java/src/org/openantivirus/engine/vfs/container CompressedContainerFactory.java,1.4,1.5 ArchiveContainer.java,1.2,1.3
Kurt Huwig <[email protected]> Mon, 31 May 2004 10:18:11 +0000
| Newsgroups | gmane.comp.security.virus.openantivirus.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv818/src/org/openantivirus/engine/vfs/container
Modified Files:
CompressedContainerFactory.java ArchiveContainer.java
Log Message:
Fixed hang on ACE and RPM files
Index: ArchiveContainer.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container/ArchiveContainer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ArchiveContainer.java 23 May 2004 14:39:19 -0000 1.2
+++ ArchiveContainer.java 31 May 2004 10:18:08 -0000 1.3
@@ -99,17 +99,28 @@
runCommand(command, null);
}
- protected void runCommand(String[] command, File directory)
- throws IOException {
+ protected void runCommand(String[] command,
+ File directory) throws IOException {
runCommand(command, directory, null);
}
- protected void runCommand(String[] command, File directory, OutputStream os)
- throws IOException {
+ protected void runCommand(String[] command,
+ File directory,
+ OutputStream os) throws IOException {
+ runCommand(command, directory, null, true);
+
+ }
+
+ protected void runCommand(String[] command,
+ File directory,
+ OutputStream os,
+ boolean closeStdIn) throws IOException {
Process process = null;
try {
process = Runtime.getRuntime().exec(command, null, directory);
- process.getOutputStream().close();
+ if (closeStdIn) {
+ process.getOutputStream().close();
+ }
if (os != null) {
SingleFileContainer.copyStream(process.getInputStream(), os);
}
Index: CompressedContainerFactory.java
===================================================================
RCS file: /cvsroot/openantivirus/java/src/org/openantivirus/engine/vfs/container/CompressedContainerFactory.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CompressedContainerFactory.java 30 May 2004 00:52:44 -0000 1.4
+++ CompressedContainerFactory.java 31 May 2004 10:18:08 -0000 1.5
@@ -208,9 +208,12 @@
throws IOException {
runCommand(new String[] {
"unace",
- "e",
+ "x",
+ "-y",
entry.getFile().getCanonicalPath()},
- tempDir);
+ tempDir,
+ null,
+ false);
}
};
}
@@ -397,7 +400,8 @@
tempDir,
new FileOutputStream(
tempDir.getCanonicalPath()
- + File.separator + "rpm.cpio"));
+ + File.separator + "rpm.cpio"),
+ false);
}
};
}
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click