!178 sync branch patch

From: @Linux_zhang2024 
Reviewed-by: @zhengxiaoxiaoGitee, @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
This commit is contained in:
openeuler-ci-bot 2025-04-03 01:51:59 +00:00 committed by Gitee
commit ccefa3ee9e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 36 additions and 5 deletions

View File

@ -0,0 +1,27 @@
From 92b889b671afb8e77cb9945a97088c6a63130067 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
Date: Mon, 11 Dec 2023 17:27:44 +0100
Subject: [PATCH] src/useradd: free string
useradd.c:2329:10: warning: Potential leak of memory pointed to by 'btrfs_check' [unix.Malloc]
Reference: https://github.com/shadow-maint/shadow/commit/92b889b671afb8e77cb9945a97088c6a63130067
Conflict: NA
---
src/useradd.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/useradd.c b/src/useradd.c
index f567d54..2e8725d 100644
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -2257,6 +2257,7 @@ static void create_home (void)
Prog, path);
fail_exit (E_HOMEDIR);
}
+ free(btrfs_check);
// make subvolume to mount for user instead of directory
if (btrfs_create_subvolume(path)) {
fprintf (stderr,
--
2.27.0

View File

@ -1,6 +1,6 @@
Name: shadow
Version: 4.9
Release: 16
Release: 17
Epoch: 2
License: BSD and GPLv2+
Summary: Tools for managing accounts and shadow password files
@ -96,9 +96,10 @@ Patch76: backport-shadow-userdel-add-the-adaptation-to-the-busybox-ps-.patch
Patch77: backport-lib-btrfs-avoid-NULL-dereference.patch
Patch78: backport-src-passwd.c-Switch-to-day-precision.patch
Patch79: backport-src-passwd-add-overflow-check.patch
Patch80: backport-src-useradd.c-get_groups-Fix-memory-leak.patch
Patch81: backport-src-gpasswd-Clear-password-in-more-cases.patch
Patch82: backport-lib-encrypt.c-Do-not-exit-in-error-case.patch
Patch80: backport-src-useradd-free-string.patch
Patch81: backport-src-useradd.c-get_groups-Fix-memory-leak.patch
Patch82: backport-src-gpasswd-Clear-password-in-more-cases.patch
Patch83: backport-lib-encrypt.c-Do-not-exit-in-error-case.patch
BuildRequires: gcc, libselinux-devel, audit-libs-devel, libsemanage-devel
BuildRequires: libacl-devel, libattr-devel
@ -268,9 +269,12 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.la
%{_mandir}/*/*
%changelog
* Tue Mar 18 2025 wangjiang <app@cameyan.com> - 2:4.9-16
* Tue Mar 18 2025 wangjiang <app@cameyan.com> - 2:4.9-17
- backport patches from upstream
* Sat Mar 16 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 2:4.9-16
- backport some patches
* Sun Feb 4 2024 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 2:4.9-15
- backport some patches