From: Jaeyoon Jung <[email protected]>

Use strcmp over strncmp to exact-match uid or gids. Otherwise it may end
up with returning a wrong id that matches partially.

Signed-off-by: Jaeyoon Jung <[email protected]>
---
 meta/recipes-devtools/makedevs/makedevs/makedevs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-devtools/makedevs/makedevs/makedevs.c 
b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
index 2254b54891..84b38d2b74 100644
--- a/meta/recipes-devtools/makedevs/makedevs/makedevs.c
+++ b/meta/recipes-devtools/makedevs/makedevs/makedevs.c
@@ -202,7 +202,7 @@ static unsigned long convert2guid(char *id_buf, struct 
name_id *search_list)
                // Check for bad user/group name
                node = search_list;
                while (node != NULL) {
-                       if (!strncmp(node->name, id_buf, strlen(id_buf))) {
+                       if (!strcmp(node->name, id_buf)) {
                                fprintf(stderr, "WARNING: Bad user/group name 
%s detected\n", id_buf);
                                break;
                        }
@@ -212,7 +212,7 @@ static unsigned long convert2guid(char *id_buf, struct 
name_id *search_list)
        } else {
                node = search_list;
                while (node != NULL) {
-                       if (!strncmp(node->name, id_buf, strlen(id_buf)))
+                       if (!strcmp(node->name, id_buf))
                                return node->id;
                        node = node->next;
                }
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203300): 
https://lists.openembedded.org/g/openembedded-core/message/203300
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