]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: fhandler_virtual: move fileid to path_conv member
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 2 Apr 2024 12:43:27 +0000 (14:43 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Tue, 2 Apr 2024 12:43:27 +0000 (14:43 +0200)
commita0a25849f9dda5cd3f2963bcc05563ab797c1e42
treee31806803243c45fab1c661683987a689839078c
parentb7f5a33200a91ee76f5364280ad40bafedfab142
Cygwin: fhandler_virtual: move fileid to path_conv member

Commit 80f722e97cf7 ("Cygwin: opendir(3): move ENOTDIR check into main
function") introduced a bug in fhandler_virtual handling.  While the
assertion that path_conv::check() already calls exists() and sets
FILE_ATTRIBUTE_DIRECTORY accordingly, the exists() function is called
on a fhandler_virtual object created for just this code snippet.  The
side effect of this is that the fileid member in the calling
fhandler_virtual object is not set after path_conv::check().

Move the fhandler_virtual::fileid member to path_conv::_virt_fileid
and create matching path_conv::virt_fileid() and fhandler_virtual::fileid()
methods.

Let path_conv::check() propagate the fileid set in the local
fhandler_virtual::exists() call to its own  _virt_fileid.

Use new fhandler_virtual::fileid() method throughout.

Fixes: 80f722e97cf7 ("Cygwin: opendir(3): move ENOTDIR check into main function")
Reported-by: Bruce Jerrick <bmj001@gmail.com>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler/proc.cc
winsup/cygwin/fhandler/process.cc
winsup/cygwin/fhandler/procnet.cc
winsup/cygwin/fhandler/procsysvipc.cc
winsup/cygwin/fhandler/virtual.cc
winsup/cygwin/local_includes/fhandler.h
winsup/cygwin/local_includes/path.h
winsup/cygwin/path.cc
This page took 0.03217 seconds and 5 git commands to generate.