代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/systemd 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 5f78618a44a21197e727cd1c62da5aa8bf7e0610 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 31 Dec 2021 00:31:51 +0900
Subject: [PATCH] nss-systemd: fix required buffer size calculation
This also fixes the pointer assigned to the gr_mem element of struct group.
Fixes a bug introduced by 47fd7fa6c650d7a0ac41bc89747e3b866ffb9534.
Fixes #21935.
(cherry picked from commit 1e65eb8f9b7d567462030b2e625998d77677e636)
(cherry picked from commit 17227e81ab8a9bdfac679d450ed35434435a6ff8)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/5f78618a44a21197e727cd1c62da5aa8bf7e0610
---
src/nss-systemd/nss-systemd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/nss-systemd/nss-systemd.c b/src/nss-systemd/nss-systemd.c
index 1840a0d508..7aea3652c4 100644
--- a/src/nss-systemd/nss-systemd.c
+++ b/src/nss-systemd/nss-systemd.c
@@ -236,7 +236,7 @@ static enum nss_status copy_synthesized_group(
required = strlen(src->gr_name) + 1;
required += strlen(src->gr_passwd) + 1;
- required += 1; /* ...but that NULL still needs to be stored into the buffer! */
+ required += sizeof(char*); /* ...but that NULL still needs to be stored into the buffer! */
if (buflen < required) {
*errnop = ERANGE;
@@ -250,7 +250,7 @@ static enum nss_status copy_synthesized_group(
/* String fields point into the user-provided buffer */
dest->gr_name = buffer;
dest->gr_passwd = stpcpy(dest->gr_name, src->gr_name) + 1;
- dest->gr_mem = (char **) strcpy(dest->gr_passwd, src->gr_passwd) + 1;
+ dest->gr_mem = (char **) stpcpy(dest->gr_passwd, src->gr_passwd) + 1;
*dest->gr_mem = NULL;
return NSS_STATUS_SUCCESS;
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。