Resolves: #1451826 - fix spurious acl_check() failure on setfacl --restore

This commit is contained in:
Kamil Dudka 2017-05-17 17:29:47 +02:00
parent 40e29b281f
commit e65b1249cb
2 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,40 @@
From eb123384d1e4001b62a578ec1df53aa23016aed3 Mon Sep 17 00:00:00 2001
From: Andreas Gruenbacher <agruenba@redhat.com>
Date: Fri, 17 Mar 2017 10:17:01 +0100
Subject: [PATCH] setfacl --restore: Silence valgrind
Valgrind complains that setfacl --restore triggers uninitialized memory
accesses to cmd->c_tag and cmd->c_perm of CMD_REMOVE_ACL commands in
do_set (http://savannah.nongnu.org/bugs/?50566). In this case, the
uninitialized memory accesses have no effect. Silence valgrind by
initializing cmd->c_tag and cmd->c_perm anyway.
Upstream-commit: 33f01b5d5bd98fceee0ba46cdbddb60b36fc650e
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
setfacl/sequence.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/setfacl/sequence.c b/setfacl/sequence.c
index a418b23..5ed182e 100644
--- a/setfacl/sequence.c
+++ b/setfacl/sequence.c
@@ -29,7 +29,14 @@ cmd_t
cmd_init(
void)
{
- return (cmd_t)malloc(sizeof(struct cmd_obj));
+ cmd_t cmd;
+
+ cmd = malloc(sizeof(struct cmd_obj));
+ if (cmd) {
+ cmd->c_tag = ACL_UNDEFINED_TAG;
+ cmd->c_perm = 0;
+ }
+ return cmd;
}
--
2.9.4

View File

@ -13,6 +13,9 @@ Source: http://download.savannah.gnu.org/releases-noredirect/acl/acl-%{version}.
# fix a typo in setfacl(1) man page (#675451)
Patch1: 0001-acl-2.2.49-bz675451.patch
# fix spurious acl_check() failure on setfacl --restore (#1451826)
Patch2: 0002-acl-2.2.52-setfacl-restore-initialize.patch
# prepare the test-suite for SELinux and arbitrary umask
Patch3: 0003-acl-2.2.52-tests.patch
@ -57,6 +60,7 @@ defined in POSIX 1003.1e draft standard 17.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
@ -123,6 +127,7 @@ rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}*
%changelog
* Wed May 17 2017 Kamil Dudka <kdudka@redhat.com> 2.2.52-12
- fix spurious acl_check() failure on setfacl --restore (#1451826)
- update project URL (#1418474)
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.52-11