<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/win32, branch ucrt_hack</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=ucrt_hack</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=ucrt_hack'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2021-11-12T13:56:22+00:00</updated>
<entry>
<title>win32: another attempt at a UCRT hack</title>
<updated>2021-11-12T13:56:22+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-11-12T13:56:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3d660bd84208ffc797f9d41423a8951123b3e46e'/>
<id>urn:sha1:3d660bd84208ffc797f9d41423a8951123b3e46e</id>
<content type='text'>
The problem with UCRT seems to be that if a process has been
started with a non-NULL environment block passed to CreateProcess()
any subsequent call to spawnve() with a non-NULL environment pointer
fails.

Commit 5b48ca53b (win32: pass NULL to spawnve, not environ) fixed
the problem in busybox-w32 for those cases where a NULL environment
pointer was sufficient.  It didn't handle the case where the shell
passes a modified environment to its child.

All calls to spawnve() in the shell occur in a process which will
terminate whether or not the call succeeds.  It therefore doesn't
matter if we mess with the environment of this process such that
spawnve() can be passed a NULL environment pointer.  (I think.)
</content>
</entry>
<entry>
<title>win32: move UCRT hack to process.c</title>
<updated>2021-11-04T12:27:45+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-11-04T12:27:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=9e12622a8706a0d23a3ff8792773e73b0d6108b4'/>
<id>urn:sha1:9e12622a8706a0d23a3ff8792773e73b0d6108b4</id>
<content type='text'>
Only apply the UCRT hack if we're about to call spawnve() with
a non-NULL environment pointer.

Add the pid of the process to the name of the environment variable
to provide greater assurance that the environment will be changed.
</content>
</entry>
<entry>
<title>win32: rename mingw_spawn_1</title>
<updated>2021-11-01T08:25:05+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-11-01T08:25:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0acd7c7984e680f2e352ed43556b2f4cc8da2fbb'/>
<id>urn:sha1:0acd7c7984e680f2e352ed43556b2f4cc8da2fbb</id>
<content type='text'>
The name of the function mingw_spawn_1() wasn't particularly
meaningful.  Remove its envp argument (as all of its current callers
pass a NULL pointer) and rename it mingw_spawnvp() to better reflect
what it does.

The path search it performs isn't the standard one:  it has features
specific to busybox-w32.
</content>
</entry>
<entry>
<title>win32: pass NULL to spawnve, not environ</title>
<updated>2021-10-28T13:24:24+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-28T13:24:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5b48ca53be57bc907ed8dd00635914556b4472e4'/>
<id>urn:sha1:5b48ca53be57bc907ed8dd00635914556b4472e4</id>
<content type='text'>
Building busybox-w32 for use with UCRT results in mysterious
failures.  (GitHub issue #234)

These are somehow related to the environment values passed to
spawnve.  In several places the global environ pointer was being
passed to spawnve so the child would inherit its environment from
the parent.  This can also be achieved by passing a NULL pointer.
This prevents the failures in at least some cases and also makes
the binary smaller.
</content>
</entry>
<entry>
<title>win32: rmdir(2) shouldn't delete symlinks</title>
<updated>2021-10-17T12:52:54+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-17T12:40:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=d239d2d5273e1620a6146d8f5076f6532e3569b1'/>
<id>urn:sha1:d239d2d5273e1620a6146d8f5076f6532e3569b1</id>
<content type='text'>
On Linux rmdir(2) refuses to delete a symlink to a directory on
the obvious grounds that a symlink isn't a directory.  Windows'
rmdir() is less discriminating.

Make our implementation of rmdir(2) behave more like Linux.
</content>
</entry>
<entry>
<title>win32: code shrink</title>
<updated>2021-10-16T08:59:11+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-16T08:59:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=1afcef2f5a089648430a13b2a55ba1428c8d49c0'/>
<id>urn:sha1:1afcef2f5a089648430a13b2a55ba1428c8d49c0</id>
<content type='text'>
There are a few places in mingw.c where we want to determine if a
file is a symbolic link.  Previously these called mingw_lstat()
which collects far more information than is actually needed.

Create a new is_symlink() function which does the minimum work
necessary.
</content>
</entry>
<entry>
<title>realpath: improved support for Windows paths</title>
<updated>2021-10-13T15:44:45+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-13T15:22:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=4daf57b4fdc80422d6448c0a7914699fdedb95b8'/>
<id>urn:sha1:4daf57b4fdc80422d6448c0a7914699fdedb95b8</id>
<content type='text'>
Upstream commit 94eb1c4dc (libbb: better coreutils compatibility
for realpath) made some changes to xmalloc_realpath_coreutils().
This now needs to be updated to handle Windows paths.

- Expose the macro is_unc_path() and part of the recent change to
  bb_get_last_path_component_nostrip() as a separate funtion,
  get_last_slash();

- Convert a couple of errors relating to network filesystems to
  ENOENT;

- Adjust xmalloc_realpath_coreutils() to handle Windows directory
  separators, relative paths and UNC paths.
</content>
</entry>
<entry>
<title>win32: fix creation of relative symlinks</title>
<updated>2021-10-12T12:54:38+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-12T12:54:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=35b9217405d9c3ad8ebeab23f072d35327d25cfe'/>
<id>urn:sha1:35b9217405d9c3ad8ebeab23f072d35327d25cfe</id>
<content type='text'>
Symlinks containing '.' or '..' (such as '../target', './target' or
'dir/./target') were successfully created but couldn't be accessed.

It turns out Windows requires paths of that form to use backslashes
rather than forward slashes.
</content>
</entry>
<entry>
<title>win32: rename is_absolute_path()</title>
<updated>2021-10-12T12:43:15+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-12T12:43:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b4b2b2c4fbba12561c5e988177bef699be306b26'/>
<id>urn:sha1:b4b2b2c4fbba12561c5e988177bef699be306b26</id>
<content type='text'>
As the comment pointed out is_absolute_path() was misnamed.  Rename
it to is_relative_path() and change the sense of all tests.
</content>
</entry>
<entry>
<title>win32: use is_dir_sep() everywhere</title>
<updated>2021-10-12T08:06:35+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2021-10-12T08:06:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0d127fbf4bbcd09f36740019ef129851464f8660'/>
<id>urn:sha1:0d127fbf4bbcd09f36740019ef129851464f8660</id>
<content type='text'>
The is_dir_sep() macro, which has been around since the start of
busybox-w32, can be used instead of is_path_sep().
</content>
</entry>
</feed>
