https://cygwin.com/pipermail/cygwin/2020-December/246938.html
reports a problem where, when adding a Cygwin default symlink
to $PATH since Cygwin 3.1.5, $PATH handling appears to be broken.
3.1.5 switched to WSL symlinks as Cygwin default symlinks.
A piece of code in path handling skips resolving reparse points
if they are the last component in the path. Thus a reparse point
in $PATH is not resolved but converted to Windows path syntax
verbatim.
If you do this with a WSL symlink, certain WinAPI functions fail.
The underlying $PATH handling fails to recognize the reparse
point in $PATH and returns with STATUS_IO_REPARSE_TAG_NOT_HANDLED.
As a result, the calling WinAPI function fails, most prominently
so CreateProcess.
Fix this problem by adding a PATH_REP_NOAPI bit to path_types
and a matching method path_conv::is_winapi_reparse_point().
Right now this flag is set for WSL symlinks and Cygwin AF_UNIX
sockets (new type implemented as reparse points).
The aforementioned code skipping repare point path resolution calls
is_winapi_reparse_point() rather than is_known_reparse_point(),
so now path resolution is only skipped for reparse points known
to WinAPI.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This libltp is old as old dirt and still using K&R style.
If it's really to be used again at all, it needs a serious
refresh.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Network filesystems are not block devices. Apparently this code
hasn't been executed anyway, given how network filesystems are
hidden behind \Device\Mup.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Use fhandler_dev_floppy instead of fhandler_procsys for such devices.
The read()/write() functions from fhandler_procsys do not ensure
sector aligned transfers and lseek() fails always.
Signed-off-by: Christian Franke <franke@computer.org>
- If vim is executed in WSL in mintty, some garbage string caused
by "OSC Ps;? BEL/ST" will be shown in some situations. This patch
fixes the issue by removing "OSC Ps;? BEL/ST" from pseudo console
output.
Since we are now only configuring once, in winsup, with
AC_CONFIG_AUX_DIR(..), the auxiliary files are taken from the top-level.
(Previously we had a random assorment of AC_CONFIG_AUX_DIR(..) and
AC_CONFIG_AUX_DIR(../..) in winsup subdirectories, so auxiliary files
would be taken from winsup or the top-level.)
There's doesn't seem to be much use in independently distributing these
subdirectories, so allowing them to be independently configured seems
pointless and overcomplicated.
The order in which the subdirectories are built is still a little odd,
as cygwin is linked with libcygserver, and cygserver is then linked with
cygwin. So, we build the cygwin directory first, which invokes a build
of libcygserver in the cygserver directory, and then build in the
cygserver directory to build the cygserver executable.
Drop AC_CONFIGURE_ARGS, since we don't need to recursively call
configure with the same arguments anymore.
Slightly refine when we build utils: Previously we didn't build any
utils if MinGW compiler use was avoided, now we just avoid building
those utils which require that compiler.
Greatly simplify how winsup_srcdir and target_builddir are set, since
we're only configuring from one directory. (These are still kept
absolute, since we don't adjust them where used for being used in a
subdirectory).
Remove configure.cygwin and put it's (greatly reduced) contents inline
in the one place it's used now.
Remove generated configure and aclocal.m4 in subdirectories.
This has a test of the path translation code used in various utilities
(mount, cygpath, strace).
MOUNT_BINARY is replaced with the absence of MOUNT_TEXT since 26e0b37e.
The issys member of mnt_t struct was removed in b677a99b.
> $ make check
[...]
> total tests: 63
> pass : 63 (100.0%)
> fail : 0 (0.0%)
'-fno-exceptions -fno-rtti' are already present in the compile command
COMPILE.cc set by Makefile.common, so we don't need to add them to
CXXFLAGS as well.
Invoke grep in text mode when looking for version strings inside the
cygwin DLL, so it outputs something more informative than:
Binary file ../cygwin/cygwin0.dll matches
The overflow check in mEMALIGn erroneously checks for INT_MAX,
albeit the input parameter is size_t. Fix this to check for
__SIZE_MAX__ instead. Also, it misses to check the req against
adding the alignment before calling mALLOc.
While at it, add out-of-bounds checks to pvALLOc, nano_memalign,
nano_valloc, and Cygwin's (unused) dlpvalloc.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Replace the 'WCHAR pipe_name_buf[48]' class member by 'PWCHAR
pipe_name_buf', and allocate space for the latter as needed.
Change the default constructor to accommodate this change, and add a
destructor that frees the allocated space.
Also change get_pipe_name and clone to accommodate this change.
By default, libltp tests will create temporary files in a subdirectory
of /tmp, which will (nowadays) be located relative to the test DLL (by
assuming that it is in /bin). This will evaluate to the directory
$target_builddir/winsup/tmp, which doesn't exist.
The location used for these temporary files can be explicitly controlled
by setting the TDIRECTORY env var. Arrange to set that env var to the
/cygdrive path of a tmp subdirectory of the build directory.
Unfortunately, libltp doesn't clean the temporary directory if
TDIRECTORY is set, and some tests assume they are started in a clean
directory, so we need to do that in tcl.
Set the PATH so that tests can pick up cygwin0.dll. Looks like this was
dropped by accident in 2e488e95 ("Don't rely on in-build tools"), so
restore it as it was prior to 9d89f634.
Drop MINGW_FE, which I can't find any trace of, and instead detect and
use MinGW compilers.
This requires adding AC_CANONICAL_TARGET, to set $target_cpu.
This is now required as cygwin_build is defined in terms of
target_builddir.
(Note that in other subdirectories, the autoconf variable
target_builddir is AC_SUBST-ed as a side-effect of using a macro from
winsup/acinclude.m4, which is perhaps less than ideal)
The autoconf variable all_host is used to make building of the stub
library used by the testsuite conditional on not cross-compiling.
Make it unconditional, so we will notice if it's broken when
cross-compiling.