summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2002-02-26 02:32:48 +0000
committerNathan Scott <nathans@sgi.com>2002-02-26 02:32:48 +0000
commit0406b735ddf3c52d4213cce77ba8c26d86979bee (patch)
tree97b64799087cc57fa747f8021819797a5ae3b4bc
parent368202f9af7b38948fda25d9d07a2ed92fa7eb5c (diff)
downloadattr-0406b735ddf3c52d4213cce77ba8c26d86979bee.tar.gz
bump to 2.0.1, we should now be completely sync'd with Andreas for "attr".
-rw-r--r--VERSION2
-rw-r--r--debian/changelog4
-rw-r--r--doc/CHANGES7
-rw-r--r--doc/Makefile9
-rw-r--r--doc/ea-conv/Makefile45
-rw-r--r--doc/ea-conv/README13
-rw-r--r--doc/ea-conv/ea-conv119
-rw-r--r--man/man1/getfattr.136
-rw-r--r--man/man1/setfattr.134
9 files changed, 231 insertions, 38 deletions
diff --git a/VERSION b/VERSION
index 9467406..1772b38 100644
--- a/VERSION
+++ b/VERSION
@@ -3,5 +3,5 @@
#
PKG_MAJOR=2
PKG_MINOR=0
-PKG_REVISION=0
+PKG_REVISION=1
PKG_BUILD=0
diff --git a/debian/changelog b/debian/changelog
index 18bd8d4..6a6e16b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-attr (2.0.0-1) unstable; urgency=low
+attr (2.0.1-1) unstable; urgency=low
* Major new upstream release
* Uses the new official ext2/ext3/XFS extended attributes interfaces
@@ -8,7 +8,7 @@ attr (2.0.0-1) unstable; urgency=low
for new POSIX ACL packages; this is in addition to the existing
attr and attr-dev packages this source generates
- -- Nathan Scott <nathans@debian.org> Thu, 7 Feb 2002 13:25:26 +1100
+ -- Nathan Scott <nathans@debian.org> Tue, 26 Feb 2002 13:25:26 +1100
attr (1.1.3-0) unstable; urgency=low
diff --git a/doc/CHANGES b/doc/CHANGES
index 2b1b111..7b3de09 100644
--- a/doc/CHANGES
+++ b/doc/CHANGES
@@ -1,4 +1,9 @@
-attr-2.0.0 (07 February 2002)
+attr-2.0.1 (26 February 2002)
+ - incorporate several documentation changes from Andreas,
+ including a script to convert from the aget format of
+ attribute backup file, to the new getfattr format
+
+attr-2.0.0 (26 February 2002)
- initial introduction of the new system call interface
- synced up with the ext2 project, incorporated get/set tools
- new man pages for system calls, getfattr(1) and setfattr(1)
diff --git a/doc/Makefile b/doc/Makefile
index 1ccc01a..80585b9 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -33,10 +33,13 @@
TOPDIR = ..
include $(TOPDIR)/include/builddefs
+SUBDIRS = ea-conv
+
LSRCFILES = INSTALL PORTING CHANGES COPYING
LDIRT = *.gz
-default: CHANGES.gz
+default: $(SUBDIRS) CHANGES.gz
+ $(SUBDIRS_MAKERULE)
include $(BUILDRULES)
@@ -44,6 +47,7 @@ CHANGES.gz:
$(ZIP) --best -c < CHANGES > $@
install: default
+ $(SUBDIRS_MAKERULE)
$(INSTALL) -m 755 -d $(PKG_DOC_DIR)
$(INSTALL) -m 644 PORTING CHANGES.gz $(PKG_DOC_DIR)
ifeq ($(PKG_DISTRIBUTION), debian)
@@ -52,4 +56,5 @@ else
$(INSTALL) -m 644 COPYING $(PKG_DOC_DIR)
endif
-install-dev install-lib:
+install-dev install-lib: $(SUBDIRS)
+ $(SUBDIRS_MAKERULE)
diff --git a/doc/ea-conv/Makefile b/doc/ea-conv/Makefile
new file mode 100644
index 0000000..785d55f
--- /dev/null
+++ b/doc/ea-conv/Makefile
@@ -0,0 +1,45 @@
+#
+# Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it would be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Further, this software is distributed without any warranty that it is
+# free of the rightful claim of any third person regarding infringement
+# or the like. Any license provided herein, whether implied or
+# otherwise, applies only to this software file. Patent licenses, if
+# any, provided herein do not apply to combinations of this program with
+# other software, or any other product whatsoever.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write the Free Software Foundation, Inc., 59
+# Temple Place - Suite 330, Boston MA 02111-1307, USA.
+#
+# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
+# Mountain View, CA 94043, or:
+#
+# http://www.sgi.com
+#
+# For further information regarding this notice, see:
+#
+# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+#
+
+TOPDIR = ../..
+include $(TOPDIR)/include/builddefs
+
+LSRCFILES = README ea-conv
+
+include $(BUILDRULES)
+
+install: default
+ $(INSTALL) -m 755 -d $(PKG_DOC_DIR)/ea-conv
+ $(INSTALL) -m 644 README $(PKG_DOC_DIR)/ea-conv
+ $(INSTALL) -m 755 ea-conv $(PKG_DOC_DIR)/ea-conv
+
+default install-dev install-lib:
diff --git a/doc/ea-conv/README b/doc/ea-conv/README
new file mode 100644
index 0000000..aaf6b3a
--- /dev/null
+++ b/doc/ea-conv/README
@@ -0,0 +1,13 @@
+ea-conv -- convert between aget and getfattr format
+
+This script converts between the extended attribute text formats of
+getfattr and its predecessor, aget. To get all attributes with aget
+and convert the result to getfattr format, use the following command:
+
+ aget -Rds -e hex . | ea-conv -
+
+To get all attributes with getfattr and convert the result to aget
+format, use the following command:
+
+ getfattr -Rd -m - -e hex . | ea-conv -
+
diff --git a/doc/ea-conv/ea-conv b/doc/ea-conv/ea-conv
new file mode 100644
index 0000000..a51b512
--- /dev/null
+++ b/doc/ea-conv/ea-conv
@@ -0,0 +1,119 @@
+#!/usr/bin/perl -w
+
+use strict;
+use FileHandle;
+
+sub convert_acl($)
+{
+ my ($value) = @_;
+
+ local $_ = $value;
+
+ die "ACL value must be hex encoded\n" unless (s/^0x//);
+ s/\s//g;
+
+ my ($x4, $x8) = ('([0-9A-Fa-f]{4})', '([0-9A-Fa-f]{8})');
+
+ if (s/^01000000//) {
+ my $new_value = '0x02000000 ';
+ while ($_ ne '') {
+ if (s/^(0100|0400|1000|2000)$x4//) {
+ $new_value .= "$1$2ffffffff ";
+ } elsif (s/^(0200|0800)$x4$x8//) {
+ $new_value .= "$1$2$3 ";
+ } else {
+ die "ACL format not recognized\n"
+ }
+ }
+ return $new_value;
+ } elsif (s/^02000000//) {
+ my $new_value = '0x01000000 ';
+ while ($_ ne '') {
+ if (s/^(0100|0400|1000|2000)$x4$x8//) {
+ $new_value .= "$1$2 ";
+ } elsif (s/^(0200|0800)$x4$x8//) {
+ $new_value .= "$1$2$3 ";
+ } else {
+ die "ACL format not recognized\n"
+ }
+ }
+ return $new_value;
+ } else {
+ die "ACL format not recognized\n"
+ }
+}
+
+sub check_name($) {
+ my ($name) = @_;
+ if ($name =~ m[^[^A-Za-z]]) {
+ print STDERR "Renaming attribute `user.$name' to `X$name'.\n";
+ return "X$name";
+ }
+ return $name;
+}
+
+sub convert($) {
+ my ($file) = @_;
+
+ eval {
+ while (<$file>) {
+ m[^(#.*)?$] ||
+ s[^system\.posix_acl_access=(0x02.*)]
+ ['$acl=' . convert_acl($1)]e ||
+ s[^system\.posix_acl_default=(0x02.*)]
+ ['$defacl=' . convert_acl($1)]e ||
+ s[^user\.([^=]*)][check_name($1)]e ||
+
+ s[^\$acl=(0x01.*)]
+ ['system.posix_acl_access=' .
+ convert_acl($1)]e ||
+ s[^\$defacl=(0x01.*)]
+ ['system.posix_acl_default=' .
+ convert_acl($1)]e ||
+ s[^([A-Za-z][^=]*)][user.$1] ||
+
+ die "Input format error\n";
+
+ print;
+ }
+ };
+ if ($@) {
+ chomp $@;
+ print STDERR "$@ in line $..\n";
+ }
+ return (not $@);
+}
+
+unless (@ARGV) {
+ printf STDERR <<EOF;
+$0 -- convert between aget and getfattr format
+
+This script converts between the extended attribute text formats of
+getfattr and its predecessor, aget. To get all attributes with aget
+and convert the result to getfattr format, use the following command:
+
+ aget -Rds -e hex . | $0 -
+
+To get all attributes with getfattr and convert the result to aget
+format, use the following command:
+
+ getfattr -Rd -m - -e hex . | $0 -
+
+EOF
+ exit 1;
+}
+
+my $good = 1;
+foreach my $arg (@ARGV) {
+ my $fh = ($arg eq '-') ? *STDIN : new FileHandle($arg);
+
+ unless ($fh) {
+ print STDERR "$0: $arg: $!\n";
+ next;
+ }
+
+ $good = 0 unless convert $fh;
+
+ $fh->close unless ($arg eq '-');
+}
+exit (not $good);
diff --git a/man/man1/getfattr.1 b/man/man1/getfattr.1
index 93de390..014aa63 100644
--- a/man/man1/getfattr.1
+++ b/man/man1/getfattr.1
@@ -7,7 +7,6 @@ getfattr \- get extended attributes of filesystem objects
\f3pathname\f1...
\f3getfattr\f1 [\f3\-hRLP\f1] \f3\-d\f1 [\f3\-e en\f1] \c
[\f3\-m pattern\f1] \f3pathname\f1...
-\f3getfattr\f1 [\f3\-\-version\f1]
.fi
.SH DESCRIPTION
For each file,
@@ -52,42 +51,47 @@ Encode values after retrieving them.
Valid values of
.I en
are "text", "hex", and "base64".
+Values encoded as text strings are enclosed in double quotes ("),
+while strings encoded as hexidecimal and base64 are prefixed with
+0x and 0s, respectively.
.TP
.BR \-h ", " \-\-no-dereference
-Do not follow symlinks - if
+Do not follow symlinks.
+If
.I pathname
-is a symbolic link, it is not followed, but is instead itself the
-inode being examined.
+is a symbolic link, the symbolic link itself is examined,
+rather than the file the link refers to.
.TP
.BR \-m " \f2pattern\f1, " \-\-match "=\f2pattern\f1"
+Only include attributes with names matching the regular expression
+.IR pattern .
+The default value for
.I pattern
-is a regular expression pattern to apply to the set of extended
-attribute names being returned.
-It defaults to "^user\\." if no
+is "^user\\\\.",
.B \-m
-is specified, which causes
-.B getfattr
-to operate on only extended attributes from the user namespace.
+which includes all the attributes in the user namespace.
Refer to
.BR attr (5)
for a more detailed discussion on namespaces.
.TP
.B \-\-absolute-names
-Suppress the stripping of leading '/' from an absolute
-.IR pathname .
+Do not strip leading slash characters ('/').
+The default behaviour is to strip leading slash characters.
.TP
.B \-\-only-values
Dump out the extended attribute value(s) only.
.TP
.BR \-R ", " \-\-recursive
-Recurse into subdirectories, dumping extended attributes for each file
-encountered (breadth first).
+List the attributes of all files and directories recursively.
.TP
.BR \-L ", " \-\-logical
-Refines the \-R option - "logical walk" (do follow symbolic links).
+Logical walk, follow symbolic links.
+The default behaviour is to follow symbolic link arguments, and to
+skip symbolic links encountered in subdirectories.
.TP
.BR \-P ", " \-\-physical
-Refines the \-R option - "physical walk" (do not follow symbolic links).
+Physical walk, skip all symbolic links.
+This also skips symbolic link arguments.
.TP
.B \-\-version
Print the version of
diff --git a/man/man1/setfattr.1 b/man/man1/setfattr.1
index d032801..2289486 100644
--- a/man/man1/setfattr.1
+++ b/man/man1/setfattr.1
@@ -6,12 +6,11 @@ setfattr \- set extended attributes of filesystem objects
\f3setfattr\f1 [\f3\-h\f1] \f3\-n name\f1 [\f3\-v value\f1] \f3pathname\f1...
\f3setfattr\f1 [\f3\-h\f1] \f3\-x name\f1 \f3pathname\f1...
\f3setfattr\f1 [\f3\-h\f1] \f3\-\-restore=file\f1
-\f3setfattr\f1 [\f3\-\-version\f1]
.fi
.SH DESCRIPTION
The
.B setfattr
-command is used to associate a new
+command associates a new
.I value
with an extended attribute
.IR name
@@ -19,29 +18,32 @@ for each specified file.
.SS OPTIONS
.TP 4
.BR \-n " \f2name\f1, " \-\-name "=\f2name\f1"
-Set the value of the named extended attribute extended attribute.
+Specifies the name of the extended attribute to set.
.TP
-.BR \-h ", " \-\-no-dereference
-Do not follow symlinks - if
-.I pathname
-is a symbolic link, it is not followed, but is instead itself the
-inode being modified.
+.BR \-v " \f2value\f1, " \-\-value "=\f2value\f1"
+Specifies the new value for the extended attribute.
.TP
.BR \-x " \f2name\f1, " \-\-remove "=\f2name\f1"
Remove the named extended attribute entirely.
.TP
-.BR \-v " \f2value\f1, " \-\-value "=\f2value\f1"
-Specifies the new value for the named extended attribute.
+.BR \-h ", " \-\-no-dereference
+Do not follow symlinks. If
+.I pathname
+is a symbolic link, it is not followed, but is instead itself the
+inode being modified.
.TP
.BR \-\-restore =\f2file\f1
-Restores extended attributes using values from the specified file.
+Restores extended attributes from file.
The file must be in the format generated by the
.B getfattr
-command.
-The file name
-.I \-
-may be used in conjunction with this option, to specify the
-standard input stream to be used rather than a named file.
+command with the
+.B \-\-dump
+option.
+If a dash (\c
+.IR \- )
+is given as the file name,
+.B setfattr
+reads from standard input.
.TP
.B \-\-version
Print the version of