public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Herrmann <dh.herrmann@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	daniel@zonque.org, tixxdz@opendz.org,
	David Herrmann <dh.herrmann@gmail.com>
Subject: [PATCH 1/6] kdbus/selftests: fix CAP translation tests
Date: Thu,  2 Jul 2015 10:28:29 +0200	[thread overview]
Message-ID: <1435825714-3567-2-git-send-email-dh.herrmann@gmail.com> (raw)
In-Reply-To: <1435825714-3567-1-git-send-email-dh.herrmann@gmail.com>

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


  reply	other threads:[~2015-07-02  8:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02  8:28 [PATCH 0/6] Miscellaneous kdbus fixes and code removal David Herrmann
2015-07-02  8:28 ` David Herrmann [this message]
2015-07-02  8:28 ` [PATCH 2/6] kdbus: drop redundant KDBUS_MSG_MAX_ITEMS David Herrmann
2015-07-03 21:14   ` Sergei Zviagintsev
2015-07-04 11:22   ` [PATCH v2 " David Herrmann
2015-07-02  8:28 ` [PATCH 3/6] kdbus: drop unused 'bloom_generation' field David Herrmann
2015-07-02  8:28 ` [PATCH 4/6] kdbus: drop support for required attach-flags on buses David Herrmann
2015-07-02  8:28 ` [PATCH 5/6] kdbus: pin namespaces on HELLO David Herrmann
2015-07-03 21:44   ` Sergei Zviagintsev
2015-07-04 11:26     ` David Herrmann
2015-07-02  8:28 ` [PATCH 6/6] kdbus: fix NULL-deref in activator cleanup David Herrmann
2015-07-06 18:49 ` [PATCH 0/6] Miscellaneous kdbus fixes and code removal David Herrmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435825714-3567-2-git-send-email-dh.herrmann@gmail.com \
    --to=dh.herrmann@gmail.com \
    --cc=daniel@zonque.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tixxdz@opendz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox