fsyncs removed - bb#844

git-svn: trunk@3728
remotes/push_mirror/metadata
aCaB 18 years ago
parent eae2fcdcaa
commit fd747ed8cc
  1. 5
      ChangeLog
  2. 2
      libclamav/autoit.c
  3. 2
      libclamav/clamav.h
  4. 2
      libclamav/others.c
  5. 2
      libclamav/pe.c
  6. 36
      libclamav/scanners.c

@ -1,3 +1,8 @@
Thu Mar 20 20:55:37 CET 2008 (acab)
-----------------------------------
* libclamav: Remove fsync()'s. Win32 ports should greatly benefit from it
Please report problems. - bb#844
Thu Mar 20 12:16:13 CET 2008 (tk)
---------------------------------
* clamdscan/client.c: some messages were being printed twice (bb#884)

@ -371,7 +371,6 @@ static int ea05(int desc, cli_ctx *ctx, char *tmpd) {
cli_dbgmsg("autoit: file extracted to %s\n", tempfile);
else
cli_dbgmsg("autoit: file successfully extracted\n");
fsync(i);
lseek(i, 0, SEEK_SET);
if(cli_magic_scandesc(i, ctx) == CL_VIRUS) {
close(i);
@ -880,7 +879,6 @@ static int ea06(int desc, cli_ctx *ctx, char *tmpd) {
cli_dbgmsg("autoit: %s extracted to %s\n", (script)?"script":"file", tempfile);
else
cli_dbgmsg("autoit: %s successfully extracted\n", (script)?"script":"file");
fsync(i);
lseek(i, 0, SEEK_SET);
if(cli_magic_scandesc(i, ctx) == CL_VIRUS) {
close(i);

@ -48,7 +48,7 @@ extern "C"
#define CL_EACCES -110 /* access denied */
#define CL_ENULLARG -111 /* null argument */
#define CL_ETMPFILE -112 /* tmpfile() failed */
#define CL_EFSYNC -113 /* fsync() failed */
/* #define CL_EFSYNC -113 *//* fsync() failed */
#define CL_EMEM -114 /* memory allocation error */
#define CL_EOPEN -115 /* file open error */
#define CL_EMALFDB -116 /* malformed database */

@ -167,8 +167,6 @@ const char *cl_strerror(int clerror)
return "Unable to create temporary file";
case CL_ETMPDIR:
return "Unable to create temporary directory";
case CL_EFSYNC:
return "Unable to synchronize file <-> disk";
case CL_EMEM:
return "Unable to allocate memory";
case CL_EOPEN:

@ -130,7 +130,6 @@ if((ndesc = open(tempfile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, S_IRWXU)) < 0) { \
cli_dbgmsg(NAME": Unpacked and rebuilt executable\n"); \
cli_multifree FREEME; \
free(exe_sections); \
fsync(ndesc); \
lseek(ndesc, 0, SEEK_SET); \
cli_dbgmsg("***** Scanning rebuilt PE file *****\n"); \
if(cli_magic_scandesc(ndesc, ctx) == CL_VIRUS) { \
@ -1736,7 +1735,6 @@ int cli_scanpe(int desc, cli_ctx *ctx)
}
free(dest);
fsync(ndesc);
lseek(ndesc, 0, SEEK_SET);
if(cli_leavetemps_flag)

@ -502,15 +502,6 @@ static int cli_scangzip(int desc, cli_ctx *ctx)
return ret;
}
if(fsync(fd) == -1) {
cli_dbgmsg("GZip: Can't synchronise descriptor %d\n", fd);
close(fd);
if(!cli_leavetemps_flag)
unlink(tmpname);
free(tmpname);
return CL_EFSYNC;
}
lseek(fd, 0, SEEK_SET);
if((ret = cli_magic_scandesc(fd, ctx)) == CL_VIRUS ) {
cli_dbgmsg("GZip: Infected with %s\n", *ctx->virname);
@ -611,16 +602,6 @@ static int cli_scanbzip(int desc, cli_ctx *ctx)
return ret;
}
if(fsync(fd) == -1) {
cli_dbgmsg("Bzip: Synchronisation failed for descriptor %d\n", fd);
close(fd);
if(!cli_leavetemps_flag)
unlink(tmpname);
free(tmpname);
fclose(fs);
return CL_EFSYNC;
}
lseek(fd, 0, SEEK_SET);
if((ret = cli_magic_scandesc(fd, ctx)) == CL_VIRUS ) {
cli_dbgmsg("Bzip: Infected with %s\n", *ctx->virname);
@ -1058,7 +1039,6 @@ static int cli_scanhtml_utf16(int desc, cli_ctx *ctx)
}
}
fsync(fd);
lseek(fd, 0, SEEK_SET);
ret = cli_scanhtml(fd, ctx);
close(fd);
@ -1352,13 +1332,6 @@ static int cli_scancryptff(int desc, cli_ctx *ctx)
free(dest);
if(fsync(ndesc) == -1) {
cli_errmsg("CryptFF: Can't fsync descriptor %d\n", ndesc);
close(ndesc);
free(tempfile);
return CL_EIO;
}
lseek(ndesc, 0, SEEK_SET);
cli_dbgmsg("CryptFF: Scanning decrypted data\n");
@ -1523,15 +1496,6 @@ static int cli_scanembpe(int desc, cli_ctx *ctx)
}
}
if(fsync(fd) == -1) {
cli_dbgmsg("cli_scanembpe: Can't synchronise descriptor %d\n", fd);
close(fd);
if(!cli_leavetemps_flag)
unlink(tmpname);
free(tmpname);
return CL_EFSYNC;
}
ctx->recursion++;
lseek(fd, 0, SEEK_SET);
if((ret = cli_magic_scandesc(fd, ctx)) == CL_VIRUS) {

Loading…
Cancel
Save