From 466ca7ae205126c7cac83735db887d69e293f816 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 16 Jan 2023 13:29:43 -0800 Subject: Add Dir.fchdir This is useful for passing directory file descriptors over UNIX sockets or to child processes to avoid TOCTOU vulnerabilities. The implementation follows the Dir.chdir code. This will raise NotImplementedError on platforms not supporting both fchdir and dirfd. Implements [Feature #19347] --- NEWS.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'NEWS.md') diff --git a/NEWS.md b/NEWS.md index 53a7f2e723..c3118976bf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,6 +15,11 @@ Note: We're only listing outstanding class updates. * `Array#pack` now raises ArgumentError for unknown directives. [[Bug #19150]] +* Dir + + * `Dir.fchdir` added for changing the directory to the directory specified + by the provided directory file descriptor. [[Feature #19347]] + * String * `String#unpack` now raises ArgumentError for unknown directives. [[Bug #19150]] @@ -65,3 +70,4 @@ changelog for details of the default gems or bundled gems. [Bug #19150]: https://bugs.ruby-lang.org/issues/19150 [Feature #19314]: https://bugs.ruby-lang.org/issues/19314 +[Feature #19347]: https://bugs.ruby-lang.org/issues/19347 -- cgit v1.2.3