Commit 1e2f82d
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: a528d35 ("statx: Add a system call to make enhanced file info available")
Reported-by: Michael Kerrisk <[email protected]>
Signed-off-by: David Howells <[email protected]>
cc: Eric Sandeen <[email protected]>
cc: [email protected]
cc: [email protected]
cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>1 parent fc08b19 commit 1e2f82d
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
556 | | - | |
| 555 | + | |
| 556 | + | |
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| 570 | + | |
| 571 | + | |
570 | 572 | | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
| 573 | + | |
575 | 574 | | |
576 | 575 | | |
577 | 576 | | |
| |||
0 commit comments