The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3112

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Hello.
This patch prevent search username as a substring in another username.
Signed-off-by: Alexander Kriventsov <akrivent...@nic.ru>
From 9ed8c96ffbcc3028cbb44d3e620502c978c27f62 Mon Sep 17 00:00:00 2001
From: Alexander Kriventsov <akrivent...@nic.ru>
Date: Mon, 29 Jul 2019 19:33:39 +0300
Subject: [PATCH] try to fix search user instead of search substring

Signed-off-by: Alexander Kriventsov <akrivent...@nic.ru>
---
 src/lxc/cmd/lxc_user_nic.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/lxc/cmd/lxc_user_nic.c b/src/lxc/cmd/lxc_user_nic.c
index 84823bd5d8..15d000eebf 100644
--- a/src/lxc/cmd/lxc_user_nic.c
+++ b/src/lxc/cmd/lxc_user_nic.c
@@ -423,7 +423,8 @@ static char *find_line(char *buf_start, char *buf_end, char 
*name,
                if (strncmp(buf_start, name, strlen(name)))
                        *found = false;
                else
-                       *owner = true;
+                       if (strlen(name) == (size_t)(end_of_word - buf_start))
+                               *owner = true;
 
                buf_start = end_of_word + 1;
                while ((buf_start < buf_end) && isblank(*buf_start))
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to