summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@hadrons.org>2019-07-20 04:24:32 +0200
committerMike Frysinger <vapier@gentoo.org>2022-11-12 21:39:08 +0700
commit65c5d72e311294dcf823a35bb195ed7241845537 (patch)
treee977550801b96e10929f2beac26987f7e4026a3f
parent8bd8bf4becf543fccb415493285ef578c15e8c15 (diff)
downloadacl-65c5d72e311294dcf823a35bb195ed7241845537.tar.gz
Remove PATH_MAX usage which does not exist on GNU/Hurd
The Hurd is intended to have no hardcoded limits, and POSIX makes it possible for a system to not define PATH_MAX. Switch to the simpler solution which is to generate the constants at compile time.
-rw-r--r--test/test_group.c6
-rw-r--r--test/test_passwd.c7
-rw-r--r--tools/parse.c5
3 files changed, 2 insertions, 16 deletions
diff --git a/test/test_group.c b/test/test_group.c
index 00c0027..6ca761a 100644
--- 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)
diff --git a/test/test_passwd.c b/test/test_passwd.c
index 890e041..9a6dad5 100644
--- 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)
diff --git a/tools/parse.c b/tools/parse.c
index f052400..78ae49a 100644
--- 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;