tech-crypto archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: More Problems with CFS (zero-length files)

I had this problem and fixed it, but don't remember what it was.
Sorry for not posting a patch.  Pause to find diffs...

Now I remember why I didn't post this: I didn't understand what was
wrong, although I didn't stare really hard or long enough.

The following patch makes cfs work.  (I had added syslog calls for
debugging, which is the reason for the spurious added include of

Looking at the dtov definition, I really don't get why an intermediate
store fixes the problem (or rather why it's wrong without it).
The code has pre-ANSI decls, unfortunately - I'd be tempted to ANSIfy
things first, since I suspect that would point out some other minor
portability issues.

I don't recall examining the assembler for all of this.  Had it been a
PDP-11 I would have, but I don't know sparc asm very well.

As in your situation, my ciphertext files had the right length; the
plaintext files just show up as 0.

I compiled this on 2001-08-01, with whatever the 1.5.2 compiler was.
My system has been synced to netbsd-1-5 since then, and shows gcc
version egcs-2.91.66 19990314 (egcs-1.1.2 release)

This is a regular Sparc 5, in case that matters.

--- cfs_fh.c.DIST       Tue Jul 31 13:22:21 2001
+++ cfs_fh.c    Wed Aug  1 10:29:40 2001
@@ -48,6 +48,8 @@
 #include "admproto.h"
 #include "cfs.h"
+#include <syslog.h>
 #ifdef NO_UTIMES
 /* simulate utimes with utime */
 int utimes(s,tv)
@@ -595,6 +597,8 @@
      cfs_fileid *h;
      struct stat *sb;
+       int s1;
        if (h == NULL) {
                return -2;
@@ -603,7 +607,9 @@
           end in /. */
        if (lstat(h->name,sb)<0)
                return -1;
-       sb->st_size=dtov(sb->st_size); /* tweek size */
+       s1 = sb->st_size;
+       s1 = dtov(s1);
+       sb->st_size=s1;
        return 0;

        Greg Troxel <>

Home | Main Index | Thread Index | Old Index