acl/0009-libacl-fix-SIGSEGV-of-getfacl-e-on-overly-long-group.patch
Marcus Meissner 5439477a49 Accepting request 347209 from home:jeff_mahoney:branches:Base:System
- Update to git snapshot dated 21 Sep 2015.
  - Added:
    * 0001-Install-the-libraries-to-the-appropriate-directory.patch
    * 0002-setfacl.1-fix-typo-inclu-de-include.patch
    * 0003-test-fix-insufficient-quoting-of.patch
    * 0004-Makefile-rename-configure.in-to-configure.ac.patch
    * 0005-Bad-markup-in-acl.5-page.patch
    * 0006-.gitignore-ignore-and-config.h.in.patch
    * 0007-Use-autoreconf-rather-than-autoconf-to-regenerate-th.patch
    * 0008-libacl-Make-sure-that-acl_from_text-always-sets-errn.patch
    * 0009-libacl-fix-SIGSEGV-of-getfacl-e-on-overly-long-group.patch
    * 0010-punt-debian-rpm-packaging-logic.patch
    * 0011-move-gettext-logic-into-misc.h.patch
    * 0012-test-make-running-parallel-out-of-tree-safe.patch
    * 0013-modernize-build-system.patch
    * 0014-po-regenerate-files-after-move.patch
    * 0015-build-drop-aclincludedir-use-pkgincludedir.patch
    * 0016-build-make-use-of-an-aux-dir-to-stow-away-helper-scr.patch
    * 0017-build-ship-a-pkgconfig-file-for-libacl.patch
    * 0018-read_acl_-comments-seq-rename-line-to-lineno.patch
    * 0019-read_acl_-comments-seq-switch-to-next_line.patch
    * 0020-telldir-return-value-and-seekdir-second-parameters-a.patch
    * 0021-mark-libmisc-funcs-as-hidden-so-they-are-not-exporte.patch
    * 0022-add-__acl_-prefixes-to-internal-symbols.patch
    * 0023-cp.test-Check-permissions-of-the-right-file.patch
    * 0024-libacl-acl_set_file-Remove-unnecesary-racy-check.patch
    * 0025-fix-compilation-with-latest-xattr-git.patch
    * 0026-getfacl-Fix-memory-leak.patch
    * 0027-Fix-the-display-block-nesting-in-acl.5.patch
    * 0028-setfacl-man-page-Minor-wording-improvements.patch

OBS-URL: https://build.opensuse.org/request/show/347209
OBS-URL: https://build.opensuse.org/package/show/Base:System/acl?expand=0&rev=43
2015-12-03 14:58:36 +00:00

56 lines
1.6 KiB
Diff

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 09/34] 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(+)
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
--
2.5.2