[66] in The Cryptographic File System users list

home help back first fref pref prev next nref lref last post

Re: Annoying CFS bug fixed

daemon@ATHENA.MIT.EDU (Rob Stampfli)
Sun Apr 26 20:21:12 1998

From owner-cfs-users@research.att.com Mon Apr 27 00:21:11 1998
Return-Path: <owner-cfs-users@research.att.com>
Delivered-To: cfs-mtg@bloom-picayune.mit.edu
Received: (qmail 5940 invoked from network); 27 Apr 1998 00:21:10 -0000
Received: from unknown (HELO ns.research.att.com) (192.20.225.4)
  by bloom-picayune.mit.edu with SMTP; 27 Apr 1998 00:21:10 -0000
Received: from research.att.com ([135.207.30.100]) by ns; Sun Apr 26 20:19:24 EDT 1998
Received: from amontillado.research.att.com ([135.207.24.32]) by research-clone; Sun Apr 26 20:09:18 EDT 1998
Received: from nsa.research.att.com (majordomo@nsa.research.att.com [135.207.24.155])
	by amontillado.research.att.com (8.8.7/8.8.7) with ESMTP id UAA02319;
	Sun, 26 Apr 1998 20:09:16 -0400 (EDT)
Received: (from majordomo@localhost) by nsa.research.att.com (8.7.3/8.7.3) id UAA28518 for cfs-users-list; Sun, 26 Apr 1998 20:06:54 -0400 (EDT)
X-Authentication-Warning: nsa.research.att.com: majordomo set sender to owner-cfs-users@nsa.research.att.com using -f
Received: from research.att.com (research-clone.research.att.com [135.207.30.100]) by nsa.research.att.com (8.7.3/8.7.3) with SMTP id UAA28514 for <cfs-users@nsa.research.att.com>; Sun, 26 Apr 1998 20:06:52 -0400 (EDT)
Received: from elektro.cmhnet.org ([192.188.133.3]) by research-clone; Sun Apr 26 20:07:10 EDT 1998
Received: from colnet by elektro.cmhnet.org with uucp
	(Smail3.1.29.1 #1) id m0yTbRP-00004qC; Sun, 26 Apr 98 20:06 EDT
Received: from kd8wk.cmhnet.org by colnet.cmhnet.org with smtp
	(Smail3.1.28.1 #4) id m0yTbKT-0008F9C; Sun, 26 Apr 98 19:59 EDT
Received: by kd8wk.cmhnet.org (Smail3.1.28.1 #4)
	id m0yTbKA-0000nqC; Sun, 26 Apr 98 19:59 EDT
Message-Id: <m0yTbKA-0000nqC@kd8wk.cmhnet.org>
Date: Sun, 26 Apr 98 19:59 EDT
From: res@kd8wk.cmhnet.org (Rob Stampfli)
To: cfs-users@research.att.com
Subject: Re: Annoying CFS bug fixed
Sender: owner-cfs-users@research.att.com
Precedence: bulk

In recent email Sean Sheedy writes:
>
>The current version of CFS has a bug where the modification time is
>changed on the file even if it is opened only for read.  I've attached a
>patch to fix this bug.  Also, this patch has a change to avoid an
>unnecessary truncate when the file isn't actually shrinking.
>
>Sean
...
>*** cfs_fh.c	1998/01/02 07:12:25	1.1
>--- cfs_fh.c	1998/03/14 00:18:10
>***************
>*** 547,553 ****
>  		openfd=NULL;
>  	}
>  
>! 	if (mode==0) { mode=CFS_WRITE; }
>  	/* Phil Karn's hack for R/O file systems */
>  	if ((fd=open(f->name,mode,0))<0 && errno == EROFS) {
>  		mode = CFS_READ;        /* Force read and try again */
>--- 547,554 ----
>  		openfd=NULL;
>  	}
>  
>! 	/* ### This looks badly wrong */
>! 	/* if (mode==0) { mode=CFS_WRITE; } */
>  	/* Phil Karn's hack for R/O file systems */
>  	if ((fd=open(f->name,mode,0))<0 && errno == EROFS) {
>  		mode = CFS_READ;        /* Force read and try again */

Thanks, Sean.  I'll make this change to my copy and look for it in the
next release of cfs.

Your mail prompted me to examine this file, and it looks like there may
be a very minor bug in the section right above it, too:  There is a static
variable curfd which contains a file descriptor to the "working" file.  I
would recommend adding the line: "curfd = -1;" immediately after the line
"close(curfd);   /* hope it was valid... */", to prevent doing multiple
close()s on the file.  Most Unixes would take this in stride, but there
might be some strange version somewhere that would get upset.

Also, does anyone on the group use esm?  I do, and I've hacked my esm.c
to ignore ctrl-S and ctrl-Q in the stream while exchanging keys and while
running in ecrypted mode.  I have found that this is necessary for it to
work in certain conditions (like when there is a "cu" or "tip" in the
pipeline).  I can provide the diffs, if anyone is interested.

My 2 cents on a rainy Sunday afternoon...
-- 
Rob Stampfli   rob@colnet.cmhnet.org       The Bill of Rights:  It was a
614-864-9377   HAM RADIO: kd8wk@w8cqk.oh   good thing while it lasted...

home help back first fref pref prev next nref lref last post