SHA256
1
0
forked from pool/attr
OBS User unknown 2007-10-26 18:09:10 +00:00 committed by Git OBS Bridge
parent 3f67f64a4e
commit 4e0dbb700e
10 changed files with 785 additions and 162 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1ff1c464693c5e756b8047412f49e84c38c6385aa5b4e1230aafc81ea21f59e7
size 93657

3
attr-2.4.39.src.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f28213f4942e86b3640707e367b367b0870d893d5707d38f2b34adae87673d5d
size 102133

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Oct 26 02:10:44 CEST 2007 - agruen@suse.de
- A large jump to the current upstream version 2.4.39.
- Fix the upstream path walking code.
- Remove the ea-conv script; this is not relevant anymore since
years.
-------------------------------------------------------------------
Wed Apr 25 16:20:42 CEST 2007 - agruen@suse.de

View File

@ -1,5 +1,5 @@
#
# spec file for package attr (Version 2.4.28)
# spec file for package attr (Version 2.4.39)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -12,19 +12,19 @@
Name: attr
Group: System/Filesystems
Autoreqprov: on
Summary: A Command to Manipulate File System Extended Attributes
Version: 2.4.28
Release: 52
AutoReqProv: on
Summary: Commands for Manipulating Extended Attributes
Version: 2.4.39
Release: 1
Source: %{name}-%{version}.src.tar.bz2
Source1: xattr.conf
Patch0: builddefs.in.diff
Patch1: xfs-cmds-25211a-skip-DMF-attributes-on-copy-also
Patch2: xfs-cmds-25263a-fix-list_attr-segfault
Patch3: xattr_conf.diff
URL: ftp://oss.sgi.com/projects/xfs/cmd_tars
Patch1: xattr_conf.diff
Patch2: remove-ea-conv.diff
Patch3: walk-attr.diff
Url: ftp://oss.sgi.com/projects/xfs/cmd_tars
BuildRoot: %{_tmppath}/%{name}-%{version}-build
License: GNU General Public License (GPL)
License: GPL v2 or later
Conflicts: xfsdump < 2.0.0
%description
@ -42,7 +42,7 @@ Authors:
%package -n libattr
Summary: A dynamic library for filesystem extended attribute support
Autoreqprov: on
AutoReqProv: on
Group: System/Libraries
%description -n libattr
@ -58,7 +58,7 @@ Authors:
%package -n libattr-devel
Summary: Include Files and Libraries mandatory for Development
Autoreqprov: on
AutoReqProv: on
Group: Development/Libraries/C and C++
Provides: attr-devel
Obsoletes: attr-devel
@ -79,8 +79,8 @@ Authors:
%prep
%setup
%patch0 -p1
%patch1 -p2
%patch2 -p2
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
@ -128,13 +128,10 @@ rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr (-,root,root)
%dir %attr(755,root,root) /usr/share/doc/packages/attr
%dir %attr(755,root,root) /usr/share/doc/packages/attr/ea-conv
%doc %attr(644,root,root) /usr/share/doc/packages/attr/README
%doc %attr(644,root,root) /usr/share/doc/packages/attr/CHANGES.gz
%doc %attr(644,root,root) /usr/share/doc/packages/attr/COPYING
%doc %attr(644,root,root) /usr/share/doc/packages/attr/PORTING
%doc %attr(644,root,root) /usr/share/doc/packages/attr/ea-conv/README
%doc %attr(755,root,root) /usr/share/doc/packages/attr/ea-conv/ea-conv
%doc %attr(644,root,root) %{_mandir}/man1/attr.1.gz
%doc %attr(644,root,root) %{_mandir}/man1/getfattr.1.gz
%doc %attr(644,root,root) %{_mandir}/man1/setfattr.1.gz
@ -167,8 +164,12 @@ rm -rf $RPM_BUILD_ROOT
%defattr (-,root,root)
/%{_lib}/libattr.so.1*
%config %{_sysconfdir}/xattr.conf
%changelog
* Fri Oct 26 2007 - agruen@suse.de
- A large jump to the current upstream version 2.4.39.
- Fix the upstream path walking code.
- Remove the ea-conv script; this is not relevant anymore since
years.
* Wed Apr 25 2007 - agruen@suse.de
- Fix the permissions of /etc/xattr.conf.
* Mon Oct 16 2006 - agruen@suse.de

View File

@ -1,7 +1,9 @@
--- attr-2.4.28/include/builddefs.in
+++ attr-2.4.28/include/builddefs.in
@@ -30,7 +30,7 @@
PKG_DEVLIB_DIR = @libexecdir@
Index: attr-2.4.39/include/builddefs.in
===================================================================
--- attr-2.4.39.orig/include/builddefs.in
+++ attr-2.4.39/include/builddefs.in
@@ -33,7 +33,7 @@ PKG_LIB_DIR = @libdir@@libdirsuffix@
PKG_DEVLIB_DIR = @libexecdir@@libdirsuffix@
PKG_INC_DIR = @includedir@/attr
PKG_MAN_DIR = @mandir@
-PKG_DOC_DIR = @datadir@/doc/@pkg_name@

177
remove-ea-conv.diff Normal file
View File

@ -0,0 +1,177 @@
Index: attr-2.4.39/doc/Makefile
===================================================================
--- attr-2.4.39.orig/doc/Makefile
+++ attr-2.4.39/doc/Makefile
@@ -5,8 +5,6 @@
TOPDIR = ..
include $(TOPDIR)/include/builddefs
-SUBDIRS = ea-conv
-
LSRCFILES = INSTALL PORTING CHANGES COPYING
LDIRT = *.gz
Index: attr-2.4.39/doc/ea-conv/Makefile
===================================================================
--- attr-2.4.39.orig/doc/ea-conv/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# Copyright (c) 2000, 2002 Silicon Graphics, Inc. All Rights Reserved.
-#
-
-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:
Index: attr-2.4.39/doc/ea-conv/README
===================================================================
--- attr-2.4.39.orig/doc/ea-conv/README
+++ /dev/null
@@ -1,13 +0,0 @@
-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 -
-
Index: attr-2.4.39/doc/ea-conv/ea-conv
===================================================================
--- attr-2.4.39.orig/doc/ea-conv/ea-conv
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/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);

547
walk-attr.diff Normal file
View File

@ -0,0 +1,547 @@
Index: attr-2.4.39/doc/CHANGES
===================================================================
--- attr-2.4.39.orig/doc/CHANGES
+++ attr-2.4.39/doc/CHANGES
@@ -1,3 +1,13 @@
+attr-2.4.40 (?)
+ - In some cases, gcc does not link in functions from libmisc.a
+ unless libmisc is specifief before the dynamic libraries on
+ the command line.
+ - Rip out nftw tree walking, it is broken and hopeless to fix.
+ The replacement walk_tree() function does exactly what we
+ want, and is much simpler to use.
+ - Add a test case for tree walking.
+ - For some reason, test/attr.test broke.
+
attr-2.4.39 (11 September 2007)
- Fix symlink handling with getfattr, thanks to Utako Usaka.
Index: attr-2.4.39/getfattr/Makefile
===================================================================
--- attr-2.4.39.orig/getfattr/Makefile
+++ attr-2.4.39/getfattr/Makefile
@@ -8,8 +8,8 @@ include $(TOPDIR)/include/builddefs
LTCOMMAND = getfattr
CFILES = getfattr.c
-LLDLIBS = $(LIBATTR) $(LIBMISC)
-LTDEPENDENCIES = $(LIBATTR) $(LIBMISC)
+LLDLIBS = $(LIBMISC) $(LIBATTR)
+LTDEPENDENCIES = $(LIBMISC) $(LIBATTR)
default: $(LTCOMMAND)
Index: attr-2.4.39/getfattr/getfattr.c
===================================================================
--- attr-2.4.39.orig/getfattr/getfattr.c
+++ attr-2.4.39/getfattr/getfattr.c
@@ -28,11 +28,11 @@
#include <ctype.h>
#include <getopt.h>
#include <regex.h>
-#include <ftw.h>
#include <locale.h>
#include <attr/xattr.h>
#include "config.h"
+#include "walk_tree.h"
#include "misc.h"
#define CMD_LINE_OPTIONS "n:de:m:hRLP"
@@ -54,11 +54,8 @@ struct option long_options[] = {
{ NULL, 0, 0, 0 }
};
-int opt_recursive; /* recurse into sub-directories? */
-int opt_walk_logical; /* always follow symbolic links */
-int opt_walk_physical; /* never follow symbolic links */
+int walk_flags = WALK_TREE_DEREFERENCE;
int opt_dump; /* dump attribute values (or only list the names) */
-int opt_deref = 1; /* dereference symbolic links */
char *opt_name; /* dump named attributes */
char *opt_name_pattern = "^user\\."; /* include only matching names */
char *opt_encoding; /* encode values automatically (NULL), or as "text",
@@ -84,12 +81,14 @@ static const char *xquote(const char *st
int do_getxattr(const char *path, const char *name, void *value, size_t size)
{
- return (opt_deref ? getxattr : lgetxattr)(path, name, value, size);
+ return ((walk_flags & WALK_TREE_DEREFERENCE) ?
+ getxattr : lgetxattr)(path, name, value, size);
}
int do_listxattr(const char *path, char *list, size_t size)
{
- return (opt_deref ? listxattr : llistxattr)(path, list, size);
+ return ((walk_flags & WALK_TREE_DEREFERENCE) ?
+ listxattr : llistxattr)(path, list, size);
}
const char *strerror_ea(int err)
@@ -347,22 +346,14 @@ int list_attributes(const char *path, in
return 0;
}
-int do_print(const char *path, const struct stat *stat,
- int flag, struct FTW *ftw)
+int do_print(const char *path, const struct stat *stat, int walk_flags, void *unused)
{
- int saved_errno = errno;
int header_printed = 0;
- /*
- * Process the target of a symbolic link, and traverse the
- * link, only if doing a logical walk, or if the symbolic link
- * was specified on the command line. Always skip symbolic
- * links if doing a physical walk.
- */
-
- if (S_ISLNK(stat->st_mode) &&
- (opt_walk_physical || (ftw->level > 0 && !opt_walk_logical)))
- return 0;
+ if (walk_flags & WALK_TREE_FAILED) {
+ fprintf(stderr, "%s: %s: %s\n", progname, xquote(path), strerror(errno));
+ return 1;
+ }
if (opt_name)
print_attribute(path, opt_name, &header_printed);
@@ -371,21 +362,6 @@ int do_print(const char *path, const str
if (header_printed)
puts("");
-
- if (flag == FTW_DNR && opt_recursive) {
- /* Item is a directory which can't be read. */
- fprintf(stderr, "%s: %s: %s\n", progname, xquote(path),
- strerror(saved_errno));
- return 0;
- }
-
- /*
- * We also get here in non-recursive mode. In that case,
- * return something != 0 to abort nftw.
- */
-
- if (!opt_recursive)
- return 1;
return 0;
}
@@ -410,39 +386,6 @@ void help(void)
" --help this help text\n"));
}
-char *resolve_symlinks(const char *file)
-{
- static char buffer[4096];
- struct stat stat;
- char *path = NULL;
-
- if (lstat(file, &stat) == -1)
- return path;
-
- if (S_ISLNK(stat.st_mode) && !opt_walk_physical)
- path = realpath(file, buffer);
- else
- path = (char *)file; /* not a symlink, use given path */
-
- return path;
-}
-
-int walk_tree(const char *file)
-{
- const char *p;
-
- if ((p = resolve_symlinks(file)) == NULL) {
- fprintf(stderr, "%s: %s: %s\n", progname,
- xquote(file), strerror(errno));
- return 1;
- } else if (nftw(p, do_print, 0, opt_walk_logical? 0 : FTW_PHYS) < 0) {
- fprintf(stderr, "%s: %s: %s\n", progname, xquote(file),
- strerror(errno));
- return 1;
- }
- return 0;
-}
-
int main(int argc, char *argv[])
{
int opt;
@@ -478,7 +421,7 @@ int main(int argc, char *argv[])
return 0;
case 'h': /* do not dereference symlinks */
- opt_deref = 0;
+ walk_flags &= ~WALK_TREE_DEREFERENCE;
break;
case 'n': /* get named attribute */
@@ -497,17 +440,17 @@ int main(int argc, char *argv[])
break;
case 'L':
- opt_walk_logical = 1;
- opt_walk_physical = 0;
+ walk_flags |= WALK_TREE_LOGICAL;
+ walk_flags &= ~WALK_TREE_PHYSICAL;
break;
case 'P':
- opt_walk_logical = 0;
- opt_walk_physical = 1;
+ walk_flags |= WALK_TREE_PHYSICAL;
+ walk_flags &= ~WALK_TREE_LOGICAL;
break;
case 'R':
- opt_recursive = 1;
+ walk_flags |= WALK_TREE_RECURSIVE;
break;
case 'V':
@@ -531,7 +474,7 @@ int main(int argc, char *argv[])
}
while (optind < argc) {
- had_errors += walk_tree(argv[optind]);
+ had_errors += walk_tree(argv[optind], walk_flags, do_print, NULL);
optind++;
}
Index: attr-2.4.39/libmisc/Makefile
===================================================================
--- attr-2.4.39.orig/libmisc/Makefile
+++ attr-2.4.39/libmisc/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/include/builddefs
LTLIBRARY = libmisc.la
LTLDFLAGS =
-CFILES = quote.c unquote.c high_water_alloc.c next_line.c
+CFILES = quote.c unquote.c high_water_alloc.c next_line.c walk_tree.c
default: $(LTLIBRARY)
install install-dev install-lib:
Index: attr-2.4.39/setfattr/Makefile
===================================================================
--- attr-2.4.39.orig/setfattr/Makefile
+++ attr-2.4.39/setfattr/Makefile
@@ -8,8 +8,8 @@ include $(TOPDIR)/include/builddefs
LTCOMMAND = setfattr
CFILES = setfattr.c
-LLDLIBS = $(LIBATTR) $(LIBMISC)
-LTDEPENDENCIES = $(LIBATTR) $(LIBMISC)
+LLDLIBS = $(LIBMISC) $(LIBATTR)
+LTDEPENDENCIES = $(LIBMISC) $(LIBATTR)
default: $(LTCOMMAND)
Index: attr-2.4.39/test/attr.test
===================================================================
--- attr-2.4.39.orig/test/attr.test
+++ attr-2.4.39/test/attr.test
@@ -10,6 +10,9 @@ Execute this test using the `run' script
Try various valid and invalid names
+ $ mkdir d
+ $ cd d
+
$ touch f
$ setfattr -n user -v value f
> setfattr: f: Operation not supported
@@ -29,8 +32,8 @@ Try various valid and invalid names
Size checks, for an ext2/ext3 file system with a block size of 4K
$ touch f
- $ setfattr -n user.name -v 4040+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
- $ setfattr -n user.name -v 4041++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
+ $ setfattr -n user.name -v 4040++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
+ $ setfattr -n user.name -v 4041+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f
> setfattr: f: No space left on device
$ rm f
@@ -86,13 +89,6 @@ Value encodings
> user.name3=0s3vrO
>
- $ getfattr -d -e text f
- > # file: f
- > user.name="º¾"
- > user.name2="Þ­¾ï"
- > user.name3="ÞúÎ"
- >
-
$ rm f
Everything with one file
@@ -105,7 +101,7 @@ Everything with one file
$ setfattr -n user.short -v value f
$ setfattr -n user.novalue-yet f
$ ls -s f
- > 4 f
+ > 4 f
$ getfattr -d f
> # file: f
@@ -143,7 +139,7 @@ Everything with one file
$ setfattr -x user.novalue-yet f
$ getfattr -d f
$ ls -s f
- > 0 f
+ > 0 f
$ rm f
@@ -152,15 +148,15 @@ Test extended attribute block sharing
$ touch f g h
$ setfattr -n user.novalue f g h
$ ls -s f g h
- > 4 f
- > 4 g
- > 4 h
+ > 4 f
+ > 4 g
+ > 4 h
$ setfattr -n user.name -v value f
$ ls -s f g h
- > 4 f
- > 4 g
- > 4 h
+ > 4 f
+ > 4 g
+ > 4 h
$ getfattr -d f g h
> # file: f
@@ -176,15 +172,15 @@ Test extended attribute block sharing
$ setfattr -n user.name -v value g
$ ls -s f g h
- > 4 f
- > 4 g
- > 4 h
+ > 4 f
+ > 4 g
+ > 4 h
$ setfattr -x user.novalue h
$ ls -s f g h
- > 4 f
- > 4 g
- > 0 h
+ > 4 f
+ > 4 g
+ > 0 h
$ getfattr -d f g h
> # file: f
@@ -201,9 +197,9 @@ Test extended attribute block sharing
$ setfattr -x user.name f g
$ setfattr -x user.novalue f g
$ ls -s f g h
- > 0 f
- > 0 g
- > 0 h
+ > 0 f
+ > 0 g
+ > 0 h
$ rm f g h
@@ -260,6 +256,5 @@ Tests for attribute names that contains
$ setfattr -x "user.special\\007" f
$ rm f
-Some POSIX ACL tests...
-
- $ touch f
+ $ cd ..
+ $ rm -rf d
Index: attr-2.4.39/include/walk_tree.h
===================================================================
--- /dev/null
+++ attr-2.4.39/include/walk_tree.h
@@ -0,0 +1,18 @@
+#ifndef __WALK_TREE_H
+#define __WALK_TREE_H
+
+#define WALK_TREE_RECURSIVE 0x1
+#define WALK_TREE_PHYSICAL 0x2
+#define WALK_TREE_LOGICAL 0x4
+#define WALK_TREE_DEREFERENCE 0x8
+
+#define WALK_TREE_SYMLINK 0x10
+#define WALK_TREE_FAILED 0x20
+
+struct stat;
+
+extern int walk_tree(const char *path, int walk_flags,
+ int (*func)(const char *, const struct stat *, int, void *),
+ void *arg);
+
+#endif
Index: attr-2.4.39/libmisc/walk_tree.c
===================================================================
--- /dev/null
+++ attr-2.4.39/libmisc/walk_tree.c
@@ -0,0 +1,100 @@
+/*
+ File: walk_tree.c
+
+ Copyright (C) 2007 Andreas Gruenbacher <a.gruenbacher@computer.org>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include "walk_tree.h"
+
+static int walk_tree_rec(const char *path, int walk_flags,
+ int (*func)(const char *, const struct stat *, int, void *),
+ void *arg, int depth)
+{
+ int (*xstat)(const char *, struct stat *) = lstat;
+ struct stat st;
+ int local_walk_flags = walk_flags, err;
+
+ /* Default to traversing symlinks on the command line, traverse all symlinks
+ * with -L, and do not traverse symlinks with -P. (This is similar to chown.)
+ */
+
+follow_symlink:
+ if (xstat(path, &st) != 0)
+ return func(path, NULL, local_walk_flags | WALK_TREE_FAILED, arg);
+ if (S_ISLNK(st.st_mode)) {
+ if ((local_walk_flags & WALK_TREE_PHYSICAL) ||
+ (!(local_walk_flags & WALK_TREE_LOGICAL) && depth > 1))
+ return 0;
+ local_walk_flags |= WALK_TREE_SYMLINK;
+ xstat = stat;
+ if (local_walk_flags & WALK_TREE_DEREFERENCE)
+ goto follow_symlink;
+ }
+ err = func(path, &st, local_walk_flags, arg);
+ if ((local_walk_flags & WALK_TREE_RECURSIVE) &&
+ (S_ISDIR(st.st_mode) || S_ISLNK(st.st_mode))) {
+ char path2[FILENAME_MAX];
+ DIR *dir;
+ struct dirent *entry;
+ int err2;
+
+ dir = opendir(path);
+ if (!dir) {
+ /* PATH may be a symlink to a regular file or a dead symlink
+ * which we didn't follow above.
+ */
+ if (errno != ENOTDIR && errno != ENOENT)
+ err += func(path, &st,
+ local_walk_flags | WALK_TREE_FAILED, arg);
+ return err;
+ }
+ while ((entry = readdir(dir)) != NULL) {
+ if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, ".."))
+ continue;
+ err2 = snprintf(path2, sizeof(path2), "%s/%s", path,
+ entry->d_name);
+ if (err2 < 0 || err2 > FILENAME_MAX) {
+ errno = ENAMETOOLONG;
+ err += func(path, NULL,
+ local_walk_flags | WALK_TREE_FAILED, arg);
+ continue;
+ }
+ err += walk_tree_rec(path2, walk_flags, func, arg, depth + 1);
+ }
+ if (closedir(dir) != 0)
+ err += func(path, &st, local_walk_flags | WALK_TREE_FAILED, arg);
+ }
+ return err;
+}
+
+int walk_tree(const char *path, int walk_flags,
+ int (*func)(const char *, const struct stat *, int, void *), void *arg)
+{
+ if (strlen(path) >= FILENAME_MAX) {
+ errno = ENAMETOOLONG;
+ return func(path, NULL, WALK_TREE_FAILED, arg);
+ }
+ return walk_tree_rec(path, walk_flags, func, arg, 1);
+}
Index: attr-2.4.39/test/getfattr.test
===================================================================
--- /dev/null
+++ attr-2.4.39/test/getfattr.test
@@ -0,0 +1,52 @@
+ $ mkdir d
+ $ cd d
+
+ $ touch f
+ $ setfattr -n user.test -v test f
+ $ ln -s f l
+
+This case should be obvious:
+ $ getfattr -d f
+ > # file: f
+ > user.test="test"
+ >
+
+If a symlink is explicitly specified on the command line, follow it
+(-H behavior):
+ $ getfattr -d l
+ > # file: l
+ > user.test="test"
+ >
+
+Unless we are explicitly told not to dereference symlinks:
+ $ getfattr -hd l
+
+When walking a tree, it does not make sense to follow symlinks. We should
+only see f's attributes here -- that's a bug:
+ $ getfattr -Rd .
+ > # file: f
+ > user.test="test"
+ >
+
+This case works as expected:
+ $ getfattr -Rhd .
+ > # file: f
+ > user.test="test"
+ >
+
+In these two cases, getfattr should dereference the symlink passed on the
+command line, but not l. This doesn't work correctly, either; it's the same
+bug:
+ $ ln -s . here
+ $ getfattr -Rd here
+ > # file: here/f
+ > user.test="test"
+ >
+
+ $ getfattr -Rhd here
+ > # file: here/f
+ > user.test="test"
+ >
+
+ $ cd ..
+ $ rm -rf d

View File

@ -1,20 +1,20 @@
Index: attr-2.4.28/libattr/Makefile
Index: attr-2.4.39/libattr/Makefile
===================================================================
--- attr-2.4.28.orig/libattr/Makefile
+++ attr-2.4.28/libattr/Makefile
@@ -13,7 +13,7 @@ LT_CURRENT = 2
--- attr-2.4.39.orig/libattr/Makefile
+++ attr-2.4.39/libattr/Makefile
@@ -12,7 +12,7 @@ LT_CURRENT = 2
LT_REVISION = 0
LT_AGE = 1
-CFILES = libattr.c syscalls.c attr_copy_fd.c attr_copy_file.c attr_copy_check.c
+CFILES = libattr.c syscalls.c attr_copy_fd.c attr_copy_file.c attr_copy_check.c attr_copy_action.c
-CFILES = libattr.c attr_copy_fd.c attr_copy_file.c attr_copy_check.c
+CFILES = libattr.c attr_copy_fd.c attr_copy_file.c attr_copy_check.c attr_copy_action.c
HFILES = libattr.h
LCFLAGS = -include libattr.h
Index: attr-2.4.28/libattr/attr_copy_action.c
ifeq ($(PKG_PLATFORM),linux)
Index: attr-2.4.39/libattr/attr_copy_action.c
===================================================================
--- /dev/null
+++ attr-2.4.28/libattr/attr_copy_action.c
+++ attr-2.4.39/libattr/attr_copy_action.c
@@ -0,0 +1,163 @@
+/* Copyright (C) 2006 Andreas Gruenbacher <agruen@suse.de>, SuSE Linux AG.
+
@ -179,11 +179,11 @@ Index: attr-2.4.28/libattr/attr_copy_action.c
+ }
+ return 0;
+}
Index: attr-2.4.28/libattr/attr_copy_fd.c
Index: attr-2.4.39/libattr/attr_copy_fd.c
===================================================================
--- attr-2.4.28.orig/libattr/attr_copy_fd.c
+++ attr-2.4.28/libattr/attr_copy_fd.c
@@ -120,7 +120,7 @@ attr_copy_fd(const char *src_path, int s
--- attr-2.4.39.orig/libattr/attr_copy_fd.c
+++ attr-2.4.39/libattr/attr_copy_fd.c
@@ -119,7 +119,7 @@ attr_copy_fd(const char *src_path, int s
quote_free (ctx, qname);
quote_free (ctx, qpath);
ret = -1;
@ -192,7 +192,7 @@ Index: attr-2.4.28/libattr/attr_copy_fd.c
}
value = (char *) realloc (old_value = value, size);
if (size != 0 && value == NULL) {
@@ -137,6 +137,7 @@ attr_copy_fd(const char *src_path, int s
@@ -136,6 +136,7 @@ attr_copy_fd(const char *src_path, int s
quote_free (ctx, qname);
quote_free (ctx, qpath);
ret = -1;
@ -200,11 +200,11 @@ Index: attr-2.4.28/libattr/attr_copy_fd.c
}
if (fsetxattr (dst_fd, name, value, size, 0) != 0) {
if (errno == ENOTSUP)
Index: attr-2.4.28/libattr/attr_copy_file.c
Index: attr-2.4.39/libattr/attr_copy_file.c
===================================================================
--- attr-2.4.28.orig/libattr/attr_copy_file.c
+++ attr-2.4.28/libattr/attr_copy_file.c
@@ -118,7 +118,7 @@ attr_copy_file(const char *src_path, con
--- attr-2.4.39.orig/libattr/attr_copy_file.c
+++ attr-2.4.39/libattr/attr_copy_file.c
@@ -117,7 +117,7 @@ attr_copy_file(const char *src_path, con
quote_free (ctx, qname);
quote_free (ctx, qpath);
ret = -1;
@ -213,7 +213,7 @@ Index: attr-2.4.28/libattr/attr_copy_file.c
}
value = (char *) realloc (old_value = value, size);
if (size != 0 && value == NULL) {
@@ -135,6 +135,7 @@ attr_copy_file(const char *src_path, con
@@ -134,6 +134,7 @@ attr_copy_file(const char *src_path, con
quote_free (ctx, qname);
quote_free (ctx, qpath);
ret = -1;
@ -221,10 +221,10 @@ Index: attr-2.4.28/libattr/attr_copy_file.c
}
if (lsetxattr (dst_path, name, value, size, 0) != 0) {
if (errno == ENOTSUP)
Index: attr-2.4.28/libattr/attr_copy_check.c
Index: attr-2.4.39/libattr/attr_copy_check.c
===================================================================
--- attr-2.4.28.orig/libattr/attr_copy_check.c
+++ attr-2.4.28/libattr/attr_copy_check.c
--- attr-2.4.39.orig/libattr/attr_copy_check.c
+++ attr-2.4.39/libattr/attr_copy_check.c
@@ -23,32 +23,6 @@
int
attr_copy_check_permissions(const char *name, struct error_context *ctx)
@ -259,10 +259,10 @@ Index: attr-2.4.28/libattr/attr_copy_check.c
+ return attr_copy_action(name, ctx) == 0;
}
Index: attr-2.4.28/include/libattr.h
Index: attr-2.4.39/include/libattr.h
===================================================================
--- attr-2.4.28.orig/include/libattr.h
+++ attr-2.4.28/include/libattr.h
--- attr-2.4.39.orig/include/libattr.h
+++ attr-2.4.39/include/libattr.h
@@ -14,9 +14,14 @@ extern int attr_copy_fd (const char *, i
int (*) (const char *, struct error_context *),
struct error_context *);

View File

@ -1,31 +0,0 @@
Date: Thu, Feb 16 2006 14:16:37 +1100
From: Nathan Scott <nathans@sgi.com>
References: 151782, SGI:PV948880
Subject: skip DMF attributes on copy also
Do not copy SGI DMI (data migration) attributes as well.
===========================================================================
Index: attr/libattr/attr_copy_check.c
===========================================================================
--- a/attr/libattr/attr_copy_check.c 2006-02-16 13:47:35.000000000 +1100
+++ b/attr/libattr/attr_copy_check.c 2006-02-16 13:47:35.000000000 +1100
@@ -30,12 +30,15 @@ attr_copy_check_permissions(const char *
return 0;
/* Skip permissions attributes which are used on IRIX, and
- hence are part of the XFS ondisk format (incl. ACLs). */
+ hence are part of the XFS ondisk format (incl. ACLs).
+ Also skip SGI DMF attributes as they are inappropriate
+ targets for copying over as well. */
if (strncmp(name, "trusted.SGI_", 12) == 0 &&
(strcmp(name+12, "ACL_DEFAULT") == 0 ||
strcmp(name+12, "ACL_FILE") == 0 ||
strcmp(name+12, "CAP_FILE") == 0 ||
- strcmp(name+12, "MAC_FILE") == 0))
+ strcmp(name+12, "MAC_FILE") == 0 ||
+ strncmp(name+12, "DMI_", 4) == 0))
return 0;
/* The xfsroot namespace mirrored attributes, some of which

View File

@ -1,81 +0,0 @@
Date: Wed, Feb 22 2006 13:56:35 +1100
From: Nathan Scott <nathans@sgi.com>
References: SGI:PV949977
Subject: fix list_attr segfault
Fix a possible segfault from the attr list compat interfaces,
thanks to Simon Munton.
===========================================================================
Index: attr/libattr/libattr.c
===========================================================================
--- a/attr/libattr/libattr.c 2006-02-22 13:28:37.000000000 +1100
+++ b/attr/libattr/libattr.c 2006-02-22 13:28:37.000000000 +1100
@@ -268,7 +268,7 @@ attr_list(const char *path, char *buffer
attrlist_cursor_t *cursor)
{
const char *l;
- int length, count = 0;
+ int length, vlength, count = 0;
char lbuf[MAXLISTLEN];
char name[MAXNAMELEN+16];
unsigned int start_offset, end_offset;
@@ -293,14 +293,14 @@ attr_list(const char *path, char *buffer
if (api_unconvert(name, l, flags))
continue;
if (flags & ATTR_DONTFOLLOW)
- length = lgetxattr(path, l, NULL, 0);
+ vlength = lgetxattr(path, l, NULL, 0);
else
- length = getxattr(path, l, NULL, 0);
- if (length < 0 && (errno == ENOATTR || errno == ENOTSUP))
+ vlength = getxattr(path, l, NULL, 0);
+ if (vlength < 0 && (errno == ENOATTR || errno == ENOTSUP))
continue;
if (count++ < cursor->opaque[0])
continue;
- if (attr_list_pack(name, length, buffer, buffersize,
+ if (attr_list_pack(name, vlength, buffer, buffersize,
&start_offset, &end_offset)) {
cursor->opaque[0] = count;
break;
@@ -314,7 +314,7 @@ attr_listf(int fd, char *buffer, const i
attrlist_cursor_t *cursor)
{
const char *l;
- int c, count = 0;
+ int length, vlength, count = 0;
char lbuf[MAXLISTLEN];
char name[MAXNAMELEN+16];
unsigned int start_offset, end_offset;
@@ -325,22 +325,22 @@ attr_listf(int fd, char *buffer, const i
}
bzero(buffer, sizeof(attrlist_t));
- c = flistxattr(fd, lbuf, sizeof(lbuf));
- if (c < 0)
- return c;
+ length = flistxattr(fd, lbuf, sizeof(lbuf));
+ if (length < 0)
+ return length;
start_offset = sizeof(attrlist_t);
end_offset = buffersize & ~(8-1); /* 8 byte align */
- for (l = lbuf; l != lbuf + c; l = strchr(l, '\0') + 1) {
+ for (l = lbuf; l != lbuf + length; l = strchr(l, '\0') + 1) {
if (api_unconvert(name, l, flags))
continue;
- c = fgetxattr(fd, l, NULL, 0);
- if (c < 0 && (errno == ENOATTR || errno == ENOTSUP))
+ vlength = fgetxattr(fd, l, NULL, 0);
+ if (vlength < 0 && (errno == ENOATTR || errno == ENOTSUP))
continue;
if (count++ < cursor->opaque[0])
continue;
- if (attr_list_pack(name, c, buffer, buffersize,
+ if (attr_list_pack(name, vlength, buffer, buffersize,
&start_offset, &end_offset)) {
cursor->opaque[0] = count;
break;