Compare commits

...

1 Commits
rawhide ... f19

Author SHA1 Message Date
Kamil Dudka 336d2b43a7 fix SIGSEGV of getfacl -e on overly long group name 2013-11-01 13:35:25 +01:00
2 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,54 @@
From fb071c302b8cad8837bc1e57407dc3ffa14d3f99 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 31 Oct 2013 19:24:35 +0100
Subject: [PATCH] libacl: fix SIGSEGV of getfacl -e on overly long group name
We simply make sure that at least one tab is used for indentation.
---
libacl/__acl_to_any_text.c | 5 +++++
test/root/getfacl.test | 17 +++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
create mode 100644 test/root/getfacl.test
diff --git a/libacl/__acl_to_any_text.c b/libacl/__acl_to_any_text.c
index a4f9c34..1d10e81 100644
--- a/libacl/__acl_to_any_text.c
+++ b/libacl/__acl_to_any_text.c
@@ -247,6 +247,11 @@ acl_entry_to_any_str(const acl_entry_t entry_d, char *text_p, ssize_t size,
options & TEXT_ALL_EFFECTIVE) {
x = (options & TEXT_SMART_INDENT) ?
((text_p - orig_text_p)/8) : TABS-1;
+
+ /* use at least one tab for indentation */
+ if (x > (TABS-1))
+ x = (TABS-1);
+
strncpy(text_p, tabs+x, size);
ADVANCE(TABS-x);
diff --git a/test/root/getfacl.test b/test/root/getfacl.test
new file mode 100644
index 0000000..f84e25d
--- /dev/null
+++ b/test/root/getfacl.test
@@ -0,0 +1,17 @@
+Make sure that getfacl always adds at least one space between the permissions
+in an acl entry and the effective permissions comment.
+
+ $ umask 022
+ $ mkdir d
+ $ groupadd loooooooooooooooooooooooonggroup
+ $ setfacl -dm group:loooooooooooooooooooooooonggroup:rwx d
+ $ getfacl -cde d
+ > user::rwx
+ > group::r-x #effective:r-x
+ > group:loooooooooooooooooooooooonggroup:rwx #effective:rwx
+ > mask::rwx
+ > other::r-x
+ >
+
+ $ groupdel loooooooooooooooooooooooonggroup
+ $ rm -r d
--
1.7.1

View File

@ -1,7 +1,7 @@
Summary: Access control list utilities
Name: acl
Version: 2.2.51
Release: 9%{?dist}
Release: 10%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gawk
BuildRequires: gettext
@ -17,6 +17,9 @@ Patch4: acl-2.2.49-tests.patch
# fix typos in setfacl(1) man page (#675451)
Patch6: acl-2.2.49-bz675451.patch
# fix SIGSEGV of getfacl -e on overly long group name
Patch7: acl-2.2.51-getfacl-segv.patch
License: GPLv2+
Group: System Environment/Base
URL: http://acl.bestbits.at/
@ -54,6 +57,7 @@ defined in POSIX 1003.1e draft standard 17.
%patch1 -p1
%patch4 -p1
%patch6 -p1
%patch7 -p1
%build
touch .census
@ -116,6 +120,9 @@ chmod 0755 $RPM_BUILD_ROOT/%{_libdir}/libacl.so.*.*.*
%{_libdir}/libacl.so.*
%changelog
* Fri Nov 01 2013 Kamil Dudka <kdudka@redhat.com> 2.2.51-10
- fix SIGSEGV of getfacl -e on overly long group name
* Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.51-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild