Skip to contentSkip to conversation

systemd: do not use host system-uid/gid ranges

PATCH New Anssi Hannula 3 participants 5 messages Mar 8, 2018 – Apr 7, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 systemd: do not use host system-uid/gid ranges

systemd meson.build uses values from host /etc/login.defs if system-uid-max and system-gid-max build options are not explicitly specified.

Avoid that by setting system-uid-max and system-gid-max to 999 which is the systemd default if SYSTEM_UID_MAX and SYSTEM_GID_MAX are not set in /etc/login.defs.

---
 package/systemd/systemd.mk | 2 ++
 1 file changed, 2 insertions(+)
package/systemd/systemd.mk +2 -0
index 8c22c08..3bc322c 100644
@@ -40,6 +40,8 @@ SYSTEMD_CONF_OPTS += \
 	-Dldconfig=false \
 	-Ddefault-dnssec=no \
 	-Dtests=false \
+	-Dsystem-uid-max=999 \
+	-Dsystem-gid-max=999 \
 	-Dtelinit-path=$(TARGET_DIR)/sbin/telinit \
 	-Dkill-path=/usr/bin/kill \
 	-Dkmod-path=/usr/bin/kmod \
Signature · 1 line
2.8.3
#1 lore raw

PATCH 1/1 systemd: do not use host system-uid/gid ranges

Anssi, All,

On 2018-03-08 16:25 +0200, Anssi Hannula spake thusly:

Quoted 9 lines

systemd meson.build uses values from host /etc/login.defs if system-uid-max and system-gid-max build options are not explicitly specified.

Avoid that by setting system-uid-max and system-gid-max to 999 which is the systemd default if SYSTEM_UID_MAX and SYSTEM_GID_MAX are not set in /etc/login.defs.

Would we need to do something with dynamic-uid-min, dynamic-uid-max, and so on?

Regards,
Yann E. MORIN.

Quoted 20 lines
---
 package/systemd/systemd.mk | 2 ++
 1 file changed, 2 insertions(+)
package/systemd/systemd.mk +2 -0
index 8c22c08..3bc322c 100644
@@ -40,6 +40,8 @@ SYSTEMD_CONF_OPTS += \
 	-Dldconfig=false \
 	-Ddefault-dnssec=no \
 	-Dtests=false \
+	-Dsystem-uid-max=999 \
+	-Dsystem-gid-max=999 \
 	-Dtelinit-path=$(TARGET_DIR)/sbin/telinit \
 	-Dkill-path=/usr/bin/kill \
 	-Dkmod-path=/usr/bin/kmod \
Signature · 1 line
2.8.3
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 systemd: do not use host system-uid/gid ranges

Quoted 11 lines · Yann E. MORIN

Anssi, All,

On 2018-03-08 16:25 +0200, Anssi Hannula spake thusly:

Quoted 8 lines

systemd meson.build uses values from host /etc/login.defs if system-uid-max and system-gid-max build options are not explicitly specified.

Avoid that by setting system-uid-max and system-gid-max to 999 which is the systemd default if SYSTEM_UID_MAX and SYSTEM_GID_MAX are not set in /etc/login.defs.

Quoted 5 lines
Quoted 1 line

Would we need to do something with dynamic-uid-min, dynamic-uid-max, and so on?

I don't think so, for the other uid/gid options the defaults seemed sane and did not depend on the host system.

Quoted 20 lines
Quoted 20 lines
---
 package/systemd/systemd.mk | 2 ++
 1 file changed, 2 insertions(+)
package/systemd/systemd.mk +2 -0
index 8c22c08..3bc322c 100644
@@ -40,6 +40,8 @@ SYSTEMD_CONF_OPTS += \
 	-Dldconfig=false \
 	-Ddefault-dnssec=no \
 	-Dtests=false \
+	-Dsystem-uid-max=999 \
+	-Dsystem-gid-max=999 \
 	-Dtelinit-path=$(TARGET_DIR)/sbin/telinit \
 	-Dkill-path=/usr/bin/kill \
 	-Dkmod-path=/usr/bin/kmod \
Signature · 1 line
2.8.3
Signature · 2 lines
Anssi Hannula / Bitwise Oy
+358503803997
#3 lore raw

PATCH 1/1 systemd: do not use host system-uid/gid ranges

In reply to Anssi Hannula
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Anssi" == Anssi Hannula <[email protected]> writes:

systemd meson.build uses values from host /etc/login.defs if system-uid-max and system-gid-max build options are not explicitly specified.

Avoid that by setting system-uid-max and system-gid-max to 999 which is the systemd default if SYSTEM_UID_MAX and SYSTEM_GID_MAX are not set in /etc/login.defs.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#4 lore raw

PATCH 1/1 systemd: do not use host system-uid/gid ranges

In reply to Anssi Hannula
Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Anssi" == Anssi Hannula <[email protected]> writes:

systemd meson.build uses values from host /etc/login.defs if system-uid-max and system-gid-max build options are not explicitly specified.

Avoid that by setting system-uid-max and system-gid-max to 999 which is the systemd default if SYSTEM_UID_MAX and SYSTEM_GID_MAX are not set in /etc/login.defs.

Committed to 2018.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard