File: build-no-PATH_MAX.patch

package info (click to toggle)
acl 2.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,272 kB
  • sloc: ansic: 5,898; sh: 5,116; perl: 279; makefile: 51; sed: 16
file content (59 lines) | stat: -rw-r--r-- 1,749 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Description: Remove PATH_MAX usage which does not exist on GNU/Hurd.
Author: Guillem Jover <guillem@debian.org>
Origin: vendor
Forwarded: yes
Applied-Upstream: 2.3.1+, commit:65c5d72e311294dcf823a35bb195ed7241845537
Last-Update: 2019-02-28

---
 test/test_group.c  |    6 +-----
 test/test_passwd.c |    7 +------
 tools/parse.c      |    9 ++++-----
 3 files changed, 6 insertions(+), 16 deletions(-)

--- a/tools/parse.c
+++ b/tools/parse.c
@@ -413,11 +413,6 @@ read_acl_comments(
 	mode_t *flags)
 {
 	int c;
-	/*
-	  Max PATH_MAX bytes even for UTF-8 path names and additional 9
-	  bytes for "# file: ". Not a good solution but for now it is the
-	  best I can do without too much impact on the code. [tw]
-	*/
 	char *line, *cp, *p;
 	int comments_read = 0;
 	
--- a/test/test_group.c
+++ b/test/test_group.c
@@ -9,12 +9,8 @@
 #include <grp.h>
 
 #define TEST_GROUP "test/test.group"
-static char grfile[PATH_MAX];
-static void setup_grfile() __attribute__((constructor));
+static char grfile[] = BASEDIR "/" TEST_GROUP;
 
-static void setup_grfile() {
-	snprintf(grfile, sizeof(grfile), "%s/%s", BASEDIR, TEST_GROUP);
-}
 
 #define ALIGN_MASK(x, mask)    (((x) + (mask)) & ~(mask))
 #define ALIGN(x, a)            ALIGN_MASK(x, (typeof(x))(a) - 1)
--- a/test/test_passwd.c
+++ b/test/test_passwd.c
@@ -9,12 +9,7 @@
 #include <pwd.h>
 
 #define TEST_PASSWD "test/test.passwd"
-static char pwfile[PATH_MAX];
-static void setup_pwfile() __attribute__((constructor));
-
-static void setup_pwfile() {
-	snprintf(pwfile, sizeof(pwfile), "%s/%s", BASEDIR, TEST_PASSWD);
-}
+static char pwfile[] = BASEDIR "/" TEST_PASSWD;
 
 #define ALIGN_MASK(x, mask)    (((x) + (mask)) & ~(mask))
 #define ALIGN(x, a)            ALIGN_MASK(x, (typeof(x))(a) - 1)