| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
| |
This returns a Dir instance for the given directory file descriptor.
If fdopendir is not supported, this raises NotImplementedError.
Implements [Feature #19347]
|
|
|
|
|
|
| |
This uses Dir.fchdir if supported, or Dir.chdir otherwise.
Implements [Feature #19347]
|
|
|
|
|
|
|
|
|
|
|
|
| |
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]
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Dir.glob brace pattern with '/' after '**' does not match
paths in recursive expansion process.
We expand braces with '/' before expanding a recursive.
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|
|
|
| |
[Misc #18891]
|
|
|
|
| |
Otherwise it's way too easy to confuse it with US_ASCII.
|
| |
|
|
|
|
|
|
|
|
|
| |
When using `IFTODT` defined in libc, `dirent.d_type` oriented pathtype
is compatible with `IFTODT(stat.st_mode)`. However they are not
compatible when emulating `IFTODT`, so `glob_helper` has to stat instead
of reusing dirent result by passing unknown pathtype to `glob_helper`.
This is a follow-up fix of 0c90ca4dd0abbd28d7bb34b9241d93995ab9cfb7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
dir.c defines IFTODT if the system doesn't have it. The macro is used
when comparing with rb_pathtype_t's cases. rb_pathtype_t's cases are
defined by DT_XXX macro if they are available, or defined using IFTODT.
Most POSIX-compatible platforms have both IFTODT and DT_XXX and most of
other platforms like MinGW have neither of them. On those platforms,
DT_XXX-oriented rb_pathtype_t is always compared with values converted
by system's IFTODT, and emulated-IFTODT-oriented rb_pathtype_t is always
compared with values converted by emulated-IFTODT.
However, when IFTODT is *not defined* and DT_XXX is *defined*, like
on wasi-libc, DT_XXX-oriented rb_pathtype_t was compared with values
converted by emulated-IFTODT, and they are not guaranteed to be
compatible.
This patch fixes such a situation by using emulated-IFTODT to define
rb_pathtype_t when either IFTODT or DT_XXX is not available.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This was already documented as being ignored, but it wasn't being
ignored, causing an issue in a particular case where a UTF-8
pattern was provided and a filename was tested that wasn't valid
UTF-8.
Fixes [Bug #14456]
|
| |
|
|
|
|
| |
So that no longer disturbed by C comment delimiters.
|
|
|
|
| |
What's Here for class Dir
|
|
|
|
|
|
| |
* See [Feature #17752]
* Using this to detect them:
git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
|
|
|
|
|
|
| |
* See [Feature #17752]
Co-authored-by: xtkoba (Tee KOBAYASHI) <xtkoba+ruby@gmail.com>
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Jeremy Evans <code@jeremyevans.net>
|
|
|
|
|
| |
... and keep it as a warning (like 2.7) when it is called in the same
thread. [Bug #15661]
|
|
|
|
| |
This reverts commit 1a5205536f0c0d6021450b11722919211847df86.
|
| |
|
|
|
|
|
|
|
|
| |
The documentation already stated this was an error in one case
(when it was previously a warning). Describe the other case,
where chdir without block is called inside block passed to chdir.
Fixes [Bug #15661]
|
|
|
|
|
|
| |
RARRAY_AREF has been a macro for reasons. We might not be able to
change that for public APIs, but why not relax the situation internally
to make it an inline function.
|
|
|
|
| |
Nobu likes this arrangement.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
|
| |
I'm not necessarily against every goto in general, but jumping into a
branch is definitely a bad idea. Better refactor.
|
|
|
|
| |
To fix build failures.
|
|
|
|
| |
This shall fix compile errors.
|
| |
|
|
|
| |
Split ruby.h
|
|
|
|
| |
Fixed up a58bbd6a512d95ca010d8bebae4fe590400c1413.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Function pointers are not void*. See also
ce4ea956d24eab5089a143bba38126f2b11b55b6
8427fca49bd85205f5a8766292dd893f003c0e48
|
|
|
|
|
|
| |
In the case that shinking the entries buffer to the exact size
failed, `dirp` is already closed. Found by mame with Coverity
Scan.
|