selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selinux-testsuite: move variable definitions out of binder_common.h
@ 2020-01-23 22:39 Paul Moore
  2020-01-24 14:07 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Moore @ 2020-01-23 22:39 UTC (permalink / raw)
  To: selinux

From: Paul Moore <paul@paul-moore.com>

Move the definitions of variables out of binder_common.h and into
binder_common.c in order to prevent compiler errors.

Signed-off-by: Paul Moore <paul@paul-moore.com>
---
 tests/binder/binder_common.c |    4 ++++
 tests/binder/binder_common.h |   15 +++++++++++----
 2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/tests/binder/binder_common.c b/tests/binder/binder_common.c
index 224238b..7cf6c74 100644
--- a/tests/binder/binder_common.c
+++ b/tests/binder/binder_common.c
@@ -16,6 +16,10 @@
 
 #include "binder_common.h"
 
+bool verbose;
+enum binder_test_fd_t fd_type;
+char *fd_type_str;
+
 const char *cmd_name(uint32_t cmd)
 {
 	switch (cmd) {
diff --git a/tests/binder/binder_common.h b/tests/binder/binder_common.h
index f0245f3..f60860e 100644
--- a/tests/binder/binder_common.h
+++ b/tests/binder/binder_common.h
@@ -1,3 +1,6 @@
+#ifndef _BINDER_COMMON_H
+#define _BINDER_COMMON_H
+
 #include <errno.h>
 #include <fcntl.h>
 #include <inttypes.h>
@@ -42,16 +45,20 @@ enum {
 #define TEST_SERVICE_GET	290317 /* Sent by Client */
 #define TEST_SERVICE_SEND_FD	311019 /* Sent by Client */
 
-bool verbose;
+extern bool verbose;
 
 const char *cmd_name(uint32_t cmd);
 void print_trans_data(const struct binder_transaction_data *txn_in);
 int binder_write(int fd, void *data, size_t len);
 
-enum {
+enum binder_test_fd_t {
 	BINDER_FD,
 	BPF_MAP_FD,
 	BPF_PROG_FD,
 	BPF_TEST
-} fd_type;
-char *fd_type_str;
+};
+extern enum binder_test_fd_t fd_type;
+
+extern char *fd_type_str;
+
+#endif


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] selinux-testsuite: move variable definitions out of binder_common.h
  2020-01-23 22:39 [PATCH] selinux-testsuite: move variable definitions out of binder_common.h Paul Moore
@ 2020-01-24 14:07 ` Stephen Smalley
  2020-01-24 19:08   ` Paul Moore
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Smalley @ 2020-01-24 14:07 UTC (permalink / raw)
  To: Paul Moore, selinux

On 1/23/20 5:39 PM, Paul Moore wrote:
> From: Paul Moore <paul@paul-moore.com>
> 
> Move the definitions of variables out of binder_common.h and into
> binder_common.c in order to prevent compiler errors.
> 
> Signed-off-by: Paul Moore <paul@paul-moore.com>

Acked-by: Stephen Smalley <sds@tycho.nsa.gov>

> ---
>   tests/binder/binder_common.c |    4 ++++
>   tests/binder/binder_common.h |   15 +++++++++++----
>   2 files changed, 15 insertions(+), 4 deletions(-)
> 
> diff --git a/tests/binder/binder_common.c b/tests/binder/binder_common.c
> index 224238b..7cf6c74 100644
> --- a/tests/binder/binder_common.c
> +++ b/tests/binder/binder_common.c
> @@ -16,6 +16,10 @@
>   
>   #include "binder_common.h"
>   
> +bool verbose;
> +enum binder_test_fd_t fd_type;
> +char *fd_type_str;
> +
>   const char *cmd_name(uint32_t cmd)
>   {
>   	switch (cmd) {
> diff --git a/tests/binder/binder_common.h b/tests/binder/binder_common.h
> index f0245f3..f60860e 100644
> --- a/tests/binder/binder_common.h
> +++ b/tests/binder/binder_common.h
> @@ -1,3 +1,6 @@
> +#ifndef _BINDER_COMMON_H
> +#define _BINDER_COMMON_H
> +
>   #include <errno.h>
>   #include <fcntl.h>
>   #include <inttypes.h>
> @@ -42,16 +45,20 @@ enum {
>   #define TEST_SERVICE_GET	290317 /* Sent by Client */
>   #define TEST_SERVICE_SEND_FD	311019 /* Sent by Client */
>   
> -bool verbose;
> +extern bool verbose;
>   
>   const char *cmd_name(uint32_t cmd);
>   void print_trans_data(const struct binder_transaction_data *txn_in);
>   int binder_write(int fd, void *data, size_t len);
>   
> -enum {
> +enum binder_test_fd_t {
>   	BINDER_FD,
>   	BPF_MAP_FD,
>   	BPF_PROG_FD,
>   	BPF_TEST
> -} fd_type;
> -char *fd_type_str;
> +};
> +extern enum binder_test_fd_t fd_type;
> +
> +extern char *fd_type_str;
> +
> +#endif
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] selinux-testsuite: move variable definitions out of binder_common.h
  2020-01-24 14:07 ` Stephen Smalley
@ 2020-01-24 19:08   ` Paul Moore
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Moore @ 2020-01-24 19:08 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: selinux

On Fri, Jan 24, 2020 at 9:06 AM Stephen Smalley <sds@tycho.nsa.gov> wrote:
> On 1/23/20 5:39 PM, Paul Moore wrote:
> > From: Paul Moore <paul@paul-moore.com>
> >
> > Move the definitions of variables out of binder_common.h and into
> > binder_common.c in order to prevent compiler errors.
> >
> > Signed-off-by: Paul Moore <paul@paul-moore.com>
>
> Acked-by: Stephen Smalley <sds@tycho.nsa.gov>

I'm pretty sure Ondrej is fairly busy right now with DevConf.cz so I
went ahead and merged this into the master branch.

-- 
paul moore
www.paul-moore.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-24 19:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-23 22:39 [PATCH] selinux-testsuite: move variable definitions out of binder_common.h Paul Moore
2020-01-24 14:07 ` Stephen Smalley
2020-01-24 19:08   ` Paul Moore

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).