Skip to contentSkip to conversation

libsemanage: Allow user to set SYSCONFDIR

PATCH In review Matt Sheets 3 participants 6 messages Sep 22, 2022 – Oct 5, 2022 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsemanage: Allow user to set SYSCONFDIR

This change will allow a user to set the location of their sysconfdir, defaulted to /etc, if they are installing into nonstandard locations.

---
 libsemanage/src/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
libsemanage/src/Makefile +2 -1
index 71c2a1d2..01df0181 100644
@@ -11,6 +11,7 @@ PKG_CONFIG ?= pkg-config
 PREFIX ?= /usr
 LIBDIR ?= $(PREFIX)/lib
 INCLUDEDIR ?= $(PREFIX)/include
+SYSCONFDIR ?= /etc
 PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
 PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
 PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))")
@@ -19,7 +20,7 @@ RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] +
 RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
 RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
 
-DEFAULT_SEMANAGE_CONF_LOCATION=/etc/selinux/semanage.conf
+DEFAULT_SEMANAGE_CONF_LOCATION=$(SYSCONFDIR)/selinux/semanage.conf
 
 ifeq ($(DEBUG),1)
 	export CFLAGS ?= -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror
Signature · 1 line
2.25.1
#1 lore raw
Quoted 22 lines · Matt Sheets

This change will allow a user to set the location of their sysconfdir, defaulted to /etc, if they are installing into nonstandard locations.

---
  libsemanage/src/Makefile | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
libsemanage/src/Makefile +1 -0
index 71c2a1d2..01df0181 100644
@@ -11,6 +11,7 @@ PKG_CONFIG ?= pkg-config
  PREFIX ?= /usr
  LIBDIR ?= $(PREFIX)/lib
  INCLUDEDIR ?= $(PREFIX)/include
+SYSCONFDIR ?= /etc
  PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
  PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
  PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))")

libsemanage/src/Makefile RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] + · line 26

Quoted 8 lines
libsemanage/src/Makefile +1 -1
@@ -19,7 +20,7 @@ RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + RbConfig::CONFIG["rubyarchhdrdir"] +
  RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
  RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')
 
-DEFAULT_SEMANAGE_CONF_LOCATION=/etc/selinux/semanage.conf
+DEFAULT_SEMANAGE_CONF_LOCATION=$(SYSCONFDIR)/selinux/semanage.conf
 
  ifeq ($(DEBUG),1)
  	export CFLAGS ?= -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror

That looks good thanks. Sorry, one last request. This is a generic yocto issue, right? Are you able to provide publicly visible links to the upstream yocto project in the git commit message to justify why using a nonstandard /etc is a normal/reasonable thing to do?

Reviewed-by
#2 lore raw
Quoted 25 lines · Daniel Burgener
Quoted 24 lines · Matt Sheets

This change will allow a user to set the location of their sysconfdir, defaulted to /etc, if they are installing into nonstandard locations.

---
  libsemanage/src/Makefile | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)
libsemanage/src/Makefile +0 -0
index 71c2a1d2..01df0181 100644
@@ -11,6 +11,7 @@ PKG_CONFIG ?= pkg-config

  PREFIX ?= /usr
  LIBDIR ?= $(PREFIX)/lib
  INCLUDEDIR ?= $(PREFIX)/include
+SYSCONFDIR ?= /etc
  PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
  PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
  PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))")

libsemanage/src/Makefile +0 -0
@@ -19,7 +20,7 @@ RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + 

RbConfig::CONFIG["rubyarchhdrdir"] +
  RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')

Quoted 8 lines
Quoted 6 lines

  RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')

libsemanage/src/Makefile +1 -1
-DEFAULT_SEMANAGE_CONF_LOCATION=/etc/selinux/semanage.conf
+DEFAULT_SEMANAGE_CONF_LOCATION=$(SYSCONFDIR)/selinux/semanage.conf

  ifeq ($(DEBUG),1)
      export CFLAGS ?= -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror

That looks good thanks.  Sorry, one last request.  This is a generic yocto issue, right?  Are you able to provide publicly visible links to the upstream yocto project in the git commit message to justify why using a nonstandard /etc is a normal/reasonable thing to do?

Oops, I'd been discussing this with Matt, and didn't realize this one hit the public list :) Just trying to improve the rationale/justification.

Regarding the actual change:

#3 lore raw

Just to provide more background about the yocto comment. The main reason I want to push this change is to then add support for yocto nativesdk builds for some of these packages(things like audit2allow and sesearch). In our situation our nativesdk root in not in standard location so we get packaging complaints that we have to kludge around. With this in place building for yocto nativesdk becomes easier because we can set the ENV variable.

Quoted 40 lines · Daniel Burgener
Quoted 25 lines · Daniel Burgener
Quoted 24 lines · Matt Sheets

This change will allow a user to set the location of their sysconfdir, defaulted to /etc, if they are installing into nonstandard locations.

---
  libsemanage/src/Makefile | 3 ++-

  1 file changed, 2 insertions(+), 1 deletion(-)
libsemanage/src/Makefile +0 -0
index 71c2a1d2..01df0181 100644
@@ -11,6 +11,7 @@ PKG_CONFIG ?= pkg-config

  PREFIX ?= /usr
  LIBDIR ?= $(PREFIX)/lib
  INCLUDEDIR ?= $(PREFIX)/include
+SYSCONFDIR ?= /etc
  PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
  PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
  PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))")

libsemanage/src/Makefile +0 -0
@@ -19,7 +20,7 @@ RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" + 

RbConfig::CONFIG["rubyarchhdrdir"] +
  RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" + RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')

Quoted 8 lines
Quoted 6 lines

  RUBYINSTALL ?= $(shell $(RUBY) -e 'puts RbConfig::CONFIG["vendorarchdir"]')

libsemanage/src/Makefile +1 -1
-DEFAULT_SEMANAGE_CONF_LOCATION=/etc/selinux/semanage.conf
+DEFAULT_SEMANAGE_CONF_LOCATION=$(SYSCONFDIR)/selinux/semanage.conf

  ifeq ($(DEBUG),1)
      export CFLAGS ?= -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall -Wshadow -Werror

That looks good thanks.  Sorry, one last request.  This is a generic yocto issue, right?  Are you able to provide publicly visible links to the upstream yocto project in the git commit message to justify why using a nonstandard /etc is a normal/reasonable thing to do?

Oops, I'd been discussing this with Matt, and didn't realize this one hit the public list :)  Just trying to improve the rationale/justification.

Regarding the actual change:

Acked-by
#4 lore raw
In reply to Daniel Burgener
Quoted 8 lines · Daniel Burgener
Quoted 6 lines · Daniel Burgener
Quoted 5 lines · Matt Sheets

This change will allow a user to set the location of their sysconfdir, defaulted to /etc, if they are installing into nonstandard locations.

Quoted 41 lines
Quoted 26 lines
Quoted 26 lines
---
  libsemanage/src/Makefile | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
libsemanage/src/Makefile +1 -0
index 71c2a1d2..01df0181 100644
@@ -11,6 +11,7 @@ PKG_CONFIG ?= pkg-config
  PREFIX ?= /usr
  LIBDIR ?= $(PREFIX)/lib
  INCLUDEDIR ?= $(PREFIX)/include
+SYSCONFDIR ?= /etc
  PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
  PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
  PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig

import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))")

libsemanage/src/Makefile +0 -0
@@ -19,7 +20,7 @@ RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" +

RbConfig::CONFIG["rubyarchhdrdir"] +
RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" +
RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
RUBYINSTALL ?= $(shell $(RUBY) -e 'puts
RbConfig::CONFIG["vendorarchdir"]')

libsemanage/src/Makefile +1 -1
-DEFAULT_SEMANAGE_CONF_LOCATION=/etc/selinux/semanage.conf
+DEFAULT_SEMANAGE_CONF_LOCATION=$(SYSCONFDIR)/selinux/semanage.conf
Quoted 8 lines
Quoted 3 lines

ifeq ($(DEBUG),1)
export CFLAGS ?= -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall
-Wshadow -Werror

That looks good thanks. Sorry, one last request. This is a generic yocto issue, right? Are you able to provide publicly visible links to the upstream yocto project in the git commit message to justify why using a nonstandard /etc is a normal/reasonable thing to do?

Oops, I'd been discussing this with Matt, and didn't realize this one hit the public list :) Just trying to improve the rationale/justification.

Regarding the actual change:

#5 lore raw
Quoted 5 lines · James Carter
Quoted 2 lines · Daniel Burgener

On 9/22/2022 2:04 PM, Daniel Burgener wrote:

Quoted 9 lines
Quoted 6 lines
Quoted 6 lines · Matt Sheets
Quoted 5 lines

This change will allow a user to set the location of their sysconfdir, defaulted to /etc, if they are installing into nonstandard locations.

Merged.
Thanks,
Jim

Quoted 41 lines
Quoted 41 lines
Quoted 26 lines
Quoted 26 lines
---
  libsemanage/src/Makefile | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
libsemanage/src/Makefile +1 -0
index 71c2a1d2..01df0181 100644
@@ -11,6 +11,7 @@ PKG_CONFIG ?= pkg-config
  PREFIX ?= /usr
  LIBDIR ?= $(PREFIX)/lib
  INCLUDEDIR ?= $(PREFIX)/include
+SYSCONFDIR ?= /etc
  PYINC ?= $(shell $(PKG_CONFIG) --cflags $(PYPREFIX))
  PYLIBS ?= $(shell $(PKG_CONFIG) --libs $(PYPREFIX))
  PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig

import *; print(get_python_lib(plat_specific=1, prefix='$(PREFIX)'))")

libsemanage/src/Makefile +0 -0
@@ -19,7 +20,7 @@ RUBYINC ?= $(shell $(RUBY) -e 'puts "-I" +

RbConfig::CONFIG["rubyarchhdrdir"] +
RUBYLIBS ?= $(shell $(RUBY) -e 'puts "-L" +
RbConfig::CONFIG["libdir"] + " -L" + RbConfig::CONFIG["archlibdir"] + " " + RbConfig::CONFIG["LIBRUBYARG_SHARED"]')
RUBYINSTALL ?= $(shell $(RUBY) -e 'puts
RbConfig::CONFIG["vendorarchdir"]')

libsemanage/src/Makefile +1 -1
-DEFAULT_SEMANAGE_CONF_LOCATION=/etc/selinux/semanage.conf
+DEFAULT_SEMANAGE_CONF_LOCATION=$(SYSCONFDIR)/selinux/semanage.conf
Quoted 8 lines
Quoted 3 lines

ifeq ($(DEBUG),1)
export CFLAGS ?= -g3 -O0 -gdwarf-2 -fno-strict-aliasing -Wall
-Wshadow -Werror

That looks good thanks. Sorry, one last request. This is a generic yocto issue, right? Are you able to provide publicly visible links to the upstream yocto project in the git commit message to justify why using a nonstandard /etc is a normal/reasonable thing to do?

Oops, I'd been discussing this with Matt, and didn't realize this one hit the public list :) Just trying to improve the rationale/justification.

Regarding the actual change: