From f4ba0f3fbc3534978fda14ceeef83983eb8c7517 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Mon, 29 Dec 2025 12:49:33 -0500 Subject: [PATCH 1/2] test_ls: allow a space in lieu of security context (.) or FACL (+) symbols. --- tests/by-util/test_ls.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 38729d30630..2f9e4c622b9 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -1529,28 +1529,28 @@ fn test_ls_long_formats() { // Zero or one "." for indicating a file with security context // Regex for three names, so all of author, group and owner - let re_three = Regex::new(r"[xrw-]{9}[.+]? \d ([-0-9_a-z.A-Z]+ ){3}0").unwrap(); + let re_three = Regex::new(r"[xrw-]{9}[.+ ]? \d ([-0-9_a-z.A-Z]+ ){3}0").unwrap(); #[cfg(unix)] - let re_three_num = Regex::new(r"[xrw-]{9}[.+]? \d (\d+ ){3}0").unwrap(); + let re_three_num = Regex::new(r"[xrw-]{9}[.+ ]? \d (\d+ ){3}0").unwrap(); // Regex for two names, either: // - group and owner // - author and owner // - author and group - let re_two = Regex::new(r"[xrw-]{9}[.+]? \d ([-0-9_a-z.A-Z]+ ){2}0").unwrap(); + let re_two = Regex::new(r"[xrw-]{9}[.+ ]? \d ([-0-9_a-z.A-Z]+ ){2}0").unwrap(); #[cfg(unix)] - let re_two_num = Regex::new(r"[xrw-]{9}[.+]? \d (\d+ ){2}0").unwrap(); + let re_two_num = Regex::new(r"[xrw-]{9}[.+ ]? \d (\d+ ){2}0").unwrap(); // Regex for one name: author, group or owner - let re_one = Regex::new(r"[xrw-]{9}[.+]? \d [-0-9_a-z.A-Z]+ 0").unwrap(); + let re_one = Regex::new(r"[xrw-]{9}[.+ ]? \d [-0-9_a-z.A-Z]+ 0").unwrap(); #[cfg(unix)] - let re_one_num = Regex::new(r"[xrw-]{9}[.+]? \d \d+ 0").unwrap(); + let re_one_num = Regex::new(r"[xrw-]{9}[.+ ]? \d \d+ 0").unwrap(); // Regex for no names - let re_zero = Regex::new(r"[xrw-]{9}[.+]? \d 0").unwrap(); + let re_zero = Regex::new(r"[xrw-]{9}[.+ ]? \d 0").unwrap(); scene .ucmd() From 8f55102959f2043a95ba77f0f6dfc83f046639f8 Mon Sep 17 00:00:00 2001 From: Stephen Marz Date: Mon, 29 Dec 2025 12:54:36 -0500 Subject: [PATCH 2/2] ls: add padding for permission output if the security context (.) or FACL (+) indicator symbols are not present in long output format. --- src/uu/ls/src/ls.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index 3a7e8014e18..e759e8bb049 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -2827,11 +2827,12 @@ fn display_item_long( if item.security_context(config).len() > 1 { // GNU `ls` uses a "." character to indicate a file with a security context, // but not other alternate access method. - output_display.extend(b"."); + output_display.extend(b". "); } else if is_acl_set { - output_display.extend(b"+"); + output_display.extend(b"+ "); + } else { + output_display.extend(b" "); } - output_display.extend(b" "); output_display.extend_pad_left(&display_symlink_count(md), padding.link_count); if config.long.owner {