]> git.baikalelectronics.ru Git - kernel.git/commit
statx: Kill fd-with-NULL-path support in favour of AT_EMPTY_PATH
authorDavid Howells <dhowells@redhat.com>
Wed, 26 Apr 2017 21:15:55 +0000 (22:15 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 26 Apr 2017 22:05:47 +0000 (15:05 -0700)
commit60a0b2031355c535617c613734dc4f7bfa29a3dc
tree7eeeb6ba287547adc07c8fd6f916bfda60414e54
parentc7570c036b2d8255fd77cd3fe1c72766d1f5373f
statx: Kill fd-with-NULL-path support in favour of AT_EMPTY_PATH

With the new statx() syscall, the following both allow the attributes of
the file attached to a file descriptor to be retrieved:

statx(dfd, NULL, 0, ...);

and:

statx(dfd, "", AT_EMPTY_PATH, ...);

Change the code to reject the first option, though this means copying
the path and engaging pathwalk for the fstat() equivalent.  dfd can be a
non-directory provided path is "".

[ The timing of this isn't wonderful, but applying this now before we
  have statx() in any released kernel, before anybody starts using the
  NULL special case.    - Linus ]

Fixes: 33113bef26bf ("statx: Add a system call to make enhanced file info available")
Reported-by: Michael Kerrisk <mtk.manpages@gmail.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Eric Sandeen <sandeen@sandeen.net>
cc: fstests@vger.kernel.org
cc: linux-api@vger.kernel.org
cc: linux-man@vger.kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/stat.c