From owner-freebsd-bugs Sun Nov 9 11:30:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA29861 for bugs-outgoing; Sun, 9 Nov 1997 11:30:05 -0800 (PST) (envelope-from owner-freebsd-bugs) Received: (from gnats@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA29841; Sun, 9 Nov 1997 11:30:02 -0800 (PST) (envelope-from gnats) Date: Sun, 9 Nov 1997 11:30:02 -0800 (PST) Message-Id: <199711091930.LAA29841@hub.freebsd.org> To: freebsd-bugs Cc: From: Kevin Day Subject: Re: bin/4925: sendmail ignores user quotas Reply-To: Kevin Day Sender: owner-freebsd-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR bin/4925; it has been noted by GNATS. From: Kevin Day To: vasim@diaspro.com (Vasim Valejev) Cc: toasty@dragondata.com, freebsd-gnats-submit@FreeBSD.ORG, gnats@FreeBSD.ORG, freebsd-bugs@hub.freebsd.org Subject: Re: bin/4925: sendmail ignores user quotas Date: Sun, 9 Nov 1997 13:23:37 -0600 (CST) > Hi ! > > On Sun, 2 Nov 1997 toasty@dragondata.com wrote: > > >Description: > > Users can receive mail well over their hard space limit. I'd like to be able to stop this from happening. /var/spool/mail is on it's own partition, so I thought I could apply a quota to prevent users from getting mailbombed, and also from just saving too much mail on the server. > > > > repquota shows the correct amount used, and will even show them going over the hard limit, but sendmail still dumps more data in their mail file. > > > > Is this a bug? Probably not, but it's not really consistant behavior, as nearly every other service will stop when their limit is reached. > > > > It's problem in /usr/libexec/mail.local . This program open and write in > user's mailboxes under root . > > > >How-To-Repeat: > > Enable quotas, and send a ton of mail to a user with very little space left. > > >Fix: > > Possible fix (not tested) for /usr/src/libexec/mail.local/mail.local.c : > > *** mail.local.c.orig Sat Oct 25 14:09:39 1997 > --- mail.local.c Mon Nov 3 13:24:53 1997 > *************** > *** 266,271 **** > --- 266,287 ---- > } > } > > + if (mbfd == -1) { > + e_to_sys(errno); > + warn("%s: %s", path, strerror(errno)); > + return; > + } > + > + close(mbfd); > + > + if (setuid(pw->pw_uid) < 0) > + { > + e_to_sys(errno); > + warn("%d: %s", pw->pw_uid, strerror(errno)); > + return; > + } > + > + mbfd = open(path, O_APPEND|O_WRONLY, 0); > if (mbfd == -1) { > e_to_sys(errno); > warn("%s: %s", path, strerror(errno)); > I'm not sure if this is related or not, but when a user over their quota got another message, there suddenly were thousands of 'mail.local' processes running, all trying to send mail to that user... It had otherwise worked perfectly before. Kevin