From owner-p4-projects@FreeBSD.ORG Fri Dec 2 23:57:43 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4243D16A422; Fri, 2 Dec 2005 23:57:43 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 05F7216A41F for ; Fri, 2 Dec 2005 23:57:43 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id C44A343D55 for ; Fri, 2 Dec 2005 23:57:42 +0000 (GMT) (envelope-from wsalamon@computer.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id jB2Nvg4L091987 for ; Fri, 2 Dec 2005 23:57:42 GMT (envelope-from wsalamon@computer.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id jB2NvgRr091984 for perforce@freebsd.org; Fri, 2 Dec 2005 23:57:42 GMT (envelope-from wsalamon@computer.org) Date: Fri, 2 Dec 2005 23:57:42 GMT Message-Id: <200512022357.jB2NvgRr091984@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to wsalamon@computer.org using -f From: Wayne Salamon To: Perforce Change Reviews Cc: Subject: PERFORCE change 87662 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2005 23:57:44 -0000 http://perforce.freebsd.org/chv.cgi?CH=87662 Change 87662 by wsalamon@gretsch on 2005/12/02 23:57:14 Add a test case for a failed FCHDIR record. Clean up some other things. Affected files ... .. //depot/projects/trustedbsd/audit3/tools/regression/audit/test/file/tdir.c#4 edit Differences ... ==== //depot/projects/trustedbsd/audit3/tools/regression/audit/test/file/tdir.c#4 (text+ko) ==== @@ -25,12 +25,13 @@ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ +#include +#include +#include #include #include #include -#include -#include -#include +#include /* * Test the auditing of some of the dir-related system calls. @@ -61,6 +62,7 @@ /* The next calls should generate AUE_CHDIR audit records */ chdir(tempname); + /* This next call is necessasry so we can find the audit log file. */ chdir(".."); aut_assert(AUE_CHDIR); @@ -78,8 +80,11 @@ /* The next calls should generate AUE_FCHDIR audit records */ fchdir(temp_fd); - temp_fd = dirfd(opendir("..")); - fchdir(temp_fd); + chdir(".."); + aut_assert(AUE_FCHDIR); + + /* Generate a failure AUE_FCHDIR record */ + fchdir(999); aut_assert(AUE_FCHDIR); /* The next call should generate a AUE_RMDIR audit record */