diff options
| author | Yi Zhao <yi.zhao@eng.windriver.com> | 2025-03-27 21:23:27 +0800 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2025-04-13 14:07:57 -0400 |
| commit | d31c2619da9f2b21b129d54a91d27088107f9026 (patch) | |
| tree | 251a3bfbe6b107f6255348951f30b21ccaa09362 | |
| parent | 0d6aa528cf91701cfc368dc3013d9bba84d2d831 (diff) | |
| download | meta-security-d31c2619da9f2b21b129d54a91d27088107f9026.tar.gz | |
sssd: enable unprivileged service user feature
The unprivileged service user feature has been improved in 2.10 to allow
running the sssd service as an unprivileged user [1]. So enable this
feature, and then we can run the service as the unprivileged user sssd.
[1] https://github.com/SSSD/sssd/releases/tag/2.10.0
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb b/dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb index 0ed62b8..b02710e 100644 --- a/dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb +++ b/dynamic-layers/networking-layer/recipes-security/sssd/sssd_2.10.2.bb | |||
| @@ -28,12 +28,16 @@ SRC_URI[sha256sum] = "e8aa5e6b48ae465bea7064048715ce7e9c53b50ec6a9c69304f59e0d35 | |||
| 28 | 28 | ||
| 29 | UPSTREAM_CHECK_URI = "https://github.com/SSSD/${BPN}/releases" | 29 | UPSTREAM_CHECK_URI = "https://github.com/SSSD/${BPN}/releases" |
| 30 | 30 | ||
| 31 | inherit autotools pkgconfig gettext python3native features_check systemd | 31 | inherit autotools pkgconfig gettext python3native features_check systemd useradd |
| 32 | 32 | ||
| 33 | REQUIRED_DISTRO_FEATURES = "pam" | 33 | REQUIRED_DISTRO_FEATURES = "pam" |
| 34 | 34 | ||
| 35 | SSSD_UID ?= "root" | 35 | SSSD_UID ?= "sssd" |
| 36 | SSSD_GID ?= "root" | 36 | SSSD_GID ?= "sssd" |
| 37 | |||
| 38 | USERADD_PACKAGES = "${PN}" | ||
| 39 | GROUPADD_PARAM:${PN} = "--system sssd" | ||
| 40 | USERADD_PARAM:${PN} = "--system --home /run/sssd --no-create-home -g sssd --shell /sbin/nologin sssd" | ||
| 37 | 41 | ||
| 38 | CACHED_CONFIGUREVARS = "ac_cv_member_struct_ldap_conncb_lc_arg=no \ | 42 | CACHED_CONFIGUREVARS = "ac_cv_member_struct_ldap_conncb_lc_arg=no \ |
| 39 | ac_cv_prog_HAVE_PYTHON3=yes \ | 43 | ac_cv_prog_HAVE_PYTHON3=yes \ |
| @@ -66,6 +70,7 @@ EXTRA_OECONF += " \ | |||
| 66 | --with-xml-catalog-path=${STAGING_ETCDIR_NATIVE}/xml/catalog \ | 70 | --with-xml-catalog-path=${STAGING_ETCDIR_NATIVE}/xml/catalog \ |
| 67 | --with-pid-path=/run/sssd \ | 71 | --with-pid-path=/run/sssd \ |
| 68 | --with-os=fedora \ | 72 | --with-os=fedora \ |
| 73 | --with-sssd-user=sssd \ | ||
| 69 | " | 74 | " |
| 70 | 75 | ||
| 71 | do_configure:prepend () { | 76 | do_configure:prepend () { |
| @@ -87,6 +92,7 @@ do_install () { | |||
| 87 | 92 | ||
| 88 | install -d ${D}/${sysconfdir}/${BPN} | 93 | install -d ${D}/${sysconfdir}/${BPN} |
| 89 | install -m 600 ${UNPACKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN} | 94 | install -m 600 ${UNPACKDIR}/${BPN}.conf ${D}/${sysconfdir}/${BPN} |
| 95 | chown -R root:${SSSD_GID} ${D}/${sysconfdir}/${BPN} | ||
| 90 | 96 | ||
| 91 | # /var/log/sssd needs to be created in runtime. Use rmdir to catch if | 97 | # /var/log/sssd needs to be created in runtime. Use rmdir to catch if |
| 92 | # upstream stops creating /var/log/sssd, or adds something else in | 98 | # upstream stops creating /var/log/sssd, or adds something else in |
| @@ -118,7 +124,6 @@ pkg_postinst_ontarget:${PN} () { | |||
| 118 | if [ -e /etc/init.d/populate-volatile.sh ] ; then | 124 | if [ -e /etc/init.d/populate-volatile.sh ] ; then |
| 119 | ${sysconfdir}/init.d/populate-volatile.sh update | 125 | ${sysconfdir}/init.d/populate-volatile.sh update |
| 120 | fi | 126 | fi |
| 121 | chown ${SSSD_UID}:${SSSD_GID} ${sysconfdir}/${BPN}/${BPN}.conf | ||
| 122 | } | 127 | } |
| 123 | 128 | ||
| 124 | CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf" | 129 | CONFFILES:${PN} = "${sysconfdir}/${BPN}/${BPN}.conf" |
| @@ -146,6 +151,7 @@ FILES:${PN} += "${base_libdir}/security/pam_sss*.so \ | |||
| 146 | ${nonarch_libdir}/tmpfiles.d \ | 151 | ${nonarch_libdir}/tmpfiles.d \ |
| 147 | ${datadir}/dbus-1/system.d/*.conf \ | 152 | ${datadir}/dbus-1/system.d/*.conf \ |
| 148 | ${datadir}/dbus-1/system-services/*.service \ | 153 | ${datadir}/dbus-1/system-services/*.service \ |
| 154 | ${datadir}/polkit-1/* \ | ||
| 149 | ${libdir}/krb5/* \ | 155 | ${libdir}/krb5/* \ |
| 150 | ${libdir}/ldb/* \ | 156 | ${libdir}/ldb/* \ |
| 151 | ${PYTHON_SITEPACKAGES_DIR}/sssd \ | 157 | ${PYTHON_SITEPACKAGES_DIR}/sssd \ |
