gioser

sergio/takana

> Una distribución Linux construida con un laboratorio funcional y hermético en el > sótano, y una terminal mutable, clásica y anárquica en el piso de arriba — diseñada > desde el suelo para que una IA programadora entienda, modifique y co…

TOML 1182Shell 87Rust 63Markdown 541592 Definitions

⎇ 2e4cfcaa6b78066e05fa0d49c8d7c8ebf0a055d6 recipes/fix-t4219-with-sticky-bit.patch 48 lines · 1.8 KB History raw

base-system: promover 17 esenciales a canónicas + repo firmado (713→730) fb6cb05aa · sergio ·

1The last test of t4129 creates a directory and expects its setgid bit
2(g+s) to be off. But this makes the test fail when the parent directory
3has the bit set, as setgid's state is inherited by newly created
4subdirectories. Make the test more robust by accepting the presence of
5the setgid bit on the created directory. We only allow 'S' (setgid on
6but no executable permission) and not 's' (setgid on with executable
7permission) because the previous 'umask 0077' shouldn't allow the second
8scenario to happen.
9
10Note that only subdirectories inherit this bit, so we don't have to make
11the same change for the regular file that is also created by this test.
12But checking the permissions using grep instead of test_cmp makes the
13test a little simpler, so let's use it for the regular file as well.
14
15Also note that the sticky bit (+t) and the setuid bit (u+s) are not
16inherited, so we don't have to worry about those.
17
18Reported-by: Kevin Daudt <me@ikke.info>
19Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br>
20---
21 t/t4129-apply-samemode.sh | 10 ++++------
22 1 file changed, 4 insertions(+), 6 deletions(-)
23
24diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
25index 41818d8315..3818398ca9 100755
26--- a/t/t4129-apply-samemode.sh
27+++ b/t/t4129-apply-samemode.sh
28@@ -90,12 +90,10 @@ test_expect_success POSIXPERM 'do not use core.sharedRepository for working tree
29 		rm -rf d f1 &&
30 		git apply patch-f1-and-f2.txt &&
31 
32-		echo "-rw-------" >f1_mode.expected &&
33-		echo "drwx------" >d_mode.expected &&
34-		test_modebits f1 >f1_mode.actual &&
35-		test_modebits d >d_mode.actual &&
36-		test_cmp f1_mode.expected f1_mode.actual &&
37-		test_cmp d_mode.expected d_mode.actual
38+		test_modebits f1 >f1_mode &&
39+		test_modebits d >d_mode &&
40+		grep "^-rw-------$" f1_mode &&
41+		grep "^drwx--[-S]---$" d_mode
42 	)
43 '
44 
45-- 
462.29.2
47
48