<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/shell, branch cng_backend</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=cng_backend</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=cng_backend'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2024-12-30T14:45:15+00:00</updated>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2024-12-30T14:45:15+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-12-30T14:45:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=370ce52cca8e7e8a341d5e238a79fd67f6048bb6'/>
<id>urn:sha1:370ce52cca8e7e8a341d5e238a79fd67f6048bb6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>hush: fix G.argv0_for_re_execing to avoid endless loop</title>
<updated>2024-12-09T00:58:45+00:00</updated>
<author>
<name>Hajime Tazaki</name>
<email>thehajime@gmail.com</email>
</author>
<published>2024-11-25T05:08:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=23db6896830d6b37fc3bcc3ad5a7f725eb97d2e1'/>
<id>urn:sha1:23db6896830d6b37fc3bcc3ad5a7f725eb97d2e1</id>
<content type='text'>
When the busybox is used as /sbin/init and the inittab file contains
below:

::respawn:-/bin/sh

/sbin/init spawns hush for the first time with the argv[0] contains '-',
and hush treats it as login shell.  Then it reads /etc/profile and if
the file contains the command execution like below, it invokes hush as
login shell because the argv[0] argument is still '-/bin/sh' and reads
/etc/profile again.  This will last until some failure (e.g., memory
failure) happens.

  [ "$(id -u)" -eq 0 ] &amp;&amp; PS1="${PS1}# " || PS1="${PS1}\$ "

This commit fixes this issues by adding an offset (+1) to the
G.argv0_for_re_execing variable.

This issue happens on our out-of-tree UML (use mode linux) with nommu
configuration.

Link: https://lore.kernel.org/all/cover.1731290567.git.thehajime@gmail.com/
Signed-off-by: Hajime Tazaki &lt;thehajime@gmail.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>ash: match behaviour of cmd.exe in cd builtin</title>
<updated>2024-11-19T09:18:56+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-11-19T09:18:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=90c87dc65452889cd79debdc58d46fee76d17726'/>
<id>urn:sha1:90c87dc65452889cd79debdc58d46fee76d17726</id>
<content type='text'>
The Windows API strips trailing dots and spaces from the last
component of a path.  cmd.exe handles this quirk when changing
directory by adjusting its idea of the current directory to match
reality.  The shell in busybox-w32 didn't do this, leading to some
confusion.

Fix the shell's cd builtin so it works more like cmd.exe.

Adds 64-80 bytes.

(GitHub issue #478)
</content>
</entry>
<entry>
<title>win32: drop stream i/o workaround</title>
<updated>2024-10-30T09:23:19+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-30T09:23:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5ad83957fa74aafd061afbfb8da14ce3220659a9'/>
<id>urn:sha1:5ad83957fa74aafd061afbfb8da14ce3220659a9</id>
<content type='text'>
It seems that one of the workarounds for problems with stream i/o
in MSVCRT was unnecessary.  It also caused display glitches when
the 32-bit binary was run on 64-bit systems.

Remove it.

Saves 112 bytes in the 32-bit build.

(GitHub issue #472)
</content>
</entry>
<entry>
<title>win32: try harder to prevent output to stdout</title>
<updated>2024-10-29T15:39:40+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-29T15:39:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e5beafdf959f0642c226483a16c0a58c4aedba37'/>
<id>urn:sha1:e5beafdf959f0642c226483a16c0a58c4aedba37</id>
<content type='text'>
The previous commit failed to stop 'uname 1&gt;&amp;-' from writing to
standard output with 32-bit MSVCRT.

Close the stream _and_ the file descriptor.

(Github issue #472)
</content>
</entry>
<entry>
<title>win32: more problems with stream i/o and MSVCRT</title>
<updated>2024-10-29T12:52:12+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-29T12:52:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=bed407a12630c0886532b4b2d54dbedd74d52d98'/>
<id>urn:sha1:bed407a12630c0886532b4b2d54dbedd74d52d98</id>
<content type='text'>
These commands:

   cut --wrong-opt 2&gt;&amp;1
   echo $(cut --wrong-opt 2&gt;&amp;1)

resulted in different output.  In the first case the message about
the invalid option appeared before the usage message; in the second
after.

The command

   uname --wrong-opt 1&gt;&amp;- 2&gt;&amp;-

displayed the error message even though both output streams were
closed.

These issues appear to be related to those previously fixed by
commits 4be93f32f and f192e6539:

- They involve the interaction between shell redirection and stream
  input/output.

- UCRT builds aren't affected.

Apply two workarounds:

- When the file descriptor associated with stderr is redirected
  remind stderr it should be unbuffered.  (32- and 64-bit MSVCRT)

- When the file descriptor associated with any of the standard i/o
  streams is to be closed do it by closing the stream instead.
  (32-bit MSVCRT)

Adds 48-176 bytes.

(GitHub commit #472)
</content>
</entry>
<entry>
<title>ash: fix waiting for status of background job</title>
<updated>2024-10-28T13:50:59+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-28T13:50:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=1bdb630cc7b17ca69598bf47ef5ae1b6565c7207'/>
<id>urn:sha1:1bdb630cc7b17ca69598bf47ef5ae1b6565c7207</id>
<content type='text'>
The following has never worked properly in busybox-w32:

   $ my_func() { return 5; }
   $ my_func &amp; sleep 1; wait $!; echo $?

The expected result is that 'echo' should display '5'.  Actual
results used to be '0' and more recently have been '127'.

The culprit was commit fa6f44ea72 (win32: ash: reimplement
waitpid(-1)).  When the status of a job changed its pid was set to
-1, which flagged processes of interest to the implementation of
waitpid().

This is no longer necessary as waitpid() now uses the process
handle instead.  There's therefore no need to overwrite the pid.

(GitHub issue #470)
</content>
</entry>
<entry>
<title>ash: correctly identify nofork applets in error message</title>
<updated>2024-10-28T08:52:51+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-28T08:52:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b4684bee87cb4acf392f27003c702d6650eda469'/>
<id>urn:sha1:b4684bee87cb4acf392f27003c702d6650eda469</id>
<content type='text'>
Commit 633e3a5eae (ash: correctly identify applet in getopt() error
messages) made getopt() display the correct name for noexec applets
in case of error.

Do the same for nofork applets.

Adds 32-48 bytes.
</content>
</entry>
<entry>
<title>ash: update comment</title>
<updated>2024-10-13T09:18:39+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-13T09:18:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e26ca25a4332330dfcf439bb79bd37dbe85f8e60'/>
<id>urn:sha1:e26ca25a4332330dfcf439bb79bd37dbe85f8e60</id>
<content type='text'>
PPID is no longer fake.
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2024-10-08T11:09:30+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-10-08T10:54:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=ded78ca2656fd41f130d65345b0eb4d39b1fcbdf'/>
<id>urn:sha1:ded78ca2656fd41f130d65345b0eb4d39b1fcbdf</id>
<content type='text'>
</content>
</entry>
</feed>
