Skip to content

Commit

Permalink
MAKE: only add 'AmbientCapabilities' template if
Browse files Browse the repository at this point in the history
built '--with-conf-service-user-support'
  • Loading branch information
alexey-tikhonov committed May 9, 2024
1 parent 0f86a4e commit f93406b
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,19 @@ ifp_systemdservice = SystemdService=sssd-ifp.service
# or some snippet under /etc/sssd/sssd.conf.d/) to be present.
condconfigexists = ConditionPathExists=\|/etc/sssd/sssd.conf\nConditionDirectoryNotEmpty=\|/etc/sssd/conf.d/

if SSSD_NON_ROOT_USER
# If non-root service user is supported, monitor might need SET-ID to switch user (deprecated 'sssd.conf::user' option)
# but this is non default configuration, so 'AmbientCapabilities=' are commented out.
# Bounding set needs to list capabilities required by ldap/krb5/selinux_childs, otherwise they can't gain it.
capabilities = CapabilityBoundingSet= CAP_CHOWN CAP_DAC_OVERRIDE CAP_SETGID CAP_SETUID\n\# Uncomment if support of deprecated "sssd.conf::user" option is required:\n\#AmbientCapabilities= CAP_SETGID CAP_SETUID
capabilities = CapabilityBoundingSet= CAP_CHOWN CAP_DAC_OVERRIDE CAP_SETGID CAP_SETUID

if BUILD_CONF_SERVICE_USER_SUPPORT
# If non-root service user is supported, monitor might need SET-ID to switch user (deprecated 'sssd.conf::user' option)
capabilities += \n\# Comment this out if support of deprecated "sssd.conf::user" option is not required:\nAmbientCapabilities= CAP_SETGID CAP_SETUID
endif # BUILD_CONF_SERVICE_USER_SUPPORT

if SSSD_NON_ROOT_USER
nss_service_user_group = User=$(SSSD_USER)\nGroup=$(SSSD_USER)
nss_socket_user_group = SocketUser=$(SSSD_USER)\nSocketGroup=$(SSSD_USER)
supplementary_groups = \# If service configured to be run under "root", uncomment "SupplementaryGroups"\n\#SupplementaryGroups=$(SSSD_USER)
else
# If non-root service user isn't supported, monitor/sssd_be/responders don't need any effective capabilities
# but bounding set needs to list capabilities required by ldap/krb5/selinux_childs, otherwise they can't gain it.
capabilities = CapabilityBoundingSet= CAP_CHOWN CAP_DAC_OVERRIDE CAP_SETGID CAP_SETUID
supplementary_groups = \# Note: SSSD package was built without support of running as non-privileged user
endif # SSSD_NON_ROOT_USER

Expand Down

0 comments on commit f93406b

Please sign in to comment.