From owner-freebsd-questions Sun Feb 23 15:47:27 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id PAA10293 for questions-outgoing; Sun, 23 Feb 1997 15:47:27 -0800 (PST) Received: from infowest.com (infowest.com [204.17.177.10]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id PAA10288 for ; Sun, 23 Feb 1997 15:47:23 -0800 (PST) Received: from orchestra (GKar.infowest.com [204.17.177.123]) by infowest.com (8.8.5/8.8.5) with SMTP id QAA29300 for ; Sun, 23 Feb 1997 16:47:37 -0700 (MST) Message-Id: <3.0.1.32.19970223164720.006ab5a0@infowest.com> X-Sender: agifford@infowest.com X-Mailer: Windows Eudora Light Version 3.0.1 beta 12 (32) Date: Sun, 23 Feb 1997 16:47:20 -0700 To: questions@freebsd.org From: "Aaron D. Gifford" Subject: 2.1.7 and Tripwire ftruncate() fun Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk 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.