From owner-freebsd-hackers Mon Aug 27 2:35:18 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from proxy2.ba.best.com (proxy2.ba.best.com [206.184.139.14]) by hub.freebsd.org (Postfix) with ESMTP id C25C437B401 for ; Mon, 27 Aug 2001 02:35:14 -0700 (PDT) (envelope-from scott@renfro.org) Received: from renfro.org (kgeaoi@sdn-ar-007casjosP255.dialsprint.net [63.180.75.17]) by proxy2.ba.best.com (8.9.3/8.9.2/best.out) with ESMTP id CAA11139; Mon, 27 Aug 2001 02:33:26 -0700 (PDT) Received: (from scott@localhost) by renfro.org (8.11.4/8.11.4) id f7R9XNY59577; Mon, 27 Aug 2001 02:33:23 -0700 (PDT) (envelope-from scott) Date: Mon, 27 Aug 2001 02:33:23 -0700 From: Scott Renfro To: Konstantin Chuguev Cc: Josef Karthauser , Vladimir Terziev , hackers@FreeBSD.ORG Subject: Re: secure Filesystem Message-ID: <20010827023323.A59347@bonsai.home.renfro.org> References: <200108160909.f7G99ic57826@star.rila.bg> <20010816101355.B3163@tao.org.uk> <3B7B9002.8E915742@dante.org.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="TB36FDmn/VVEgNH/" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3B7B9002.8E915742@dante.org.uk>; from Konstantin.Chuguev@dante.org.uk on Thu, Aug 16, 2001 at 10:18:58AM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 16, 2001 at 10:18:58AM +0100, Konstantin Chuguev wrote: > > I'd say, it's a daemon pretending to be an NFS server. It's running > locally on port other than NFS. > > Very nice implementation, I use it a lot. A small problem with it is > that it seems to support 7-bit file names only. I tracked down tonight the one other problem with cfs that has plagued me repeatedly (although it hasn't prevented me from using it day in and day out with a couple of shell scripts to fix-up mail files corrupted by this bug). There is a rather serious bug in cfs that causes it to throw away writes when those writes append to the file, are smaller than the blocksize (8 bytes by default), and would otherwise leave the file a multiple of the blocksize. In this situation, the file needs to be truncated (due to the padding scheme in use), but cfs doesn't truncate and the file appears unchanged after the write. Patches have been sent to cfs-users@crypto.com and I submitted a separate PR[1] to get the patch into ports until a new cfs release hits the street. I've attached a copy of that patch since the readers of this thread seem to be using cfs. cheers, --Scott [1] http://www.FreeBSD.org/cgi/query-pr.cgi?pr=30120 -- Scott Renfro --TB36FDmn/VVEgNH/ Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="cfs-write-bug.diff" --- cfs_fh.c.orig Mon Aug 27 01:47:52 2001 +++ cfs_fh.c Mon Aug 27 01:48:41 2001 @@ -177,6 +177,13 @@ perror("write"); return -1; } + /* due to the way the file is padded we may actually have to + truncate it here. This happens when the write is at the end of + the file, is shorter than CFSBLOCK and brings the file to a length + which is evenly dividable by CFSBLOCK */ + if (offset+len > dtov(sb.st_size) && vtod(offset+len) < sb.st_size) { + ftruncate(fd, vtod(offset+len)); + } /* iolen may contain CFSBLOCK extra chars */ return(dtov(iolen)-fronterr); } --TB36FDmn/VVEgNH/-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message