All of lore.kernel.org
 help / color / mirror / Atom feed
* [refpolicy][PATCH] fix Makefile BASE_MODS and MOD_MODS detection
@ 2005-11-09  1:35 Johan Fischer
  2005-11-09 14:22 ` Christopher J. PeBenito
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Fischer @ 2005-11-09  1:35 UTC (permalink / raw)
  To: SELinux

[-- Attachment #1: Type: text/plain, Size: 1152 bytes --]

Hi,

quick patch to fix the modules detection from the modules.conf file...

before:
$ awk '/^[[:blank:]]*[[:alpha:]]/{ if ($3 == "module") print $1 }'
policy/modules.conf
(no result)

after:
$ awk '/^[[:blank:]]*[[:alpha:]]*/{ if ($3 == "module") print $1 }'
policy/modules.conf
apm
apache
bluetooth

Cheers.
J.


-- 
Johan Fischer
Capital Markets CRC Limited
Level 2, 9 Castlereagh Street, Sydney NSW 2000
Tel: +61 2 9233 7999   Direct: +61 2 9236 9150
Fax: +61 2 9236 9177   http://www.cmcrc.com

Capital Markets CRC Ltd (CMCRC) - Confidential Communication
The information contained in this e-mail is confidential.  It is intended solely for the addressee. If you receive this e-mail by mistake please promptly inform us by reply e-mail and then delete the e-mail and destroy any printed copy. You must not disclose or use in any way the information in the e-mail. There is no warranty that this e-mail is error or virus free. It may be a private communication, and if so, does not represent the views of the CMCRC and its associates. If it is a private communication, care should be taken in opening it to ensure that undue offence is not given.


[-- Attachment #2: Makefile.diff --]
[-- Type: text/plain, Size: 1117 bytes --]

? Makefile.diff
Index: Makefile
===================================================================
RCS file: /cvsroot/serefpolicy/refpolicy/Makefile,v
retrieving revision 1.24
diff -u -r1.24 Makefile
--- Makefile	7 Nov 2005 20:10:44 -0000	1.24
+++ Makefile	9 Nov 2005 01:31:06 -0000
@@ -199,8 +199,8 @@
 MODMOD := module
 
 # extract settings from modules.conf
-BASE_MODS := $(foreach mod,$(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODBASE)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te)))
-MOD_MODS := $(foreach mod,$(shell awk '/^[[:blank:]]*[[:alpha:]]/{ if ($$3 == "$(MODMOD)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te)))
+BASE_MODS := $(foreach mod,$(shell awk '/^[[:blank:]]*[[:alpha:]]*/{ if ($$3 == "$(MODBASE)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te)))
+MOD_MODS := $(foreach mod,$(shell awk '/^[[:blank:]]*[[:alpha:]]*/{ if ($$3 == "$(MODMOD)") print $$1 }' $(MOD_CONF) 2> /dev/null),$(subst ./,,$(shell find -iname $(mod).te)))
 
 HOMEDIR_TEMPLATE = tmp/homedir_template
 

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

* Re: [refpolicy][PATCH] fix Makefile BASE_MODS and MOD_MODS detection
  2005-11-09  1:35 [refpolicy][PATCH] fix Makefile BASE_MODS and MOD_MODS detection Johan Fischer
@ 2005-11-09 14:22 ` Christopher J. PeBenito
  2005-11-25  0:11   ` Johan Fischer
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher J. PeBenito @ 2005-11-09 14:22 UTC (permalink / raw)
  To: Johan Fischer; +Cc: SELinux

On Wed, 2005-11-09 at 12:35 +1100, Johan Fischer wrote:
> quick patch to fix the modules detection from the modules.conf file...
> 
> before:
> $ awk '/^[[:blank:]]*[[:alpha:]]/{ if ($3 == "module") print $1 }'
> policy/modules.conf
> (no result)
> 
> after:
> $ awk '/^[[:blank:]]*[[:alpha:]]*/{ if ($3 == "module") print $1 }'
> policy/modules.conf
> apm
> apache
> bluetooth

I can't reproduce this behavior.  I don't believe this patch is correct,
as it makes the regex too inspecific.  With the change, the regex
matches all lines, so if the second word in a comment was "module", it
would print out "#", causing errors.
 
-- 
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [refpolicy][PATCH] fix Makefile BASE_MODS and MOD_MODS detection
  2005-11-09 14:22 ` Christopher J. PeBenito
@ 2005-11-25  0:11   ` Johan Fischer
  2005-11-25 14:22     ` Christopher J. PeBenito
  0 siblings, 1 reply; 4+ messages in thread
From: Johan Fischer @ 2005-11-25  0:11 UTC (permalink / raw)
  To: Christopher J. PeBenito; +Cc: SELinux

FYI,

the solution to the problem....

make sure that you're using gawk and not mawk as the default awk on your
system.

possibly the gawk and mawk way of adding extra anchors might be
different making it fail on my installation ( I don't how when I
installed mawk or why, but anyway....)

Cheers.
J.


Christopher J. PeBenito wrote:

>On Wed, 2005-11-09 at 12:35 +1100, Johan Fischer wrote:
>  
>
>>quick patch to fix the modules detection from the modules.conf file...
>>
>>before:
>>$ awk '/^[[:blank:]]*[[:alpha:]]/{ if ($3 == "module") print $1 }'
>>policy/modules.conf
>>(no result)
>>
>>after:
>>$ awk '/^[[:blank:]]*[[:alpha:]]*/{ if ($3 == "module") print $1 }'
>>policy/modules.conf
>>apm
>>apache
>>bluetooth
>>    
>>
>
>I can't reproduce this behavior.  I don't believe this patch is correct,
>as it makes the regex too inspecific.  With the change, the regex
>matches all lines, so if the second word in a comment was "module", it
>would print out "#", causing errors.
> 
>  
>

-- 
Johan Fischer
Capital Markets CRC Limited
Level 2, 9 Castlereagh Street, Sydney NSW 2000
Tel: +61 2 9233 7999   Direct: +61 2 9236 9150
Fax: +61 2 9236 9177   http://www.cmcrc.com

Capital Markets CRC Ltd (CMCRC) - Confidential Communication
The information contained in this e-mail is confidential.  It is intended solely for the addressee. If you receive this e-mail by mistake please promptly inform us by reply e-mail and then delete the e-mail and destroy any printed copy. You must not disclose or use in any way the information in the e-mail. There is no warranty that this e-mail is error or virus free. It may be a private communication, and if so, does not represent the views of the CMCRC and its associates. If it is a private communication, care should be taken in opening it to ensure that undue offence is not given.


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

* Re: [refpolicy][PATCH] fix Makefile BASE_MODS and MOD_MODS detection
  2005-11-25  0:11   ` Johan Fischer
@ 2005-11-25 14:22     ` Christopher J. PeBenito
  0 siblings, 0 replies; 4+ messages in thread
From: Christopher J. PeBenito @ 2005-11-25 14:22 UTC (permalink / raw)
  To: Johan Fischer; +Cc: SELinux

On Fri, 2005-11-25 at 11:11 +1100, Johan Fischer wrote:
> the solution to the problem....
> 
> make sure that you're using gawk and not mawk as the default awk on your
> system.
> 
> possibly the gawk and mawk way of adding extra anchors might be
> different making it fail on my installation ( I don't how when I
> installed mawk or why, but anyway....)

Perhaps the awk commands should be changed to gawk.  I wouldn't think it
would be a problem; it doesn't seem likely that a policy will be built
on a non-GNU system.

> Christopher J. PeBenito wrote:
> 
> >On Wed, 2005-11-09 at 12:35 +1100, Johan Fischer wrote:
> >  
> >
> >>quick patch to fix the modules detection from the modules.conf file...
> >>
> >>before:
> >>$ awk '/^[[:blank:]]*[[:alpha:]]/{ if ($3 == "module") print $1 }'
> >>policy/modules.conf
> >>(no result)
> >>
> >>after:
> >>$ awk '/^[[:blank:]]*[[:alpha:]]*/{ if ($3 == "module") print $1 }'
> >>policy/modules.conf
> >>apm
> >>apache
> >>bluetooth
> >>    
> >>
> >
> >I can't reproduce this behavior.  I don't believe this patch is correct,
> >as it makes the regex too inspecific.  With the change, the regex
> >matches all lines, so if the second word in a comment was "module", it
> >would print out "#", causing errors.
> > 
> >  
> >
> 
-- 
Chris PeBenito
Tresys Technology, LLC
(410) 290-1411 x150


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

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

end of thread, other threads:[~2005-11-25 14:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-09  1:35 [refpolicy][PATCH] fix Makefile BASE_MODS and MOD_MODS detection Johan Fischer
2005-11-09 14:22 ` Christopher J. PeBenito
2005-11-25  0:11   ` Johan Fischer
2005-11-25 14:22     ` Christopher J. PeBenito

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.