1 Star 0 Fork 37

ikernel_Mryao/shadow

forked from src-openEuler/shadow 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-passwd-erase-password-copy-on-all-error-branches.patch 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
yunjia_w 提交于 2022-10-31 11:00 +08:00 . add some backport to optimize some functions
From 58b6e97a9eef866e9e479fb781aaaf59fb11ef36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Mon, 25 Apr 2022 12:17:40 +0200
Subject: [PATCH] passwd: erase password copy on all error branches
Reference: https://github.com/shadow-maint/shadow/commit/58b6e97a9eef866e9e479fb781aaaf59fb11ef36
Conflict: NA
---
src/passwd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/passwd.c b/src/passwd.c
index 80531ec6..8c6f81a9 100644
--- a/src/passwd.c
+++ b/src/passwd.c
@@ -289,6 +289,7 @@ static int new_password (const struct passwd *pw)
cp = getpass (_("New password: "));
if (NULL == cp) {
memzero (orig, sizeof orig);
+ memzero (pass, sizeof pass);
return -1;
}
if (warned && (strcmp (pass, cp) != 0)) {
@@ -316,6 +317,7 @@ static int new_password (const struct passwd *pw)
cp = getpass (_("Re-enter new password: "));
if (NULL == cp) {
memzero (orig, sizeof orig);
+ memzero (pass, sizeof pass);
return -1;
}
if (strcmp (cp, pass) != 0) {
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ikernel-mryao/shadow.git
git@gitee.com:ikernel-mryao/shadow.git
ikernel-mryao
shadow
shadow
master

搜索帮助