public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/4] acl patches from Fedora / Red Hat rpm
@ 2008-12-30 18:14 Eric Sandeen
  2008-12-30 18:14 ` [patch 1/4] acl: add short option support to the acl commands Eric Sandeen
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Eric Sandeen @ 2008-12-30 18:14 UTC (permalink / raw)
  To: xfs

Here are a few patches (modulo distro-specific changes)
from the Fedora / Red Hat acl package.

-Eric
-- 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch 1/4] acl: add short option support to the acl commands.
  2008-12-30 18:14 [patch 0/4] acl patches from Fedora / Red Hat rpm Eric Sandeen
@ 2008-12-30 18:14 ` Eric Sandeen
  2008-12-30 18:14 ` [patch 2/4] acl: fix setfacl segfault when using only "--" as parameter Eric Sandeen
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2008-12-30 18:14 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: acl-2.2.47-params.patch --]
[-- Type: text/plain, Size: 6006 bytes --]

Resolves Red Hat bugs:
 204087 -  getfacl/setfacl should support -n
 457244 -  setfacl does not recognize -v and -h

From: Jiri Moskovcak <jmoskovc@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: xfs-cmds/acl/getfacl/getfacl.c
===================================================================
--- xfs-cmds.orig/acl/getfacl/getfacl.c
+++ xfs-cmds/acl/getfacl/getfacl.c
@@ -43,7 +43,7 @@
 #define POSIXLY_CORRECT_STR "POSIXLY_CORRECT"
 
 #if !POSIXLY_CORRECT
-#  define CMD_LINE_OPTIONS "dRLP"
+#  define CMD_LINE_OPTIONS "aceEsRLPtpndvh"
 #endif
 #define POSIXLY_CMD_LINE_OPTIONS "d"
 
@@ -555,23 +555,23 @@ void help(void)
 #if !POSIXLY_CORRECT
 	} else {
 		printf(_(
-"      --access            display the file access control list only\n"
+"  -a,  --access           display the file access control list only\n"
 "  -d, --default           display the default access control list only\n"
-"      --omit-header       do not display the comment header\n"
-"      --all-effective     print all effective rights\n"
-"      --no-effective      print no effective rights\n"
-"      --skip-base         skip files that only have the base entries\n"
+"  -c, --omit-header       do not display the comment header\n"
+"  -e, --all-effective     print all effective rights\n"
+"  -E, --no-effective      print no effective rights\n"
+"  -s, --skip-base         skip files that only have the base entries\n"
 "  -R, --recursive         recurse into subdirectories\n"
 "  -L, --logical           logical walk, follow symbolic links\n"
 "  -P, --physical          physical walk, do not follow symbolic links\n"
-"      --tabular           use tabular output format\n"
-"      --numeric           print numeric user/group identifiers\n"
-"      --absolute-names    don't strip leading '/' in pathnames\n"));
+"  -t, --tabular           use tabular output format\n"
+"  -n, --numeric           print numeric user/group identifiers\n"
+"  -p, --absolute-names    don't strip leading '/' in pathnames\n"));
 	}
 #endif
 	printf(_(
-"      --version           print version and exit\n"
-"      --help              this help text\n"));
+"  -v, --version           print version and exit\n"
+"  -h, --help              this help text\n"));
 }
 
 int main(int argc, char *argv[])
Index: xfs-cmds/acl/man/man1/getfacl.1
===================================================================
--- xfs-cmds.orig/acl/man/man1/getfacl.1
+++ xfs-cmds/acl/man/man1/getfacl.1
@@ -12,10 +12,10 @@ getfacl \- get file access control lists
 .SH SYNOPSIS
 
 .B getfacl
-[\-dRLPvh] file ...
+[\-aceEsRLPrpndvh] file ...
 
 .B getfacl
-[\-dRLPvh] \-
+[\-aceEsRLPrpndvh] \-
 
 .SH DESCRIPTION
 For each file, getfacl displays the file name, owner, the group,
@@ -78,22 +78,22 @@ accessing the file mode.
 
 .SS OPTIONS
 .TP 4
-.I \-\-access
+.I \-a, \-\-access
 Display the file access control list.
 .TP
 .I \-d, \-\-default
 Display the default access control list.
 .TP
-.I \-\-omit-header
+.I \-c, \-\-omit-header
 Do not display the comment header (the first three lines of each file's output).
 .TP
-.I \-\-all-effective
+.I \-e, \-\-all-effective
 Print all effective rights comments, even if identical to the rights defined by the ACL entry.
 .TP
-.I \-\-no-effective
+.I \-E, \-\-no-effective
 Do not print effective rights comments.
 .TP
-.I \-\-skip-base
+.I \-s, \-\-skip-base
 Skip files that only have the base ACL entries (owner, group, others).
 .TP
 .I \-R, \-\-recursive
@@ -109,17 +109,20 @@ Physical walk, do not follow symbolic li
 link arguments.
 Only effective in combination with \-R.
 .TP
-.I \-\-tabular
+.I \-t, \-\-tabular
 Use an alternative tabular output format. The ACL and the default ACL are displayed side by side. Permissions that are ineffective due to the ACL mask entry are displayed capitalized. The entry tag names for the ACL_USER_OBJ and ACL_GROUP_OBJ entries are also displayed in capital letters, which helps in spotting those entries.
 .TP
-.I \-\-absolute-names
+.I \-p, \-\-absolute-names
 Do not strip leading slash characters (`/'). The default behavior is to
 strip leading slash characters.
 .TP
-.I \-\-version
+.I \-n, \-\-numeric
+List numeric user and group IDs
+.TP
+.I \-v, \-\-version
 Print the version of getfacl and exit.
 .TP
-.I \-\-help
+.I \-h, \-\-help
 Print help explaining the command line options.
 .TP
 .I \-\-
Index: xfs-cmds/acl/man/man1/setfacl.1
===================================================================
--- xfs-cmds.orig/acl/man/man1/setfacl.1
+++ xfs-cmds/acl/man/man1/setfacl.1
@@ -115,10 +115,10 @@ This also skips symbolic link arguments.
 Only effective in combination with \-R.
 This option cannot be mixed with `\-\-restore'.
 .TP 4
-.I \-\-version
+.I \-v, \-\-version
 Print the version of setfacl and exit.
 .TP 4
-.I \-\-help
+.I \-h, \-\-help
 Print help explaining the command line options.
 .TP 4
 .I \-\-
Index: xfs-cmds/acl/setfacl/setfacl.c
===================================================================
--- xfs-cmds.orig/acl/setfacl/setfacl.c
+++ xfs-cmds/acl/setfacl/setfacl.c
@@ -42,10 +42,10 @@ extern int do_set(const char *path_p, co
 
 /* '-' stands for `process non-option arguments in loop' */
 #if !POSIXLY_CORRECT
-#  define CMD_LINE_OPTIONS "-:bkndm:M:x:X:RLP"
+#  define CMD_LINE_OPTIONS "-:bkndvhm:M:x:X:RLP"
 #  define CMD_LINE_SPEC "[-bkndRLP] { -m|-M|-x|-X ... } file ..."
 #endif
-#define POSIXLY_CMD_LINE_OPTIONS "-:bkndm:M:x:X:"
+#define POSIXLY_CMD_LINE_OPTIONS "-:bkndvhm:M:x:X:"
 #define POSIXLY_CMD_LINE_SPEC "[-bknd] {-m|-M|-x|-X ... } file ..."
 
 struct option long_options[] = {
@@ -263,8 +263,8 @@ void help(void)
 	}
 #endif
 	printf(_(
-"      --version           print version and exit\n"
-"      --help              this help text\n"));
+"  -v, --version           print version and exit\n"
+"  -h, --help              this help text\n"));
 }
 
 

-- 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch 2/4] acl: fix setfacl segfault when using only "--" as parameter.
  2008-12-30 18:14 [patch 0/4] acl patches from Fedora / Red Hat rpm Eric Sandeen
  2008-12-30 18:14 ` [patch 1/4] acl: add short option support to the acl commands Eric Sandeen
@ 2008-12-30 18:14 ` Eric Sandeen
  2008-12-30 18:14 ` [patch 3/4] acl: Return error status on setfacl failures Eric Sandeen
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2008-12-30 18:14 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: acl-2.2.39-segfault.patch --]
[-- Type: text/plain, Size: 683 bytes --]

Resolves Red Hat bug:
 430458 - execute command "setfacl -- --test" will occur Segmentation Fault

From: Jiri Moskovcak <jmoskovc@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: xfs-cmds/acl/setfacl/setfacl.c
===================================================================
--- xfs-cmds.orig/acl/setfacl/setfacl.c
+++ xfs-cmds/acl/setfacl/setfacl.c
@@ -599,6 +599,8 @@ int main(int argc, char *argv[])
 		}
 	}
 	while (optind < argc) {
+		if(!seq)
+			goto synopsis;
 		if (seq_empty(seq))
 			goto synopsis;
 		saw_files = 1;

-- 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch 3/4] acl: Return error status on setfacl failures
  2008-12-30 18:14 [patch 0/4] acl patches from Fedora / Red Hat rpm Eric Sandeen
  2008-12-30 18:14 ` [patch 1/4] acl: add short option support to the acl commands Eric Sandeen
  2008-12-30 18:14 ` [patch 2/4] acl: fix setfacl segfault when using only "--" as parameter Eric Sandeen
@ 2008-12-30 18:14 ` Eric Sandeen
  2008-12-30 18:14 ` [patch 4/4] acl: fix setfacl for long utf8 filenames Eric Sandeen
  2009-01-04 18:20 ` [patch 0/4] acl patches from Fedora / Red Hat rpm Andreas Gruenbacher
  4 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2008-12-30 18:14 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: acl-2.2.45-exitcode.patch --]
[-- Type: text/plain, Size: 959 bytes --]

Resolves Red Hat bug:
 Bug 368451 -  setfacl returns 0 even though it fails

From: Jiri Moskovcak <jmoskovc@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: xfs-cmds/acl/setfacl/setfacl.c
===================================================================
--- xfs-cmds.orig/acl/setfacl/setfacl.c
+++ xfs-cmds/acl/setfacl/setfacl.c
@@ -137,7 +137,7 @@ restore(
 		if (error < 0)
 			goto fail;
 		if (error == 0)
-			return 0;
+			return status;
 
 		if (path_p == NULL) {
 			if (filename) {
@@ -151,6 +151,7 @@ restore(
 						 "aborting\n"),
 					progname, backup_line);
 			}
+			status = 1;
 			goto getout;
 		}
 
@@ -169,6 +170,7 @@ restore(
 			fprintf(stderr, _("%s: %s: %s in line %d\n"),
 			        progname, xquote(filename), strerror(errno),
 				line);
+			status = 1;
 			goto getout;
 		}
 

-- 

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [patch 4/4] acl: fix setfacl for long utf8 filenames
  2008-12-30 18:14 [patch 0/4] acl patches from Fedora / Red Hat rpm Eric Sandeen
                   ` (2 preceding siblings ...)
  2008-12-30 18:14 ` [patch 3/4] acl: Return error status on setfacl failures Eric Sandeen
@ 2008-12-30 18:14 ` Eric Sandeen
  2009-01-04 18:20 ` [patch 0/4] acl patches from Fedora / Red Hat rpm Andreas Gruenbacher
  4 siblings, 0 replies; 6+ messages in thread
From: Eric Sandeen @ 2008-12-30 18:14 UTC (permalink / raw)
  To: xfs

[-- Attachment #1: acl-2.2.39-path_max.patch --]
[-- Type: text/plain, Size: 1093 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch 0/4] acl patches from Fedora / Red Hat rpm
  2008-12-30 18:14 [patch 0/4] acl patches from Fedora / Red Hat rpm Eric Sandeen
                   ` (3 preceding siblings ...)
  2008-12-30 18:14 ` [patch 4/4] acl: fix setfacl for long utf8 filenames Eric Sandeen
@ 2009-01-04 18:20 ` Andreas Gruenbacher
  4 siblings, 0 replies; 6+ messages in thread
From: Andreas Gruenbacher @ 2009-01-04 18:20 UTC (permalink / raw)
  To: xfs; +Cc: Eric Sandeen

On Tuesday, 30 December 2008 19:14:13 Eric Sandeen wrote:
> Here are a few patches (modulo distro-specific changes)
> from the Fedora / Red Hat acl package.

All four patches look good. Thanks for digging them out!

Andreas

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-01-04 18:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-30 18:14 [patch 0/4] acl patches from Fedora / Red Hat rpm Eric Sandeen
2008-12-30 18:14 ` [patch 1/4] acl: add short option support to the acl commands Eric Sandeen
2008-12-30 18:14 ` [patch 2/4] acl: fix setfacl segfault when using only "--" as parameter Eric Sandeen
2008-12-30 18:14 ` [patch 3/4] acl: Return error status on setfacl failures Eric Sandeen
2008-12-30 18:14 ` [patch 4/4] acl: fix setfacl for long utf8 filenames Eric Sandeen
2009-01-04 18:20 ` [patch 0/4] acl patches from Fedora / Red Hat rpm Andreas Gruenbacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox