diff mbox series

[3/3] rootfs-postcommands.bbclass: ignore comment mismatch in systemd_user_check

Message ID 20231227042036.2376255-3-Qi.Chen@windriver.com
State Accepted, archived
Commit 2a700c3102b2233e71a157f0f88ed88496fa9fbf
Headers show
Series [1/3] systemd: upgrade to 255.1 | expand

Commit Message

ChenQi Dec. 27, 2023, 4:20 a.m. UTC
From: Chen Qi <Qi.Chen@windriver.com>

The check was forcing every field to be identical, this is too
strict. For example, if the comment differs, there's really no
impact. For example, root user's comment is 'root' in passwd,
and it's 'Super User' in sysusers.d/basic.conf. Such difference is
not worth a warning. In fact, previous codes use 'lower()' to
avoid warning between 'nobody' and 'Nobody', and what's more, another
patch puts its own basic.conf.in in systemd's SRC_URI, but it changes
'Super User' to 'root'. Such changes are all unnecessary. We should
just ignore comment mismatch.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 meta/classes-recipe/rootfs-postcommands.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass
index 29ee74932a..f996b6c71a 100644
--- a/meta/classes-recipe/rootfs-postcommands.bbclass
+++ b/meta/classes-recipe/rootfs-postcommands.bbclass
@@ -111,12 +111,11 @@  def compare_users(user, e_user):
     # user and e_user must not have None values. Unset values must be '-'.
     (name, uid, gid, comment, homedir, ushell) = user
     (e_name, e_uid, e_gid, e_comment, e_homedir, e_ushell) = e_user
-    # Ignore 'uid', 'gid' or 'comment' if they are not set
+    # Ignore 'uid', 'gid' or 'homedir' if they are not set
     # Ignore 'shell' and 'ushell' if one is not set
     return name == e_name \
         and (uid == '-' or uid == e_uid) \
         and (gid == '-' or gid == e_gid) \
-        and (comment == '-' or e_comment == '-' or comment.lower() == e_comment.lower()) \
         and (homedir == '-' or e_homedir == '-' or homedir == e_homedir) \
         and (ushell == '-' or e_ushell == '-' or ushell == e_ushell)