All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Chad Sellers <csellers@tresys.com>
Cc: SE Linux <selinux@tycho.nsa.gov>
Subject: Re: Add modules support to semanage
Date: Thu, 12 Nov 2009 11:23:15 -0500	[thread overview]
Message-ID: <4AFC3673.4020505@redhat.com> (raw)
In-Reply-To: <C7207217.AFD8F%csellers@tresys.com>

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

On 11/11/2009 01:52 PM, Chad Sellers wrote:
> On 9/30/09 2:33 PM, "Daniel J Walsh" <dwalsh@redhat.com> wrote:
> 
>> Includes enable and disable.
>>
> I presume I should hold off on this patch until you have a chance to
> resubmit the libsemanage support that it relies on. Let me know if that's
> not the case.
> 
> Thanks,
> Chad
> 
Lets do this patch.


Moves load_policy from /usr/sbin to /sbin

Removed cruft.

[-- Attachment #2: selinux_load_policy.patch --]
[-- Type: text/plain, Size: 1403 bytes --]

diff --git a/libsemanage/src/conf-parse.y b/libsemanage/src/conf-parse.y
index 23661bf..931448f 100644
--- a/libsemanage/src/conf-parse.y
+++ b/libsemanage/src/conf-parse.y
@@ -263,7 +263,13 @@ static int semanage_conf_init(semanage_conf_t * conf)
 	     calloc(1, sizeof(*(current_conf->load_policy)))) == NULL) {
 		return -1;
 	}
-	if ((conf->load_policy->path = strdup("/usr/sbin/load_policy")) == NULL) {
+
+	if (access("/sbin/load_policy", X_OK) == 0) {
+		conf->load_policy->path = strdup("/sbin/load_policy");
+	} else {
+		conf->load_policy->path = strdup("/usr/sbin/load_policy");
+	}
+	if (conf->load_policy->path == NULL)
 		return -1;
 	}
 	conf->load_policy->args = NULL;
diff --git a/policycoreutils/load_policy/Makefile b/policycoreutils/load_policy/Makefile
index 2dd2943..91dc6c8 100644
--- a/policycoreutils/load_policy/Makefile
+++ b/policycoreutils/load_policy/Makefile
@@ -1,6 +1,7 @@
 # Installation directories.
 PREFIX ?= ${DESTDIR}/usr
-SBINDIR ?= $(PREFIX)/sbin
+SBINDIR ?= $(DESTDIR)/sbin
+USRSBINDIR ?= $(PREFIX)/sbin
 MANDIR ?= $(PREFIX)/share/man
 LOCALEDIR ?= /usr/share/locale
 
@@ -17,6 +18,8 @@ install: all
 	install -m 755 $(TARGETS) $(SBINDIR)
 	test -d $(MANDIR)/man8 || install -m 755 -d $(MANDIR)/man8
 	install -m 644 load_policy.8 $(MANDIR)/man8/
+	-mkdir -p $(USRSBINDIR)
+	ln -s /sbin/load_policy $(USRSBINDIR)/load_policy
 
 clean:
 	-rm -f $(TARGETS) *.o 

  reply	other threads:[~2009-11-12 16:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-30 18:33 Add modules support to semanage Daniel J Walsh
2009-11-11 18:52 ` Chad Sellers
2009-11-12 16:23   ` Daniel J Walsh [this message]
2009-11-18 20:24     ` Chad Sellers
2009-11-18 20:28       ` Daniel J Walsh
2009-11-18 21:53         ` Chad Sellers
2009-11-12 16:45   ` Daniel J Walsh
2009-12-30 19:48     ` Chad Sellers
2009-11-12 16:46   ` Daniel J Walsh

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=4AFC3673.4020505@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=csellers@tresys.com \
    --cc=selinux@tycho.nsa.gov \
    /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 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.