Skip to contentSkip to conversation

policycoreutils: sestatus belongs to bin not sbin

PATCH Applied bauen1 3 participants 3 messages Feb 21, 2021 – Feb 24, 2021 SELinux security module

lore
Share & tools
lore

bauen1

author
#0 lore raw

PATCH v3 1/1 policycoreutils: sestatus belongs to bin not sbin

It is quite useful even to non-privileged users and doesn't require any privileges to work, except for maybe -v.

Some tools hard code the old path, so a compatibility symlink is also created.

---
 policycoreutils/sestatus/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
policycoreutils/sestatus/Makefile +7 -1
index 8c4f45f8..3dbb792b 100644
@@ -1,6 +1,7 @@
 # Installation directories.
 LINGUAS ?= ru
 PREFIX ?= /usr
+BINDIR ?= $(PREFIX)/bin
 SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 ETCDIR ?= /etc
@@ -16,8 +17,13 @@ sestatus: sestatus.o
 install: all
 	[ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8
 	[ -d $(DESTDIR)$(MANDIR)/man5 ] || mkdir -p $(DESTDIR)$(MANDIR)/man5
+	-mkdir -p $(DESTDIR)$(BINDIR)
 	-mkdir -p $(DESTDIR)$(SBINDIR)
-	install -m 755 sestatus $(DESTDIR)$(SBINDIR)
+	# Some tools hard code /usr/sbin/sestatus ; add a compatibility symlink
+	# install will overwrite a symlink, so create the symlink before calling
+	# install to allow distributions with BINDIR == SBINDIR
+	ln -sf --relative $(DESTDIR)$(BINDIR)/sestatus $(DESTDIR)$(SBINDIR)
+	install -m 755 sestatus $(DESTDIR)$(BINDIR)
 	install -m 644 sestatus.8 $(DESTDIR)$(MANDIR)/man8
 	install -m 644 sestatus.conf.5 $(DESTDIR)$(MANDIR)/man5
 	for lang in $(LINGUAS) ; do \
Signature · 1 line
2.30.1
Acked-by on v3 1/1
#1 lore raw
Quoted 8 lines · On Sun, Feb 21, 2021 at 5:04 PM bauen1 <[email protected]> wrote:

It is quite useful even to non-privileged users and doesn't require any privileges to work, except for maybe -v.

Some tools hard code the old path, so a compatibility symlink is also created.

Thanks!
Nicolas

Quoted 34 lines
---
 policycoreutils/sestatus/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
policycoreutils/sestatus/Makefile +7 -2
index 8c4f45f8..3dbb792b 100644
@@ -1,6 +1,7 @@
 # Installation directories.
 LINGUAS ?= ru
 PREFIX ?= /usr
+BINDIR ?= $(PREFIX)/bin
 SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 ETCDIR ?= /etc
@@ -16,8 +17,13 @@ sestatus: sestatus.o
 install: all
        [ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8
        [ -d $(DESTDIR)$(MANDIR)/man5 ] || mkdir -p $(DESTDIR)$(MANDIR)/man5
+       -mkdir -p $(DESTDIR)$(BINDIR)
        -mkdir -p $(DESTDIR)$(SBINDIR)
-       install -m 755 sestatus $(DESTDIR)$(SBINDIR)
+       # Some tools hard code /usr/sbin/sestatus ; add a compatibility symlink
+       # install will overwrite a symlink, so create the symlink before calling
+       # install to allow distributions with BINDIR == SBINDIR
+       ln -sf --relative $(DESTDIR)$(BINDIR)/sestatus $(DESTDIR)$(SBINDIR)
+       install -m 755 sestatus $(DESTDIR)$(BINDIR)
        install -m 644 sestatus.8 $(DESTDIR)$(MANDIR)/man8
        install -m 644 sestatus.conf.5 $(DESTDIR)$(MANDIR)/man5
        for lang in $(LINGUAS) ; do \
--

2.30.1

#2 lore raw
Quoted 5 lines · Nicolas Iooss
Quoted 4 lines · On Sun, Feb 21, 2021 at 5:04 PM bauen1 <[email protected]> wrote:

It is quite useful even to non-privileged users and doesn't require any privileges to work, except for maybe -v.

Quoted 7 lines
Quoted 4 lines

Some tools hard code the old path, so a compatibility symlink is also created.

Merged, thanks!

Quoted 37 lines

Thanks!
Nicolas

Quoted 34 lines
---
 policycoreutils/sestatus/Makefile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
policycoreutils/sestatus/Makefile +7 -2
index 8c4f45f8..3dbb792b 100644
@@ -1,6 +1,7 @@
 # Installation directories.
 LINGUAS ?= ru
 PREFIX ?= /usr
+BINDIR ?= $(PREFIX)/bin
 SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 ETCDIR ?= /etc
@@ -16,8 +17,13 @@ sestatus: sestatus.o
 install: all
        [ -d $(DESTDIR)$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)$(MANDIR)/man8
        [ -d $(DESTDIR)$(MANDIR)/man5 ] || mkdir -p $(DESTDIR)$(MANDIR)/man5
+       -mkdir -p $(DESTDIR)$(BINDIR)
        -mkdir -p $(DESTDIR)$(SBINDIR)
-       install -m 755 sestatus $(DESTDIR)$(SBINDIR)
+       # Some tools hard code /usr/sbin/sestatus ; add a compatibility symlink
+       # install will overwrite a symlink, so create the symlink before calling
+       # install to allow distributions with BINDIR == SBINDIR
+       ln -sf --relative $(DESTDIR)$(BINDIR)/sestatus $(DESTDIR)$(SBINDIR)
+       install -m 755 sestatus $(DESTDIR)$(BINDIR)
        install -m 644 sestatus.8 $(DESTDIR)$(MANDIR)/man8
        install -m 644 sestatus.conf.5 $(DESTDIR)$(MANDIR)/man5
        for lang in $(LINGUAS) ; do \
--

2.30.1