allow overriding systemd-tmpfiles program

In some contexts, filesystem mounts may be owned by unmapped users
(e.g. `emptyDir` mounts in Kubernetes / OpenShift when using user
namespaces).  This causes `systemd-tmpfiles(8)` to fail, as a
consequence of systemd's path processing routines which reject this
scenario.  Therefore, in Fedora container context, if the
`IPA_TMPFILES_PROG` environment value is set, use the program
specified by its value instead of `/bin/systemd-tmpfiles`.

Signed-off-by: Fraser Tweedale <ftweedal@redhat.com>
Fixes: https://pagure.io/freeipa/issue/9126
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Fraser Tweedale authored and Florence Blanc-Renaud committed 2022-03-15 08:32:56 +01:00
1 parent 1e2cf55150
commit b413a327f3
2 files changed
+20

No files matched your search

+10
View File
@@ -29,5 +29,15 @@ class FedoraContainerPathNamespace(FedoraPathNamespace):
HTTPD_IPA_WSGI_MODULES_CONF = None
HTTPD_PASSWD_FILE_FMT = data(FedoraPathNamespace.HTTPD_PASSWD_FILE_FMT)
# In some contexts, filesystem mounts may be owned by unmapped users
# (e.g. "emptyDir" mounts in Kubernetes / OpenShift when using user
# namespaces). This causes systemd-tmpfiles(8) to fail, as a
# consequence of systemd's path processing routines which reject
# this scenario. Therefore we provide a way to substitute
# systemd-tmpfiles with a "clone" program.
#
SYSTEMD_TMPFILES = os.environ.get(
'IPA_TMPFILES_PROG', FedoraPathNamespace.SYSTEMD_TMPFILES)
paths = FedoraContainerPathNamespace()
+10
View File
@@ -29,5 +29,15 @@ class RHELContainerPathNamespace(RHELPathNamespace):
HTTPD_IPA_WSGI_MODULES_CONF = None
HTTPD_PASSWD_FILE_FMT = data(RHELPathNamespace.HTTPD_PASSWD_FILE_FMT)
# In some contexts, filesystem mounts may be owned by unmapped users
# (e.g. "emptyDir" mounts in Kubernetes / OpenShift when using user
# namespaces). This causes systemd-tmpfiles(8) to fail, as a
# consequence of systemd's path processing routines which reject
# this scenario. Therefore we provide a way to substitute
# systemd-tmpfiles with a "clone" program.
#
SYSTEMD_TMPFILES = os.environ.get(
'IPA_TMPFILES_PROG', RHELPathNamespace.SYSTEMD_TMPFILES)
paths = RHELContainerPathNamespace()