util-linux/backport-tests-test_mkfds-netlink-pass-a-correct-file-descrip.patch
zhangyao e15e1479d3 wall: fix escape sequence Injection
(cherry picked from commit ff7818f897f8f3e0c0d4ddfb655ccf359de3c74d)
2024-04-08 14:06:40 +08:00

31 lines
860 B
Diff

From acdba9c454506cdd29ac400df3f72bde4c74647d Mon Sep 17 00:00:00 2001
From: Masatake YAMATO <yamato@redhat.com>
Date: Wed, 3 Apr 2024 00:01:27 +0900
Subject: [PATCH] tests: (test_mkfds::netlink) pass a correct file descriptor
to bind(2)
Close #2901
The original code passed a closed file descriptor to bind(2).
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
---
tests/helpers/test_mkfds.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c
index dd0a128a8..28ed3bffc 100644
--- a/tests/helpers/test_mkfds.c
+++ b/tests/helpers/test_mkfds.c
@@ -2293,6 +2293,7 @@ static void *make_netlink(const struct factory *factory, struct fdesc fdescs[],
err(EXIT_FAILURE, "failed to dup %d -> %d", sd, fdescs[0].fd);
}
close(sd);
+ sd = fdescs[0].fd;
}
struct sockaddr_nl nl;
--
2.33.0