On Mon, 2024-08-26 at 22:41 +0900, Jung Jaeyoon(Jay) wrote:
> As an actual example, suppose there is an entry as below in a device
> table that makedevs receives:
> 
> /dev/system        c       0660    root       system      1000     
> 0      -       -       -
> 
> then you will get "system" group for id_buf in convert2guid().
> and suppose there are two entries in /etc/group where both start with
> "system" like:
> 
> systemd-journal:x:900:
> system:x:2020:
> 
> Obviously convert2guid() should return 2020 in this case, but with
> the existing code it will return 900 because the entry of "systemd-
> journal" comes first in the loop and strncmp("systemd-journal",
> "system", strlen("system")) returns 0.

That makes sense and does indeed look like a bug. I think we should 
change the strlen to MAX_ID_LEN instead?

I'm still a little worried there is an off by one error somewhere in
there too.

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203754): 
https://lists.openembedded.org/g/openembedded-core/message/203754
Mute This Topic: https://lists.openembedded.org/mt/107888859/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to