You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(23) |
Sep
(3) |
Oct
(28) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
(11) |
Jun
(4) |
Jul
(5) |
Aug
(4) |
Sep
|
Oct
|
Nov
(7) |
Dec
(6) |
2008 |
Jan
(8) |
Feb
(5) |
Mar
|
Apr
(5) |
May
(1) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(7) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Richard D. <ric...@us...> - 2012-06-17 09:09:22
|
Update of /cvsroot/file-extattr/File-Attributes-Extended In directory vz-cvs-3.sog:/tmp/cvs-serv7788 Added Files: 000_MOVED_TO_GITHUB Log Message: Moved the source code to Github --- NEW FILE: 000_MOVED_TO_GITHUB --- The source code for this module is now at Github: https://github.com/richdawe/file-attributes-extended |
From: Richard D. <ric...@us...> - 2012-06-17 09:08:18
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory vz-cvs-3.sog:/tmp/cvs-serv7757 Added Files: 000_MOVED_TO_GITHUB Log Message: Moved the source code to Github --- NEW FILE: 000_MOVED_TO_GITHUB --- The source code for this module is now at Github: https://github.com/richdawe/file-extattr |
From: Richard D. <ric...@us...> - 2011-08-06 09:23:06
|
Update of /cvsroot/file-extattr/File-ExtAttr/lib/File In directory vz-cvs-3.sog:/tmp/cvs-serv5414/lib/File Modified Files: ExtAttr.pm Log Message: Bump version to 1.10. Add a note about the XATTR_CREATE bug for ext4 on Linux. Index: ExtAttr.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/lib/File/ExtAttr.pm,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** ExtAttr.pm 5 Mar 2009 06:42:20 -0000 1.35 --- ExtAttr.pm 6 Aug 2011 09:23:04 -0000 1.36 *************** *** 179,183 **** ); ! our $VERSION = '1.09'; #this is used by getxattr(), needs documentation --- 179,183 ---- ); ! our $VERSION = '1.10'; #this is used by getxattr(), needs documentation *************** *** 253,256 **** --- 253,263 ---- If your code relies on the C<create> behaviour, it may be insecure on *BSD. + Note that there is a bug in Linux's ext4 filesystem that prevents + the C<create> option from working correctly. On ext4 filesystems, + C<create> will not prevent pre-existing attributes from being overwritten. + This bug was found in April 2011. See + L<http://www.spinics.net/lists/linux-fsdevel/msg43989.html> for more details. + This bug may be fixed in Linux 2.6.39 or 3.0. + =cut *************** *** 442,446 **** Copyright (C) 2005 by Kevin M. Goess ! Copyright (C) 2005, 2006, 2007, 2008 by Richard Dawe This library is free software; you can redistribute it and/or modify --- 449,453 ---- Copyright (C) 2005 by Kevin M. Goess ! Copyright (C) 2005, 2006, 2007, 2008, 2009, 2011 by Richard Dawe This library is free software; you can redistribute it and/or modify |
From: Richard D. <ric...@us...> - 2011-08-06 09:12:32
|
Update of /cvsroot/file-extattr/File-ExtAttr/scripts In directory vz-cvs-3.sog:/tmp/cvs-serv1877 Added Files: create-test-fs destroy-test-fs options-test-fs Removed Files: mkext3loopback Log Message: Add some helper scripts for creating a test ext2 filesystem on Linux --- NEW FILE: options-test-fs --- IMAGE=image.ext2 LABEL=file-extattr MOUNTPOINT=ext2-test-filesystem --- mkext3loopback DELETED --- --- NEW FILE: destroy-test-fs --- #!/bin/sh SCRIPTSDIR=`dirname $0` . $SCRIPTSDIR/options-test-fs set -e set -x sudo umount $MOUNTPOINT rmdir $MOUNTPOINT rm -f $IMAGE --- NEW FILE: create-test-fs --- #!/bin/sh SCRIPTSDIR=`dirname $0` . $SCRIPTSDIR/options-test-fs set -e set -x sudo umount $MOUNTPOINT || true dd if=/dev/zero of=$IMAGE bs=1024 count=102400 /sbin/mkfs.ext2 -F -L $LABEL $IMAGE mkdir -p $MOUNTPOINT sudo mount -o loop,user_xattr -t ext2 $IMAGE $MOUNTPOINT |
From: Richard D. <ric...@us...> - 2009-03-07 10:27:37
|
Update of /cvsroot/file-extattr/File-ExtAttr/scripts In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4846/scripts Added Files: mkext3loopback Log Message: Script for testing loopback ext3 filesystem mounted with nouser_xattr --- NEW FILE: mkext3loopback --- #!/bin/sh IMAGE=image.ext3 LABEL=file-extattr dd if=/dev/zero of=$IMAGE bs=1024 count=102400 /sbin/mkfs.ext3 -L $LABEL $IMAGE cat <<EOT Now mount $IMAGE like so: mkdir -p /tmp/foo su - mount -o loop,nouser_xattr -t ext3 $IMAGE /tmp/foo EOT |
From: Richard D. <ric...@us...> - 2009-03-07 10:26:47
|
Update of /cvsroot/file-extattr/File-ExtAttr/scripts In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4611/scripts Log Message: Directory /cvsroot/file-extattr/File-ExtAttr/scripts added to the repository |
From: Richard D. <ric...@us...> - 2009-03-07 10:24:33
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3863 Modified Files: Changes Makefile.PL Log Message: Fix #34394: "Test suite should skip on filesystems with no xattr support when run non-interactively" on Linux. Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Changes 5 Mar 2009 06:42:20 -0000 1.47 --- Changes 7 Mar 2009 10:24:25 -0000 1.48 *************** *** 1,5 **** Revision history for Perl extension File::ExtAttr. ! 1.09 2009-03-?? - (richdawe) Add note to README about needing to install --- 1,5 ---- Revision history for Perl extension File::ExtAttr. ! 1.09 2009-03-07 - (richdawe) Add note to README about needing to install *************** *** 14,17 **** --- 14,24 ---- Document issue. + - (richdawe) Fix #34394: "Test suite should skip on filesystems + with no xattr support when run non-interactively" + on Linux. + + When run interactively, it will suggest what you need + to do, to get the test suite to pass. + - (richdawe) Fix RT #37889: "Crash when operating on a closed file handle on Solaris". This was due to using an uninitialised Index: Makefile.PL =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Makefile.PL,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile.PL 24 Feb 2008 10:17:48 -0000 1.10 --- Makefile.PL 7 Mar 2009 10:24:25 -0000 1.11 *************** *** 2,5 **** --- 2,8 ---- use ExtUtils::MakeMaker; use Devel::CheckLib; + use Cwd; + use File::Temp qw/tempdir/; + use IO::File; use strict; *************** *** 48,51 **** --- 51,79 ---- } + # Check whether extended attributes are supported on this filesystem. + # If we're running non-interactive there is no point failing all the tests, + # because the machine is not set up correctly. + if ($^O eq 'linux') { + my $basedir = $ENV{ATTR_TEST_DIR} || getcwd(); + my $template .= "$basedir/XXXXXXXX"; + my $dir = tempdir($template, CLEANUP => 1); + my $file = "$dir/testfile"; + my $fh = new IO::File(">$file") or die "Unable to open $file: $!"; + undef $fh; + + my $output = `setfattr -n user.foo -v foo $file 2>&1`; + if ($output =~ /command not found/i) { + warn "Please install the attr package (containing the setfattr program)"; + exit(0) if ($ENV{AUTOMATED_TESTING}); + } + if ($output =~ /Operation not supported/i) { + warn "To run the tests, you need mount the filesystem containing $basedir with the user_xattr option"; + warn "Alternatively set the environment variable ATTR_TEST_DIR to point at a filesystem where user_xattr is enabled"; + exit(0) if ($ENV{AUTOMATED_TESTING}); + } + } + + # TODO: Check filesystem on other operating systems + # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. |
From: Richard D. <ric...@us...> - 2009-03-05 06:42:33
|
Update of /cvsroot/file-extattr/File-ExtAttr/t In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20501/t Modified Files: 12empty.t Log Message: Fix RT #31970: "OS X: setfattr fails to set empty value". According to the CPAN Testers results, this works on Mac OS X 10.5. Skip the "empty" tests on Mac OS X 10.4 and earlier. Document issue. Index: 12empty.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/12empty.t,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 12empty.t 6 Apr 2008 09:12:47 -0000 1.2 --- 12empty.t 5 Mar 2009 06:42:20 -0000 1.3 *************** *** 10,13 **** --- 10,14 ---- use strict; use Test::More; + use Config; BEGIN { *************** *** 20,23 **** --- 21,26 ---- if (t::Support::should_skip()) { plan skip_all => 'Tests unsupported on this OS/filesystem'; + } elsif (($Config{osname} eq 'darwin') && ($Config{osvers} =~ m/^[0-8]\./)) { + plan skip_all => "Mac OS X 10.4 and earlier don't support empty values"; } else { plan tests => 12; |
From: Richard D. <ric...@us...> - 2009-03-05 06:42:26
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20501 Modified Files: Changes Log Message: Fix RT #31970: "OS X: setfattr fails to set empty value". According to the CPAN Testers results, this works on Mac OS X 10.5. Skip the "empty" tests on Mac OS X 10.4 and earlier. Document issue. Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Changes 5 Mar 2009 06:20:07 -0000 1.46 --- Changes 5 Mar 2009 06:42:20 -0000 1.47 *************** *** 1,5 **** Revision history for Perl extension File::ExtAttr. ! 1.09 2009-03-05 - (richdawe) Add note to README about needing to install --- 1,5 ---- Revision history for Perl extension File::ExtAttr. ! 1.09 2009-03-?? - (richdawe) Add note to README about needing to install *************** *** 7,10 **** --- 7,17 ---- and <attr/xattr.h>. + - (richdawe) Fix RT #31970: "OS X: setfattr fails to set empty value". + According to the CPAN Testers results, this works + on Mac OS X 10.5. + + Skip the "empty" tests on Mac OS X 10.4 and earlier. + Document issue. + - (richdawe) Fix RT #37889: "Crash when operating on a closed file handle on Solaris". This was due to using an uninitialised |
From: Richard D. <ric...@us...> - 2009-03-05 06:42:26
|
Update of /cvsroot/file-extattr/File-ExtAttr/lib/File In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20501/lib/File Modified Files: ExtAttr.pm Log Message: Fix RT #31970: "OS X: setfattr fails to set empty value". According to the CPAN Testers results, this works on Mac OS X 10.5. Skip the "empty" tests on Mac OS X 10.4 and earlier. Document issue. Index: ExtAttr.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/lib/File/ExtAttr.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** ExtAttr.pm 27 Oct 2008 13:58:34 -0000 1.34 --- ExtAttr.pm 5 Mar 2009 06:42:20 -0000 1.35 *************** *** 349,352 **** --- 349,357 ---- None + =head1 BUGS + + You cannot set empty attributes on Mac OS X 10.4 and earlier. + This is a bug in Darwin, rather than File::ExtAttr. + =head1 SEE ALSO |
From: Richard D. <ric...@us...> - 2009-03-05 06:20:22
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7727 Modified Files: Changes extattr_solaris.c Log Message: Fix RT #37889: "Crash when operating on a closed file handle on Solaris". This was due to using an uninitialised directory handle. Index: extattr_solaris.c =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/extattr_solaris.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** extattr_solaris.c 19 Jul 2008 09:55:14 -0000 1.8 --- extattr_solaris.c 5 Mar 2009 06:20:07 -0000 1.9 *************** *** 172,176 **** int saved_errno = 0; int ret = 0; /* Not by default */ ! DIR *dirp; if (attrdirfd == -1) --- 172,176 ---- int saved_errno = 0; int ret = 0; /* Not by default */ ! DIR *dirp = NULL; if (attrdirfd == -1) Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** Changes 27 Oct 2008 13:58:34 -0000 1.45 --- Changes 5 Mar 2009 06:20:07 -0000 1.46 *************** *** 1,5 **** Revision history for Perl extension File::ExtAttr. ! 1.09 2008-??-?? - (richdawe) Add note to README about needing to install --- 1,5 ---- Revision history for Perl extension File::ExtAttr. ! 1.09 2009-03-05 - (richdawe) Add note to README about needing to install *************** *** 7,10 **** --- 7,14 ---- and <attr/xattr.h>. + - (richdawe) Fix RT #37889: "Crash when operating on a closed file handle + on Solaris". This was due to using an uninitialised + directory handle. + 1.08 2008-08-19 |
From: Richard D. <ric...@us...> - 2008-10-27 13:58:42
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11321 Modified Files: Changes META.yml README Log Message: Bump version to 1.09. Add note for Linux builds about installing libattr-devel for xattr headers. Index: README =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/README,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** README 26 Jan 2008 08:28:33 -0000 1.16 --- README 27 Oct 2008 13:58:34 -0000 1.17 *************** *** 1,3 **** ! File-ExtAttr version 1.08 ========================= --- 1,3 ---- ! File-ExtAttr version 1.09 ========================= *************** *** 42,45 **** --- 42,51 ---- DEPENDENCIES + On Linux, you will need to install the package that provides + the header files <attr/attributes.h> and <attr/xattr.h>. On Fedora + you can install these as follows: + + yum -y install libattr-devel + This module requires these other modules: Index: META.yml =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/META.yml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** META.yml 21 Dec 2007 16:52:12 -0000 1.10 --- META.yml 27 Oct 2008 13:58:34 -0000 1.11 *************** *** 1,5 **** # http://module-build.sourceforge.net/META-spec.html name: File-ExtAttr ! version: 1.08 version_from: lib/File/ExtAttr.pm installdirs: site --- 1,5 ---- # http://module-build.sourceforge.net/META-spec.html name: File-ExtAttr ! version: 1.09 version_from: lib/File/ExtAttr.pm installdirs: site Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** Changes 19 Jul 2008 09:55:14 -0000 1.44 --- Changes 27 Oct 2008 13:58:34 -0000 1.45 *************** *** 1,4 **** --- 1,10 ---- Revision history for Perl extension File::ExtAttr. + 1.09 2008-??-?? + + - (richdawe) Add note to README about needing to install + package that provides the headers <attr/attributes.h> + and <attr/xattr.h>. + 1.08 2008-08-19 |
From: Richard D. <ric...@us...> - 2008-10-27 13:58:39
|
Update of /cvsroot/file-extattr/File-ExtAttr/lib/File In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11321/lib/File Modified Files: ExtAttr.pm Log Message: Bump version to 1.09. Add note for Linux builds about installing libattr-devel for xattr headers. Index: ExtAttr.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/lib/File/ExtAttr.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** ExtAttr.pm 19 Jul 2008 09:55:15 -0000 1.33 --- ExtAttr.pm 27 Oct 2008 13:58:34 -0000 1.34 *************** *** 179,183 **** ); ! our $VERSION = '1.08'; #this is used by getxattr(), needs documentation --- 179,183 ---- ); ! our $VERSION = '1.09'; #this is used by getxattr(), needs documentation |
From: Richard D. <ric...@us...> - 2008-07-19 09:55:10
|
Update of /cvsroot/file-extattr/File-ExtAttr/lib/File In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22738/lib/File Modified Files: ExtAttr.pm Log Message: Update Solaris layer to use new error reporting convention. Ignore SUNWattr_r[ow] system extensible attributes on (Open)Solaris. Added doc ref to Solaris system extensible attributes. Test listfattr() on a closed file. Index: ExtAttr.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/lib/File/ExtAttr.pm,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** ExtAttr.pm 26 Jan 2008 08:46:59 -0000 1.32 --- ExtAttr.pm 19 Jul 2008 09:55:15 -0000 1.33 *************** *** 417,420 **** --- 417,428 ---- L<http://docsun.cites.uiuc.edu/sun_docs/C/solaris_9/SUNWaman/hman5/fsattr.5.html> + Solaris also has extensible system attributes, which are used + by Solaris's CIFS support on ZFS, and have a confusingly similar + name to extended file attributes. These system attributes are stored + in extended file attributes called SUNWattr_ro and SUNWattr_rw. + See PSARC 2007/315 for more details: + + L<http://opensolaris.org/os/community/arc/caselog/2007/315/spec-final-txt/> + =back |
From: Richard D. <ric...@us...> - 2008-07-19 09:55:10
|
Update of /cvsroot/file-extattr/File-ExtAttr/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22738/t Modified Files: 18list.t 20tie-basic.t 22tie-nonuser.t 30nsbasic.t 31nsmultiple.t Added Files: 81closed.t Log Message: Update Solaris layer to use new error reporting convention. Ignore SUNWattr_r[ow] system extensible attributes on (Open)Solaris. Added doc ref to Solaris system extensible attributes. Test listfattr() on a closed file. Index: 18list.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/18list.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 18list.t 6 Apr 2008 09:12:48 -0000 1.5 --- 18list.t 19 Jul 2008 09:55:15 -0000 1.6 *************** *** 64,68 **** # Check that the list contains all the attributes. my @attrs = listfattr($_); ! @attrs = sort @attrs; my @ks = sort keys %vals; --- 64,68 ---- # Check that the list contains all the attributes. my @attrs = listfattr($_); ! @attrs = sort(t::Support::filter_system_attrs(@attrs)); my @ks = sort keys %vals; *************** *** 105,109 **** # Check that the list contains all the attributes. my @attrs = listfattr($fh); ! @attrs = sort @attrs; my @ks = sort keys %vals; --- 105,109 ---- # Check that the list contains all the attributes. my @attrs = listfattr($fh); ! @attrs = sort(t::Support::filter_system_attrs(@attrs)); my @ks = sort keys %vals; Index: 31nsmultiple.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/31nsmultiple.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 31nsmultiple.t 6 Apr 2008 09:12:48 -0000 1.5 --- 31nsmultiple.t 19 Jul 2008 09:55:15 -0000 1.6 *************** *** 10,13 **** --- 10,14 ---- use strict; use Test::More; + use Data::Dumper; BEGIN { *************** *** 21,25 **** plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 40; } --- 22,26 ---- plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 42; } *************** *** 97,102 **** #check user namespace doesn't exist now ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); #} } --- 98,108 ---- #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($_); ! ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); ! } #} } *************** *** 145,152 **** #check that it's gone is (getfattr($fh, "$key", { namespace => 'user' }), undef); #check user namespace doesn't exist now ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); #} #print STDERR "done\n"; --- 151,165 ---- #check that it's gone is (getfattr($fh, "$key", { namespace => 'user' }), undef); + is (getfattr($fh, "$key2", { namespace => 'user' }), undef); + is (getfattr($fh, "$key3", { namespace => 'user' }), undef); #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($fh); ! ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); ! } #} #print STDERR "done\n"; Index: 30nsbasic.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/30nsbasic.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** 30nsbasic.t 6 Apr 2008 09:12:48 -0000 1.7 --- 30nsbasic.t 19 Jul 2008 09:55:15 -0000 1.8 *************** *** 79,84 **** #check user namespace doesn't exist now ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); #} } --- 79,89 ---- #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($_); ! ! @ns = listfattrns($_); ! is (grep(/^user$/, @ns), 0); ! } #} } *************** *** 116,121 **** #check user namespace doesn't exist now ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); #} #print STDERR "done\n"; --- 121,131 ---- #check user namespace doesn't exist now ! SKIP: { ! skip "Unremoveable user attributes prevent testing namespace removal", ! 1 if t::Support::has_system_attrs($fh); ! ! @ns = listfattrns($fh); ! is (grep(/^user$/, @ns), 0); ! } #} #print STDERR "done\n"; --- NEW FILE: 81closed.t --- #!perl -w # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Linux-xattr.t' ########################## # change 'tests => 2' to 'tests => last_test_to_print'; use strict; use Test::More; use Data::Dumper; BEGIN { my $tlib = $0; $tlib =~ s|/[^/]*$|/lib|; push(@INC, $tlib); } use t::Support; if (t::Support::should_skip()) { plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { plan tests => 1; } use File::Temp qw(tempfile); use File::Path; use File::ExtAttr qw(setfattr getfattr delfattr listfattrns); use IO::File; my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); close $fh or die "can't close $filename $!"; # This shouldn't crash. my @ns = listfattrns($fh); ok 1; END { unlink $filename if $filename; }; Index: 20tie-basic.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/20tie-basic.t,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** 20tie-basic.t 6 Apr 2008 09:12:48 -0000 1.10 --- 20tie-basic.t 19 Jul 2008 09:55:15 -0000 1.11 *************** *** 44,47 **** --- 44,48 ---- # Check there are no user extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == 0); *************** *** 83,86 **** --- 84,88 ---- # Check there are only our extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == scalar(keys(%test_attrs))); print '# '.join(' ', @ks)."\n"; Index: 22tie-nonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/22tie-nonuser.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** 22tie-nonuser.t 6 Apr 2008 09:21:27 -0000 1.7 --- 22tie-nonuser.t 19 Jul 2008 09:55:15 -0000 1.8 *************** *** 44,47 **** --- 44,48 ---- # Check there are no user extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == 0); *************** *** 92,95 **** --- 93,97 ---- # Check there are only our extattrs. @ks = keys(%extattr); + @ks = t::Support::filter_system_attrs(@ks); ok(scalar(@ks) == 0); print '# '.join(' ', @ks)."\n"; |
From: Richard D. <ric...@us...> - 2008-07-19 09:55:09
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22738 Modified Files: Changes MANIFEST TODO extattr_solaris.c Log Message: Update Solaris layer to use new error reporting convention. Ignore SUNWattr_r[ow] system extensible attributes on (Open)Solaris. Added doc ref to Solaris system extensible attributes. Test listfattr() on a closed file. Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Changes 15 Jun 2008 10:22:40 -0000 1.43 --- Changes 19 Jul 2008 09:55:14 -0000 1.44 *************** *** 1,5 **** Revision history for Perl extension File::ExtAttr. ! 1.08 2008-??-?? - (richdawe) Add a typemap for usage of "const char *" in the XS. --- 1,5 ---- Revision history for Perl extension File::ExtAttr. ! 1.08 2008-08-19 - (richdawe) Add a typemap for usage of "const char *" in the XS. *************** *** 20,27 **** system calls is propagated into $! (#32679, #32680). - XXX: This is incomplete: - - Test on Solaris. - - Make sure I've actually addressed API concerns in #32670. - - (richdawe) File::ExtAttr no longer generate noisy warnings when an xattr system call fails. All error reporting --- 20,23 ---- *************** *** 30,34 **** - (richdawe) Operations with non-default or non-"user" namespaces will now fail with EOPNOTSUPP instead of ENOATTR ! on Mac OS X and *BSD. This behaviour is like Linux. 1.07 2007-12-15 --- 26,35 ---- - (richdawe) Operations with non-default or non-"user" namespaces will now fail with EOPNOTSUPP instead of ENOATTR ! on Mac OS X, *BSD and Solaris. This behaviour ! matches the behaviour on Linux. ! ! - (richdawe) Added a note to the documentation about Solaris ! extensible system attributes, which are different ! to extended file attributes. 1.07 2007-12-15 Index: extattr_solaris.c =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/extattr_solaris.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** extattr_solaris.c 2 Oct 2006 20:05:22 -0000 1.7 --- extattr_solaris.c 19 Jul 2008 09:55:14 -0000 1.8 *************** *** 29,33 **** ok = 0; ! return ok ? 0 : -1; } --- 29,33 ---- ok = 0; ! return ok ? 0 : -errno; } *************** *** 72,76 **** errno = saved_errno; ! return ok ? sz : -1; } --- 72,76 ---- errno = saved_errno; ! return ok ? sz : -errno; } *************** *** 95,99 **** errno = saved_errno; ! return ok ? sz : -1; } --- 95,99 ---- errno = saved_errno; ! return ok ? sz : -errno; } *************** *** 110,114 **** --- 110,120 ---- if (ok) + { dirp = fdopendir(attrdirfd); + if (dirp == NULL) + { + ok = 0; + } + } if (ok) *************** *** 129,133 **** if ((len + namelen + 1) > buflen) { ! errno = ERANGE; ok = 0; break; --- 135,139 ---- if ((len + namelen + 1) > buflen) { ! saved_errno = errno = ERANGE; ok = 0; break; *************** *** 158,162 **** errno = saved_errno; ! return ok ? len : -1; } --- 164,168 ---- errno = saved_errno; ! return ok ? len : -errno; } *************** *** 172,176 **** --- 178,188 ---- if (ret >= 0) + { dirp = fdopendir(attrdirfd); + if (dirp == NULL) + { + ret = -1; + } + } if (ret >= 0) *************** *** 199,203 **** errno = saved_errno; ! return ret; } --- 211,215 ---- errno = saved_errno; ! return (ret >= 0) ? ret : -errno; } *************** *** 226,230 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } --- 238,242 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ok = 0; } *************** *** 246,250 **** errno = saved_errno; ! return ok ? 0 : -1; } --- 258,262 ---- errno = saved_errno; ! return ok ? 0 : -errno; } *************** *** 272,276 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } --- 284,288 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ok = 0; } *************** *** 292,296 **** errno = saved_errno; ! return ok ? 0 : -1; } --- 304,308 ---- errno = saved_errno; ! return ok ? 0 : -errno; } *************** *** 307,311 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } --- 319,323 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ok = 0; } *************** *** 314,318 **** attrfd = attropen(path, attrname, O_RDONLY); ! return ok ? readclose(attrfd, attrvalue, slen) : -1; } --- 326,330 ---- attrfd = attropen(path, attrname, O_RDONLY); ! return ok ? readclose(attrfd, attrvalue, slen) : -errno; } *************** *** 329,333 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } --- 341,345 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ok = 0; } *************** *** 336,340 **** attrfd = openat(fd, attrname, O_RDONLY|O_XATTR); ! return ok ? readclose(attrfd, attrvalue, slen) : -1; } --- 348,352 ---- attrfd = openat(fd, attrname, O_RDONLY|O_XATTR); ! return ok ? readclose(attrfd, attrvalue, slen) : -errno; } *************** *** 349,353 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } --- 361,365 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ok = 0; } *************** *** 356,360 **** attrdirfd = attropen(path, ".", O_RDONLY); ! return ok ? unlinkclose(attrdirfd, attrname) : -1; } --- 368,372 ---- attrdirfd = attropen(path, ".", O_RDONLY); ! return ok ? unlinkclose(attrdirfd, attrname) : -errno; } *************** *** 369,373 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } --- 381,385 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ok = 0; } *************** *** 376,380 **** attrdirfd = openat(fd, ".", O_RDONLY|O_XATTR); ! return ok ? unlinkclose(attrdirfd, attrname) : -1; } --- 388,392 ---- attrdirfd = openat(fd, ".", O_RDONLY|O_XATTR); ! return ok ? unlinkclose(attrdirfd, attrname) : -errno; } Index: TODO =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/TODO,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** TODO 6 Apr 2008 09:21:26 -0000 1.23 --- TODO 19 Jul 2008 09:55:14 -0000 1.24 *************** *** 4,10 **** * docs, explain user_xattr, mount -o remount * change to use section 2 calls instead of section 3 - * for "operation not supported" note must be prefixed with "user" * buffer size, reuse buffer? - * Set $! to errno in xattr operations, for use in FUSE filesystems. * symbolic link handling (O_NOFOLLOW on Mac OS X) * Check it can be used with Perl 5.6.x --- 4,8 ---- *************** *** 26,27 **** --- 24,30 ---- if we allow this. (Alternative is to make the portable listxattr follow the BSD API, where the separator is a length byte.) + + * Support new extensible system attributes (and its API) on Solaris? + See the PSARC referenced in the docs and its fgetattr, etc. + implementation. + Index: MANIFEST =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/MANIFEST,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** MANIFEST 6 Apr 2008 09:21:26 -0000 1.22 --- MANIFEST 19 Jul 2008 09:55:14 -0000 1.23 *************** *** 43,46 **** --- 43,47 ---- t/39nsempty.t t/80memleakget.t + t/81closed.t lib/File/ExtAttr.pm lib/File/ExtAttr/Tie.pm |
From: Richard D. <ric...@us...> - 2008-07-19 09:55:09
|
Update of /cvsroot/file-extattr/File-ExtAttr/t/lib/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22738/t/lib/t Modified Files: Support.pm Log Message: Update Solaris layer to use new error reporting convention. Ignore SUNWattr_r[ow] system extensible attributes on (Open)Solaris. Added doc ref to Solaris system extensible attributes. Test listfattr() on a closed file. Index: Support.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/lib/t/Support.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Support.pm 6 Apr 2008 09:21:27 -0000 1.2 --- Support.pm 19 Jul 2008 09:55:15 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- use strict; use Config; + use File::ExtAttr qw/listfattr/; sub should_skip { *************** *** 15,21 **** } ! # XXX: Write a function to return expected failure case for missing ! # attribute/etc. depending on platform. ! #/(Operation not supported|No such file or directory|Attribute not found)/ 1; --- 16,48 ---- } ! sub filter_system_attrs ! { ! my @attrs = @_; ! ! if ($^O eq 'solaris') ! { ! # Filter out container for extensible system attributes on Solaris. ! @attrs = grep { ! /^SUNWattr_r[ow]$/ } @attrs; ! } ! return @attrs; ! } ! ! # Check to see whether the file has unremovable system attributes. ! sub has_system_attrs ! { ! my ($h) = @_; ! my $ret = 0; ! ! if ($^O eq 'solaris') ! { ! my @attrs = listfattr($h); ! if (scalar(grep { /^SUNWattr_r[ow]$/ } @attrs) > 0) ! { ! $ret = 1; ! } ! } ! ! return $ret; ! } 1; |
From: Richard D. <ric...@us...> - 2008-06-15 10:22:37
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv13462 Modified Files: Changes extattr_bsd.c Log Message: Update BSD layer to use new error reporting convention Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Changes 3 May 2008 09:22:13 -0000 1.42 --- Changes 15 Jun 2008 10:22:40 -0000 1.43 *************** *** 21,25 **** XXX: This is incomplete: ! - Test on FreeBSD, Solaris. - Make sure I've actually addressed API concerns in #32670. --- 21,25 ---- XXX: This is incomplete: ! - Test on Solaris. - Make sure I've actually addressed API concerns in #32670. *************** *** 30,34 **** - (richdawe) Operations with non-default or non-"user" namespaces will now fail with EOPNOTSUPP instead of ENOATTR ! on Mac OS X. This behaviour is like Linux. 1.07 2007-12-15 --- 30,34 ---- - (richdawe) Operations with non-default or non-"user" namespaces will now fail with EOPNOTSUPP instead of ENOATTR ! on Mac OS X and *BSD. This behaviour is like Linux. 1.07 2007-12-15 Index: extattr_bsd.c =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/extattr_bsd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** extattr_bsd.c 2 Oct 2006 22:05:04 -0000 1.6 --- extattr_bsd.c 15 Jun 2008 10:22:40 -0000 1.7 *************** *** 58,74 **** bsd_extattr_set_succeeded (const int expected, const int actual) { ! int ret = -1; ! if (actual != -1) ! { ! if (actual != expected) ! { ! errno = ENOBUFS; /* Pretend there's not enough space for the data. */ ! ret = -1; ! } ! else ! { ! ret = 0; ! } } --- 58,68 ---- bsd_extattr_set_succeeded (const int expected, const int actual) { ! int ret = 0; ! if (actual == -1) { ! ret = -errno; ! } else if (actual != expected) { ! /* Pretend there's not enough space for the data. */ ! ret = -ENOBUFS; } *************** *** 84,97 **** { int attrnamespace = -1; ! int ok = 1; ! int ret = -1; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) { File_ExtAttr_setflags_t setflags = File_ExtAttr_flags2setflags(flags); --- 78,89 ---- { int attrnamespace = -1; ! int ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { File_ExtAttr_setflags_t setflags = File_ExtAttr_flags2setflags(flags); *************** *** 114,119 **** { /* Attribute already exists => fail. */ ! errno = EEXIST; ! ok = 0; } } --- 106,110 ---- { /* Attribute already exists => fail. */ ! ret = -EEXIST; } } *************** *** 122,126 **** } ! if (ok) { ret = extattr_set_file(path, attrnamespace, attrname, attrvalue, slen); --- 113,117 ---- } ! if (ret == 0) { ret = extattr_set_file(path, attrnamespace, attrname, attrvalue, slen); *************** *** 128,132 **** } ! return ok ? ret : -1; } --- 119,123 ---- } ! return ret; } *************** *** 139,152 **** { int attrnamespace = -1; ! int ok = 1; ! int ret = -1; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) { File_ExtAttr_setflags_t setflags = File_ExtAttr_flags2setflags(flags); --- 130,141 ---- { int attrnamespace = -1; ! int ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { File_ExtAttr_setflags_t setflags = File_ExtAttr_flags2setflags(flags); *************** *** 169,174 **** { /* Attribute already exists => fail. */ ! errno = EEXIST; ! ok = 0; } } --- 158,162 ---- { /* Attribute already exists => fail. */ ! ret = -EEXIST; } } *************** *** 177,181 **** } ! if (ok) { ret = extattr_set_fd(fd, attrnamespace, attrname, attrvalue, slen); --- 165,169 ---- } ! if (ret == 0) { ret = extattr_set_fd(fd, attrnamespace, attrname, attrvalue, slen); *************** *** 194,210 **** { int attrnamespace = -1; ! int ok = 1; ! int ret = -1; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) ret = extattr_get_file(path, attrnamespace, attrname, attrvalue, slen); ! return ok ? ret : -1; } --- 182,200 ---- { int attrnamespace = -1; ! int ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { ret = extattr_get_file(path, attrnamespace, attrname, attrvalue, slen); + if (ret < 0) { + ret = -errno; + } + } ! return ret; } *************** *** 217,233 **** { int attrnamespace = -1; ! int ok = 1; ! int ret = -1; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) ret = extattr_get_fd(fd, attrnamespace, attrname, attrvalue, slen); ! return ok ? ret : -1; } --- 207,225 ---- { int attrnamespace = -1; ! int ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { ret = extattr_get_fd(fd, attrnamespace, attrname, attrvalue, slen); + if (ret < 0) { + ret = -errno; + } + } ! return ret; } *************** *** 238,254 **** { int attrnamespace = -1; ! int ok = 1; ! int ret = -1; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) ret = extattr_delete_file(path, attrnamespace, attrname); ! return ok ? ret : -1; } --- 230,248 ---- { int attrnamespace = -1; ! int ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { ret = extattr_delete_file(path, attrnamespace, attrname); + if (ret < 0) { + ret = -errno; + } + } ! return ret; } *************** *** 259,275 **** { int attrnamespace = -1; ! int ok = 1; ! int ret = -1; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) ret = extattr_delete_fd(fd, attrnamespace, attrname); ! return ok ? ret : -1; } --- 253,271 ---- { int attrnamespace = -1; ! int ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { ret = extattr_delete_fd(fd, attrnamespace, attrname); + if (ret < 0) { + ret = -errno; + } + } ! return ret; } *************** *** 297,310 **** { int attrnamespace = -1; ! int ok = 1; ! ssize_t ret; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) { ret = extattr_list_file(path, --- 293,304 ---- { int attrnamespace = -1; ! ssize_t ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { ret = extattr_list_file(path, *************** *** 316,322 **** if (buflen && (ret > 0)) reformat_list(buf, ret); } ! return ok ? ret : -1; } --- 310,320 ---- if (buflen && (ret > 0)) reformat_list(buf, ret); + + if (ret < 0) { + ret = -errno; + } } ! return ret; } *************** *** 328,341 **** { int attrnamespace = -1; ! int ok = 1; ! ssize_t ret; if (!valid_namespace(flags, &attrnamespace)) { ! errno = ENOATTR; ! ok = 0; } ! if (ok) { ret = extattr_list_fd(fd, --- 326,337 ---- { int attrnamespace = -1; ! ssize_t ret = 0; if (!valid_namespace(flags, &attrnamespace)) { ! ret = -EOPNOTSUPP; } ! if (ret == 0) { ret = extattr_list_fd(fd, *************** *** 347,353 **** if (buflen && (ret > 0)) reformat_list(buf, ret); } ! return ok ? ret : -1; } --- 343,353 ---- if (buflen && (ret > 0)) reformat_list(buf, ret); + + if (ret < 0) { + ret = -errno; + } } ! return ret; } *************** *** 357,361 **** { size_t len = 0; ! int ret; if (iHasUser) --- 357,361 ---- { size_t len = 0; ! ssize_t ret = 0; if (iHasUser) *************** *** 387,392 **** else { ! errno = ERANGE; ! ret = -1; } --- 387,391 ---- else { ! ret = -ERANGE; } *************** *** 402,406 **** int iHasUser = 0; int iHasSystem = 0; ! ssize_t ret; ret = extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0); --- 401,405 ---- int iHasUser = 0; int iHasSystem = 0; ! ssize_t ret = 0; ret = extattr_list_file(path, EXTATTR_NAMESPACE_USER, NULL, 0); |
From: Richard D. <ric...@us...> - 2008-05-03 09:22:09
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv24985 Modified Files: Changes extattr_macosx.c Log Message: Update Mac OS X layer to use new error reporting convention Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Changes 6 Apr 2008 09:21:22 -0000 1.41 --- Changes 3 May 2008 09:22:13 -0000 1.42 *************** *** 21,25 **** XXX: This is incomplete: ! - Test on FreeBSD, Solaris, Mac OS X. - Make sure I've actually addressed API concerns in #32670. --- 21,25 ---- XXX: This is incomplete: ! - Test on FreeBSD, Solaris. - Make sure I've actually addressed API concerns in #32670. *************** *** 28,31 **** --- 28,35 ---- is now via the function return values and $!. + - (richdawe) Operations with non-default or non-"user" namespaces + will now fail with EOPNOTSUPP instead of ENOATTR + on Mac OS X. This behaviour is like Linux. + 1.07 2007-12-15 Index: extattr_macosx.c =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/extattr_macosx.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** extattr_macosx.c 4 Nov 2007 09:00:10 -0000 1.4 --- extattr_macosx.c 3 May 2008 09:22:13 -0000 1.5 *************** *** 31,42 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = setxattr(path, attrname, attrvalue, slen, 0, xflags); ! return ok ? ret : -1; } --- 31,48 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = setxattr(path, attrname, attrvalue, slen, 0, xflags); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 63,74 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = fsetxattr(fd, attrname, attrvalue, slen, 0, xflags); ! return ok ? ret : -1; } --- 69,86 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = fsetxattr(fd, attrname, attrvalue, slen, 0, xflags); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 86,97 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = getxattr(path, attrname, attrvalue, slen, 0, xflags); ! return ok ? ret : - 1; } --- 98,115 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = getxattr(path, attrname, attrvalue, slen, 0, xflags); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 109,120 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = fgetxattr(fd, attrname, attrvalue, slen, 0, xflags); ! return ok ? ret : -1; } --- 127,144 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = fgetxattr(fd, attrname, attrvalue, slen, 0, xflags); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 130,141 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = removexattr(path, attrname, xflags); ! return ok ? ret : -1; } --- 154,171 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = removexattr(path, attrname, xflags); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 151,162 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = fremovexattr(fd, attrname, xflags); ! return ok ? ret : -1; } --- 181,198 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = fremovexattr(fd, attrname, xflags); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 172,183 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = listxattr(path, buf, buflen, 0 /* XXX: flags? */); ! return ok ? ret : -1; } --- 208,225 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = listxattr(path, buf, buflen, 0 /* XXX: flags? */); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 193,204 **** if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = ENOATTR; ok = 0; } ! if (ok) ret = flistxattr(fd, buf, buflen, 0 /* XXX: flags? */); ! return ok ? ret : -1; } --- 235,252 ---- if (!File_ExtAttr_valid_default_namespace(flags)) { ! errno = EOPNOTSUPP; ! ret = -errno; ok = 0; } ! if (ok) { ret = flistxattr(fd, buf, buflen, 0 /* XXX: flags? */); + if (ret < 0) { + ret = -errno; + ok = 0; + } + } ! return ret; } *************** *** 211,216 **** ssize_t ret = listxattr(path, NULL, 0, 0 /* XXX: flags? */); ! if (ret > 0) ret = File_ExtAttr_default_listxattrns(buf, buflen); return ret; --- 259,267 ---- ssize_t ret = listxattr(path, NULL, 0, 0 /* XXX: flags? */); ! if (ret > 0) { ret = File_ExtAttr_default_listxattrns(buf, buflen); + } else if (ret < 0) { + ret = -errno; + } return ret; *************** *** 225,230 **** ssize_t ret = flistxattr(fd, NULL, 0, 0 /* XXX: flags? */); ! if (ret > 0) ret = File_ExtAttr_default_listxattrns(buf, buflen); return ret; --- 276,284 ---- ssize_t ret = flistxattr(fd, NULL, 0, 0 /* XXX: flags? */); ! if (ret > 0) { ret = File_ExtAttr_default_listxattrns(buf, buflen); + } else if (ret < 0) { + ret = -errno; + } return ret; |
From: Richard D. <ric...@us...> - 2008-04-06 09:21:23
|
Update of /cvsroot/file-extattr/File-ExtAttr/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22776/t Modified Files: 22tie-nonuser.t 32nsnonuser.t Log Message: setattr_warn must die -- too noisy Index: 22tie-nonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/22tie-nonuser.t,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** 22tie-nonuser.t 6 Apr 2008 09:12:48 -0000 1.6 --- 22tie-nonuser.t 6 Apr 2008 09:21:27 -0000 1.7 *************** *** 3,7 **** use strict; use Test::More; - use POSIX qw/setlocale LC_ALL/; BEGIN { --- 3,6 ---- *************** *** 23,33 **** use File::ExtAttr qw(getfattr); - # Use the C locale, so all warnings are in the language we are expecting. - setlocale(LC_ALL, 'C'); - - # Snaffle away the warnings for later analysis. - my $warning; - $SIG{'__WARN__'} = sub { $warning = $_[0] }; - my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); --- 22,25 ---- *************** *** 57,60 **** --- 49,53 ---- my %test_attrs = ( 'foo' => '123', 'bar' => '456' ); my $k; + my $err; foreach $k (sort(keys(%test_attrs))) *************** *** 64,77 **** # Check that creation works. $extattr{$k} = $v; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); # Check that updating works. $extattr{$k} = "$v$v"; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); $extattr{$k} = $v; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); --- 57,73 ---- # Check that creation works. $extattr{$k} = $v; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); # Check that updating works. $extattr{$k} = "$v$v"; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); $extattr{$k} = $v; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); *************** *** 89,93 **** # Check that creation works. $extattr{$k} = $v; ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); is(getfattr($_, "$k"), undef); } --- 85,90 ---- # Check that creation works. $extattr{$k} = $v; ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); is(getfattr($_, "$k"), undef); } Index: 32nsnonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/32nsnonuser.t,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** 32nsnonuser.t 6 Apr 2008 09:12:48 -0000 1.8 --- 32nsnonuser.t 6 Apr 2008 09:21:27 -0000 1.9 *************** *** 7,11 **** use strict; use Test::More; - use POSIX qw/setlocale LC_ALL/; BEGIN { --- 7,10 ---- *************** *** 26,36 **** use File::ExtAttr qw(setfattr getfattr delfattr); - # Use the C locale, so all warnings are in the language we are expecting. - setlocale(LC_ALL, 'C'); - - # Snaffle away the warnings for later analysis. - my $warning; - $SIG{'__WARN__'} = sub { $warning = $_[0] }; - my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); --- 25,28 ---- *************** *** 54,58 **** #set it setfattr($_, "$key", $val, { namespace => 'nonuser' }); ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); #read it back --- 46,51 ---- #set it setfattr($_, "$key", $val, { namespace => 'nonuser' }); ! my $err = int $!; ! is ($err, $!{EOPNOTSUPP}); #read it back *************** *** 61,65 **** #delete it delfattr($_, "$key", { namespace => 'nonuser' }); ! is ($warning =~ /(Operation not supported|No such file or directory|Attribute not found)/, 1); #check that it's gone --- 54,59 ---- #delete it delfattr($_, "$key", { namespace => 'nonuser' }); ! $err = int $!; ! is ($err, $!{EOPNOTSUPP}); #check that it's gone |
From: Richard D. <ric...@us...> - 2008-04-06 09:21:23
|
Update of /cvsroot/file-extattr/File-ExtAttr/t/lib/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22776/t/lib/t Modified Files: Support.pm Log Message: setattr_warn must die -- too noisy Index: Support.pm =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/lib/t/Support.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Support.pm 6 May 2007 09:56:40 -0000 1.1 --- Support.pm 6 Apr 2008 09:21:27 -0000 1.2 *************** *** 15,18 **** --- 15,22 ---- } + # XXX: Write a function to return expected failure case for missing + # attribute/etc. depending on platform. + #/(Operation not supported|No such file or directory|Attribute not found)/ + 1; |
From: Richard D. <ric...@us...> - 2008-04-06 09:21:23
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv22776 Modified Files: Changes ExtAttr.xs MANIFEST TODO Removed Files: helpers.c helpers.h Log Message: setattr_warn must die -- too noisy Index: ExtAttr.xs =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/ExtAttr.xs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ExtAttr.xs 6 Apr 2008 09:12:47 -0000 1.24 --- ExtAttr.xs 6 Apr 2008 09:21:26 -0000 1.25 *************** *** 4,8 **** #include "ppport.h" - #include "helpers.h" #include "portable.h" --- 4,7 ---- *************** *** 31,38 **** attrvalue = SvPV(attrvalueSV, slen); rc = portable_setxattr(path, attrname, attrvalue, slen, flags); ! if (rc < 0) { ! setattr_warn("setxattr", attrname, errno); errno = -rc; - } RETVAL = (rc == 0); --- 30,35 ---- attrvalue = SvPV(attrvalueSV, slen); rc = portable_setxattr(path, attrname, attrvalue, slen, flags); ! if (rc < 0) errno = -rc; RETVAL = (rc == 0); *************** *** 55,62 **** attrvalue = SvPV(attrvalueSV, slen); rc = portable_fsetxattr(fd, attrname, attrvalue, slen, flags); ! if (rc < 0) { ! setattr_warn("fsetxattr", attrname, errno); errno = -rc; - } RETVAL = (rc == 0); --- 52,57 ---- attrvalue = SvPV(attrvalueSV, slen); rc = portable_fsetxattr(fd, attrname, attrvalue, slen, flags); ! if (rc < 0) errno = -rc; RETVAL = (rc == 0); *************** *** 92,98 **** XSRETURN_UNDEF; ! //print warning and return undef }else{ - setattr_warn("getxattr", attrname, errno); Safefree(attrvalue); errno = -attrlen; --- 87,92 ---- XSRETURN_UNDEF; ! //return undef }else{ Safefree(attrvalue); errno = -attrlen; *************** *** 135,141 **** XSRETURN_UNDEF; ! //print warning and return undef }else{ - setattr_warn("fgetxattr", attrname, errno); Safefree(attrvalue); errno = -attrlen; --- 129,134 ---- XSRETURN_UNDEF; ! //return undef }else{ Safefree(attrvalue); errno = -attrlen; --- helpers.h DELETED --- Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Changes 6 Apr 2008 09:12:47 -0000 1.40 --- Changes 6 Apr 2008 09:21:22 -0000 1.41 *************** *** 24,27 **** --- 24,31 ---- - Make sure I've actually addressed API concerns in #32670. + - (richdawe) File::ExtAttr no longer generate noisy warnings + when an xattr system call fails. All error reporting + is now via the function return values and $!. + 1.07 2007-12-15 Index: MANIFEST =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/MANIFEST,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** MANIFEST 24 Feb 2008 10:17:48 -0000 1.21 --- MANIFEST 6 Apr 2008 09:21:26 -0000 1.22 *************** *** 12,17 **** flags.c flags.h - helpers.h - helpers.c extattr_bsd.h extattr_bsd.c --- 12,15 ---- --- helpers.c DELETED --- Index: TODO =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/TODO,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** TODO 6 Apr 2008 09:12:47 -0000 1.22 --- TODO 6 Apr 2008 09:21:26 -0000 1.23 *************** *** 1,5 **** todo: * utf8 - * warnings * check that partition supports it, especially in unit test * docs, explain user_xattr, mount -o remount --- 1,4 ---- *************** *** 7,11 **** * for "operation not supported" note must be prefixed with "user" * buffer size, reuse buffer? - * Get rid of setattr_warn * Set $! to errno in xattr operations, for use in FUSE filesystems. * symbolic link handling (O_NOFOLLOW on Mac OS X) --- 6,9 ---- |
From: Richard D. <ric...@us...> - 2008-04-06 09:12:50
|
Update of /cvsroot/file-extattr/File-ExtAttr/t In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv18613/t Modified Files: 11basic.t 12empty.t 13long.t 14optional.t 15create.t 16replace.t 17createreplace.t 18list.t 20tie-basic.t 22tie-nonuser.t 30nsbasic.t 31nsmultiple.t 32nsnonuser.t 33nslong.t 39nsempty.t 80memleakget.t Log Message: Make sure that the errno value from any failed system calls is propagated into $! (#32679, #32680). This has only been implemented and tested on Linux so far. Index: 16replace.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/16replace.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 16replace.t 5 Jul 2007 08:36:34 -0000 1.5 --- 16replace.t 6 Apr 2008 09:12:48 -0000 1.6 *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 73,77 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 73,77 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; Index: 14optional.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/14optional.t,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** 14optional.t 5 Jul 2007 08:36:34 -0000 1.6 --- 14optional.t 6 Apr 2008 09:12:48 -0000 1.7 *************** *** 30,34 **** my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 30,34 ---- my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 50,54 **** #will die if xattr stuff doesn't work at all ! setfattr($_, "$key", $val) || die "setfattr failed on $_: $!"; #set it --- 50,54 ---- #will die if xattr stuff doesn't work at all ! setfattr($_, "$key", $val) or die "setfattr failed on $_: $!"; #set it Index: 33nslong.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/33nslong.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 33nslong.t 4 Nov 2007 09:00:11 -0000 1.5 --- 33nslong.t 6 Apr 2008 09:12:48 -0000 1.6 *************** *** 34,38 **** my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 34,38 ---- my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 61,67 **** #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($_, "$key-2", ('x' x 3991)) || die "setfattr failed on $_: $!"; setfattr($_, "$key", $longval, { namespace => 'user' }) ! || die "setfattr failed on $_: $!"; #set it --- 61,67 ---- #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($_, "$key-2", ('x' x 3991)) or die "setfattr failed on $_: $!"; setfattr($_, "$key", $longval, { namespace => 'user' }) ! or die "setfattr failed on $_: $!"; #set it *************** *** 95,99 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 95,99 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 104,110 **** #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($filename, "$key-2", ('x' x 3991)) || die "setfattr failed on $filename: $!"; setfattr($fh, "$key", $longval, { namespace => 'user' }) ! || die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it --- 104,110 ---- #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($filename, "$key-2", ('x' x 3991)) or die "setfattr failed on $filename: $!"; setfattr($fh, "$key", $longval, { namespace => 'user' }) ! or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it Index: 15create.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/15create.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 15create.t 5 Jul 2007 08:36:34 -0000 1.5 --- 15create.t 6 Apr 2008 09:12:48 -0000 1.6 *************** *** 10,13 **** --- 10,14 ---- use strict; use Test::More; + use Errno; BEGIN { *************** *** 21,25 **** plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 15; } --- 22,26 ---- plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 16; } *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 33,37 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 73,77 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 74,78 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 81,85 **** #create it again -- should fail ! is (setfattr($fh, "$key", $val, { create => 1 }), 0); #read it back --- 82,89 ---- #create it again -- should fail ! my $ret = setfattr($fh, "$key", $val, { create => 1 }); ! my $err = int $!; ! is ($ret, 0); ! is ($err, $!{EEXIST}); #read it back Index: 31nsmultiple.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/31nsmultiple.t,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** 31nsmultiple.t 5 Jul 2007 08:36:35 -0000 1.4 --- 31nsmultiple.t 6 Apr 2008 09:12:48 -0000 1.5 *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 62,66 **** #will die if xattr stuff doesn't work at all setfattr($_, "$key", $val, { namespace => 'user' }) ! || die "setfattr failed on filename $_: $!"; #set it --- 62,66 ---- #will die if xattr stuff doesn't work at all setfattr($_, "$key", $val, { namespace => 'user' }) ! or die "setfattr failed on filename $_: $!"; #set it *************** *** 106,110 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 106,110 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 114,118 **** #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val, { namespace => 'user' }) ! || die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it --- 114,118 ---- #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val, { namespace => 'user' }) ! or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it Index: 30nsbasic.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/30nsbasic.t,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** 30nsbasic.t 5 Jul 2007 08:36:35 -0000 1.6 --- 30nsbasic.t 6 Apr 2008 09:12:48 -0000 1.7 *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 59,63 **** #will die if xattr stuff doesn't work at all setfattr($_, "$key", $val, { namespace => 'user' }) ! || die "setfattr failed on filename $_: $!"; #set it --- 59,63 ---- #will die if xattr stuff doesn't work at all setfattr($_, "$key", $val, { namespace => 'user' }) ! or die "setfattr failed on filename $_: $!"; #set it *************** *** 88,92 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 88,92 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 96,100 **** #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val, { namespace => 'user' }) ! || die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it --- 96,100 ---- #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val, { namespace => 'user' }) ! or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it Index: 13long.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/13long.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** 13long.t 5 Jul 2007 08:36:34 -0000 1.7 --- 13long.t 6 Apr 2008 09:12:47 -0000 1.8 *************** *** 34,38 **** my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 34,38 ---- my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 61,66 **** #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($_, "$key-2", ('x' x 3991)) || die "setfattr failed on $_: $!"; ! setfattr($_, "$key", $longval) || die "setfattr failed on $_: $!"; #set it --- 61,66 ---- #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($_, "$key-2", ('x' x 3991)) or die "setfattr failed on $_: $!"; ! setfattr($_, "$key", $longval) or die "setfattr failed on $_: $!"; #set it *************** *** 94,98 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 94,98 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 103,109 **** #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($filename, "$key-2", ('x' x 3991)) || die "setfattr failed on $filename: $!"; setfattr($fh, "$key", $longval) ! || die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it --- 103,109 ---- #on my /var partition, and 920 is the biggest for my loopback partition. #What's up with that? ! #setfattr($filename, "$key-2", ('x' x 3991)) or die "setfattr failed on $filename: $!"; setfattr($fh, "$key", $longval) ! or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it Index: 20tie-basic.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/20tie-basic.t,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** 20tie-basic.t 5 Jul 2007 08:36:35 -0000 1.9 --- 20tie-basic.t 6 Apr 2008 09:12:48 -0000 1.10 *************** *** 25,29 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 25,29 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. Index: 39nsempty.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/39nsempty.t,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** 39nsempty.t 5 Jul 2007 08:36:35 -0000 1.4 --- 39nsempty.t 6 Apr 2008 09:12:48 -0000 1.5 *************** *** 21,25 **** plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 12; } --- 21,25 ---- plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 18; } *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 54,60 **** #set it - should fail ! undef $@; ! eval { setfattr($_, "$key", $val, { namespace => '' }); }; ! isnt ($@, undef); #read it back - should be missing --- 54,61 ---- #set it - should fail ! my $ret = setfattr($_, "$key", $val, { namespace => '' }); ! my $err = int $!; ! is ($ret, 0); ! is ($err, $!{EOPNOTSUPP}); #read it back - should be missing *************** *** 62,66 **** #delete it - should fail ! is (delfattr($_, "$key", { namespace => '' }), 0); #check that it's gone --- 63,70 ---- #delete it - should fail ! $ret = delfattr($_, "$key", { namespace => '' }); ! $err = int $!; ! is ($ret, 0); ! is ($err, $!{EOPNOTSUPP}); #check that it's gone *************** *** 72,91 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; ! undef $@; ! eval { setfattr($fh->fileno(), "$key", $val, { namespace => '' }); }; ! isnt ($@, undef); #read it back - should be missing ! is (getfattr($fh->fileno(), "$key", { namespace => '' }), undef); #delete it - should fail ! is (delfattr($fh->fileno(), "$key", { namespace => '' }), 0); #check that it's gone ! is (getfattr($fh->fileno(), "$key", { namespace => '' }), undef); END { --- 76,99 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; ! my $ret = setfattr($fh, "$key", $val, { namespace => '' }); ! my $err = int $!; ! is ($ret, 0); ! is ($err, $!{EOPNOTSUPP}); #read it back - should be missing ! is (getfattr($fh, "$key", { namespace => '' }), undef); #delete it - should fail ! $ret = delfattr($fh, "$key", { namespace => '' }); ! $err = int $!; ! is ($ret, 0); ! is ($err, $!{EOPNOTSUPP}); #check that it's gone ! is (getfattr($fh, "$key", { namespace => '' }), undef); END { Index: 22tie-nonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/22tie-nonuser.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 22tie-nonuser.t 5 Jul 2007 08:36:35 -0000 1.5 --- 22tie-nonuser.t 6 Apr 2008 09:12:48 -0000 1.6 *************** *** 33,37 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 33,37 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. Index: 11basic.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/11basic.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** 11basic.t 5 Jul 2007 08:36:34 -0000 1.7 --- 11basic.t 6 Apr 2008 09:12:47 -0000 1.8 *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 56,60 **** #will die if xattr stuff doesn't work at all ! setfattr($_, "$key", $val) || die "setfattr failed on filename $_: $!"; #set it --- 56,60 ---- #will die if xattr stuff doesn't work at all ! setfattr($_, "$key", $val) or die "setfattr failed on filename $_: $!"; #set it *************** *** 77,81 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 77,81 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 85,89 **** #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val) ! || die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it --- 85,89 ---- #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val) ! or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it Index: 12empty.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/12empty.t,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** 12empty.t 15 Dec 2007 09:28:12 -0000 1.1 --- 12empty.t 6 Apr 2008 09:12:47 -0000 1.2 *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 56,60 **** #will die if xattr stuff doesn't work at all ! setfattr($_, "$key", $val) || die "setfattr failed on filename $_: $!"; #set it --- 56,60 ---- #will die if xattr stuff doesn't work at all ! setfattr($_, "$key", $val) or die "setfattr failed on filename $_: $!"; #set it *************** *** 77,81 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 77,81 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 85,89 **** #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val) ! || die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it --- 85,89 ---- #will die if xattr stuff doesn't work at all setfattr($fh, "$key", $val) ! or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; #set it Index: 80memleakget.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/80memleakget.t,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** 80memleakget.t 13 Aug 2007 12:04:35 -0000 1.2 --- 80memleakget.t 6 Apr 2008 09:12:48 -0000 1.3 *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 54,58 **** print "# using $_\n"; ! setfattr($_, $key, $val) || die "setfattr failed on filename $_: $!"; for (my $i = 0; $i < 1000; $i++) { --- 54,58 ---- print "# using $_\n"; ! setfattr($_, $key, $val) or die "setfattr failed on filename $_: $!"; for (my $i = 0; $i < 1000; $i++) { *************** *** 72,81 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; setfattr($fh, $key, $val) ! || die "setfattr failed on file descriptor ".$fh->fileno().": $!"; for (my $i = 0; $i < 1000; $i++) { --- 72,81 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; setfattr($fh, $key, $val) ! or die "setfattr failed on file descriptor ".$fh->fileno().": $!"; for (my $i = 0; $i < 1000; $i++) { Index: 17createreplace.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/17createreplace.t,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** 17createreplace.t 5 Jul 2007 08:36:34 -0000 1.5 --- 17createreplace.t 6 Apr 2008 09:12:48 -0000 1.6 *************** *** 32,36 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 32,36 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 66,70 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 66,70 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; Index: 32nsnonuser.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/32nsnonuser.t,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** 32nsnonuser.t 5 Jul 2007 08:36:35 -0000 1.7 --- 32nsnonuser.t 6 Apr 2008 09:12:48 -0000 1.8 *************** *** 35,39 **** my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 35,39 ---- my $TESTDIR = ($ENV{ATTR_TEST_DIR} || '.'); my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. Index: 18list.t =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/t/18list.t,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** 18list.t 5 Jul 2007 08:36:34 -0000 1.4 --- 18list.t 6 Apr 2008 09:12:48 -0000 1.5 *************** *** 14,18 **** plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 183; } --- 14,18 ---- plan skip_all => 'Tests unsupported on this OS/filesystem'; } else { ! plan tests => 213; } *************** *** 25,29 **** my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh || die "can't close $filename $!"; # Create a directory. --- 25,29 ---- my ($fh, $filename) = tempfile( DIR => $TESTDIR ); ! close $fh or die "can't close $filename $!"; # Create a directory. *************** *** 53,57 **** # create it again -- should fail ! is (setfattr($_, $k, $vals{$k}, { create => 1 }), 0); # read it back --- 53,60 ---- # create it again -- should fail ! my $ret = setfattr($_, $k, $vals{$k}, { create => 1 }); ! my $err = int $!; ! is ($ret, 0); ! is ($err, $!{EEXIST}); # read it back *************** *** 81,85 **** ########################## ! $fh = new IO::File("<$filename") || die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; --- 84,88 ---- ########################## ! $fh = new IO::File("<$filename") or die "Unable to open $filename"; print "# using file descriptor ".$fh->fileno()."\n"; *************** *** 91,95 **** # create it again -- should fail ! is (setfattr($fh, $_, $vals{$_}, { create => 1 }), 0); # read it back --- 94,101 ---- # create it again -- should fail ! my $ret = setfattr($fh, $_, $vals{$_}, { create => 1 }); ! my $err = int $!; ! is ($ret, 0); ! is ($err, $!{EEXIST}); # read it back |
From: Richard D. <ric...@us...> - 2008-04-06 09:12:45
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv18613 Modified Files: Changes ExtAttr.xs TODO extattr_linux.c portable.h Log Message: Make sure that the errno value from any failed system calls is propagated into $! (#32679, #32680). This has only been implemented and tested on Linux so far. Index: portable.h =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/portable.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** portable.h 4 Nov 2007 09:00:10 -0000 1.13 --- portable.h 6 Apr 2008 09:12:47 -0000 1.14 *************** *** 7,11 **** struct hv; ! /* Portable extattr functions */ static inline int portable_setxattr (const char *path, --- 7,15 ---- struct hv; ! /* ! * Portable extattr functions. When these fail, they should return ! * -errno, i.e.: < 0 indicates failure. ! */ ! static inline int portable_setxattr (const char *path, Index: ExtAttr.xs =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/ExtAttr.xs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ExtAttr.xs 15 Dec 2007 09:28:12 -0000 1.23 --- ExtAttr.xs 6 Apr 2008 09:12:47 -0000 1.24 *************** *** 31,36 **** attrvalue = SvPV(attrvalueSV, slen); rc = portable_setxattr(path, attrname, attrvalue, slen, flags); ! if (rc == -1) setattr_warn("setxattr", attrname, errno); RETVAL = (rc == 0); --- 31,38 ---- attrvalue = SvPV(attrvalueSV, slen); rc = portable_setxattr(path, attrname, attrvalue, slen, flags); ! if (rc < 0) { setattr_warn("setxattr", attrname, errno); + errno = -rc; + } RETVAL = (rc == 0); *************** *** 53,58 **** attrvalue = SvPV(attrvalueSV, slen); rc = portable_fsetxattr(fd, attrname, attrvalue, slen, flags); ! if (rc == -1) setattr_warn("fsetxattr", attrname, errno); RETVAL = (rc == 0); --- 55,62 ---- attrvalue = SvPV(attrvalueSV, slen); rc = portable_fsetxattr(fd, attrname, attrvalue, slen, flags); ! if (rc < 0) { setattr_warn("fsetxattr", attrname, errno); + errno = -rc; + } RETVAL = (rc == 0); *************** *** 80,88 **** attrlen = portable_getxattr(path, attrname, attrvalue, buflen, flags); ! if (attrlen == -1){ //key not found, just return undef if(errno == ENOATTR){ Safefree(attrvalue); XSRETURN_UNDEF; --- 84,93 ---- attrlen = portable_getxattr(path, attrname, attrvalue, buflen, flags); ! if (attrlen < 0){ //key not found, just return undef if(errno == ENOATTR){ Safefree(attrvalue); + errno = -attrlen; XSRETURN_UNDEF; *************** *** 91,94 **** --- 96,100 ---- setattr_warn("getxattr", attrname, errno); Safefree(attrvalue); + errno = -attrlen; XSRETURN_UNDEF; } *************** *** 121,129 **** attrlen = portable_fgetxattr(fd, attrname, attrvalue, buflen, flags); ! if (attrlen == -1){ //key not found, just return undef if(errno == ENOATTR){ Safefree(attrvalue); XSRETURN_UNDEF; --- 127,136 ---- attrlen = portable_fgetxattr(fd, attrname, attrvalue, buflen, flags); ! if (attrlen < 0){ //key not found, just return undef if(errno == ENOATTR){ Safefree(attrvalue); + errno = -attrlen; XSRETURN_UNDEF; *************** *** 132,135 **** --- 139,143 ---- setattr_warn("fgetxattr", attrname, errno); Safefree(attrvalue); + errno = -attrlen; XSRETURN_UNDEF; } *************** *** 148,153 **** const char *attrname HV * flags CODE: ! RETVAL = (portable_removexattr(path, attrname, flags) == 0); OUTPUT: --- 156,167 ---- const char *attrname HV * flags + PREINIT: + int rc; + CODE: ! rc = portable_removexattr(path, attrname, flags); ! if (rc < 0) ! errno = -rc; ! RETVAL = (rc == 0); OUTPUT: *************** *** 160,165 **** const char *attrname HV * flags CODE: ! RETVAL = (portable_fremovexattr(fd, attrname, flags) == 0); OUTPUT: --- 174,185 ---- const char *attrname HV * flags + PREINIT: + int rc; + CODE: ! rc = portable_fremovexattr(fd, attrname, flags); ! if (rc < 0) ! errno = -rc; ! RETVAL = (rc == 0); OUTPUT: *************** *** 182,187 **** size = portable_flistxattr(fd, NULL, 0, flags); ! if (size == -1) { XSRETURN_UNDEF; } else if (size == 0) --- 202,208 ---- size = portable_flistxattr(fd, NULL, 0, flags); ! if (size < 0) { + errno = -(int) size; XSRETURN_UNDEF; } else if (size == 0) *************** *** 201,207 **** // might return ERANGE. ! if (ret == -1) { free(namebuf); XSRETURN_UNDEF; } else if (ret == 0) --- 222,229 ---- // might return ERANGE. ! if (ret < 0) { free(namebuf); + errno = -ret; XSRETURN_UNDEF; } else if (ret == 0) *************** *** 244,249 **** size = portable_flistxattrns(fd, NULL, 0, flags); ! if (size == -1) { XSRETURN_UNDEF; } else if (size == 0) --- 266,272 ---- size = portable_flistxattrns(fd, NULL, 0, flags); ! if (size < 0) { + errno = -(int) size; XSRETURN_UNDEF; } else if (size == 0) *************** *** 263,269 **** // might return ERANGE. ! if (ret == -1) { free(namebuf); XSRETURN_UNDEF; } else if (ret == 0) --- 286,293 ---- // might return ERANGE. ! if (ret < 0) { free(namebuf); + errno = -ret; XSRETURN_UNDEF; } else if (ret == 0) Index: TODO =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/TODO,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TODO 24 Feb 2008 10:17:48 -0000 1.21 --- TODO 6 Apr 2008 09:12:47 -0000 1.22 *************** *** 7,12 **** * for "operation not supported" note must be prefixed with "user" * buffer size, reuse buffer? ! * throw exceptions rather than warnings on getxattr() failure ! (set $@, die => need eval to catch errors? not sure I like that) * Set $! to errno in xattr operations, for use in FUSE filesystems. * symbolic link handling (O_NOFOLLOW on Mac OS X) --- 7,11 ---- * for "operation not supported" note must be prefixed with "user" * buffer size, reuse buffer? ! * Get rid of setattr_warn * Set $! to errno in xattr operations, for use in FUSE filesystems. * symbolic link handling (O_NOFOLLOW on Mac OS X) Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Changes 24 Feb 2008 10:17:48 -0000 1.39 --- Changes 6 Apr 2008 09:12:47 -0000 1.40 *************** *** 17,20 **** --- 17,27 ---- in Makefile.PL on that platform. + - (richdawe) Make sure that the errno value from any failed + system calls is propagated into $! (#32679, #32680). + + XXX: This is incomplete: + - Test on FreeBSD, Solaris, Mac OS X. + - Make sure I've actually addressed API concerns in #32670. + 1.07 2007-12-15 Index: extattr_linux.c =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/extattr_linux.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** extattr_linux.c 6 Apr 2007 11:35:50 -0000 1.8 --- extattr_linux.c 6 Apr 2008 09:12:47 -0000 1.9 *************** *** 117,126 **** { ret = setxattr(path, q, attrvalue, slen, xflags); free(q); } else { ! ret = -1; ! errno = ENOMEM; } --- 117,127 ---- { ret = setxattr(path, q, attrvalue, slen, xflags); + if (ret == -1) + ret = -errno; free(q); } else { ! ret = -ENOMEM; } *************** *** 152,161 **** { ret = fsetxattr(fd, q, attrvalue, slen, xflags); free(q); } else { ! ret = -1; ! errno = ENOMEM; } --- 153,163 ---- { ret = fsetxattr(fd, q, attrvalue, slen, xflags); + if (ret == -1) + ret = -errno; free(q); } else { ! ret = -ENOMEM; } *************** *** 177,186 **** { ret = getxattr(path, q, attrvalue, slen); free(q); } else { ! ret = -1; ! errno = ENOMEM; } --- 179,189 ---- { ret = getxattr(path, q, attrvalue, slen); + if (ret == -1) + ret = -errno; free(q); } else { ! ret = -ENOMEM; } *************** *** 202,211 **** { ret = fgetxattr(fd, q, attrvalue, slen); free(q); } else { ! ret = -1; ! errno = ENOMEM; } --- 205,215 ---- { ret = fgetxattr(fd, q, attrvalue, slen); + if (ret == -1) + ret = -errno; free(q); } else { ! ret = -ENOMEM; } *************** *** 226,235 **** { ret = removexattr(path, q); free(q); } else { ! ret = -1; ! errno = ENOMEM; } --- 230,240 ---- { ret = removexattr(path, q); + if (ret == -1) + ret = -errno; free(q); } else { ! ret = -ENOMEM; } *************** *** 250,259 **** { ret = fremovexattr(fd, q); free(q); } else { ! ret = -1; ! errno = ENOMEM; } --- 255,265 ---- { ret = fremovexattr(fd, q); + if (ret == -1) + ret = -errno; free(q); } else { ! ret = -ENOMEM; } *************** *** 330,335 **** else { ! errno = ERANGE; ! ret = -1; } --- 336,340 ---- else { ! ret = -ERANGE; } *************** *** 352,357 **** if (!pNS) { ! ret = -1; ! errno = ENOMEM; } --- 357,361 ---- if (!pNS) { ! ret = -ENOMEM; } *************** *** 365,390 **** slen = listxattr(path, buf, 0); ! if (slen >= 0) ! { char *sbuf; sbuf = malloc(slen); ! if (sbuf) slen = listxattr(path, sbuf, slen); ! else ! ret = -1; ! ! if (slen) ! ret = attrlist2list(sbuf, slen, buf, buflen, 1, pNS); ! else ! ret = slen; if (sbuf) free(sbuf); } - else - { - ret = slen; - } } --- 369,393 ---- slen = listxattr(path, buf, 0); ! if (slen == -1) { ! ret = -errno; ! } else if (slen >= 0) { char *sbuf; sbuf = malloc(slen); ! if (sbuf) { slen = listxattr(path, sbuf, slen); ! if (slen >= 0) { ! ret = attrlist2list(sbuf, slen, buf, buflen, 1, pNS); ! } else { ! ret = -errno; ! } ! } else { ! ret = -errno; ! slen = 0; ! } if (sbuf) free(sbuf); } } *************** *** 407,412 **** if (!pNS) { ! ret = -1; ! errno = ENOMEM; } --- 410,414 ---- if (!pNS) { ! ret = -ENOMEM; } *************** *** 420,445 **** slen = flistxattr(fd, buf, 0); ! if (slen >= 0) ! { char *sbuf; sbuf = malloc(slen); ! if (sbuf) slen = flistxattr(fd, sbuf, slen); ! else ! ret = -1; ! ! if (slen) ! ret = attrlist2list(sbuf, slen, buf, buflen, 1, pNS); ! else ! ret = slen; if (sbuf) free(sbuf); } - else - { - ret = slen; - } } --- 422,445 ---- slen = flistxattr(fd, buf, 0); ! if (slen == -1) { ! ret = -errno; ! } else if (slen >= 0) { char *sbuf; sbuf = malloc(slen); ! if (sbuf) { slen = flistxattr(fd, sbuf, slen); ! if (slen >= 0) { ! ret = attrlist2list(sbuf, slen, buf, buflen, 1, pNS); ! } else { ! ret = -errno; ! } ! } else { ! ret = -errno; ! } if (sbuf) free(sbuf); } } *************** *** 469,481 **** sbuf = malloc(slen); ! if (sbuf) slen = listxattr(path, sbuf, slen); ! else ! ret = -1; ! ! if (slen) ! ret = attrlist2list(sbuf, slen, buf, buflen, 0, NULL); ! else ! ret = slen; if (sbuf) --- 469,482 ---- sbuf = malloc(slen); ! if (sbuf) { slen = listxattr(path, sbuf, slen); ! if (slen >= 0) { ! ret = attrlist2list(sbuf, slen, buf, buflen, 0, NULL); ! } else { ! ret = -errno; ! } ! } else { ! ret = -errno; ! } if (sbuf) *************** *** 484,488 **** else { ! ret = slen; } --- 485,489 ---- else { ! ret = -errno; } *************** *** 509,521 **** sbuf = malloc(slen); ! if (sbuf) slen = flistxattr(fd, sbuf, slen); ! else ! ret = -1; ! ! if (slen) ! ret = attrlist2list(sbuf, slen, buf, buflen, 0, NULL); ! else ! ret = slen; if (sbuf) --- 510,523 ---- sbuf = malloc(slen); ! if (sbuf) { slen = flistxattr(fd, sbuf, slen); ! if (slen >= 0) { ! ret = attrlist2list(sbuf, slen, buf, buflen, 0, NULL); ! } else { ! ret = -errno; ! } ! } else { ! ret = -errno; ! } if (sbuf) *************** *** 524,528 **** else { ! ret = slen; } --- 526,530 ---- else { ! ret = -errno; } |
From: Richard D. <ric...@us...> - 2008-02-24 10:17:47
|
Update of /cvsroot/file-extattr/File-ExtAttr In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv2016 Modified Files: Changes MANIFEST Makefile.PL TODO Log Message: Bail more gracefully when build pre-reqs aren't present Index: Changes =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Changes,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Changes 26 Jan 2008 08:33:08 -0000 1.38 --- Changes 24 Feb 2008 10:17:48 -0000 1.39 *************** *** 9,12 **** --- 9,20 ---- since File::ExtAttr's test suite will never pass on it. + - (richdawe) Update Makefile.PL to fail more gracefully when the build + pre-requisites are not present. On Linux use + Devel::CheckLib to check for libattr. Also exit + more gracefully if libattr's headers are not present. + + - (richdawe) OpenBSD isn't supported, so bail gracefully + in Makefile.PL on that platform. + 1.07 2007-12-15 Index: TODO =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/TODO,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TODO 23 Feb 2008 07:40:27 -0000 1.20 --- TODO 24 Feb 2008 10:17:48 -0000 1.21 *************** *** 1,6 **** todo: - * Detect libattr (for the header) using Devel::CheckLib - -- See <http://use.perl.org/~barbie/journal/35584?from=rss>. - -- There's no Fedora package, so package it too. * utf8 * warnings --- 1,3 ---- Index: Makefile.PL =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/Makefile.PL,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile.PL 30 Nov 2007 20:16:49 -0000 1.9 --- Makefile.PL 24 Feb 2008 10:17:48 -0000 1.10 *************** *** 1,7 **** use ExtUtils::MakeMaker; # Check whether we have <attr/attributes.h> and <attr/xattr.h> on Linux. # Suggest what the user needs to install, to get these files. ! @DIRS = qw(. /usr/include); if ($^O eq 'linux') { --- 1,17 ---- + use lib qw(inc); use ExtUtils::MakeMaker; + use Devel::CheckLib; + use strict; # Check whether we have <attr/attributes.h> and <attr/xattr.h> on Linux. # Suggest what the user needs to install, to get these files. ! ! if ($^O eq 'linux') { ! check_lib_or_exit( ! lib => [qw(attr)] ! ); ! } ! ! my @DIRS = qw(. /usr/include); if ($^O eq 'linux') { *************** *** 11,14 **** --- 21,25 ---- ); my $incdir; + my $missing = 0; foreach $incdir (@DIRS) *************** *** 22,32 **** foreach (keys %headers) { ! die "<$_> not found; perhaps you need to install libattr-devel" ! if ($headers{$_} == 0); } } # OpenBSD does not support extended attributes. ! die 'OpenBSD does not support extended attributes' if ($^O eq 'openbsd'); # See lib/ExtUtils/MakeMaker.pm for details of how to influence --- 33,50 ---- foreach (keys %headers) { ! if ($headers{$_} == 0) { ! warn "<$_> not found; perhaps you need to install libattr-devel"; ! $missing++; ! } } + + exit(0) if ($missing > 0); } # OpenBSD does not support extended attributes. ! if ($^O eq 'openbsd') { ! warn 'OpenBSD does not support extended attributes'; ! die "OS unsupported"; ! } # See lib/ExtUtils/MakeMaker.pm for details of how to influence *************** *** 37,42 **** PREREQ_PM => { # e.g., Module::Name => 1.1 ! Carp => 0, ! Scalar::Util => 0 }, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 --- 55,60 ---- PREREQ_PM => { # e.g., Module::Name => 1.1 ! 'Carp' => 0, ! 'Scalar::Util' => 0 }, ($] >= 5.005 ? ## Add these new keywords supported since 5.005 *************** *** 56,65 **** NO_META => 1, ); - - - sub MY::postamble { - ' - $(MYEXTLIB): mylib/Makefile - cd mylib && $(MAKE) $(PASSTHRU) - '; - } --- 74,75 ---- Index: MANIFEST =================================================================== RCS file: /cvsroot/file-extattr/File-ExtAttr/MANIFEST,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MANIFEST 21 Dec 2007 16:49:53 -0000 1.20 --- MANIFEST 24 Feb 2008 10:17:48 -0000 1.21 *************** *** 1,3 **** --- 1,4 ---- Changes + inc/Devel/CheckLib.pm Makefile.PL MANIFEST |