diff options
| author | Schulz, Andreas - Enabler & Imaging Software <Andreas.Schulz2@karlstorz.com> | 2026-01-21 13:39:12 +0000 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2026-01-22 22:01:05 -0800 |
| commit | 37f675a8bc8fdb7baeb0422ed263ae048f9dc164 (patch) | |
| tree | 2eec966a9d64984bb6d858126be86968775d888f | |
| parent | 9650622e078cd2be3619effe1323b85b52fb1a60 (diff) | |
| download | meta-openembedded-37f675a8bc8fdb7baeb0422ed263ae048f9dc164.tar.gz | |
chrony: Ensure /var/lib/chrony belongs to correct user/group
Signed-off-by: Andreas Schulz <andreas.schulz2@karlstorz.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
| -rw-r--r-- | meta-networking/recipes-support/chrony/chrony_4.8.bb | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/meta-networking/recipes-support/chrony/chrony_4.8.bb b/meta-networking/recipes-support/chrony/chrony_4.8.bb index f50576c272..a7fc73e081 100644 --- a/meta-networking/recipes-support/chrony/chrony_4.8.bb +++ b/meta-networking/recipes-support/chrony/chrony_4.8.bb | |||
| @@ -48,6 +48,7 @@ inherit update-rc.d systemd pkgconfig | |||
| 48 | inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '', d)} | 48 | inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'useradd', '', d)} |
| 49 | USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}" | 49 | USERADD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '${PN}', '', d)}" |
| 50 | USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /sbin/nologin chronyd;', '', d)}" | 50 | USERADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system -d / -M --shell /sbin/nologin chronyd;', '', d)}" |
| 51 | GROUPADD_PARAM:${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'privdrop', '--system chronyd', '', d)}" | ||
| 51 | 52 | ||
| 52 | # Configuration options: | 53 | # Configuration options: |
| 53 | # - Security-related: | 54 | # - Security-related: |
| @@ -113,10 +114,18 @@ do_install() { | |||
| 113 | 114 | ||
| 114 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 115 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
| 115 | install -d ${D}${sysconfdir}/tmpfiles.d | 116 | install -d ${D}${sysconfdir}/tmpfiles.d |
| 116 | echo "d /var/lib/chrony 0755 root root -" > ${D}${sysconfdir}/tmpfiles.d/chronyd.conf | 117 | if ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'true', 'false', d)}; then |
| 118 | echo "d /var/lib/chrony 0755 chronyd chronyd -" > ${D}${sysconfdir}/tmpfiles.d/chronyd.conf | ||
| 119 | else | ||
| 120 | echo "d /var/lib/chrony 0755 root root -" > ${D}${sysconfdir}/tmpfiles.d/chronyd.conf | ||
| 121 | fi | ||
| 117 | else | 122 | else |
| 118 | install -d ${D}${sysconfdir}/default/volatiles | 123 | install -d ${D}${sysconfdir}/default/volatiles |
| 119 | echo "d root root 0755 /var/lib/chrony none" > "${D}${sysconfdir}/default/volatiles/00_runtime_chrony_dirs" | 124 | if ${@bb.utils.contains('PACKAGECONFIG', 'privdrop', 'true', 'false', d)}; then |
| 125 | echo "d chronyd chronyd 0755 /var/lib/chrony none" > "${D}${sysconfdir}/default/volatiles/00_runtime_chrony_dirs" | ||
| 126 | else | ||
| 127 | echo "d root root 0755 /var/lib/chrony none" > "${D}${sysconfdir}/default/volatiles/00_runtime_chrony_dirs" | ||
| 128 | fi | ||
| 120 | fi | 129 | fi |
| 121 | 130 | ||
| 122 | } | 131 | } |
