All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hiding SELinux status on Settings app if HAVE_SELINUX:=false
@ 2012-06-22 20:43 William Roberts
  2012-06-23  0:31 ` William Roberts
  2012-06-25 12:12 ` Stephen Smalley
  0 siblings, 2 replies; 4+ messages in thread
From: William Roberts @ 2012-06-22 20:43 UTC (permalink / raw)
  To: selinux


[-- Attachment #1.1: Type: text/plain, Size: 528 bytes --]

This should hide the SELinux status in settings if you don't have
HAVE_SELINUX:=true during the build.

Please verify these patches before merging them. I only tested on Maguro.

Right now, you must do a CLEAN build to get these to work right. For some
reason props doesn't get updated right for me.

These for addressing the issues in Change-Id:
I69529fb7a3adfe31eccb16d79740fc4952ff5e68<https://android-review.googlesource.com/#/q/I69529fb7a3adfe31eccb16d79740fc4952ff5e68,n,z>
on
garret

-- 
Respectfully,

William C Roberts

[-- Attachment #1.2: Type: text/html, Size: 955 bytes --]

[-- Attachment #2: build_core_se_linux_property.patch --]
[-- Type: application/octet-stream, Size: 365 bytes --]

diff --git a/core/main.mk b/core/main.mk
index 3d8d6e0..d9b2027 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -218,6 +218,10 @@ ifneq ($(filter sdk win_sdk sdk_addon,$(MAKECMDGOALS)),)
 is_sdk_build := true
 endif
 
+## have selinux ##
+ifeq ($(HAVE_SELINUX),true)
+ADDITIONAL_BUILD_PROPERTIES := ro.have_selinux=1
+endif # HAVE_SELINUX
 
 ## user/userdebug ##
 

[-- Attachment #3: packages_apps_Settings_selinux_status_hide.patch --]
[-- Type: application/octet-stream, Size: 1399 bytes --]

diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index c2418b6..76c2c28 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -55,6 +55,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
     private static final String KEY_COPYRIGHT = "copyright";
     private static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings";
     private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
+    private static final String PROPERTY_SELINUX_STATUS = "ro.have_selinux";
     private static final String KEY_KERNEL_VERSION = "kernel_version";
     private static final String KEY_BUILD_NUMBER = "build_number";
     private static final String KEY_DEVICE_MODEL = "device_model";
@@ -85,6 +86,9 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
             setStringSummary(KEY_SELINUX_STATUS, "enforcing");
         }
 
+	// Remove selinux information if property is not present
+	removePreferenceIfPropertyMissing(getPreferenceScreen(), "selinux_status", PROPERTY_SELINUX_STATUS);
+
         // Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
         removePreferenceIfPropertyMissing(getPreferenceScreen(), "safetylegal",
                 PROPERTY_URL_SAFETYLEGAL);

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

* Re: [PATCH] hiding SELinux status on Settings app if HAVE_SELINUX:=false
  2012-06-22 20:43 [PATCH] hiding SELinux status on Settings app if HAVE_SELINUX:=false William Roberts
@ 2012-06-23  0:31 ` William Roberts
  2012-06-25 12:12 ` Stephen Smalley
  1 sibling, 0 replies; 4+ messages in thread
From: William Roberts @ 2012-06-23  0:31 UTC (permalink / raw)
  To: selinux


[-- Attachment #1.1: Type: text/plain, Size: 911 bytes --]

These patches had an issue with the system ui dying. I thought it was a
problem on master but it was my problem.

I was accidentally resetting ADDITIONAL_BUILD_PROPERTIES instead of
appending to it, these patches correct that.


On Fri, Jun 22, 2012 at 1:43 PM, William Roberts
<bill.c.roberts@gmail.com>wrote:

> This should hide the SELinux status in settings if you don't have
> HAVE_SELINUX:=true during the build.
>
> Please verify these patches before merging them. I only tested on Maguro.
>
> Right now, you must do a CLEAN build to get these to work right. For some
> reason props doesn't get updated right for me.
>
> These for addressing the issues in Change-Id:
> I69529fb7a3adfe31eccb16d79740fc4952ff5e68<https://android-review.googlesource.com/#/q/I69529fb7a3adfe31eccb16d79740fc4952ff5e68,n,z> on
> garret
>
> --
> Respectfully,
>
> William C Roberts
>
>
>


-- 
Respectfully,

William C Roberts

[-- Attachment #1.2: Type: text/html, Size: 1683 bytes --]

[-- Attachment #2: build_core_se_linux_property.patch --]
[-- Type: application/octet-stream, Size: 365 bytes --]

diff --git a/core/main.mk b/core/main.mk
index 3d8d6e0..913cfbd 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -218,6 +218,10 @@ ifneq ($(filter sdk win_sdk sdk_addon,$(MAKECMDGOALS)),)
 is_sdk_build := true
 endif
 
+## have selinux ##
+ifeq ($(HAVE_SELINUX),true)
+ADDITIONAL_BUILD_PROPERTIES += ro.have_selinux=1
+endif # HAVE_SELINUX
 
 ## user/userdebug ##
 

[-- Attachment #3: packages_apps_Settings_selinux_status_hide.patch --]
[-- Type: application/octet-stream, Size: 1399 bytes --]

diff --git a/src/com/android/settings/DeviceInfoSettings.java b/src/com/android/settings/DeviceInfoSettings.java
index c2418b6..76c2c28 100644
--- a/src/com/android/settings/DeviceInfoSettings.java
+++ b/src/com/android/settings/DeviceInfoSettings.java
@@ -55,6 +55,7 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
     private static final String KEY_COPYRIGHT = "copyright";
     private static final String KEY_SYSTEM_UPDATE_SETTINGS = "system_update_settings";
     private static final String PROPERTY_URL_SAFETYLEGAL = "ro.url.safetylegal";
+    private static final String PROPERTY_SELINUX_STATUS = "ro.have_selinux";
     private static final String KEY_KERNEL_VERSION = "kernel_version";
     private static final String KEY_BUILD_NUMBER = "build_number";
     private static final String KEY_DEVICE_MODEL = "device_model";
@@ -85,6 +86,9 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment {
             setStringSummary(KEY_SELINUX_STATUS, "enforcing");
         }
 
+	// Remove selinux information if property is not present
+	removePreferenceIfPropertyMissing(getPreferenceScreen(), "selinux_status", PROPERTY_SELINUX_STATUS);
+
         // Remove Safety information preference if PROPERTY_URL_SAFETYLEGAL is not set
         removePreferenceIfPropertyMissing(getPreferenceScreen(), "safetylegal",
                 PROPERTY_URL_SAFETYLEGAL);

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

* Re: [PATCH] hiding SELinux status on Settings app if HAVE_SELINUX:=false
  2012-06-22 20:43 [PATCH] hiding SELinux status on Settings app if HAVE_SELINUX:=false William Roberts
  2012-06-23  0:31 ` William Roberts
@ 2012-06-25 12:12 ` Stephen Smalley
  2012-06-25 16:35   ` William Roberts
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Smalley @ 2012-06-25 12:12 UTC (permalink / raw)
  To: William Roberts; +Cc: selinux

On Fri, 2012-06-22 at 13:43 -0700, William Roberts wrote:
> This should hide the SELinux status in settings if you don't have
> HAVE_SELINUX:=true during the build.
> 
> 
> Please verify these patches before merging them. I only tested on
> Maguro.
> 
> 
> Right now, you must do a CLEAN build to get these to work right. For
> some reason props doesn't get updated right for me.
> 
> 
> These for addressing the issues in Change-Id:
> I69529fb7a3adfe31eccb16d79740fc4952ff5e68 on garret

I was going to just drop the Settings app change since we now have
SEAndroidManager and it provides a superset of the Settings app
functionality (and has the benefit of being easily included/excluded in
different product builds).

-- 
Stephen Smalley
National Security Agency


--
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: [PATCH] hiding SELinux status on Settings app if HAVE_SELINUX:=false
  2012-06-25 12:12 ` Stephen Smalley
@ 2012-06-25 16:35   ` William Roberts
  0 siblings, 0 replies; 4+ messages in thread
From: William Roberts @ 2012-06-25 16:35 UTC (permalink / raw)
  To: Stephen Smalley; +Cc: selinux

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

Ahh your comment in Garret said, "willing to abandon", didn't realize you
did. How can you go about getting that patchset marked as (abandoned) in
Garret and can you please do that?

On another note, I see at times that it's hard getting around the
HAVE_SELINUX in java code since their is no conditional compilation. It
looks like the build prop is a cleaner way of handling this. Should we keep
the change in libcore and merge that?

I still think having the selinux status in Settings is useful as it doesn't
require me to bake in an app for it.

Bill

On Mon, Jun 25, 2012 at 5:12 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:

> On Fri, 2012-06-22 at 13:43 -0700, William Roberts wrote:
> > This should hide the SELinux status in settings if you don't have
> > HAVE_SELINUX:=true during the build.
> >
> >
> > Please verify these patches before merging them. I only tested on
> > Maguro.
> >
> >
> > Right now, you must do a CLEAN build to get these to work right. For
> > some reason props doesn't get updated right for me.
> >
> >
> > These for addressing the issues in Change-Id:
> > I69529fb7a3adfe31eccb16d79740fc4952ff5e68 on garret
>
> I was going to just drop the Settings app change since we now have
> SEAndroidManager and it provides a superset of the Settings app
> functionality (and has the benefit of being easily included/excluded in
> different product builds).
>
> --
> Stephen Smalley
> National Security Agency
>
>


-- 
Respectfully,

William C Roberts

[-- Attachment #2: Type: text/html, Size: 2133 bytes --]

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

end of thread, other threads:[~2012-06-25 16:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-22 20:43 [PATCH] hiding SELinux status on Settings app if HAVE_SELINUX:=false William Roberts
2012-06-23  0:31 ` William Roberts
2012-06-25 12:12 ` Stephen Smalley
2012-06-25 16:35   ` William Roberts

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.