Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753460AbbGBI3a (ORCPT ); Thu, 2 Jul 2015 04:29:30 -0400 Received: from mail-wg0-f50.google.com ([74.125.82.50]:33908 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751615AbbGBI3H (ORCPT ); Thu, 2 Jul 2015 04:29:07 -0400 From: David Herrmann To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , daniel@zonque.org, tixxdz@opendz.org, David Herrmann Subject: [PATCH 1/6] kdbus/selftests: fix CAP translation tests Date: Thu, 2 Jul 2015 10:28:29 +0200 Message-Id: <1435825714-3567-2-git-send-email-dh.herrmann@gmail.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1435825714-3567-1-git-send-email-dh.herrmann@gmail.com> References: <1435825714-3567-1-git-send-email-dh.herrmann@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2081 Lines: 55 We now support CAP translations. Make sure our tests reflect that. So far they made sure we drop CAPS on namespace borders. This is wrong, though. We really need to just make sure that no _or_ the correctly translated caps are returned. Fix this. Signed-off-by: David Herrmann --- tools/testing/selftests/kdbus/test-metadata-ns.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/kdbus/test-metadata-ns.c b/tools/testing/selftests/kdbus/test-metadata-ns.c index ccdfae0..1f6edc0 100644 --- a/tools/testing/selftests/kdbus/test-metadata-ns.c +++ b/tools/testing/selftests/kdbus/test-metadata-ns.c @@ -168,9 +168,8 @@ static int __kdbus_clone_userns_test(const char *bus, ASSERT_EXIT(ret == 0); ASSERT_EXIT(msg->dst_id == userns_conn->id); - /* Different namespaces no CAPS */ item = kdbus_get_item(msg, KDBUS_ITEM_CAPS); - ASSERT_EXIT(item == NULL); + ASSERT_EXIT(item); /* uid/gid not mapped, so we have unpriv cached creds */ ret = kdbus_match_kdbus_creds(msg, &unmapped_creds); @@ -196,9 +195,8 @@ static int __kdbus_clone_userns_test(const char *bus, ASSERT_EXIT(ret == 0); ASSERT_EXIT(msg->dst_id == KDBUS_DST_ID_BROADCAST); - /* Different namespaces no CAPS */ item = kdbus_get_item(msg, KDBUS_ITEM_CAPS); - ASSERT_EXIT(item == NULL); + ASSERT_EXIT(item); /* uid/gid not mapped, so we have unpriv cached creds */ ret = kdbus_match_kdbus_creds(msg, &unmapped_creds); @@ -358,9 +356,8 @@ static int kdbus_clone_userns_test(const char *bus, userns_conn_id = msg->src_id; - /* We do not share the userns, os no KDBUS_ITEM_CAPS */ item = kdbus_get_item(msg, KDBUS_ITEM_CAPS); - ASSERT_RETURN(item == NULL); + ASSERT_RETURN(item); /* * Compare received items, creds must be translated into -- 2.4.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/