Hello,

I have found an issue in the rootfs routine. The rootfs-postcommands.bbclass has a funtion systemd_create_users that reads /etc/sysusers.d/*.conf files and parses lines as 'type name id comment'.

However, the sysusers.d manual says, those lines can be 'type name id comment home_dir shell'. If a home directory of shell is defined, they are considered as part of the comment, and we run incorrect commands such as the one below :

useradd --shell /sbin/nologin --uid 0 --comment "Super User" /root --system root

To fix that, we require a stronger parsing. Several options look possible to me, but I am not sure which one is preferred.

1. sed with a regular expression that returns something that still needs parsing 2. awk with a step by step script that returns something that still needs to be parsed
3. use python and regexp module

Also I don't know if the parsing should completely check the sysusers syntax as said in the manual (first field is [urgm], second is alphanum_-, etc.). In my opinion it should not as this will be made by the useradd command.

Do you think it worth to add some testing about that ? I am not sure how to do that.

Regards,
Louis Rannou
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#182392): 
https://lists.openembedded.org/g/openembedded-core/message/182392
Mute This Topic: https://lists.openembedded.org/mt/99343510/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to