Package: acl
Version: 2.2.26-1
Severity: normal
Tags: patch
Dear Nathan
getfacl uses a string of length _POSIX_PATH_MAX (256 characters) when
reading in filenames via stdin (e.g. 'echo <filename> | getfacl -').
Therefore filenames (including path) longer than that fail. The linux kernel
headers define PATH_MAX in /usr/include/linux/limits.h to be 4096 characters.
So files (including paths) may exist up to that length on a linux system.
If one provides the filename as an argument (getfacl <filename>) the above
limitation does not exist (which is also inconsistent).
It would be great if getfacl could be changed to accept filenames up to
the maximum length supported by linux, i.e. PATH_MAX (4096 characters).
I attach a little patch that implements this.
To give you a little bit of background, I'm the co-maintainer of the
mondo package. A user has raised an issue with getfacl not working for
some of his files on the mondorescue mailing list which I have tracked
down to the above issue.
Best regards & thanks a lot
Andree
PS: There may be reasons why this absolutely has to be _POSIX_PATH_MAX
which I'm not aware of. I have searched Google but may have overlooked
something. If so, I would be very grateful for an explanation.
-- System Information:
Debian Release: 3.1
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-k7
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1)
Versions of packages acl depends on:
ii libacl1 2.2.26-1 Access control list shared library
ii libattr1 2.4.18-1 Extended attribute shared library
ii libc6 2.3.2.ds1-20 GNU C Library: Shared libraries an
-- no debconf information
--- getfacl.c.orig 2005-01-30 21:14:43.000000000 +1100
+++ getfacl.c 2005-01-30 21:14:57.000000000 +1100
@@ -607,7 +607,7 @@
char *next_line(FILE *file)
{
- static char line[_POSIX_PATH_MAX], *c;
+ static char line[PATH_MAX], *c;
if (!fgets(line, sizeof(line), file))
return NULL;