Can some one here explain why accessing a NFSv4/ZFS xattr directory
through proc is forbidden?

To explain the problem in shell code (cd -@ is a new option to enter
the XATTR store, redirect {n}<... opens a file or directory and
assigns the fd number to variable 'n'):
ksh -c 'touch x ; cd -@ x ; redirect {n}<"." ; cd .. ; print "hello"
>/proc/$$/fd/$n/myxattr ; true'
/home/fleyta/bin/ksh: /proc/3982/fd/10/myxattr: cannot create
[Permission denied]

truss says the syscall fails with
open("/proc/3988/fd/10/myxattr", O_WRONLY|O_CREAT|O_TRUNC, 0666) Err#13 EACCES

Accessing files or directories through /proc/$$/fd/ from a shell
otherwise works, only the xattr directories cause trouble. Native C
code has the same problem.

      ,   _                                    _   ,
     { \/`o;====-    Olga Kryzhanovska   -====;o`\/ }
.----'-/`-/   \-`\-'----.
 `'-..-| /     \ |-..-'`
      /\/\     Solaris/BSD//C/C++ programmer   /\/\
      `--`                                      `--`
zfs-discuss mailing list

Reply via email to