From owner-p4-projects@FreeBSD.ORG Mon May 17 03:48:45 2010 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 370511065670; Mon, 17 May 2010 03:48:45 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB25106564A for ; Mon, 17 May 2010 03:48:44 +0000 (UTC) (envelope-from jona@FreeBSD.org) Received: from repoman.freebsd.org (unknown [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id DD7BC8FC0C for ; Mon, 17 May 2010 03:48:44 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id o4H3mijF038138 for ; Mon, 17 May 2010 03:48:44 GMT (envelope-from jona@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id o4H3miuY038136 for perforce@freebsd.org; Mon, 17 May 2010 03:48:44 GMT (envelope-from jona@FreeBSD.org) Date: Mon, 17 May 2010 03:48:44 GMT Message-Id: <201005170348.o4H3miuY038136@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jona@FreeBSD.org using -f From: Jonathan Anderson To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 178362 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2010 03:48:45 -0000 http://p4web.freebsd.org/@@178362?ac=10 Change 178362 by jona@jona-belle-freebsd8 on 2010/05/17 03:48:27 Added regression test case: fcntl(x) should fail with ENOTCAPABLE (rather than EBADF) when x does not have CAP_FCNTL Affected files ... .. //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#2 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#2 (text+ko) ==== @@ -29,7 +29,7 @@ */ #include -__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#1 $"); +__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#2 $"); #include #include @@ -101,6 +101,13 @@ else if(fcntl(files[i].fd, F_GETFL, 0) == -1) warnx("Error calling fcntl('%s', F_GETFL)", files[i].name); + + else if (fcntl(cap_new(files[i].fd, 0), F_GETFL, 0) == -1) + { + if(errno != ENOTCAPABLE) + warn("fcntl('%s', F_GETFL) failed, but errno" + " != ENOTCAPABLE", files[i].name); + } } }