<feed xmlns='http://www.w3.org/2005/Atom'>
<title>busybox-w32/loginutils, branch awk_faster</title>
<subtitle>A mirror of https://github.com/rmyorston/busybox-w32.git
</subtitle>
<id>https://git.lua4.win/busybox-w32/atom?h=awk_faster</id>
<link rel='self' href='https://git.lua4.win/busybox-w32/atom?h=awk_faster'/>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/'/>
<updated>2020-07-09T12:10:58+00:00</updated>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2020-07-09T12:10:58+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2020-07-09T12:10:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=9c0b2f7020d7c30b21a930ef54be632e092e533b'/>
<id>urn:sha1:9c0b2f7020d7c30b21a930ef54be632e092e533b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>deluser: check if specified home is a directory before removing it</title>
<updated>2020-06-09T16:04:31+00:00</updated>
<author>
<name>Sören Tempel</name>
<email>soeren+git@soeren-tempel.net</email>
</author>
<published>2020-06-09T15:51:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=0356607264b8e1476d98a81667488ba1d6295d23'/>
<id>urn:sha1:0356607264b8e1476d98a81667488ba1d6295d23</id>
<content type='text'>
On Alpine, some users use /dev/null as a home directory. When removing
such a user with `deluser --remove-home` this causes the /dev/null
device file to be removed which is undesirable. To prevent this pitfall,
check if the home directory specified for the user is an actual
directory (or a symlink to a directory).

Implementations of similar tools for other operating systems also
implement such checks. For instance, the OpenBSD rmuser(1)
implementation [0].

[0]: https://github.com/openbsd/src/blob/b69faa6c70c5bfcfdddc6138cd8e0ee18cc15b03/usr.sbin/adduser/rmuser.perl#L143-L151

function                                             old     new   delta
deluser_main                                         337     380     +43

Signed-off-by: Sören Tempel &lt;soeren+git@soeren-tempel.net&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>win32: use lazy loading for certain DLLs</title>
<updated>2020-06-02T07:27:46+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2020-06-02T06:53:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=27c718aa1a4674587925adb543362cb8e60814c4'/>
<id>urn:sha1:27c718aa1a4674587925adb543362cb8e60814c4</id>
<content type='text'>
Only a handful of functions are used from shell32.dll, userenv.dll
and psapi.dll.  Mostly these functions are in out of the way places.

By loading the functions only when required we can avoid the startup
cost of linking the three DLLs in the common case that they aren't
needed.
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2019-08-16T08:45:21+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2019-08-16T08:42:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=517cf74f6265ec4308b790b637b3f9778cbdc6e0'/>
<id>urn:sha1:517cf74f6265ec4308b790b637b3f9778cbdc6e0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>libbb: reduce the overhead of single parameter bb_error_msg() calls</title>
<updated>2019-07-02T09:35:03+00:00</updated>
<author>
<name>James Byrne</name>
<email>james.byrne@origamienergy.com</email>
</author>
<published>2019-07-02T09:35:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=6937487be73cd4563b876413277a295a5fe2f32c'/>
<id>urn:sha1:6937487be73cd4563b876413277a295a5fe2f32c</id>
<content type='text'>
Back in 2007, commit 0c97c9d43707 ("'simple' error message functions by
Loic Grenie") introduced bb_simple_perror_msg() to allow for a lower
overhead call to bb_perror_msg() when only a string was being printed
with no parameters. This saves space for some CPU architectures because
it avoids the overhead of a call to a variadic function. However there
has never been a simple version of bb_error_msg(), and since 2007 many
new calls to bb_perror_msg() have been added that only take a single
parameter and so could have been using bb_simple_perror_message().

This changeset introduces 'simple' versions of bb_info_msg(),
bb_error_msg(), bb_error_msg_and_die(), bb_herror_msg() and
bb_herror_msg_and_die(), and replaces all calls that only take a
single parameter, or use something like ("%s", arg), with calls to the
corresponding 'simple' version.

Since it is likely that single parameter calls to the variadic functions
may be accidentally reintroduced in the future a new debugging config
option WARN_SIMPLE_MSG has been introduced. This uses some macro magic
which will cause any such calls to generate a warning, but this is
turned off by default to avoid use of the unpleasant macros in normal
circumstances.

This is a large changeset due to the number of calls that have been
replaced. The only files that contain changes other than simple
substitution of function calls are libbb.h, libbb/herror_msg.c,
libbb/verror_msg.c and libbb/xfuncs_printf.c. In miscutils/devfsd.c,
networking/udhcp/common.h and util-linux/mdev.c additonal macros have
been added for logging so that single parameter and multiple parameter
logging variants exist.

The amount of space saved varies considerably by architecture, and was
found to be as follows (for 'defconfig' using GCC 7.4):

Arm:     -92 bytes
MIPS:    -52 bytes
PPC:   -1836 bytes
x86_64: -938 bytes

Note that for the MIPS architecture only an exception had to be made
disabling the 'simple' calls for 'udhcp' (in networking/udhcp/common.h)
because it made these files larger on MIPS.

Signed-off-by: James Byrne &lt;james.byrne@origamienergy.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'busybox' into merge</title>
<updated>2019-05-27T10:56:52+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2019-05-27T10:56:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=a61949401890cbb33a9d6c4571b51c53460ad438'/>
<id>urn:sha1:a61949401890cbb33a9d6c4571b51c53460ad438</id>
<content type='text'>
</content>
</entry>
<entry>
<title>login: remove extra IF(), no code changes</title>
<updated>2019-05-02T15:13:20+00:00</updated>
<author>
<name>Denys Vlasenko</name>
<email>vda.linux@googlemail.com</email>
</author>
<published>2019-05-02T15:13:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=b052dbea54e2226ea49b9f3bdec3f6bccf879030'/>
<id>urn:sha1:b052dbea54e2226ea49b9f3bdec3f6bccf879030</id>
<content type='text'>
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>Optionally re-introduce bb_info_msg()</title>
<updated>2019-04-30T08:51:27+00:00</updated>
<author>
<name>James Byrne</name>
<email>james.byrne@origamienergy.com</email>
</author>
<published>2019-04-12T17:01:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=253c4e787a799a3e1f92957ed791b5222f8d2f64'/>
<id>urn:sha1:253c4e787a799a3e1f92957ed791b5222f8d2f64</id>
<content type='text'>
Between Busybox 1.24.2 and 1.25.0 the bb_info_msg() function was
eliminated and calls to it changed to be bb_error_msg(). The downside of
this is that daemons now log all messages to syslog at the LOG_ERR level
which makes it hard to filter errors from informational messages.

This change optionally re-introduces bb_info_msg(), controlled by a new
option FEATURE_SYSLOG_INFO, restores all the calls to bb_info_msg() that
were removed (only in applets that set logmode to LOGMODE_SYSLOG or
LOGMODE_BOTH), and also changes informational messages in ifplugd and
ntpd.

The code size change of this is as follows (using 'defconfig' on x86_64
with gcc 7.3.0-27ubuntu1~18.04)

function                                             old     new   delta
bb_info_msg                                            -     182    +182
bb_vinfo_msg                                           -      27     +27
static.log7                                          194     198      +4
log8                                                 190     191      +1
log5                                                 190     191      +1
crondlog                                              45       -     -45
------------------------------------------------------------------------------
(add/remove: 2/1 grow/shrink: 3/0 up/down: 215/-45)           Total: 170 bytes

If you don't care about everything being logged at LOG_ERR level
then when FEATURE_SYSLOG_INFO is disabled Busybox actually gets smaller:

function                                             old     new   delta
static.log7                                          194     200      +6
log8                                                 190     193      +3
log5                                                 190     193      +3
syslog_level                                           1       -      -1
bb_verror_msg                                        583     581      -2
crondlog                                              45       -     -45
------------------------------------------------------------------------------
(add/remove: 0/2 grow/shrink: 3/1 up/down: 12/-48)            Total: -36 bytes

Signed-off-by: James Byrne &lt;james.byrne@origamienergy.com&gt;
Signed-off-by: Denys Vlasenko &lt;vda.linux@googlemail.com&gt;
</content>
</entry>
<entry>
<title>win32: add function to convert slashes to backslashes</title>
<updated>2019-03-15T10:27:19+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2019-03-15T10:27:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=996f93243dda87de3140c497624312722f47ffa1'/>
<id>urn:sha1:996f93243dda87de3140c497624312722f47ffa1</id>
<content type='text'>
There are now two places where slashes are converted to backslashes
throughout a string so it makes sense to create a function to do
this.

To avoid confusion rename convert_slashes() to bs_to_slash() and
call the new function slash_to_bs().
</content>
</entry>
<entry>
<title>su: canonicalise directory before elevating privileges</title>
<updated>2019-03-14T08:42:17+00:00</updated>
<author>
<name>Ron Yorston</name>
<email>rmy@pobox.com</email>
</author>
<published>2019-03-14T08:42:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.lua4.win/busybox-w32/commit/?id=1b0ac9fc815fd308057f253397723330e6fea376'/>
<id>urn:sha1:1b0ac9fc815fd308057f253397723330e6fea376</id>
<content type='text'>
If the current directory is in a drive mapped to a network share
we may not be able to access it once we have elevated privileges.
Avoid this by canonicalising the path before calling ShellExecuteEx().
</content>
</entry>
</feed>
