diff options
author | Nathan Scott <nathans@sgi.com> | 2002-02-28 23:38:36 +0000 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2002-02-28 23:38:36 +0000 |
commit | 0ebfb79eee2a2cc2355d714102bc99401606ea74 (patch) | |
tree | 7af64adf4cb36df734002708cc9158bfe8f47315 | |
parent | dd23fb85b6a44c0bfa4f10ba113415853e535b20 (diff) | |
download | attr-0ebfb79eee2a2cc2355d714102bc99401606ea74.tar.gz |
bump version, incorporate Andreas test update & ARM syscalls.
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | doc/CHANGES | 4 | ||||
-rw-r--r-- | libattr/syscalls.c | 19 | ||||
-rw-r--r-- | test/attr.test | 206 |
5 files changed, 172 insertions, 61 deletions
@@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=0 -PKG_REVISION=2 +PKG_REVISION=3 PKG_BUILD=0 diff --git a/debian/changelog b/debian/changelog index 532a1d0..a7eb500 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -attr (2.0.2-1) unstable; urgency=low +attr (2.0.3-1) unstable; urgency=low * Major new upstream release * Uses the new official ext2/ext3/XFS extended attributes interfaces diff --git a/doc/CHANGES b/doc/CHANGES index ad8065e..86771af 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,7 @@ +attr-2.0.3 (1 March 2002) + - add in ARM architecture system call numbers + - updates to the test output from Andreas + attr-2.0.2 (27 February 2002) - add in S/390 system call numbers from Martin Schwidefsky - revert IA64 syscall numbering after further mail with diff --git a/libattr/syscalls.c b/libattr/syscalls.c index e580bb0..12af483 100644 --- a/libattr/syscalls.c +++ b/libattr/syscalls.c @@ -33,12 +33,12 @@ /* * The use of the syscall() function is an additional level of - * indirection. For now, this avoids the dependency on kernel sources, though. + * indirection. This avoids the dependency on kernel sources. */ #include <unistd.h> -#if defined(__i386__) +#if defined (__i386__) # define HAVE_XATTR_SYSCALLS 1 # define __NR_setxattr 226 # define __NR_lsetxattr 227 @@ -122,6 +122,21 @@ # define __NR_removexattr 233 # define __NR_lremovexattr 234 # define __NR_fremovexattr 235 +#elif defined (__arm__) +# define HAVE_XATTR_SYSCALLS 1 +# define __NR_SYSCALL_BASE 0x900000 +# define __NR_setxattr (__NR_SYSCALL_BASE+226) +# define __NR_lsetxattr (__NR_SYSCALL_BASE+227) +# define __NR_fsetxattr (__NR_SYSCALL_BASE+228) +# define __NR_getxattr (__NR_SYSCALL_BASE+229) +# define __NR_lgetxattr (__NR_SYSCALL_BASE+230) +# define __NR_fgetxattr (__NR_SYSCALL_BASE+231) +# define __NR_listxattr (__NR_SYSCALL_BASE+232) +# define __NR_llistxattr (__NR_SYSCALL_BASE+233) +# define __NR_flistxattr (__NR_SYSCALL_BASE+234) +# define __NR_removexattr (__NR_SYSCALL_BASE+235) +# define __NR_lremovexattr (__NR_SYSCALL_BASE+236) +# define __NR_fremovexattr (__NR_SYSCALL_BASE+237) #else # warning "Extended attribute syscalls undefined for this architecture" # define HAVE_XATTR_SYSCALLS 0 diff --git a/test/attr.test b/test/attr.test index b1399e8..0e1c4b5 100644 --- a/test/attr.test +++ b/test/attr.test @@ -1,78 +1,170 @@ ! -! Tests for getting/setting extended file attributes with ext2/ext3 -! The initial size checks are ext2/ext3 specific, but the remainder -! should work for any extended attributes filesystem (eg. XFS). +! Tests for extended attributes on ext2/ext3 file systems. The initial +! size checks and the file size checks are ext2/ext3 specific. The +! other setfattr/getfattr operations are designed to cover all special +! cases in the ext27ext3 kernel patches, but they should work on other +! filesystems as well. ! -$ mkdir attr-test -$ touch attr-test/f -! Maximum attribute size for 1024 byte blocks = 1024 - (20+20+4) = 980 -$ aset -n user.name -v 968+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ attr-test/f -! Attribute too big for 1024 byte blocks -$ aset -n user.name -v 969++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ attr-test/f -attr-test/f: No space left on device -$ aset -n user.name attr-test/f -$ aget -d attr-test/f -# file: attr-test/f -user.name +! Execute this test using the `run' script in this directory: +! +! $ run attr.text +! +! === size checks, for an ext2/ext3 file system with a block size of 1K +$ touch f +$ setfattr -n user.name -v 968+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f +$ setfattr -n user.name -v 969++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ f +setfattr: f: No space left on device +$ rm f +! +! Editing values +! +$ touch f +$ setfattr -n user.vvvvvvvvvvvv -v vvvvvvvvvvvv f +$ setfattr -n user.wwwwwwww -v wwwwwwww f +$ setfattr -n user.xxxx -v xxxx f +$ getfattr -d f +# file: f +user.vvvvvvvvvvvv="vvvvvvvvvvvv" +user.wwwwwwww="wwwwwwww" +user.xxxx="xxxx" + +$ setfattr -n user.wwwwwwww -v wwww f +$ getfattr -d f +# file: f +user.vvvvvvvvvvvv="vvvvvvvvvvvv" +user.wwwwwwww="wwww" +user.xxxx="xxxx" + +$ setfattr -n user.xxxx -v xxxxxxxx f +$ getfattr -d f +# file: f +user.vvvvvvvvvvvv="vvvvvvvvvvvv" +user.wwwwwwww="wwww" +user.xxxx="xxxxxxxx" -$ aset -n user.name -v 0xbabe attr-test/f -$ aset -n user.name2 -v 0xdeadbeef attr-test/f -$ aset -n user.name3 -v 0xdeface attr-test/f +$ rm f ! +! Value encodings ! -$ aget -d -e hex attr-test/f -# file: attr-test/f +$ touch f +$ setfattr -n user.name -v 0xbabe f +$ setfattr -n user.name2 -v 0s3q2+7w== f +$ setfattr -n user.name3 -v 0xdeface f +$ getfattr -d -e hex f +# file: f user.name=0xbabe user.name2=0xdeadbeef user.name3=0xdeface -$ aget -d -e base64 attr-test/f -# file: attr-test/f +$ getfattr -d -e base64 f +# file: f user.name=0sur4= user.name2=0s3q2+7w== user.name3=0s3vrO -! -! shrink value of existing attribute -! -$ aset -n user.name2 -v 0xdeaf attr-test/f -$ aget -d -e hex attr-test/f -# file: attr-test/f -user.name=0xbabe -user.name2=0xdeaf -user.name3=0xdeface +$ getfattr -d -e text f +# file: f +user.name="º¾" +user.name2="Þ¾ï" +user.name3="ÞúÎ" +$ rm f ! -! grow value of existing attribute +! Everything with one file ! -$ aset -n user.name2 -v 0xdecade attr-test/f -$ aget -d -e hex attr-test/f -# file: attr-test/f -user.name=0xbabe -user.name2=0xdecade -user.name3=0xdeface +$ touch f +$ setfattr -n user.novalue f +$ setfattr -n user.somename -v somevalue f +$ setfattr -n user.somename -v somevalue f +$ setfattr -n user.longername -v longervalue f +$ setfattr -n user.short -v value f +$ setfattr -n user.novalue-yet f +$ ls -s f + 1 f +$ getfattr -d f +# file: f +user.longername="longervalue" +user.novalue +user.novalue-yet +user.short="value" +user.somename="somevalue" -! -! empty value -! -$ aset -n user.name2 attr-test/f -$ aget -d -n user.name2 attr-test/f -# file: attr-test/f -user.name2 +$ setfattr -n user.novalue-yet -v avalue-now f +$ getfattr -d f +# file: f +user.longername="longervalue" +user.novalue +user.novalue-yet="avalue-now" +user.short="value" +user.somename="somevalue" -! -! overwrite empty value -! -$ aset -n user.name2 -v 0xcafe attr-test/f -$ aget -d -e hex -n user.name2 attr-test/f -# file: attr-test/f -user.name2=0xcafe +$ setfattr -x user.noname f +setfattr: f: No such attribute +$ setfattr -x user.somename f +$ setfattr -x user.short f +$ getfattr -d f +# file: f +user.longername="longervalue" +user.novalue +user.novalue-yet="avalue-now" +$ setfattr -x user.longername f +$ setfattr -x user.novalue f +$ setfattr -x user.novalue-yet f +$ getfattr -d f +$ ls -s f + 0 f +$ rm f ! -! remove attribute +! Test extended attribute block sharing ! -$ aset -x user.name2 attr-test/f -$ aget -d -n user.name2 attr-test/f -attr-test/f: user.name2: No such attribute -$ rm attr-test/f -$ rmdir attr-test +$ touch f g h +$ setfattr -n user.novalue f g h +$ ls -s f g h + 1 f + 1 g + 1 h +$ setfattr -n user.name -v value f +$ ls -s f g h + 1 f + 1 g + 1 h +$ getfattr -d f g h +# file: f +user.name="value" +user.novalue + +# file: g +user.novalue + +# file: h +user.novalue + +$ setfattr -n user.name -v value g +$ ls -s f g h + 1 f + 1 g + 1 h +$ setfattr -x user.novalue h +$ ls -s f g h + 1 f + 1 g + 0 h +$ getfattr -d f g h +# file: f +user.name="value" +user.novalue + +# file: g +user.name="value" +user.novalue + +$ setfattr -n user.name -v other-value g +$ setfattr -n user.name -v value g +$ setfattr -x user.name f g +$ setfattr -x user.novalue f g +$ ls -s f g h + 0 f + 0 g + 0 h +$ rm f g h |