git-svn: trunk@3750
remotes/push_mirror/metadata
aCaB 17 years ago
parent 2023340a41
commit 6c06c7b3bb
  1. 4
      ChangeLog
  2. 6
      libclamav/blob.c
  3. 19
      libclamav/mbox.c
  4. 9
      libclamav/others.c
  5. 2
      libclamav/others.h

@ -1,3 +1,7 @@
Wed Apr 2 16:38:36 CEST 2008 (acab)
------------------------------------
* libclamav: check return codes from syscalls (bb#384)
Wed Apr 2 16:34:43 CEST 2008 (tk)
----------------------------------
* libclamav: update copyrights and stick more files to GPLv2; move and add

@ -439,8 +439,7 @@ fileblobDestructiveDestroy(fileblob *fb)
if(fb->fp && fb->fullname) {
fclose(fb->fp);
cli_dbgmsg("fileblobDestructiveDestroy: %s\n", fb->fullname);
if(cli_unlink(fb->fullname) < 0)
cli_warnmsg("fileblobDestructiveDestroy: Can't delete file %s\n", fb->fullname);
cli_unlink(fb->fullname);
free(fb->fullname);
fb->fp = NULL;
fb->fullname = NULL;
@ -468,8 +467,7 @@ fileblobDestroy(fileblob *fb)
cli_dbgmsg("fileblobDestroy: %s\n", fb->fullname);
if(!fb->isNotEmpty) {
cli_dbgmsg("fileblobDestroy: not saving empty file\n");
if(cli_unlink(fb->fullname) < 0)
cli_warnmsg("fileblobDestroy: Can't delete empty file %s\n", fb->fullname);
cli_unlink(fb->fullname);
}
}
free(fb->b.name);

@ -3851,8 +3851,7 @@ rfc1341(message *m, const char *dir)
if(stat(fullname, &statb) < 0)
continue;
if(now - statb.st_mtime > (time_t)(7 * 24 * 3600))
if(cli_unlink(fullname) >= 0)
cli_dbgmsg("removed old RFC1341 file %s\n", fullname);
cli_unlink(fullname);
continue;
}
@ -3876,10 +3875,18 @@ rfc1341(message *m, const char *dir)
nblanks++;
else {
if(nblanks)
do
putc('\n', fout);
while(--nblanks > 0);
fputs(buffer, fout);
do {
if (putc('\n', fout)==EOF) break;
} while(--nblanks > 0);
if (nblanks || fputs(buffer, fout)==EOF) {
fclose(fin);
fclose(fout);
cli_unlink(outname);
free(id);
free(number);
closedir(dd);
return -1;
}
}
fclose(fin);

@ -562,7 +562,7 @@ int cli_gentempfd(const char *dir, char **name, int *fd)
/* Function: unlink
unlink() with error checking
*/
int cli_unlink(const char *pathname)
void cli_unlink(const char *pathname)
{
if (unlink(pathname)) cli_warnmsg("cli_unlink: failure - %s\n", strerror(errno));
}
@ -704,12 +704,7 @@ int cli_rmdirs(const char *dirname)
}
}
} else
if(cli_unlink(path) < 0) {
cli_warnmsg("cli_rmdirs: Couldn't remove %s: %s\n", path, strerror(errno));
free(path);
closedir(dd);
return -1;
}
cli_unlink(path);
}
free(path);
}

@ -233,7 +233,7 @@ int cli_rmdirs(const char *dirname);
unsigned char *cli_md5digest(int desc);
char *cli_md5stream(FILE *fs, unsigned char *digcpy);
char *cli_md5file(const char *filename);
int cli_unlink(const char *pathname);
void cli_unlink(const char *pathname);
int cli_readn(int fd, void *buff, unsigned int count);
int cli_writen(int fd, const void *buff, unsigned int count);
char *cli_gentemp(const char *dir);

Loading…
Cancel
Save