Date: Mon, 3 Nov 1997 13:53:28 +0500 (ES) From: Vasim Valejev <vasim@diaspro.com> To: toasty@dragondata.com Cc: freebsd-gnats-submit@FreeBSD.ORG, GNATS Management <gnats@FreeBSD.ORG>, freebsd-bugs@hub.freebsd.org Subject: Re: bin/4925: sendmail ignores user quotas Message-ID: <Pine.BSF.3.96.971103133936.3406A-100000@uddias.diaspro.com> In-Reply-To: <199711030607.WAA09558@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi !
On Sun, 2 Nov 1997 toasty@dragondata.com wrote:
> >Number: 4925
> >Category: bin
> >Synopsis: sendmail ignores user quotas
> >Confidential: no
> >Severity: non-critical
> >Priority: low
> >Responsible: freebsd-bugs
> >State: open
> >Class: sw-bug
> >Submitter-Id: current-users
> >Arrival-Date: Sun Nov 2 22:10:01 PST 1997
> >Last-Modified:
> >Originator: Kevin Day
> >Organization:
> DragonData
> >Release: 2.2.1-RELEASE
> >Environment:
> FreeBSD home.dragondata.com 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Thu Sep 25 0
> 0:27:55 CDT 1997 toasty@home.dragondata.com:/usr/src/sys/compile/HOME i386
2.2-STABLE and 3.0-CURRENT too :( .
> >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));
>
> >Audit-Trail:
> >Unformatted:
>
Vasim V. (2:5011/27 http://members.tripod.com/~Vasim VV86-RIPE)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.971103133936.3406A-100000>
