!27 回合社区补丁

From: @wguanghao 
Reviewed-by: @swf504 
Signed-off-by: @swf504
This commit is contained in:
openeuler-ci-bot 2024-07-31 01:45:53 +00:00 committed by Gitee
commit e8fabf0738
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 48 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From b0f95e3954f85d97a99f8a08645418945484dbca Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Wed, 1 Sep 2021 08:00:00 +0000
Subject: [PATCH] common.c: fix strncat usage
When quota is configured using --enable-werror, gcc -flto fails with
the following diagnostics:
In function 'strncat',
inlined from 'sstrncat' at common.c:113:2,
inlined from 'get_proc_num' at quotastats.c:46:2:
/usr/include/bits/string_fortified.h:122:10: error: '__builtin___strncat_chk' specified bound 4096 equals destination size [-Werror=str
ingop-overflow=]
122 | return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
| ^
This diagnostics is correct: when "src" contains "len" or more bytes,
strncat() writes "len"+1 bytes to "dest" ("len" from "src" plus
the terminating null byte).
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Jan Kara <jack@suse.cz>
---
common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/common.c b/common.c
index 8be0428..b3e5ad2 100644
--- a/common.c
+++ b/common.c
@@ -110,8 +110,7 @@ void sstrncpy(char *d, const char *s, size_t len)
void sstrncat(char *d, const char *s, size_t len)
{
- strncat(d, s, len);
- d[len - 1] = 0;
+ strncat(d, s, len - 1);
}
char *sstrdup(const char *s)
--
2.39.2

View File

@ -1,7 +1,7 @@
Name: quota
Version: 4.06
Epoch: 1
Release: 7
Release: 8
Summary: Linux Diskquota system as part of the Linux kernel
License: BSD and GPLv2 and GPLv2+ and LGPLv2+
URL: http://sourceforge.net/projects/linuxquota/
@ -18,6 +18,7 @@ Patch2: 0002-quotaio_xfs-Warn-when-large-kernel-timestamps-cannot.patch
Patch3: 0003-quota-Add-sw64-architecture.patch
Patch4: 0004-quota_nld-Initialize-sa_mask-when-registering-PID-fi.patch
Patch5: 0005-quota-nld-fix-open-PID-file-failed-when-systemd-read.patch
Patch6: 0006-common.c-fix-strncat-usage.patch
BuildRequires: autoconf, automake, coreutils, rpcgen, systemd, gcc
BuildRequires: e2fsprogs-devel, gettext-devel, openldap-devel
@ -126,6 +127,9 @@ make check
%{_mandir}/man*/*
%changelog
* Tue Jul 30 2024 wuguanghao <wuguanghao3@huawei.com> - 1:4.06-8
- common.c: fix strncat usage
* Tue Dec 6 2022 lihaoxiang <lihaoxiang9@huawei.com> - 1:4.06-7
- Type:bugfix
- ID:NA