Possible bug with spam permissions
Julian Field
MailScanner at ecs.soton.ac.uk
Tue Aug 23 15:47:40 IST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm having a bit of a stupid day. What do you mean by "GID: 6 0 6"
and what is wrong? And which chown are you talking about? I don't see
your point at all.
On 23 Aug 2005, at 14:32, Jan-Peter Koopmann wrote:
> On Tuesday, August 23, 2005 1:14 PM Julian Field wrote:
>
>
>> Check for the presence or absence of g+s perms on the dir.
>>
>
> I am no perl-guru, but this looks suspicious to me:
>
> # Store it if they want that
> if ($actions{'store'}) {
> my($dir, $dir2, $spamdir, $uid, $gid, $changeowner);
> $uid = $global::MS->{quar}->{uid};
> $gid = $global::MS->{quar}->{gid};
> $changeowner = $global::MS->{quar}->{changeowner};
> $dir = MailScanner::Config::Value('quarantinedir', $this);
> #$dir2 = $dir . '/' . MailScanner::Quarantine::TodayDir();
> $dir2 = $dir . '/' . $this->{datenumber};
> $spamdir = $dir2 . '/' . $HamSpam;
> #print STDERR "dir = $dir\ndir2 = $dir2\nspamdir = $spamdir\n";
> umask $global::MS->{quar}->{dirumask};
> unless (-d $dir) {
> mkdir $dir, 0777;
> chown $uid, $gid, $dir if $changeowner;
> }
> unless (-d $dir2) {
> mkdir $dir2, 0777;
> chown $uid, $gid, $dir2 if $changeowner;
> }
> unless (-d $spamdir) {
> mkdir $spamdir, 0777;
> chown $uid, $gid, $spamdir if $changeowner;
> }
> #print STDERR "Storing spam to $spamdir/" . $this->{id} . "\n";
> #print STDERR "uid=$uid gid=$gid changeowner=$changeowner\n";
> umask $global::MS->{quar}->{fileumask};
> my @paths = $this->{store}->CopyEntireMessage($this, $spamdir,
> $this->{id},
> $uid, $gid,
> $changeowner);
> # Remember where we have stored the spam in an archive, so we
> never
> # archive infected messages
> #print STDERR "Added " . join(',', @paths) . " to spamarchive\n";
> push @{$this->{spamarchive}}, @paths;
> chown $uid, $gid, "$spamdir/" . $this->{id}; # Harmless if this
> fails
> }
> umask 0077; # Safety net
>
>
> This will do a chown $uid, $gid on the spam file will it not? I
> added some debugging code to this. At the time of the chown the
> variables contain this
>
> UID: 26
> GID: 6 0 6
>
> UID 26 --> mailnull --> correct
> GID: 6 --> mail --> not correct.
>
> I have
>
> Quarantine Group = getqmail
>
> which would be GID 8006. And of course the spam files are created
> belong to group 'mail'. So this looks like a MailScanner problem
> and not like a setup/FreeBSD problem.
>
> Regards,
> JP
>
> ------------------------ MailScanner list ------------------------
> To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
> 'leave mailscanner' in the body of the email.
> Before posting, read the Wiki (http://wiki.mailscanner.info/) and
> the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
>
> Support MailScanner development - buy the book off the website!
>
- --
Julian Field
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store
PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
-----BEGIN PGP SIGNATURE-----
Version: PGP Desktop 9.0.2 (Build 2425)
iQA/AwUBQws3EBH2WUcUFbZUEQIeKACeIUPmyxTzyJtTxOe8ar5q5iug8OwAnie6
SW8HyzC4GYjS0t+Qq71zQAly
=i6Ta
-----END PGP SIGNATURE-----
------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).
Support MailScanner development - buy the book off the website!
More information about the MailScanner
mailing list