<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/loginutils/suw32.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>2025-02-03T11:55:28+00:00</updated>
<entry>
<title>win32: retry when command needs elevated privileges</title>
<updated>2025-02-03T11:55:28+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2025-02-03T11:55:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=14ccc45d548c9dfa73594f155e920c83e2882081'/>
<id>urn:sha1:14ccc45d548c9dfa73594f155e920c83e2882081</id>
<content type='text'>
Some installer programs have an entry in their manifest to indicate
that they need elevated privileges.  The shell in busybox-w32 was
unable to run such programs.

When a program fails to run with ERROR_ELEVATION_REQUIRED, try
again using ShellExecuteEx() with the 'runas' verb to give it
elevated privileges.

Adds 272-288 bytes.

(GitHub issue #481)
</content>
</entry>
<entry>
<title>su: note that test mode implies -W in usage message</title>
<updated>2024-08-08T07:01:10+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-08-08T07:01:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e4a79dee4062157bc209f60895263d6dd85b6d9f'/>
<id>urn:sha1:e4a79dee4062157bc209f60895263d6dd85b6d9f</id>
<content type='text'>
Saves 8-16 bytes

(GitHub issue #438)
</content>
</entry>
<entry>
<title>su: add test mode</title>
<updated>2024-08-07T11:32:11+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-08-07T11:32:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=2908a94a565c162eea751f1d7042b75cdc8cd13d'/>
<id>urn:sha1:2908a94a565c162eea751f1d7042b75cdc8cd13d</id>
<content type='text'>
Testing some uses of 'su' can be challenging because any errors
appear in the new console window which may close as a result.

Add the '-t' option to enable test mode.  This starts a new shell
using ShellExecuteEx(), but without elevated privileges and a new
console.  All other options and arguments are handled much as
before, though some differences in behaviour are to be expected due
to the lack of elevated privilege.

Adds 80-96 bytes.

(GitHub issue #438)
</content>
</entry>
<entry>
<title>su: use correct option when cmd.exe is used as shell</title>
<updated>2024-08-05T13:32:44+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-08-05T13:32:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=e5244175baa5c94726670a6aeb8645428306011a'/>
<id>urn:sha1:e5244175baa5c94726670a6aeb8645428306011a</id>
<content type='text'>
Most Unix shells (and PowerShell) use the '-c' option to specify
commands to execute.  cmd.exe uses '/c' instead.

Detect when cmd.exe is the 'shell' being used with 'su -s' and
adjust the command option to suit.

Adds 48-56 bytes.

(GitHub issue #438)
</content>
</entry>
<entry>
<title>su: allow an alternative shell to be selected</title>
<updated>2024-08-04T11:36:09+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-08-04T11:36:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=5eb14d55da843927f792e35dbf54079579f0d701'/>
<id>urn:sha1:5eb14d55da843927f792e35dbf54079579f0d701</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.

Certain features are only available when the built-in shell is
used:

- The '-N' option, which allows the console window to remain open
  when the shell exits.

- The fix which allows the current directory to be retained despite
  the efforts of ShellExecute() to change it.

- The friendly message in the console title.

Adds 128 bytes.

(GitHub issue #438)
</content>
</entry>
<entry>
<title>su: detect inability to raise privilege</title>
<updated>2024-08-03T09:00:59+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-08-03T09:00:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=fb959dd3f29c2d0655e01147f7b0b9bb2dab4223'/>
<id>urn:sha1:fb959dd3f29c2d0655e01147f7b0b9bb2dab4223</id>
<content type='text'>
When privilege has been dropped by the 'drop' applet, the 'su'
applet is unable to raise it again because ShellExecuteEx()
thinks it unnecessary.

Detect this situation, report an error and return exit code 2.

Costs 72-112 bytes.

(GitHub issue #437)
</content>
</entry>
<entry>
<title>su: free all allocated memory</title>
<updated>2024-03-08T09:19:30+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-03-08T09:16:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=a9f74eb95d4c0da15b93d943ccdf872a642ea368'/>
<id>urn:sha1:a9f74eb95d4c0da15b93d943ccdf872a642ea368</id>
<content type='text'>
Ensure memory is freed even on early exit.

Saves 0-16 bytes.
</content>
</entry>
<entry>
<title>su: handle restricted disk drivers</title>
<updated>2024-03-07T14:34:22+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2024-03-07T14:34:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=3aef195c435771e43ccddb6226f8c98519e2b830'/>
<id>urn:sha1:3aef195c435771e43ccddb6226f8c98519e2b830</id>
<content type='text'>
Certain tools which allow disk image files and RAM disks to be
mounted were found to lack a feature used to implement realpath(3).
This resulted in a segfault in the 'su' applet when it was run in
such a virtual filesystem.

'su' uses realpath(3) to canonicalise the current directory.  This
is only really required to handle network shares mapped to a drive
letter.  (GitHub issue #148)

- If the call to realpath(3) fails for some reason fall back to
  using the current directory determined by calling getcwd(3).

- If getcwd(3) fails simply don't pass any directory to the shell
  being started by 'su'.

Also, ensure all allocated memory is freed, if required.

(GitHub issue #389)

Adds 16-32 bytes.
</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>su: fix usage message</title>
<updated>2023-05-28T09:13:49+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2023-05-28T09:13:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=82accfc19fcbda7cd2245a727ca493b582fb0994'/>
<id>urn:sha1:82accfc19fcbda7cd2245a727ca493b582fb0994</id>
<content type='text'>
</content>
</entry>
</feed>
