Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Feb 1997 11:36:18 -0700
From:      "Aaron D. Gifford" <agifford@infowest.com>
To:        freebsd-isp@freebsd.org
Subject:   2.1.7 and Tripwire ftruncate() fun
Message-ID:  <3.0.1.32.19970224113618.006aa8e4@infowest.com>

next in thread | raw e-mail | index | archive | help
Hi,

Is anyone running tripwire on FreeBSD 2.1.7?  It compiled fine for me but
dies while initializing the tripwire database with a truncate error.  The
source code looks like it should work fine.  I did a little testing and see
that ftruncate(fd, 0) call is failing with error 22 EINVAL which the
ftruncate() man page says "The fd references a socket, not a file." and
this is NOT true.  The fd sent to the ftruncate() call is a fd to a temp
file in /tmp that has been unlink()'d and is of length 0 on my machine when
the ftruncate() call is made.  Adding some more testing code, I
successfully did a write(fd, "TEST\n", 5) to the fd both BEFORE and AFTER
the failed ftruncate() call and after commenting out the unlink() code so
the file would remain in /tmp, I saw that indeed the file contained the two
"TEST\n" lines, one written before the failed ftruncate() call and the
other written after ftruncate() failed with an EINVAL error.  Weird!  Is
this an OS bug?  I searched the archives and saw that the ftruncate()
failure with tripwire was briefly mentioned in about 4-6 messages almost a
year ago, but no solutions were forthcoming.

Aaron out.








Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.1.32.19970224113618.006aa8e4>