LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [2.6 patch] selinux/netlabel.c should #include "netlabel.h"
@ 2008-02-27 21:20 Adrian Bunk
  2008-02-27 21:42 ` Paul Moore
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2008-02-27 21:20 UTC (permalink / raw)
  To: paul.moore, sds, jmorris, eparis; +Cc: netdev, linux-kernel

Every file should include the headers containing the externs for its 
global code.

Signed-off-by: Adrian Bunk <bunk@kernel.org>

---
1f65757bac3e82514b447822ab30ee10d33a59a2 foobar
diff --git a/security/selinux/netlabel.c b/security/selinux/netlabel.c
index 0fa2be4..6d22d76 100644
--- a/security/selinux/netlabel.c
+++ b/security/selinux/netlabel.c
@@ -34,6 +34,7 @@
 
 #include "objsec.h"
 #include "security.h"
+#include "netlabel.h"
 
 /**
  * selinux_netlbl_sidlookup_cached - Cache a SID lookup


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

* Re: [2.6 patch] selinux/netlabel.c should #include "netlabel.h"
  2008-02-27 21:20 [2.6 patch] selinux/netlabel.c should #include "netlabel.h" Adrian Bunk
@ 2008-02-27 21:42 ` Paul Moore
  2008-02-27 21:55   ` Adrian Bunk
  2008-02-27 22:16   ` James Morris
  0 siblings, 2 replies; 5+ messages in thread
From: Paul Moore @ 2008-02-27 21:42 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: sds, jmorris, eparis, netdev, linux-kernel

On Wednesday 27 February 2008 4:20:42 pm Adrian Bunk wrote:
> Every file should include the headers containing the externs for its
> global code.
>
> Signed-off-by: Adrian Bunk <bunk@kernel.org>

It doesn't _need_ the file in the strictest sense, the header file is 
just there for the core SELinux code to call into the NetLabel/SELinux 
glue code (what is in security/selinux/netlabel.c).  However, if this 
is to conform better to kernel coding policy (I assume that is the case 
here?) then that is fine with me.

Acked-by: Paul Moore <paul.moore@hp.com>

> ---
> 1f65757bac3e82514b447822ab30ee10d33a59a2 foobar
> diff --git a/security/selinux/netlabel.c
> b/security/selinux/netlabel.c index 0fa2be4..6d22d76 100644
> --- a/security/selinux/netlabel.c
> +++ b/security/selinux/netlabel.c
> @@ -34,6 +34,7 @@
>
>  #include "objsec.h"
>  #include "security.h"
> +#include "netlabel.h"
>
>  /**
>   * selinux_netlbl_sidlookup_cached - Cache a SID lookup

-- 
paul moore
linux security @ hp

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

* Re: [2.6 patch] selinux/netlabel.c should #include "netlabel.h"
  2008-02-27 21:42 ` Paul Moore
@ 2008-02-27 21:55   ` Adrian Bunk
  2008-02-27 22:08     ` Paul Moore
  2008-02-27 22:16   ` James Morris
  1 sibling, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2008-02-27 21:55 UTC (permalink / raw)
  To: Paul Moore; +Cc: sds, jmorris, eparis, netdev, linux-kernel

On Wed, Feb 27, 2008 at 04:42:57PM -0500, Paul Moore wrote:
> On Wednesday 27 February 2008 4:20:42 pm Adrian Bunk wrote:
> > Every file should include the headers containing the externs for its
> > global code.
> >
> > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> 
> It doesn't _need_ the file in the strictest sense, the header file is 
> just there for the core SELinux code to call into the NetLabel/SELinux 
> glue code (what is in security/selinux/netlabel.c).  However, if this 
> is to conform better to kernel coding policy (I assume that is the case 
> here?) then that is fine with me.

I'm not claiming it needs it.

But with this #include gcc can check that the prototypes in netlabel.h 
match the functions in netlabel.c

The bugs this catches are rare, but when you have such a bug it can be 
nasty to debug.

> Acked-by: Paul Moore <paul.moore@hp.com>
> 
> > ---
> > 1f65757bac3e82514b447822ab30ee10d33a59a2 foobar
> > diff --git a/security/selinux/netlabel.c
> > b/security/selinux/netlabel.c index 0fa2be4..6d22d76 100644
> > --- a/security/selinux/netlabel.c
> > +++ b/security/selinux/netlabel.c
> > @@ -34,6 +34,7 @@
> >
> >  #include "objsec.h"
> >  #include "security.h"
> > +#include "netlabel.h"
> >
> >  /**
> >   * selinux_netlbl_sidlookup_cached - Cache a SID lookup
> 
> paul moore

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [2.6 patch] selinux/netlabel.c should #include "netlabel.h"
  2008-02-27 21:55   ` Adrian Bunk
@ 2008-02-27 22:08     ` Paul Moore
  0 siblings, 0 replies; 5+ messages in thread
From: Paul Moore @ 2008-02-27 22:08 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: sds, jmorris, eparis, netdev, linux-kernel

On Wednesday 27 February 2008 4:55:43 pm Adrian Bunk wrote:
> On Wed, Feb 27, 2008 at 04:42:57PM -0500, Paul Moore wrote:
> > On Wednesday 27 February 2008 4:20:42 pm Adrian Bunk wrote:
> > > Every file should include the headers containing the externs for
> > > its global code.
> > >
> > > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> >
> > It doesn't _need_ the file in the strictest sense, the header file
> > is just there for the core SELinux code to call into the
> > NetLabel/SELinux glue code (what is in
> > security/selinux/netlabel.c).  However, if this is to conform
> > better to kernel coding policy (I assume that is the case here?)
> > then that is fine with me.
>
> I'm not claiming it needs it.
>
> But with this #include gcc can check that the prototypes in
> netlabel.h match the functions in netlabel.c
>
> The bugs this catches are rare, but when you have such a bug it can
> be nasty to debug.

Good point, hadn't thought of that - thanks.  

> > Acked-by: Paul Moore <paul.moore@hp.com>

-- 
paul moore
linux security @ hp

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

* Re: [2.6 patch] selinux/netlabel.c should #include "netlabel.h"
  2008-02-27 21:42 ` Paul Moore
  2008-02-27 21:55   ` Adrian Bunk
@ 2008-02-27 22:16   ` James Morris
  1 sibling, 0 replies; 5+ messages in thread
From: James Morris @ 2008-02-27 22:16 UTC (permalink / raw)
  To: Paul Moore; +Cc: Adrian Bunk, sds, eparis, netdev, linux-kernel

On Wed, 27 Feb 2008, Paul Moore wrote:

> On Wednesday 27 February 2008 4:20:42 pm Adrian Bunk wrote:
> > Every file should include the headers containing the externs for its
> > global code.
> >
> > Signed-off-by: Adrian Bunk <bunk@kernel.org>
> 
> It doesn't _need_ the file in the strictest sense, the header file is 
> just there for the core SELinux code to call into the NetLabel/SELinux 
> glue code (what is in security/selinux/netlabel.c).  However, if this 
> is to conform better to kernel coding policy (I assume that is the case 
> here?) then that is fine with me.
> 
> Acked-by: Paul Moore <paul.moore@hp.com>

Applied to 
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/selinux-2.6.git#next

-- 
James Morris
<jmorris@namei.org>

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

end of thread, other threads:[~2008-02-27 22:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-27 21:20 [2.6 patch] selinux/netlabel.c should #include "netlabel.h" Adrian Bunk
2008-02-27 21:42 ` Paul Moore
2008-02-27 21:55   ` Adrian Bunk
2008-02-27 22:08     ` Paul Moore
2008-02-27 22:16   ` James Morris

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).