[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-xfs
Subject:    [patch 4/4] acl: fix setfacl for long utf8 filenames
From:       Eric Sandeen <sandeen () sandeen ! net>
Date:       2008-12-30 18:14:17
Message-ID: 20081230181447.028003436 () sandeen ! net
[Download RAW message or body]

Resolves Red Hat bugs:
 Bug 183181 -  Bad: utf8 long filenames - invalid argument
 Bug 287701 -  PATH_MAX patch seems incomplete

From: Andrey <afletdinov@dc.baikal.ru>
From: Thomas Woerner <twoerner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

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;

-- 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic