xfs
[Top] [All Lists]

[patch 4/4] acl: fix setfacl for long utf8 filenames

To: xfs@xxxxxxxxxxx
Subject: [patch 4/4] acl: fix setfacl for long utf8 filenames
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 30 Dec 2008 12:14:17 -0600
References: <20081230181413.518122170@xxxxxxxxxxx>
User-agent: quilt/0.46-1
Resolves Red Hat bugs:
 Bug 183181 -  Bad: utf8 long filenames - invalid argument
 Bug 287701 -  PATH_MAX patch seems incomplete

From: Andrey <afletdinov@xxxxxxxxxxxx>
From: Thomas Woerner <twoerner@xxxxxxxxxx>
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

Index: xfs-cmds/acl/setfacl/parse.c
===================================================================
--- xfs-cmds.orig/acl/setfacl/parse.c
+++ xfs-cmds/acl/setfacl/parse.c
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+#include <limits.h>
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -412,7 +413,12 @@ read_acl_comments(
        gid_t *gid_p)
 {
        int c;
-       char linebuf[1024];
+       /*
+         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 linebuf[(4*PATH_MAX)+9];
        char *cp;
        char *p;
        int comments_read = 0;

-- 

<Prev in Thread] Current Thread [Next in Thread>