Re: extattr problems?

2009-01-12 Thread Robert Watson
On Sun, 11 Jan 2009, Tim Kientzle wrote: I think this one is a bug. It appears that extattr_set_fd() obeys the permissions on the file, not the permissions of the descriptor. In particular, I see this on FreeBSD 6.3: Hmm. Not clear. EAs live in a slightly hazy world between data and

Re: extattr problems?

2009-01-12 Thread Tim Kientzle
Robert Watson wrote: On Sun, 11 Jan 2009, Tim Kientzle wrote: I think this one is a bug. It appears that extattr_set_fd() obeys the permissions on the file, not the permissions of the descriptor. Hmm. Not clear. EAs live in a slightly hazy world between data and meta-data. Normally you

Re: extattr problems?

2009-01-11 Thread pluknet
2009/1/11 Tim Kientzle kient...@freebsd.org: pluknet wrote: 2009/1/11 Tim Kientzle kient...@freebsd.org: FreeBSD 6.3: fd = open(test, O_WRONLY | O_CREAT | O_EXCL, 0777); n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, testattr, 1234, 4); After this, fd=3, n is non-zero, errno = 9 (EBADF)

Re: extattr problems?

2009-01-11 Thread Tim Kientzle
pluknet wrote: It's strange.. FreeBSD jaw.ripn.net 6.3-RELEASE-p5. works for me (tm), extattr_set_fd() returns 4 as expected. Thank you! *That* was my mistake; I thought extattr_set_fd() returned 0 on success, non-zero on error. I re-read the man page and now everything makes sense. Thank

Re: extattr problems?

2009-01-11 Thread Tim Kientzle
I think this one is a bug. It appears that extattr_set_fd() obeys the permissions on the file, not the permissions of the descriptor. In particular, I see this on FreeBSD 6.3: [...@dark /tmp]$ ./extattr_test fd=3 extattr_set_fd() = -1 errno = 13 (Permission denied) [...@dark /tmp]$ cat

extattr problems?

2009-01-10 Thread Tim Kientzle
FreeBSD 6.3: fd = open(test, O_WRONLY | O_CREAT | O_EXCL, 0777); n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, testattr, 1234, 4); After this, fd=3, n is non-zero, errno = 9 (EBADF) Huh? I would have expected EOPNOTSUPP if extended attributes weren't supported on this filesystem. The file

Re: extattr problems?

2009-01-10 Thread pluknet
2009/1/11 Tim Kientzle kient...@freebsd.org: FreeBSD 6.3: fd = open(test, O_WRONLY | O_CREAT | O_EXCL, 0777); n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, testattr, 1234, 4); After this, fd=3, n is non-zero, errno = 9 (EBADF) Huh? I would have expected EOPNOTSUPP if extended attributes

Re: extattr problems?

2009-01-10 Thread Tim Kientzle
pluknet wrote: 2009/1/11 Tim Kientzle kient...@freebsd.org: FreeBSD 6.3: fd = open(test, O_WRONLY | O_CREAT | O_EXCL, 0777); n = extattr_set_fd(fd, EXTATTR_NAMESPACE_USER, testattr, 1234, 4); After this, fd=3, n is non-zero, errno = 9 (EBADF) Huh? I would have expected EOPNOTSUPP if