1 Star 0 Fork 37

ikernel_Mryao/shadow

forked from src-openEuler/shadow 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Remove-commented-out-code-and-FIXMEs.patch 2.43 KB
一键复制 编辑 原始数据 按行查看 历史
yunjia_w 提交于 2022-10-31 11:00 +08:00 . add some backport to optimize some functions
From 0b51cde162322ad1c6d162be0bc1b97065ff25c8 Mon Sep 17 00:00:00 2001
From: Iker Pedrosa <ipedrosa@redhat.com>
Date: Tue, 10 May 2022 15:01:21 +0200
Subject: [PATCH] Remove commented out code and FIXMEs
In order to remove some of the FIXMEs it was necessary to change the
code and call getulong() instead of getlong().
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
Reference: https://github.com/shadow-maint/shadow/commit/0b51cde162322ad1c6d162be0bc1b97065ff25c8
Conflict: NA
---
lib/getdef.c | 1 -
lib/sgetspent.c | 3 +--
lib/shadow.c | 3 +--
libmisc/salt.c | 3 ++-
4 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/lib/getdef.c b/lib/getdef.c
index fbaea2e1..2e6022fa 100644
--- a/lib/getdef.c
+++ b/lib/getdef.c
@@ -345,7 +345,6 @@ unsigned long getdef_ulong (const char *item, unsigned long dflt)
}
if (getulong (d->value, &val) == 0) {
- /* FIXME: we should have a getulong */
fprintf (shadow_logfd,
_("configuration error - cannot parse %s value: '%s'"),
item, d->value);
diff --git a/lib/sgetspent.c b/lib/sgetspent.c
index a35b6759..cbadb7e6 100644
--- a/lib/sgetspent.c
+++ b/lib/sgetspent.c
@@ -171,8 +171,7 @@ struct spwd *sgetspent (const char *string)
if (fields[8][0] == '\0') {
spwd.sp_flag = SHADOW_SP_FLAG_UNSET;
- } else if (getlong (fields[8], &spwd.sp_flag) == 0) {
- /* FIXME: add a getulong function */
+ } else if (getulong (fields[8], &spwd.sp_flag) == 0) {
return 0;
}
diff --git a/lib/shadow.c b/lib/shadow.c
index 9e86b908..b628b657 100644
--- a/lib/shadow.c
+++ b/lib/shadow.c
@@ -305,8 +305,7 @@ static struct spwd *my_sgetspent (const char *string)
if (fields[8][0] == '\0') {
spwd.sp_flag = SHADOW_SP_FLAG_UNSET;
} else {
- if (getlong (fields[8], &spwd.sp_flag) == 0) {
- /* FIXME: add a getulong function */
+ if (getulong (fields[8], &spwd.sp_flag) == 0) {
#ifdef USE_NIS
if (nis_used) {
spwd.sp_flag = SHADOW_SP_FLAG_UNSET;
diff --git a/libmisc/salt.c b/libmisc/salt.c
index ebf162fc..450293d7 100644
--- a/libmisc/salt.c
+++ b/libmisc/salt.c
@@ -341,9 +341,10 @@ static /*@observer@*/const unsigned long BCRYPT_get_salt_rounds (/*@null@*/int *
/*
* Use 19 as an upper bound for now,
* because musl doesn't allow rounds >= 20.
+ * If musl ever supports > 20 rounds,
+ * rounds should be set to B_ROUNDS_MAX.
*/
if (rounds > 19) {
- /* rounds = B_ROUNDS_MAX; */
rounds = 19;
}
#endif /* USE_XCRYPT_GENSALT */
--
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

搜索帮助