OK here is build with FinderInfo only being zerod if mimic=hfs.
It has the fix for uchg in it.
There is also some crypto compat attempt in it.
file deleted
viewtopic.php?f=26&t=3750&p=12137#p12137
zfs get com.apple.mimic ztank/test
NAME PROPERTY VALUE SOURCE
ztank/test com.apple.mimic apfs local
touch testfile-zfs
xattr -wx com.apple.FinderInfo 5445585431313131313131313131313131313131313131313131313131313131 testfile-zfs
xattr -lx testfile-zfs
com.apple.FinderInfo:
00000000 54 45 58 54 31 31 31 31 31 31 31 31 31 31 31 31 |TEXT111111111111|
00000010 00 00 00 00 00 00 00 00 31 31 31 31 00 00 00 00 |........1111....|
00000020
chflags uchg testfile-zfs
chflags: testfile-zfs: Operation not permitted
zfs version
zfs-macOS-2.1.6-1
zfs-kmod-2.1.6-1
strings /Library/Extensions/zfs.kext/Contents/MacOS/zfs | grep -E '[0-9]\.[0-9]\.[0-9]\-'
zfs-macOS-2.1.6-0-g529f781b3
2.1.6-1
sysctl -a | grep zfs_xattr_compat
[nothing...]
# zpool version
zfs-2.1.99-1731_g1e3ae29d3
zfs-kmod-2.1.99-1731_g1e3ae29d3
# zpool version
zfs-2.1.99-1731_g1e3ae29d3
zfs-kmod-2.1.99-1731_g1e3ae29d3
touch testfile-zfs
xattr -w org.home.emptyattr "" testfile-zfs
File "/usr/bin/xattr", line 13, in <module>
load_entry_point('xattr==0.6.4', 'console_scripts', 'xattr')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/xattr/tool.py", line 258, in main
doSinglePathChange(filename,attr_name,attr_value,read,write,delete,recursive)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/xattr/tool.py", line 198, in doSinglePathChange
attrs[attr_name] = attr_value
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/xattr/__init__.py", line 124, in __setitem__
self.set(item, value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/xattr/__init__.py", line 93, in set
self._set(name, value, 0, options | self.options)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/xattr/__init__.py", line 28, in _func
return func(first, *args)
KeyError: 'org.home.emptyattr'
xattr -lx testfile-zfs
[nothing]
xattr -w org.home.someattr "test" testfile-zfs
xattr -w org.home.emptyattr "" testfile-zfs
ls -l@ testfile-zfs
-rw-r--r--@ 1 user staff 0 22 Feb 20:20 testfile-zfs
org.home.someattr 4
org.home.emptyattr 0
roemer wrote:FILENAME/..namedfork/rsrc special path seems not supported yet
# touch /Volumes/BOOM/testfile.txt
# echo "HelloWorld" > /Volumes/BOOM/testfile.txt/..namedfork/rsrc
# cat /Volumes/BOOM/testfile.txt/..namedfork/rsrc
HelloWorld
# xattr /Volumes/BOOM/testfile.txt
com.apple.ResourceFork
# xattr -l /Volumes/BOOM/testfile.txt
com.apple.ResourceFork: HelloWorld
I cannot set a 'archived' BSD flag
ResourceFork xattr can be created on a symlink, though neither HFS nor APFS write a ResourceFork on a symlink
creating an empty xattr only works if there is already any other extended attribute; if it is the first, the xattr tool fails miserably
# cat x.c
#include <stdio.h>
#include <sys/xattr.h>
int main(int argc, char **argv)
{
int err;
err = setxattr("/Volumes/BOOM/test.txt",
"org.xattr.empty",
"", 0,
0,0);
printf("setxattr %d\n", err);
}
clang -o x x.c
# touch /tmp/roger
# ln -s /tmp/roger /tmp/moore
# xattr -w com.apple.ResourceFork HelloWorld /tmp/moore
# xattr -l /tmp/moore
com.apple.ResourceFork: HelloWorld
/* Write the Resource Fork. */
if (strcmp(ap->a_name, XATTR_RESOURCEFORK_NAME) == 0) {
struct vnode *rvp = NULL;
int namelen = 0;
int openunlinked = 0;
if (!vnode_isreg(vp)) {
return (EPERM);
touch testfile-rfork.txt
echo "HelloWorld" > testfile-rfork.txt/..namedfork/rsrc
ls -aleO@ testfile-rfork.txt
-rw-r--r--@ 1 user staff - 11 22 Feb 21:37 testfile-rfork.txt
com.apple.ResourceFork 11
xattr -lx testfile-rfork.txt
com.apple.ResourceFork:
00000000 48 65 6C 6C 6F 57 6F 72 6C 64 0A |HelloWorld.|
0000000b
cat testfile-rfork.txt/..namedfork/rsrc
HelloWorld
# so far, so good; but now let's write a new value via xattr:
xattr -w com.apple.ResourceFork "Hello You" testfile-rfork.txt
xattr -lx testfile-rfork.txt
com.apple.ResourceFork:
00000000 48 65 6C 6C 6F 20 59 6F 75 |Hello You|
00000009
cat testfile-rfork.txt/..namedfork/rsrc
cat: testfile-rfork.txt/..namedfork/rsrc: No such file or directory
ln -s testfile-zfs testlink-zfs
# notice the -s option:
xattr -ws com.apple.ResourceFork "Whatever" testlink-zfs
ls -l@ testlink-zfs
lrwxr-xr-x@ 1 user staff 13 22 Feb 18:52 testlink-zfs -> testfile-zfs
com.apple.ResourceFork 8
Users browsing this forum: No registered users and 15 guests