linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Reading/changing projid of a symlink
@ 2018-05-31  0:26 Ilya Pronin
  2018-06-12 14:36 ` Carlos Maiolino
  0 siblings, 1 reply; 12+ messages in thread
From: Ilya Pronin @ 2018-05-31  0:26 UTC (permalink / raw)
  To: linux-xfs

Hello,

I am trying to recursively check/change projid on a directory that
contains symlinks among other files. The way I do it is like this
(attributes reading part as an example, modulo error handling):

oflags = O_NOFOLLOW | O_RDONLY;
if (S_ISDIR(stat->st_mode))
        oflags |= O_DIRECTORY;
if (S_ISLNK(stat->st_mode))
        oflags |= O_PATH;
fd = open(path, oflags, 0);
xfsctl(NULL, fd, XFS_IOC_FSGETXATTR, &attr);

The xfsctl() call fails with EBADF. Apparently this is because
xfsctl() is implemented as ioctl(), at least on Linux, which doesn't
work with file descriptors obtained with O_PATH. Is there any way to
manipulate projid on symlinks?

Thanks!

-- 
Ilya Pronin

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-06-15  9:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-31  0:26 Reading/changing projid of a symlink Ilya Pronin
2018-06-12 14:36 ` Carlos Maiolino
2018-06-12 22:17   ` Ilya Pronin
2018-06-13  6:23     ` Christoph Hellwig
2018-06-13 14:22       ` Eric Sandeen
2018-06-13  9:40     ` Carlos Maiolino
2018-06-15  0:14       ` Ilya Pronin
2018-06-15  7:08         ` Carlos Maiolino
2018-06-15  7:12           ` Christoph Hellwig
2018-06-15  8:57             ` Carlos Maiolino
2018-06-15  9:00               ` Christoph Hellwig
2018-06-14  2:31     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).