From owner-freebsd-security Sat Sep 5 23:10:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA03712 for freebsd-security-outgoing; Sat, 5 Sep 1998 23:10:56 -0700 (PDT) (envelope-from owner-freebsd-security@FreeBSD.ORG) Received: from roma.coe.ufrj.br (roma.coe.ufrj.br [146.164.53.65]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA03705; Sat, 5 Sep 1998 23:10:54 -0700 (PDT) (envelope-from jonny@jonny.eng.br) Received: (from jonny@localhost) by roma.coe.ufrj.br (8.8.8/8.8.8) id DAA01265; Sun, 6 Sep 1998 03:10:40 -0300 (EST) (envelope-from jonny) From: Joao Carlos Mendes Luis Message-Id: <199809060610.DAA01265@roma.coe.ufrj.br> Subject: Re: small LDA c program requested In-Reply-To: <35F2248F.87CE70FC@softweyr.com> from Wes Peters at "Sep 5, 98 11:58:39 pm" To: wes@softweyr.com (Wes Peters) Date: Sun, 6 Sep 1998 03:10:40 -0300 (EST) Cc: jonny@jonny.eng.br, lva@dds.nl, freebsd-isp@FreeBSD.ORG, freebsd-security@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL40 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-security@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org #define quoting(Wes Peters) // > Shouldn't you lock the file ? O_APPEND is only good for atomic // > writes, IIRC. // // You're right. A quick fix would be to open the file with O_EXLOCK // and puke if the filesystem doesn't support locking; this would rule // out NFS-mounted mailboxes. Which should not be used anyway, at least with the current implementation in FreeBSD. I've already lost lots of email by reading it over NFS. Now I just ssh the mail server and call elm from there. // It would be better, IMHO, to collect the entire input and write it in a // single call, but this might get expensive in terms of memory allocation. // You could do it by allocating a number of large, fixed-size buffers and // using writev for output, but what about some bonehead who mails a 40 Meg // "Word" document? Users are always ahead of managers in terms of finding new problems :) But I'm not sure. Wouldn't NFS break the write in smaller ones ? Is there such atomic write in NFS, even for VERY large blocks ? Jonny -- Joao Carlos Mendes Luis M.Sc. Student jonny@jonny.eng.br Universidade Federal do Rio de Janeiro "There are two major products that come out of Berkeley: LSD and Unix. We don't believe this to be a coincidence." -- Jeremy S. Anderson To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-security" in the body of the message