<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/miscutils/drop.c, branch cron_changes</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=cron_changes</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=cron_changes'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2024-08-08T07:31:09+00:00</updated>
<entry>
<title>drop: use correct option when cmd.exe is used as shell</title>
<updated>2024-08-08T07:31:09+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-08-08T07:31:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=c7f8fcfb3e26067019de01fdeeffd1ab556f73b9'/>
<id>urn:sha1:c7f8fcfb3e26067019de01fdeeffd1ab556f73b9</id>
<content type='text'>
Use the '/c' option to pass a command to cmd.exe.  This is similar
to what was previously done for 'su':  commit e5244175b (su: use
correct option when cmd.exe is used as shell).

Adds 48-64 bytes.

(GitHub issue #438)
</content>
</entry>
<entry>
<title>drop: allow an alternative shell to be selected</title>
<updated>2024-08-05T10:08:10+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-08-05T10:08:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=2a09008c8eab35b5cc0422fab333ca657877256c'/>
<id>urn:sha1:2a09008c8eab35b5cc0422fab333ca657877256c</id>
<content type='text'>
Add the '-s' option to allow an alternative shell to be given.
No PATH search is performed for the shell, so an absolute or
relative path to a suitable executable must be provided.

Adds 80-96 bytes.

(GitHub issue #438)
</content>
</entry>
<entry>
<title>win32: convert exit codes</title>
<updated>2023-09-14T07:09:14+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-09-14T07:09:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0475b7a649209487269e35cbe49662a33524e6ae'/>
<id>urn:sha1:0475b7a649209487269e35cbe49662a33524e6ae</id>
<content type='text'>
Add two utility functions to convert Windows process exit codes.

- exit_code_to_wait_status() converts to a POSIX wait status.
  This is used in ash and the implementations of system(3) and
  mingw_wait3().

- exit_code_to_posix() converts to a POSIX exit code.  (Not that
  POSIX has much to say about them.)

As a result it's possible for more applets to report when child
processes are killed as if by a signal.  'time', 'drop' and 'su -W',
for example.

Adds 64-80 bytes.
</content>
</entry>
<entry>
<title>win32: remove special treatment of USERNAME</title>
<updated>2023-06-05T10:30:39+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-06-05T10:30:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6fcf8ade94f6cb05a57562abb6a5491a39146682'/>
<id>urn:sha1:6fcf8ade94f6cb05a57562abb6a5491a39146682</id>
<content type='text'>
Commit 255ebaf535 (drop: adjust environment on privilege change)
added USERNAME to the variables subject to special treatment when
the shell starts or privilege is dropped.

It's been pointed out this may not be appropriate for a variable
that's Windows-specific.  Remove the special treatment of USERNAME.

Saves 40-48 bytes.

(GitHub issue #300)
</content>
</entry>
<entry>
<title>drop: changes to ctrl-c handling</title>
<updated>2023-05-23T09:57:56+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-05-23T09:57:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=c2eb45989fcd59617884dc853743b5cc94b15935'/>
<id>urn:sha1:c2eb45989fcd59617884dc853743b5cc94b15935</id>
<content type='text'>
Use the new kill_child_ctrl_handler() function:

- Ctrl-C can be used to terminate non-console applications.

- Ctrl-C in an interactive cmd.exe or PowerShell session won't
  cause drop to terminate.

Also:

- Use getopt32() to process options.

- Update usage messages.

Adds 96-160 bytes.
</content>
</entry>
<entry>
<title>win32: export xappendword()</title>
<updated>2023-04-23T08:04:01+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-04-23T08:00:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0575aaaa0779812752427badbc0f80a09aac02a4'/>
<id>urn:sha1:0575aaaa0779812752427badbc0f80a09aac02a4</id>
<content type='text'>
Export the function xappendword() from make.  Use it in drop and
watch.

Saves 8-80 bytes, an unusually large disparity.
</content>
</entry>
<entry>
<title>drop: adjust environment on privilege change</title>
<updated>2023-03-27T07:57:40+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-03-27T07:57:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=255ebaf535c9f6d8a88e23d55d8be04b0ea73343'/>
<id>urn:sha1:255ebaf535c9f6d8a88e23d55d8be04b0ea73343</id>
<content type='text'>
Some environment variables are subject to special treatment: USER,
LOGNAME, HOME and SHELL are initialised when the shell starts if
they don't already have a value.

Some adjustments are necessary when changing privilege level:

- USERNAME is added to the set of variables subject to special
  treatment.  Unlike the others this is normally set on Windows.

- The special variables are now also updated on shell start up if
  the current process is running with elevated privileges.  This is
  necessary so USER, USERNAME and LOGNAME have the correct value.

- USER, USERNAME and LOGNAME are set to the name of the unprivileged
  user when elevated privileges are dropped, though not if they've
  been changed from the expected value of "root".

Costs 160-208 bytes.

(GitHub issue #300)
</content>
</entry>
<entry>
<title>drop: cdrop and pdrop don't need shell</title>
<updated>2023-03-23T11:29:34+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-03-23T11:29:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=f491e57d1ce04ec8124b9605268e5ecd3b1fb489'/>
<id>urn:sha1:f491e57d1ce04ec8124b9605268e5ecd3b1fb489</id>
<content type='text'>
The cdrop and pdrop variants don't require the binary to include
a shell.  Removing this dependency makes it possible to build
cdrop/pdrop as a much smaller standalone binaries.

Update the default configuration to build a standalone make binary
to exclude drop/cdrop/pdrop.
</content>
</entry>
<entry>
<title>drop: search PATH for cmd.exe/PowerShell</title>
<updated>2023-03-23T08:00:36+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-03-23T08:00:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=138e956a2e34d1b708366b6286687766a7176341'/>
<id>urn:sha1:138e956a2e34d1b708366b6286687766a7176341</id>
<content type='text'>
Rather than hardcode the paths of cmd.exe and PowerShell find them
by searching PATH.

Saves 104-128 bytes.

(GitHub issue #240)
</content>
</entry>
<entry>
<title>drop: add cdrop and pdrop aliases</title>
<updated>2023-03-19T10:26:24+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-03-19T10:26:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=d9e8bb61cf380264511a4524281af2ca57498bce'/>
<id>urn:sha1:d9e8bb61cf380264511a4524281af2ca57498bce</id>
<content type='text'>
Add cdrop and pdrop applets as aliases for drop.  If a command
isn't specified these use cmd.exe and PowerShell instead of the
BusyBox shell.

This makes it possible to choose the default shell used for SSH
connections even in older versions of OpenSSH that don't support
the DefaultShellArguments registry key.

Note that to get cmd.exe to run a command rather than an interactive
shell it's necessary to set the DefaultShellCommandOption registry
key to '/c'.

Costs 248-272 bytes.
</content>
</entry>
</feed>
