[Toybox] Patches for toybox-0.4.8

Isaac Dunham ibid.ag at gmail.com
Mon Jun 23 14:45:24 PDT 2014


On Mon, Jun 23, 2014 at 05:35:55PM +0200, luckboy at vp.pl wrote:
> I created own build system for small linux distributions. I had to
> write two patches for your
> toybox-0.4.8. First patch fixes display of the id toy. Second patch
> fixes sigsegv of the which
> toy for the unset PATH variable of environment. These patches:
> 
> https://github.com/luckboy/toyroot/blob/master/patch/toybox-0.4.8-fixes.patch

This is not correct; a system where ngroups !> 0 is broken, and id *should*
perror_exit().
Make sure you have something in /etc/group and /etc/passwd.

> https://github.com/luckboy/toyroot/blob/master/patch/toybox-0.4.8-which-sigsegv.patch
Looks good.

> First patch also contains fixes of toy.h for musl c library.
ie,
+#include <sys/ttydefaults.h>

I've had no recent issues building toybox on my system, based on musl.
What did you hit?
(I'm guessing top, telnet, or watch under toys/pending/ ?)

Also, sys/ttydefaults.h is not a POSIX header; it does not go into
toys.h.
If it's needed, it goes into the toy where it's needed.


Anyhow:
You probably should add mkpasswd, which encrypts passwords.

A minimal /etc/group (group:cryptpasswd:gid:users)
root:x:0:root

where "x" means "the group password isn't here", and users is a
comma-separated list of all users in the group.

And /etc/passwd:
root:x:0:0:root:/root:/bin/sh

where the fields are as follows:
username
password (encrypted, or "x" to indicate that it's in /etc/shadow)
uid
gid
full user name
$HOME
shell

And building /etc/shadow:
#!/bin/sh
printf "root password: "
read password
echo "root:`mkpasswd -m sha512 $password`:$((365*44)):0:99999:7:::" \
 >$DESTDIR/etc/shadow

Where 365*44 is the number of days from Jan 1 1970 to when you set the
password; 99999 is the number of days from when you set the password
till it expires; and 7 is the number of days from expiration that you
have a chance to login and change your password.


Hope this helps,
Isaac Dunham

 1403559924.0


More information about the Toybox mailing list