AppleFileServer ignores XATTR_REPLACE in FPSetExtAttr
| Originator: | sloowfranklin | ||
| Number: | rdar://15780654 | Date Originated: | 09-Jan-2014 |
| Status: | Open | Resolved: | |
| Product: | OS X | Product Version: | 10.9.1 |
| Classification: | Bug | Reproducible: | Always |
Ralph Boehme09-Jan-2014 11:03 AM
Summary:
According to
<https://developer.apple.com/library/mac/documentation/Networking/Reference/AFP_Reference/Reference/reference.html#//apple_ref/doc/constant_group/Extended_Attributes_Bitmap>
an AFP server must return an error code for a FPSetExtAttr request with set kXAttrReplace flag in case the attribute doesn't exist.
Apparently AppleFileServer on 10.9.1 returns no error and simply discards the request.
Steps to Reproduce:
inti:~ ralph$ cat myxattr.c
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/xattr.h>
int main(int argc, char **argv)
{
if (argc != 4) {
printf("usage: %s file ea value\n", argv[0]);
return 1;
}
if (setxattr(argv[1], argv[2], argv[3], strlen(argv[3]), 0, XATTR_REPLACE) != 0) {
perror("setxattr");
return 2;
}
return 0;
}
inti:~ ralph$ gcc -Wall -o myxattr myxattr.c
inti:~ ralph$ pwd
/Users/ralph
inti:~ ralph$ rm -f file && touch file
inti:~ ralph$ ./myxattr file test bla
setxattr: Attribute not found
inti:~ ralph$ xattr -l file
inti:~ ralph$
inti:~ ralph$ mount | grep afp
//sysadmin@10.10.10.30/sysadmin on /Volumes/sysadmin (afpfs, nodev, nosuid, mounted by ralph)
inti:~ ralph$ ssh sysadmin@10.10.10.30
Last login: Thu Jan 9 10:44:20 2014 from 10.10.10.157
mac-mini:~ sysadmin$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.9.1
BuildVersion: 13B42
mac-mini:~ sysadmin$ logout
Connection to 10.10.10.30 closed.
inti:~ ralph$ rm -f /Volumes/sysadmin/file && touch /Volumes/sysadmin/file
inti:~ ralph$ ./myxattr /Volumes/sysadmin/file test bla
inti:~ ralph$ xattr -l /Volumes/sysadmin/file
inti:~ ralph$
Expected Results:
Return an AFP error code like kFPObjectNotFound.
Actual Results:
kFPNoErr
Version:
10.9.1
Notes:
Configuration:
10.9.1 AFP client with 10.9.1 AFP server.
Attachments:
'FPSetExtAttr-replace.pcapng' and 'myxattr.c' were successfully uploaded.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!