fixed an open(2) issue

This commit is contained in:
ensc 2007-08-25 10:40:56 +00:00
parent 1d4259aaa9
commit 7aecf13b51
2 changed files with 26 additions and 1 deletions

22
clamav-0.91.2-open.patch Normal file
View File

@ -0,0 +1,22 @@
--- clamav-0.91.2/clamd/dazukoio_compat12.c.open 2007-03-06 14:38:06.000000000 +0100
+++ clamav-0.91.2/clamd/dazukoio_compat12.c 2007-08-25 12:36:30.000000000 +0200
@@ -89,7 +89,7 @@ int dazukoRegister_TS_compat12(struct da
if (dazuko->device < 0)
{
- dazuko->device = open("/dev/dazuko", 0);
+ dazuko->device = open("/dev/dazuko", O_RDONLY);
if (dazuko->device < 0)
return -1;
--- clamav-0.91.2/shared/misc.c.open 2007-03-31 21:27:31.000000000 +0200
+++ clamav-0.91.2/shared/misc.c 2007-08-25 12:36:30.000000000 +0200
@@ -165,7 +165,7 @@ int filecopy(const char *src, const char
if((s = open(src, O_RDONLY|O_BINARY)) == -1)
return -1;
- if((d = open(dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY)) == -1) {
+ if((d = open(dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, 0600)) == -1) {
close(s);
return -1;
}

View File

@ -1,4 +1,4 @@
## $Id: clamav.spec,v 1.56 2007/07/17 07:27:38 ensc Exp $
## $Id: clamav.spec,v 1.57 2007/08/25 10:12:31 ensc Exp $
## Fedora Extras specific customization below...
%bcond_without fedora
@ -35,6 +35,7 @@ Source8: clamav-notify-servers
Patch21: clamav-0.70-path.patch
Patch22: clamav-0.80-initoff.patch
Patch24: clamav-0.90rc3-private.patch
Patch25: clamav-0.91.2-open.patch
BuildRoot: %_tmppath/%name-%version-%release-root
Requires: clamav-lib = %version-%release
Requires: data(clamav)
@ -226,6 +227,7 @@ The SysV initscripts for clamav-milter.
%patch21 -p1 -b .path
%patch22 -p1 -b .initoff
%patch24 -p1 -b .private
%patch25 -p1 -b .open
perl -pi -e 's!^(#?LogFile ).*!\1/var/log/clamd.<SERVICE>!g;
s!^#?(LocalSocket ).*!\1/var/run/clamd.<SERVICE>/clamd.sock!g;
@ -511,6 +513,7 @@ test "$1" = 0 || %_initrddir/clamav-milter condrestart >/dev/null || :
- DOS in html normalizer
- arbitrary command execution by special crafted recipients in
clamav-milter's black-hole mode
- fixed an open(2) issue
* Tue Jul 17 2007 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de> - 0.91.1-0
- updated to 0.91.1