|
From: Adam C. M. <ad...@mi...> - 2004-04-14 17:25:39
|
Mark Martinec wrote:
>Adam,
>
>| FWIW I'd argue that running everything as one user comes with it's own
>| set of security problems. For example I like that `clamav' is in group
>| `amavis' because it produces a one-way trust relationship from the
>| former to the latter while it doesn't allow amavis the ability to write
>| to the ClamAV virus patterns database.
>
>I agree. Patch accepted, thanks.
>
>| !(StatBuf.st_mode & (S_IRWXU|S_IRGRP|S_IXGRP)))
>shouldn't this be:
> (StatBuf.st_mode & ~(S_IRWXU|S_IRGRP|S_IXGRP)) )
>
>
Yes, it should. My apologies. To much %s// without watching where I
was going...
>| - if ((priv->mlfi_fp = fopen(priv->mlfi_fname, "w+")) == NULL) {
>| + if ((priv->mlfi_fp = fopen(priv->mlfi_fname, "w+")) == NULL
>| + || fchmod(fileno(priv->mlfi_fp), S_IRUSR|S_IWUSR|S_IRGRP) == -1) {
>
>The umask should have take cane of this, or perhaps:
>
> if ((priv->mlfi_fp = fopen(priv->mlfi_fname, "w+",
> S_IRUSR|S_IWUSR|S_IRGRP)) == NULL) {
>
>
Hmmm, not sure what you mean here. fopen(3) doesn't take a mode_t
argument so this won't compile as is. open(2) takes mode_t but would
leave you with an integer file-descriptor which you could feed to
fdopen(3) which if nested could look almost like what you have above. ;-)
With respect to the umask, i set the mode with fchmod(2) because
amavis-milter generally seems to like to control permissions explicitly
throughout rather than relying on umask so I stuck with that.
>Mark
>
>
>
--
Adam C. Migus - http://people.migus.org/~adam/
|