Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1175805

[PATCH 1/6] kdbus/selftests: fix CAP translation tests

From David Herrmann <dh.herrmann@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 1/6] kdbus/selftests: fix CAP translation tests
Date 2015-07-02 10:30 +0200
Message-ID <pHI2C-gz-7@gated-at.bofh.it> (permalink)
References <pHI2C-gz-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <dh.herrmann@gmail.com>
---
 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/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 1/6] kdbus/selftests: fix CAP translation tests David Herrmann <dh.herrmann@gmail.com> - 2015-07-02 10:30 +0200

csiph-web