All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
@ 2018-05-02  9:05 Stefan Becker
  2018-05-02 17:57 ` Yann E. MORIN
                   ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Stefan Becker @ 2018-05-02  9:05 UTC (permalink / raw)
  To: buildroot

crypt() is an optional glibc feature. Some distros, like Fedora 28, are
phasing it out to be replaced with libxcrypt [1]. Unfortunately this
change is only ABI compatible, not source code compatible, i.e. the code
will compile with warnings about undefined crypt(), but the resulting
binary will crash.

Follow the guidance in the Fedora bug and include crypt.h when
_XOPEN_CRYPT is not defined.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1566464

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
---
 package/mkpasswd/mkpasswd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/mkpasswd/mkpasswd.c b/package/mkpasswd/mkpasswd.c
index 5820f32501..fd16230468 100644
--- a/package/mkpasswd/mkpasswd.c
+++ b/package/mkpasswd/mkpasswd.c
@@ -44,6 +44,11 @@
 #include <sys/time.h>
 #endif
 
+/* glibc without crypt() */
+#ifndef _XOPEN_CRYPT
+#include <crypt.h>
+#endif
+
 /* Application-specific */
 #include "utils.h"
 
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02  9:05 [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host Stefan Becker
@ 2018-05-02 17:57 ` Yann E. MORIN
  2018-05-02 18:23   ` Stefan Becker
  2018-05-03 19:56 ` Thomas Petazzoni
  2018-05-03 21:26 ` Peter Korsgaard
  2 siblings, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2018-05-02 17:57 UTC (permalink / raw)
  To: buildroot

Stefan, All,

On 2018-05-02 12:05 +0300, Stefan Becker spake thusly:
> crypt() is an optional glibc feature. Some distros, like Fedora 28, are
> phasing it out to be replaced with libxcrypt [1]. Unfortunately this
> change is only ABI compatible, not source code compatible, i.e. the code
> will compile with warnings about undefined crypt(), but the resulting
> binary will crash.
> 
> Follow the guidance in the Fedora bug and include crypt.h when
> _XOPEN_CRYPT is not defined.
> 
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1566464
> 
> Signed-off-by: Stefan Becker <chemobejk@gmail.com>
> ---
>  package/mkpasswd/mkpasswd.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/package/mkpasswd/mkpasswd.c b/package/mkpasswd/mkpasswd.c
> index 5820f32501..fd16230468 100644
> --- a/package/mkpasswd/mkpasswd.c
> +++ b/package/mkpasswd/mkpasswd.c
> @@ -44,6 +44,11 @@
>  #include <sys/time.h>
>  #endif
>  
> +/* glibc without crypt() */
> +#ifndef _XOPEN_CRYPT
> +#include <crypt.h>
> +#endif

But what if the libxcrypt package is not installed? Since crypt is only
optional in POSIX, there is no guarantee that libxcrypt is even present
on a system, especially now that glibc has decided to no longer provide
it by default, and given that even --enable-obsolete-crypt does not even
declare _XOPEN_CRYPT...

However, until we have another distribution with the new glibc version,
this fix is good enough since it is at least working as-is on a stock
Fedora 28.

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

>  /* Application-specific */
>  #include "utils.h"
>  
> -- 
> 2.17.0
> 

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02 17:57 ` Yann E. MORIN
@ 2018-05-02 18:23   ` Stefan Becker
  2018-05-02 20:38     ` Arnout Vandecappelle
  2018-05-02 21:06     ` Yann E. MORIN
  0 siblings, 2 replies; 38+ messages in thread
From: Stefan Becker @ 2018-05-02 18:23 UTC (permalink / raw)
  To: buildroot

Yann, All,

On Wed, May 2, 2018 at 8:57 PM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

>
> But what if the libxcrypt package is not installed? Since crypt is only
> optional in POSIX, there is no guarantee that libxcrypt is even present
> on a system, especially now that glibc has decided to no longer provide
> it by default, and given that even --enable-obsolete-crypt does not even
> declare _XOPEN_CRYPT...
>

If crypt() is provided by libxcrypt instead of glibc, then this should be
automatically handled by package dependencies, i.e.

$ rpm -q --provides libxcrypt
...
libcrypt.so.1()(64bit)
libcrypt.so.1(GLIBC_2.2.5)(64bit)
libcrypt.so.1(OW_CRYPT_1.0)(64bit)
libcrypt.so.1(XCRYPT_2.0)(64bit)
$ rpm -q --whatrequires 'libcrypt.so.1()(64bit)' | wc -l
57
$ rpm -q --whatrequires 'libcrypt.so.1(XCRYPT_2.0)(64bit)' | wc -l
26

The first one ensures that pre-F28 binaries still continue to work on
Fedora 28. The latter ones have obviously been rebuilt against libxcrypt.so
already.

As for the development stuff:

$ rpm -ql libxcrypt-devel
/lib64/libcrypt.so
/usr/include/crypt.h
...
$ rpm -q --provides libxcrypt-devel
libxcrypt-devel = 4.0.0-5.fc28
libxcrypt-devel(x86-64) = 4.0.0-5.fc28
pkgconfig(libxcrypt) = 4.0.0
$ rpm -q --whatrequires 'libxcrypt-devel(x86-64)'
glibc-devel-2.27-8.fc28.x86_64

So at least on Fedora 28 this is handled in a backward compatible way, i.e.
if I want to compile against glibc I also get libxcrypt-devel and therefore
crypt.h.

In short: I updated 2 systems from F27 to F28 and automatically have
libxcrypt and libxcrypt-devel available after the update. On the remaining
F27 system I can see that libxcrypt isn't available at all, i.e. it is a
new F28 feature.

Just my ?0.02, Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180502/6b8ecc97/attachment.html>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02 18:23   ` Stefan Becker
@ 2018-05-02 20:38     ` Arnout Vandecappelle
  2018-05-02 21:04       ` Yann E. MORIN
  2018-05-03  6:11       ` Stefan Becker
  2018-05-02 21:06     ` Yann E. MORIN
  1 sibling, 2 replies; 38+ messages in thread
From: Arnout Vandecappelle @ 2018-05-02 20:38 UTC (permalink / raw)
  To: buildroot



On 02-05-18 20:23, Stefan Becker wrote:
> Yann, All,
> 
> On Wed, May 2, 2018 at 8:57 PM Yann E. MORIN <yann.morin.1998@free.fr
> <mailto:yann.morin.1998@free.fr>> wrote:
> 
> 
>     But what if the libxcrypt package is not installed? Since crypt is only
>     optional in POSIX, there is no guarantee that libxcrypt is even present
>     on a system, especially now that glibc has decided to no longer provide
>     it by default, and given that even --enable-obsolete-crypt does not even
>     declare _XOPEN_CRYPT...
> 
> ?
> If crypt() is provided by libxcrypt instead of glibc, then this should be
> automatically handled by package dependencies, i.e.
> 
> $ rpm -q --provides libxcrypt
> ...
> libcrypt.so.1()(64bit)
> libcrypt.so.1(GLIBC_2.2.5)(64bit)
> libcrypt.so.1(OW_CRYPT_1.0)(64bit)
> libcrypt.so.1(XCRYPT_2.0)(64bit)
> $ rpm -q --whatrequires 'libcrypt.so.1()(64bit)' | wc -l
> 57
> $ rpm -q --whatrequires 'libcrypt.so.1(XCRYPT_2.0)(64bit)' | wc -l
> 26
> 
> The first one ensures that pre-F28 binaries still continue to work on Fedora 28.
> The latter ones have obviously been rebuilt against libxcrypt.so already.
> 
> As for the development stuff:
> 
> $ rpm -ql libxcrypt-devel
> /lib64/libcrypt.so
> /usr/include/crypt.h

 And in pre-F28 this header will be provided by glibc-devel, right?

 But so in practice we can assume that crypt.h is always present, so why not
include it unconditionally?


 BTW, how is this solved in upstream whois?

 Regards,
 Arnout


> ...
> $ rpm -q --provides libxcrypt-devel
> libxcrypt-devel = 4.0.0-5.fc28
> libxcrypt-devel(x86-64) = 4.0.0-5.fc28
> pkgconfig(libxcrypt) = 4.0.0
> $ rpm -q --whatrequires 'libxcrypt-devel(x86-64)'
> glibc-devel-2.27-8.fc28.x86_64
> 
> So at least on Fedora 28 this is handled in a backward compatible way, i.e. if I
> want to compile against glibc I also get libxcrypt-devel and therefore crypt.h.
> 
> In short: I updated 2 systems from F27 to F28 and automatically have libxcrypt
> and libxcrypt-devel available after the update. On the remaining F27 system I
> can see that libxcrypt isn't available at all, i.e. it is a new F28 feature.
> 
> Just my ?0.02, Stefan
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02 20:38     ` Arnout Vandecappelle
@ 2018-05-02 21:04       ` Yann E. MORIN
  2018-05-03  6:11       ` Stefan Becker
  1 sibling, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2018-05-02 21:04 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2018-05-02 22:38 +0200, Arnout Vandecappelle spake thusly:
> On 02-05-18 20:23, Stefan Becker wrote:
> > On Wed, May 2, 2018 at 8:57 PM Yann E. MORIN <yann.morin.1998@free.fr
> > <mailto:yann.morin.1998@free.fr>> wrote:
> >     But what if the libxcrypt package is not installed? Since crypt is only
> >     optional in POSIX, there is no guarantee that libxcrypt is even present
> >     on a system, especially now that glibc has decided to no longer provide
> >     it by default, and given that even --enable-obsolete-crypt does not even
> >     declare _XOPEN_CRYPT...
> > ?
> > If crypt() is provided by libxcrypt instead of glibc, then this should be
> > automatically handled by package dependencies, i.e.
[--SNIP--]
>  And in pre-F28 this header will be provided by glibc-devel, right?

At least it is so in a debian-based distro, yes.

>  But so in practice we can assume that crypt.h is always present, so why not
> include it unconditionally?
> 
>  BTW, how is this solved in upstream whois?

Sufficiently good that we may want to update?

When we included mkpasswd, we did not have the whois package in
Buildroot. Now we have it, but there is no host variant.

Maybe it is time to add host-whois, that installs mkpasswd, and then
ditch our bundled copy of mkpasswd?

rc1 is really close now (Peter said next weekend), so it is a bit late
to switch, maybe... :-/

In the meantime, as I already said, this patch is good-enough to go
as-is for now.

If we get a better solution after the release, we can backport it if
that makes sense. But until then...

Regards,
Yann E. MORIN.

> > ...
> > $ rpm -q --provides libxcrypt-devel
> > libxcrypt-devel = 4.0.0-5.fc28
> > libxcrypt-devel(x86-64) = 4.0.0-5.fc28
> > pkgconfig(libxcrypt) = 4.0.0
> > $ rpm -q --whatrequires 'libxcrypt-devel(x86-64)'
> > glibc-devel-2.27-8.fc28.x86_64
> > 
> > So at least on Fedora 28 this is handled in a backward compatible way, i.e. if I
> > want to compile against glibc I also get libxcrypt-devel and therefore crypt.h.
> > 
> > In short: I updated 2 systems from F27 to F28 and automatically have libxcrypt
> > and libxcrypt-devel available after the update. On the remaining F27 system I
> > can see that libxcrypt isn't available at all, i.e. it is a new F28 feature.
> > 
> > Just my ?0.02, Stefan
> > 
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> > 
> 
> -- 
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02 18:23   ` Stefan Becker
  2018-05-02 20:38     ` Arnout Vandecappelle
@ 2018-05-02 21:06     ` Yann E. MORIN
  1 sibling, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2018-05-02 21:06 UTC (permalink / raw)
  To: buildroot

Stefan, All,

On 2018-05-02 18:23 +0000, Stefan Becker spake thusly:
> On Wed, May 2, 2018 at 8:57 PM Yann E. MORIN < [1]yann.morin.1998@free.fr> wrote:
>   But what if the libxcrypt package is not installed? [...]
> If crypt() is provided by libxcrypt instead of glibc, then this should
> be automatically handled by package dependencies, i.e.
[--SNIP--]
> So at least on Fedora 28 this is handled in a backward compatible way,
> i.e. if I want to compile against glibc I also get libxcrypt-devel and
> therefore crypt.h.

OK, thanks for the explanations on how that's handled in Fedora. :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02 20:38     ` Arnout Vandecappelle
  2018-05-02 21:04       ` Yann E. MORIN
@ 2018-05-03  6:11       ` Stefan Becker
  1 sibling, 0 replies; 38+ messages in thread
From: Stefan Becker @ 2018-05-03  6:11 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On Wed, May 2, 2018 at 11:38 PM Arnout Vandecappelle <arnout@mind.be> wrote:

> And in pre-F28 this header will be provided by glibc-devel, right?
>
> But so in practice we can assume that crypt.h is always present, so why not
> include it unconditionally?
>

crypt.h and -lcrypt seem to be ancient glibc artefacts. E.g. RedHat 7.x
glibc-2.2.5 (
http://rpm.pbone.net/index.php3/stat/4/idpl/38881780/dir/redhat_7.x/com/glibc-devel-2.2.5-44.i386.rpm.html
).

For the Fedora 28 change see also:

*
https://fedoraproject.org/wiki/Changes/Replace_glibc_libcrypt_with_libxcrypt
*
https://src.fedoraproject.org/rpms/glibc/c/2687b3c78b7b05ca9cc568e40464fb7909e9ec6d
* https://sourceware.org/ml/libc-alpha/2017-08/msg01257.html

So at least on Linux & glibc the guidance

   #define _XOPEN_SOURCE

   #include <stdlib.h>
   #include <stdio.h>
   #include <unistd.h>

   #ifndef _XOPEN_CRYPT
   #include <crypt.h>
   #endif

   int main(int argc, char **argv)
   {
     (void)argc;
     (void)argv;
     printf("%s\n", crypt("passwd", "salt"));
     return(0);
  }

should be always correct.

Fedora 28 (glibc 2.27 + libcrypt deprecation patch):

$ gcc -Wall -Wextra -Werror -dD -E dummy.c | fgrep -e _CRYPT -e crypt.h -e
'*crypt '
    _SC_XOPEN_CRYPT,
#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
# 1 "/usr/include/crypt.h" 1 3 4
# 20 "/usr/include/crypt.h" 3 4
#define _CRYPT_H 1
# 63 "/usr/include/crypt.h" 3 4
extern char *crypt (const char *__phrase, const char *__setting)
...

Fedora 27  (glibc 2.26):

$ gcc -Wall -Wextra -Werror -dD -E dummy.c | fgrep -e _CRYPT -e crypt.h -e
'*crypt '
#define _XOPEN_CRYPT 1
    _SC_XOPEN_CRYPT,
#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
extern char *crypt (const char *__key, const char *__salt)

Ubuntu 14.04 (glibc 2.19):

$ gcc -Wall -Wextra -Werror -dD -E dummy.c | fgrep -e _CRYPT -e crypt.h -e
'*crypt '
#define _XOPEN_CRYPT 1
    _SC_XOPEN_CRYPT,
#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
extern char *crypt (const char *__key, const char *__salt)

Buildroot target @master (glibc 2.27):

$ output/host/bin/arm-buildroot-linux-gnueabihf-gcc -Wall -Wextra -Werror
-dD -E dummy.c | fgrep -e _CRYPT -e crypt.h -e '*crypt '
#undef __ARM_FEATURE_CRYPTO
#define _XOPEN_CRYPT 1
    _SC_XOPEN_CRYPT,
#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
extern char *crypt (const char *__key, const char *__salt)

Regards, Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180503/a8c28eb0/attachment.html>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02  9:05 [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host Stefan Becker
  2018-05-02 17:57 ` Yann E. MORIN
@ 2018-05-03 19:56 ` Thomas Petazzoni
  2018-05-03 20:04   ` Yann E. MORIN
  2018-05-03 21:26 ` Peter Korsgaard
  2 siblings, 1 reply; 38+ messages in thread
From: Thomas Petazzoni @ 2018-05-03 19:56 UTC (permalink / raw)
  To: buildroot

Hello,

On Wed,  2 May 2018 12:05:08 +0300, Stefan Becker wrote:
> crypt() is an optional glibc feature. Some distros, like Fedora 28, are
> phasing it out to be replaced with libxcrypt [1]. Unfortunately this
> change is only ABI compatible, not source code compatible, i.e. the code
> will compile with warnings about undefined crypt(), but the resulting
> binary will crash.
> 
> Follow the guidance in the Fedora bug and include crypt.h when
> _XOPEN_CRYPT is not defined.
> 
> [1] https://bugzilla.redhat.com/show_bug.cgi?id=1566464
> 
> Signed-off-by: Stefan Becker <chemobejk@gmail.com>
> ---
>  package/mkpasswd/mkpasswd.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-03 19:56 ` Thomas Petazzoni
@ 2018-05-03 20:04   ` Yann E. MORIN
  2018-05-06 16:19     ` Stefan Becker
  2018-05-29  6:43     ` [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host Stefan Becker
  0 siblings, 2 replies; 38+ messages in thread
From: Yann E. MORIN @ 2018-05-03 20:04 UTC (permalink / raw)
  To: buildroot

Stefan, All,

On 2018-05-03 21:56 +0200, Thomas Petazzoni spake thusly:
> On Wed,  2 May 2018 12:05:08 +0300, Stefan Becker wrote:
> > crypt() is an optional glibc feature. Some distros, like Fedora 28, are
> > phasing it out to be replaced with libxcrypt [1]. Unfortunately this
> > change is only ABI compatible, not source code compatible, i.e. the code
> > will compile with warnings about undefined crypt(), but the resulting
> > binary will crash.
> > 
> > Follow the guidance in the Fedora bug and include crypt.h when
> > _XOPEN_CRYPT is not defined.
> > 
> > [1] https://bugzilla.redhat.com/show_bug.cgi?id=1566464
> > 
> > Signed-off-by: Stefan Becker <chemobejk@gmail.com>
> > ---
> >  package/mkpasswd/mkpasswd.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> 
> Applied to master, thanks.

Although in the long run, I believe it might be preferrable that we
ditch our own bundled version, and switch to making our whois package a
hot pacakge, and use that as the provider for mkpasswd.

Stefan, would you want to do that? ;-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-02  9:05 [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host Stefan Becker
  2018-05-02 17:57 ` Yann E. MORIN
  2018-05-03 19:56 ` Thomas Petazzoni
@ 2018-05-03 21:26 ` Peter Korsgaard
  2 siblings, 0 replies; 38+ messages in thread
From: Peter Korsgaard @ 2018-05-03 21:26 UTC (permalink / raw)
  To: buildroot

>>>>> "Stefan" == Stefan Becker <chemobejk@gmail.com> writes:

 > crypt() is an optional glibc feature. Some distros, like Fedora 28, are
 > phasing it out to be replaced with libxcrypt [1]. Unfortunately this
 > change is only ABI compatible, not source code compatible, i.e. the code
 > will compile with warnings about undefined crypt(), but the resulting
 > binary will crash.

 > Follow the guidance in the Fedora bug and include crypt.h when
 > _XOPEN_CRYPT is not defined.

 > [1] https://bugzilla.redhat.com/show_bug.cgi?id=1566464

 > Signed-off-by: Stefan Becker <chemobejk@gmail.com>

Committed to 2018.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-03 20:04   ` Yann E. MORIN
@ 2018-05-06 16:19     ` Stefan Becker
  2018-05-07 15:00       ` M ZV
  2018-05-29  6:43     ` [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host Stefan Becker
  1 sibling, 1 reply; 38+ messages in thread
From: Stefan Becker @ 2018-05-06 16:19 UTC (permalink / raw)
  To: buildroot

Yann, All,

On Thu, May 3, 2018 at 11:04 PM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> ditch our own bundled version, and switch to making our whois package a
> hot pacakge, and use that as the provider for mkpasswd.
>
> Stefan, would you want to do that? ;-)
>

I'll give it a go, but can only work on this in a few weeks when I get some
free cycles...

Regards, Stefan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180506/25416ee7/attachment.html>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-06 16:19     ` Stefan Becker
@ 2018-05-07 15:00       ` M ZV
  2018-05-08 21:37         ` Arnout Vandecappelle
  0 siblings, 1 reply; 38+ messages in thread
From: M ZV @ 2018-05-07 15:00 UTC (permalink / raw)
  To: buildroot

 Hello,


>
> On Thu, May 3, 2018 at 11:04 PM Yann E. MORIN <yann.morin.1998@free.fr>
> wrote:
>
>> ditch our own bundled version, and switch to making our whois package a
>> hot pacakge, and use that as the provider for mkpasswd.
>>
>> Stefan, would you want to do that? ;-)
>>
>
> I'll give it a go, but can only work on this in a few weeks when I get
> some free cycles...
>
> Regards, Stefan
>
>
We're using mkpasswd specifically for a single task (skeleton-init-common
root password generation). I'm already tackling building this on Alpine
(musl environment) and facing
multiple issues: had to use -lintl for linking (that libintl musl/glibc can
of worms) and of course, it only makes md5 hashes since all SHA
functionalities are disabled on non-glibc systems via its header.

Can we just use a couple of python code using crypt.crypt(...), since
python is already a requirement. One less package to maintain is a good
news (buildroots already brimming with a mind boggling number of packages).

By the way, my first post here, I hope I'm not coming off as a nagging
pedestrian just adding noise. I highly appreciate the effort you guys are
putting into this.
Thank you.

(My apologies for double posting - it seems, at first, I didn't reply to
all)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180507/f55c7698/attachment.html>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-07 15:00       ` M ZV
@ 2018-05-08 21:37         ` Arnout Vandecappelle
  2018-05-09 20:22           ` Yann E. MORIN
  0 siblings, 1 reply; 38+ messages in thread
From: Arnout Vandecappelle @ 2018-05-08 21:37 UTC (permalink / raw)
  To: buildroot

[Added Matt as

On 07-05-18 17:00, M ZV wrote:
> Hello,?
> ?
> 
> 
>     On Thu, May 3, 2018 at 11:04 PM Yann E. MORIN <yann.morin.1998@free.fr
>     <mailto:yann.morin.1998@free.fr>> wrote:
> 
>         ditch our own bundled version, and switch to making our whois package a
>         hot pacakge, and use that as the provider for mkpasswd.
> 
>         Stefan, would you want to do that? ;-)
> 
> 
>     I'll give it a go, but can only work on this in a few weeks when I get some
>     free cycles...
> 
>     Regards, Stefan
> 
> 
> We're using?mkpasswd specifically for a single task (skeleton-init-common root
> password generation). I'm already tackling building this on Alpine (musl

 Yes, Alpine is a pain :-)

> environment) and facing?
> multiple issues: had to use -lintl for linking (that libintl musl/glibc can of
> worms) and of course, it only makes md5 hashes since all SHA functionalities are
> disabled on non-glibc systems via its header.
> 
> Can we just use a couple of python code using?crypt.crypt(...), since python is
> already a requirement. One less package to maintain is a good news (buildroots
> already brimming with a mind boggling?number of packages).

 Great idea! Indeed, the python script would be rather trivial - mostly
generating salt.

 Probably, when doing that, more of the mkusers script could migrate to python.
But to start with it could be a python "oneliner":

	dd if=/dev/urandom bs=1 count=12 | python -c "
			import sys, crypt, base64
			salt = sys.stdin.read()
			b64salt = base64.b64encode(salt, './')
			b64salt = b64salt.strip('=')
			print(crypt.crypt('${password}',
				'${PASSWD_METHOD}' + b64salt))"


 Normally, I'd say I want to avoid calling python in the normal build path
(because of python overhead, because it's a hard-to-reproduce environment,
because of python2/3 uncertainty, ...). However, that ship has sailed with the
introduction of check-uniq-files.


 Would you like to prepare a patch introducing the python-based approach? It
should be two patches: the first one introducing the python script in mkusers,
the second one removing the mkpasswd package.


 Regards,
 Arnout

> By the way, my first post here, I hope I'm not coming off as a nagging
> pedestrian just adding noise. I highly appreciate the effort you guys are
> putting into this.
> Thank you.
> 
> (My apologies for double posting - it seems, at first, I didn't reply to all)
> 
> 
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-08 21:37         ` Arnout Vandecappelle
@ 2018-05-09 20:22           ` Yann E. MORIN
  2018-05-10 16:02             ` M ZV
  2018-05-29  7:37             ` Peter Korsgaard
  0 siblings, 2 replies; 38+ messages in thread
From: Yann E. MORIN @ 2018-05-09 20:22 UTC (permalink / raw)
  To: buildroot

M ZV, All,

On 2018-05-08 23:37 +0200, Arnout Vandecappelle spake thusly:
> On 07-05-18 17:00, M ZV wrote:
> > Hello,?
> > We're using?mkpasswd specifically for a single task (skeleton-init-common root
> > password generation). I'm already tackling building this on Alpine (musl
>  Yes, Alpine is a pain :-)

Meh, yes... :-(

However, all the tricks required to actually build with musl are known.
Except we only have code to handle that for target packages.

For host pacakges, it is more tricky to do, though...

> > environment) and facing?
> > multiple issues: had to use -lintl for linking (that libintl musl/glibc can of
> > worms) and of course, it only makes md5 hashes since all SHA functionalities are
> > disabled on non-glibc systems via its header.
> > 
> > Can we just use a couple of python code using?crypt.crypt(...), since python is
> > already a requirement. One less package to maintain is a good news (buildroots
> > already brimming with a mind boggling?number of packages).
> 
>  Great idea! Indeed, the python script would be rather trivial - mostly
> generating salt.

I don't like that we reinvent such tools... Especially when dealing with
security-related tools...

>  Probably, when doing that, more of the mkusers script could migrate to python.
> But to start with it could be a python "oneliner":
> 
> 	dd if=/dev/urandom bs=1 count=12 | python -c "

This is not optimal. Better to do a single read instead of 12: bs=12
count=1

> 			import sys, crypt, base64
> 			salt = sys.stdin.read()

Why such convoluted code to read 12 bytes of random data? Why not use
Python's builtins for that?

    https://docs.python.org/3/library/secrets.html

    import secrets
    blob = secrets.token_bytes(12)

> 			b64salt = base64.b64encode(salt, './')
> 			b64salt = b64salt.strip('=')
> 			print(crypt.crypt('${password}',
> 				'${PASSWD_METHOD}' + b64salt))"
> 
> 
>  Normally, I'd say I want to avoid calling python in the normal build path
> (because of python overhead, because it's a hard-to-reproduce environment,
> because of python2/3 uncertainty, ...). However, that ship has sailed with the
> introduction of check-uniq-files.
> 
> 
>  Would you like to prepare a patch introducing the python-based approach? It
> should be two patches: the first one introducing the python script in mkusers,
> the second one removing the mkpasswd package.

Sorry, I am not too convinced that writing our own tool is good...

Regards,
Yann E. MORIN.

> 
>  Regards,
>  Arnout
> 
> > By the way, my first post here, I hope I'm not coming off as a nagging
> > pedestrian just adding noise. I highly appreciate the effort you guys are
> > putting into this.
> > Thank you.
> > 
> > (My apologies for double posting - it seems, at first, I didn't reply to all)
> > 
> > 
> > 
> > _______________________________________________
> > buildroot mailing list
> > buildroot at busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
> > 
> 
> -- 
> Arnout Vandecappelle                          arnout at mind be
> Senior Embedded Software Architect            +32-16-286500
> Essensium/Mind                                http://www.mind.be
> G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
> LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
> GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-09 20:22           ` Yann E. MORIN
@ 2018-05-10 16:02             ` M ZV
  2018-05-29  7:37             ` Peter Korsgaard
  1 sibling, 0 replies; 38+ messages in thread
From: M ZV @ 2018-05-10 16:02 UTC (permalink / raw)
  To: buildroot

Hello,
Arnout, Yann, All,

I just noticed there are actually two places host-mkpasswd is being used:
root account (skeleton-init-common.mk) and users table. I think,
if we're going to replace mkpasswd with a script, this all should go through
one single point somehow (something like support/scripts/crypt_wrapper).

On Thu, May 10, 2018 at 12:52 AM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
> I don't like that we reinvent such tools... Especially when dealing with
> security-related tools...
>
>>       dd if=/dev/urandom bs=1 count=12 | python -c "
>
> This is not optimal. Better to do a single read instead of 12: bs=12
> count=1
>
>>                       import sys, crypt, base64
>>                       salt = sys.stdin.read()
>
> Why such convoluted code to read 12 bytes of random data? Why not use
> Python's builtins for that?
>
>     https://docs.python.org/3/library/secrets.html
>
>     import secrets
>     blob = secrets.token_bytes(12)
>

I actually like Arnout way of using /dev/urandom. The more we make use of
system resources (and less responsibility for python) the better.

>
> Sorry, I am not too convinced that writing our own tool is good...
>
> Regards,
> Yann E. MORIN.

To be honest, like all of you, I'm also very uncomfortable replacing
mkpasswd with
a python solution. There're three reasons that made me convinced this
is the right thing to do.

First, it's cryptographically sound. We're not going to roll our own
hash algorithm.
It?s simply making a LIBC crypt(3) function call. Like mkpasswd, this is just a
system/libc call wrapper.

Second, host-mkpasswd (which is carved out of another package to be a
lightweight
buildroot?s own bundle) apparently needs periodic attention (as can be
seen in the
mailing list archive throughout the years). In my case it actually
built the shadow
with empty password for the root (SHA functions are ignored for musl)
without throwing
 any errors. I know these blatant failures are easily caught by the
developer before any kind
of release but they all reveal how rapidly this package is going
through bit-rot.

And finally, this (python or perl script) seems to be the only
cross-distribution solution
that actually works without adding hundreds of lines of code (or a
full-blown whois package)
to the build infrastructure with their own specific libc compatibility
patches and version bumps.
And it works on Alpine!

I personally settle for a code that is aesthetically wanting or
philosophically unschooled
if the alternative is to take more of the maintainers? attention and time.
An absolute rare commodity we can ill afford.

Thank you.
Mike Z. Vand

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-03 20:04   ` Yann E. MORIN
  2018-05-06 16:19     ` Stefan Becker
@ 2018-05-29  6:43     ` Stefan Becker
  1 sibling, 0 replies; 38+ messages in thread
From: Stefan Becker @ 2018-05-29  6:43 UTC (permalink / raw)
  To: buildroot

Yann, All,

On Thu, May 3, 2018 at 11:04 PM Yann E. MORIN <yann.morin.1998@free.fr>
wrote:

> Stefan, All,

> Although in the long run, I believe it might be preferrable that we
> ditch our own bundled version, and switch to making our whois package a
> hot pacakge, and use that as the provider for mkpasswd.

> Stefan, would you want to do that? ;-)

I poked around in package/whois this morning to add host-whois. IMHO that
package is not much of an improvement over package/mkpasswd. Everything is
hard-coded there too, i.e. the build does not detect if the build host
needs crypt.h/-lcrypt or not.

Just my $0.02,

Stefan

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-09 20:22           ` Yann E. MORIN
  2018-05-10 16:02             ` M ZV
@ 2018-05-29  7:37             ` Peter Korsgaard
  2018-05-30 15:31               ` Yann E. MORIN
  1 sibling, 1 reply; 38+ messages in thread
From: Peter Korsgaard @ 2018-05-29  7:37 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

Hi,

 >> Would you like to prepare a patch introducing the python-based approach? It
 >> should be two patches: the first one introducing the python script in mkusers,
 >> the second one removing the mkpasswd package.

 > Sorry, I am not too convinced that writing our own tool is good...

Me neither. Another alternative is to build host-busybox and use the
mkpasswd applet with the built in crypt routines (ENABLE_USE_BB_CRYPT).

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-29  7:37             ` Peter Korsgaard
@ 2018-05-30 15:31               ` Yann E. MORIN
  2018-05-30 16:45                 ` Arnout Vandecappelle
  0 siblings, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2018-05-30 15:31 UTC (permalink / raw)
  To: buildroot

Peter, All,

On 2018-05-29 09:37 +0200, Peter Korsgaard spake thusly:
> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
>  >> Would you like to prepare a patch introducing the python-based approach? It
>  >> should be two patches: the first one introducing the python script in mkusers,
>  >> the second one removing the mkpasswd package.
> 
>  > Sorry, I am not too convinced that writing our own tool is good...
> 
> Me neither. Another alternative is to build host-busybox and use the
> mkpasswd applet with the built in crypt routines (ENABLE_USE_BB_CRYPT).

Yeah, I like that idea more. Plus, we can get known-reproducible
behaviour for other applets, should we need to add that.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host
  2018-05-30 15:31               ` Yann E. MORIN
@ 2018-05-30 16:45                 ` Arnout Vandecappelle
  2018-06-01 12:58                   ` [Buildroot] [PATCH proposal/next] replace host-mkpasswd Stefan Becker
  0 siblings, 1 reply; 38+ messages in thread
From: Arnout Vandecappelle @ 2018-05-30 16:45 UTC (permalink / raw)
  To: buildroot



On 30-05-18 17:31, Yann E. MORIN wrote:
> Peter, All,
> 
> On 2018-05-29 09:37 +0200, Peter Korsgaard spake thusly:
>>>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
>>  >> Would you like to prepare a patch introducing the python-based approach? It
>>  >> should be two patches: the first one introducing the python script in mkusers,
>>  >> the second one removing the mkpasswd package.
>>
>>  > Sorry, I am not too convinced that writing our own tool is good...

 If I understand correctly, you don't want to write our own tool because "don't
roll your own security"...

>>
>> Me neither. Another alternative is to build host-busybox and use the
>> mkpasswd applet with the built in crypt routines (ENABLE_USE_BB_CRYPT).
> 
> Yeah, I like that idea more. Plus, we can get known-reproducible
> behaviour for other applets, should we need to add that.

 ... and you'd rather replace it with the busybox implementation that uses a
homegrown hash of getpid() + monotonic_us() as the salt?

 The whois stuff at least uses /dev/urandom to generate the salt...

 Or maybe that was your point, eliminate randomness to get known-reproducible
behaviour?

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH proposal/next] replace host-mkpasswd
  2018-05-30 16:45                 ` Arnout Vandecappelle
@ 2018-06-01 12:58                   ` Stefan Becker
  2018-06-01 12:58                     ` [Buildroot] [PATCH proposal/next 1/2] package/busybox: add host variant Stefan Becker
                                       ` (2 more replies)
  0 siblings, 3 replies; 38+ messages in thread
From: Stefan Becker @ 2018-06-01 12:58 UTC (permalink / raw)
  To: buildroot

As discussed in the mail thread add a host variant of busybox that
provides the "mkpasswd" tool for the build.

Rough first draft that probably requires some polishing.

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH proposal/next 1/2] package/busybox: add host variant
  2018-06-01 12:58                   ` [Buildroot] [PATCH proposal/next] replace host-mkpasswd Stefan Becker
@ 2018-06-01 12:58                     ` Stefan Becker
  2018-06-01 13:03                       ` Thomas Petazzoni
  2018-06-01 12:59                     ` [Buildroot] [PATCH proposal/next 2/2] package/mkpasswd: remove obsolete package Stefan Becker
  2018-06-01 13:30                     ` [Buildroot] [PATCHv2 propsal/next] replace host-mkpasswd Stefan Becker
  2 siblings, 1 reply; 38+ messages in thread
From: Stefan Becker @ 2018-06-01 12:58 UTC (permalink / raw)
  To: buildroot

Build stripped down version of busybox for the build host to provide
"mkpasswd" for the build.

This is a replacement for host-mkpasswd.

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
---
 fs/common.mk                                  |  2 +-
 package/Config.in.host                        |  2 +-
 package/busybox/Config.in.host                |  2 ++
 package/busybox/busybox.mk                    | 28 +++++++++++++++++++
 .../skeleton-init-common.mk                   |  2 +-
 5 files changed, 33 insertions(+), 3 deletions(-)
 create mode 100644 package/busybox/Config.in.host

diff --git a/fs/common.mk b/fs/common.mk
index 9baf367729..42d5dff569 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -63,7 +63,7 @@ ROOTFS_COMMON_TARGET_DIR = $(FS_DIR)/target
 
 ROOTFS_COMMON_DEPENDENCIES = \
 	host-fakeroot host-makedevs \
-	$(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd)
+	$(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-busybox)
 
 $(ROOTFS_COMMON_TAR): ROOTFS=COMMON
 $(ROOTFS_COMMON_TAR): FAKEROOT_SCRIPT=$(FS_DIR)/fakeroot.fs
diff --git a/package/Config.in.host b/package/Config.in.host
index 38543e7390..c524333671 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -2,6 +2,7 @@ menu "Host utilities"
 
 	source "package/aespipe/Config.in.host"
 	source "package/android-tools/Config.in.host"
+	source "package/busybox/Config.in.host"
 	source "package/cargo/Config.in.host"
 	source "package/cbootimage/Config.in.host"
 	source "package/checkpolicy/Config.in.host"
@@ -31,7 +32,6 @@ menu "Host utilities"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
 	source "package/mfgtools/Config.in.host"
-	source "package/mkpasswd/Config.in.host"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
 	source "package/mxsldr/Config.in.host"
diff --git a/package/busybox/Config.in.host b/package/busybox/Config.in.host
new file mode 100644
index 0000000000..93774bdf60
--- /dev/null
+++ b/package/busybox/Config.in.host
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_HOST_MKPASSWD
+	bool "host mkpasswd"
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 75fe7e137b..aa89f1cc33 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -302,4 +302,32 @@ $(error No BusyBox configuration file specified, check your BR2_PACKAGE_BUSYBOX_
 endif
 endif
 
+#
+# Host version of busybox to provide "mkpasswd" for the build
+#
+HOST_BUSYBOX_BUILD_CONFIG = $(HOST_BUSYBOX_DIR)/.config
+define HOST_BUSYBOX_CONFIGURE_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) allnoconfig
+	$(call KCONFIG_ENABLE_OPT,CONFIG_MKPASSWD,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BB_CRYPT,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BR_CRYPT_SHA,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_BUILD_LIBBUSYBOX,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_INDIVIDUAL,$(HOST_BUSYBOX_BUILD_CONFIG))
+endef
+
+define HOST_BUSYBOX_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) busybox
+endef
+
+define HOST_BUSYBOX_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) \
+		CONFIG_PREFIX="$(HOST_DIR)" \
+		EXTRA_LDFLAGS="-Wl,-rpath,$(HOST_DIR)/lib" \
+		-C $(@D) install
+	rm -f $(HOST_DIR)/bin/sh $(HOST_DIR)/bin/busybox
+endef
+
 $(eval $(kconfig-package))
+$(eval $(host-generic-package))
+
+MKPASSWD = $(HOST_DIR)/bin/mkpasswd
diff --git a/package/skeleton-init-common/skeleton-init-common.mk b/package/skeleton-init-common/skeleton-init-common.mk
index e8a0522052..99c87e3861 100644
--- a/package/skeleton-init-common/skeleton-init-common.mk
+++ b/package/skeleton-init-common/skeleton-init-common.mk
@@ -63,7 +63,7 @@ ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_INIT_COMMON_ROOT_PASSWD)),)
 SKELETON_INIT_COMMON_ROOT_PASSWORD = '$(SKELETON_INIT_COMMON_ROOT_PASSWD)'
 else ifneq ($(SKELETON_INIT_COMMON_ROOT_PASSWD),)
 # This variable will only be evaluated in the finalize stage, so we can
-# be sure that host-mkpasswd will have already been built by that time.
+# be sure that host-busybox will have already been built by that time.
 SKELETON_INIT_COMMON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_INIT_COMMON_PASSWD_METHOD)" "$(SKELETON_INIT_COMMON_ROOT_PASSWD)"`"
 endif
 else # !BR2_TARGET_ENABLE_ROOT_LOGIN
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH proposal/next 2/2] package/mkpasswd: remove obsolete package
  2018-06-01 12:58                   ` [Buildroot] [PATCH proposal/next] replace host-mkpasswd Stefan Becker
  2018-06-01 12:58                     ` [Buildroot] [PATCH proposal/next 1/2] package/busybox: add host variant Stefan Becker
@ 2018-06-01 12:59                     ` Stefan Becker
  2018-06-01 13:30                     ` [Buildroot] [PATCHv2 propsal/next] replace host-mkpasswd Stefan Becker
  2 siblings, 0 replies; 38+ messages in thread
From: Stefan Becker @ 2018-06-01 12:59 UTC (permalink / raw)
  To: buildroot

mkpasswd for the host is now provided by busybox.

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
---
 package/mkpasswd/Config.in.host |   2 -
 package/mkpasswd/config.h       |  95 -------
 package/mkpasswd/mkpasswd.c     | 461 --------------------------------
 package/mkpasswd/mkpasswd.mk    |  24 --
 package/mkpasswd/utils.c        |  96 -------
 package/mkpasswd/utils.h        |  56 ----
 6 files changed, 734 deletions(-)
 delete mode 100644 package/mkpasswd/Config.in.host
 delete mode 100644 package/mkpasswd/config.h
 delete mode 100644 package/mkpasswd/mkpasswd.c
 delete mode 100644 package/mkpasswd/mkpasswd.mk
 delete mode 100644 package/mkpasswd/utils.c
 delete mode 100644 package/mkpasswd/utils.h

diff --git a/package/mkpasswd/Config.in.host b/package/mkpasswd/Config.in.host
deleted file mode 100644
index 93774bdf60..0000000000
--- a/package/mkpasswd/Config.in.host
+++ /dev/null
@@ -1,2 +0,0 @@
-config BR2_PACKAGE_HOST_MKPASSWD
-	bool "host mkpasswd"
diff --git a/package/mkpasswd/config.h b/package/mkpasswd/config.h
deleted file mode 100644
index f345074121..0000000000
--- a/package/mkpasswd/config.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Program version */
-#define VERSION "5.0.26"
-
-/* Configurable features */
-
-/* Always hide legal disclaimers */
-#undef ALWAYS_HIDE_DISCL
-
-/* Default server */
-#define DEFAULTSERVER   "whois.arin.net"
-
-/* Configuration file */
-/*
-#define CONFIG_FILE "/etc/whois.conf"
-*/
-
-
-/* autoconf in cpp macros */
-#ifdef linux
-# define ENABLE_NLS
-#endif
-
-#ifdef __FreeBSD__
-/* which versions? */
-# define HAVE_GETOPT_LONG
-# define HAVE_GETADDRINFO
-# define ENABLE_NLS
-# ifndef LOCALEDIR
-#  define LOCALEDIR "/usr/local/share/locale"
-# endif
-#endif
-
-/* needs unistd.h */
-#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L
-# define HAVE_GETADDRINFO
-# define HAVE_REGEXEC
-#endif
-
-#if defined __APPLE__ && defined __MACH__
-# define HAVE_GETOPT_LONG
-# define HAVE_GETADDRINFO
-#endif
-
-#if defined __GLIBC__
-# define HAVE_GETOPT_LONG
-# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
-#  define HAVE_GETADDRINFO
-# endif
-# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 7
-#  define HAVE_SHA_CRYPT
-# endif
-#endif
-
-/* Unknown versions of Solaris */
-#if defined __SVR4 && defined __sun
-# define HAVE_SHA_CRYPT
-# define HAVE_SOLARIS_CRYPT_GENSALT
-#endif
-
-/* FIXME: which systems lack this? */
-#define HAVE_GETTIMEOFDAY
-/* FIXME: disabled because it does not parse addresses with a netmask length.
- * The code using it needs to be either fixed or removed.
-#define HAVE_INET_PTON
-*/
-
-/*
- * Please send patches to correctly ignore old releases which lack a RNG
- * and add more systems which have one.
- */
-#ifdef RANDOM_DEVICE
-#elif defined __GLIBC__ \
-	|| defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ \
-	/* AIX >= 5.2? */ \
-	|| defined _AIX52 \
-	/* HP-UX >= B.11.11.09? */ \
-	|| defined  __hpux \
-	/* OS X: */ \
-	|| (defined __APPLE__ && defined __MACH__) \
-	/* Solaris >= 9 (this is >= 7): */ \
-	|| (defined __SVR4 && defined __sun && defined SUSv2) \
-	/* Tru64 UNIX >= 5.1B? */ \
-	|| defined __osf
-# define RANDOM_DEVICE "/dev/urandom"
-#endif
-
-#ifdef ENABLE_NLS
-# ifndef NLS_CAT_NAME
-#  define NLS_CAT_NAME   "whois"
-# endif
-# ifndef LOCALEDIR
-#  define LOCALEDIR     "/usr/share/locale"
-# endif
-#endif
-
diff --git a/package/mkpasswd/mkpasswd.c b/package/mkpasswd/mkpasswd.c
deleted file mode 100644
index fd16230468..0000000000
--- a/package/mkpasswd/mkpasswd.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Copyright (C) 2001-2008  Marco d'Itri
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/* for crypt, snprintf and strcasecmp */
-#define _XOPEN_SOURCE
-#define _BSD_SOURCE
-
-/* System library */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "config.h"
-#ifdef HAVE_GETOPT_LONG
-#include <getopt.h>
-#endif
-#include <fcntl.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#ifdef HAVE_XCRYPT
-#include <xcrypt.h>
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_LINUX_CRYPT_GENSALT
-#define _OW_SOURCE
-#include <crypt.h>
-#endif
-#ifdef HAVE_GETTIMEOFDAY
-#include <sys/time.h>
-#endif
-
-/* glibc without crypt() */
-#ifndef _XOPEN_CRYPT
-#include <crypt.h>
-#endif
-
-/* Application-specific */
-#include "utils.h"
-
-/* Global variables */
-#ifdef HAVE_GETOPT_LONG
-static const struct option longopts[] = {
-    {"method",		optional_argument,	NULL, 'm'},
-    /* for backward compatibility with versions < 4.7.25 (< 20080321): */
-    {"hash",		optional_argument,	NULL, 'H'},
-    {"help",		no_argument,		NULL, 'h'},
-    {"password-fd",	required_argument,	NULL, 'P'},
-    {"stdin",		no_argument,		NULL, 's'},
-    {"salt",		required_argument,	NULL, 'S'},
-    {"rounds",		required_argument,	NULL, 'R'},
-    {"version",		no_argument,		NULL, 'V'},
-    {NULL,		0,			NULL, 0  }
-};
-#else
-extern char *optarg;
-extern int optind;
-#endif
-
-static const char valid_salts[] = "abcdefghijklmnopqrstuvwxyz"
-"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
-
-struct crypt_method {
-    const char *method;		/* short name used by the command line option */
-    const char *prefix;		/* salt prefix */
-    const unsigned int minlen;	/* minimum salt length */
-    const unsigned int maxlen;	/* maximum salt length */
-    const unsigned int rounds;	/* supports a variable number of rounds */
-    const char *desc;		/* long description for the methods list */
-};
-
-static const struct crypt_method methods[] = {
-    /* method		prefix	minlen,	maxlen	rounds description */
-    { "des",		"",	2,	2,	0,
-	N_("standard 56 bit DES-based crypt(3)") },
-    { "md5",		"$1$",	8,	8,	0, "MD5" },
-#if defined OpenBSD || defined FreeBSD || (defined __SVR4 && defined __sun)
-    { "bf",		"$2a$", 22,	22,	1, "Blowfish" },
-#endif
-#if defined HAVE_LINUX_CRYPT_GENSALT
-    { "bf",		"$2a$", 22,	22,	1, "Blowfish, system-specific on 8-bit chars" },
-    /* algorithm 2y fixes CVE-2011-2483 */
-    { "bfy",		"$2y$", 22,	22,	1, "Blowfish, correct handling of 8-bit chars" },
-#endif
-#if defined FreeBSD
-    { "nt",		"$3$",  0,	0,	0, "NT-Hash" },
-#endif
-#if defined HAVE_SHA_CRYPT
-    /* http://people.redhat.com/drepper/SHA-crypt.txt */
-    { "sha-256",	"$5$",	8,	16,	1, "SHA-256" },
-    { "sha-512",	"$6$",	8,	16,	1, "SHA-512" },
-#endif
-    /* http://www.crypticide.com/dropsafe/article/1389 */
-    /*
-     * Actually the maximum salt length is arbitrary, but Solaris by default
-     * always uses 8 characters:
-     * http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/ \
-     *   usr/src/lib/crypt_modules/sunmd5/sunmd5.c#crypt_gensalt_impl
-     */
-#if defined __SVR4 && defined __sun
-    { "sunmd5",		"$md5$", 8,	8,	1, "SunMD5" },
-#endif
-    { NULL,		NULL,	0,	0,	0, NULL }
-};
-
-void generate_salt(char *const buf, const unsigned int len);
-void *get_random_bytes(const int len);
-void display_help(int error);
-void display_version(void);
-void display_methods(void);
-
-int main(int argc, char *argv[])
-{
-    int ch, i;
-    int password_fd = -1;
-    unsigned int salt_minlen = 0;
-    unsigned int salt_maxlen = 0;
-    unsigned int rounds_support = 0;
-    const char *salt_prefix = NULL;
-    const char *salt_arg = NULL;
-    unsigned int rounds = 0;
-    char *salt = NULL;
-    char rounds_str[30];
-    char *password = NULL;
-
-#ifdef ENABLE_NLS
-    setlocale(LC_ALL, "");
-    bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
-    textdomain(NLS_CAT_NAME);
-#endif
-
-    /* prepend options from environment */
-    argv = merge_args(getenv("MKPASSWD_OPTIONS"), argv, &argc);
-
-    while ((ch = GETOPT_LONGISH(argc, argv, "hH:m:5P:R:sS:V", longopts, 0))
-	    > 0) {
-	switch (ch) {
-	case '5':
-	    optarg = (char *) "md5";
-	    /* fall through */
-	case 'm':
-	case 'H':
-	    if (!optarg || strcaseeq("help", optarg)) {
-		display_methods();
-		exit(0);
-	    }
-	    for (i = 0; methods[i].method != NULL; i++)
-		if (strcaseeq(methods[i].method, optarg)) {
-		    salt_prefix = methods[i].prefix;
-		    salt_minlen = methods[i].minlen;
-		    salt_maxlen = methods[i].maxlen;
-		    rounds_support = methods[i].rounds;
-		    break;
-		}
-	    if (!salt_prefix) {
-		fprintf(stderr, _("Invalid method '%s'.\n"), optarg);
-		exit(1);
-	    }
-	    break;
-	case 'P':
-	    {
-		char *p;
-		password_fd = strtol(optarg, &p, 10);
-		if (p == NULL || *p != '\0' || password_fd < 0) {
-		    fprintf(stderr, _("Invalid number '%s'.\n"), optarg);
-		    exit(1);
-		}
-	    }
-	    break;
-	case 'R':
-	    {
-		char *p;
-		rounds = strtol(optarg, &p, 10);
-		if (p == NULL || *p != '\0' || rounds < 0) {
-		    fprintf(stderr, _("Invalid number '%s'.\n"), optarg);
-		    exit(1);
-		}
-	    }
-	    break;
-	case 's':
-	    password_fd = 0;
-	    break;
-	case 'S':
-	    salt_arg = optarg;
-	    break;
-	case 'V':
-	    display_version();
-	    exit(0);
-	case 'h':
-	    display_help(EXIT_SUCCESS);
-	default:
-	    fprintf(stderr, _("Try '%s --help' for more information.\n"),
-		    argv[0]);
-	    exit(1);
-	}
-    }
-    argc -= optind;
-    argv += optind;
-
-    if (argc == 2 && !salt_arg) {
-	password = argv[0];
-	salt_arg = argv[1];
-    } else if (argc == 1) {
-	password = argv[0];
-    } else if (argc == 0) {
-    } else {
-	display_help(EXIT_FAILURE);
-    }
-
-    /* default: DES password */
-    if (!salt_prefix) {
-	salt_minlen = methods[0].minlen;
-	salt_maxlen = methods[0].maxlen;
-	salt_prefix = methods[0].prefix;
-    }
-
-    if (streq(salt_prefix, "$2a$") || streq(salt_prefix, "$2y$")) {
-	/* OpenBSD Blowfish and derivatives */
-	if (rounds <= 5)
-	    rounds = 5;
-	/* actually for 2a/2y it is the logarithm of the number of rounds */
-	snprintf(rounds_str, sizeof(rounds_str), "%02u$", rounds);
-    } else if (rounds_support && rounds)
-	snprintf(rounds_str, sizeof(rounds_str), "rounds=%u$", rounds);
-    else
-	rounds_str[0] = '\0';
-
-    if (salt_arg) {
-	unsigned int c = strlen(salt_arg);
-	if (c < salt_minlen || c > salt_maxlen) {
-	    if (salt_minlen == salt_maxlen)
-		fprintf(stderr, ngettext(
-			"Wrong salt length: %d byte when %d expected.\n",
-			"Wrong salt length: %d bytes when %d expected.\n", c),
-			c, salt_maxlen);
-	    else
-		fprintf(stderr, ngettext(
-			"Wrong salt length: %d byte when %d <= n <= %d"
-			" expected.\n",
-			"Wrong salt length: %d bytes when %d <= n <= %d"
-			" expected.\n", c),
-			c, salt_minlen, salt_maxlen);
-	    exit(1);
-	}
-	while (c-- > 0) {
-	    if (strchr(valid_salts, salt_arg[c]) == NULL) {
-		fprintf(stderr, _("Illegal salt character '%c'.\n"),
-			salt_arg[c]);
-		exit(1);
-	    }
-	}
-
-	salt = NOFAIL(malloc(strlen(salt_prefix) + strlen(rounds_str)
-		+ strlen(salt_arg) + 1));
-	*salt = '\0';
-	strcat(salt, salt_prefix);
-	strcat(salt, rounds_str);
-	strcat(salt, salt_arg);
-    } else {
-#ifdef HAVE_SOLARIS_CRYPT_GENSALT
-#error "This code path is untested on Solaris. Please send a patch."
-	salt = crypt_gensalt(salt_prefix, NULL);
-	if (!salt)
-		perror(stderr, "crypt_gensalt");
-#elif defined HAVE_LINUX_CRYPT_GENSALT
-	void *entropy = get_random_bytes(64);
-
-	salt = crypt_gensalt(salt_prefix, rounds, entropy, 64);
-	if (!salt) {
-		fprintf(stderr, "crypt_gensalt failed.\n");
-		exit(2);
-	}
-	free(entropy);
-#else
-	unsigned int salt_len = salt_maxlen;
-
-	if (salt_minlen != salt_maxlen) { /* salt length can vary */
-	    srand(time(NULL) + getpid());
-	    salt_len = rand() % (salt_maxlen - salt_minlen + 1) + salt_minlen;
-	}
-
-	salt = NOFAIL(malloc(strlen(salt_prefix) + strlen(rounds_str)
-		+ salt_len + 1));
-	*salt = '\0';
-	strcat(salt, salt_prefix);
-	strcat(salt, rounds_str);
-	generate_salt(salt + strlen(salt), salt_len);
-#endif
-    }
-
-    if (password) {
-    } else if (password_fd != -1) {
-	FILE *fp;
-	char *p;
-
-	if (isatty(password_fd))
-	    fprintf(stderr, _("Password: "));
-	password = NOFAIL(malloc(128));
-	fp = fdopen(password_fd, "r");
-	if (!fp) {
-	    perror("fdopen");
-	    exit(2);
-	}
-	if (!fgets(password, 128, fp)) {
-	    perror("fgets");
-	    exit(2);
-	}
-
-	p = strpbrk(password, "\n\r");
-	if (p)
-	    *p = '\0';
-    } else {
-	password = getpass(_("Password: "));
-	if (!password) {
-	    perror("getpass");
-	    exit(2);
-	}
-    }
-
-    {
-	const char *result;
-	result = crypt(password, salt);
-	/* xcrypt returns "*0" on errors */
-	if (!result || result[0] == '*') {
-	    fprintf(stderr, "crypt failed.\n");
-	    exit(2);
-	}
-	/* yes, using strlen(salt_prefix) on salt. It's not
-	 * documented whether crypt_gensalt may change the prefix */
-	if (!strneq(result, salt, strlen(salt_prefix))) {
-	    fprintf(stderr, _("Method not supported by crypt(3).\n"));
-	    exit(2);
-	}
-	printf("%s\n", result);
-    }
-
-    exit(0);
-}
-
-#ifdef RANDOM_DEVICE
-void* get_random_bytes(const int count)
-{
-    char *buf;
-    int fd;
-
-    buf = NOFAIL(malloc(count));
-    fd = open(RANDOM_DEVICE, O_RDONLY);
-    if (fd < 0) {
-	perror("open(" RANDOM_DEVICE ")");
-	exit(2);
-    }
-    if (read(fd, buf, count) != count) {
-	if (count < 0)
-	    perror("read(" RANDOM_DEVICE ")");
-	else
-	    fprintf(stderr, "Short read of %s.\n", RANDOM_DEVICE);
-	exit(2);
-    }
-    close(fd);
-
-    return buf;
-}
-#endif
-
-#ifdef RANDOM_DEVICE
-
-void generate_salt(char *const buf, const unsigned int len)
-{
-    unsigned int i;
-
-    unsigned char *entropy = get_random_bytes(len * sizeof(unsigned char));
-    for (i = 0; i < len; i++)
-	buf[i] = valid_salts[entropy[i] % (sizeof valid_salts - 1)];
-    buf[i] = '\0';
-}
-
-#else /* RANDOM_DEVICE */
-
-void generate_salt(char *const buf, const unsigned int len)
-{
-    unsigned int i;
-
-# ifdef HAVE_GETTIMEOFDAY
-    struct timeval tv;
-
-    gettimeofday(&tv, NULL);
-    srand(tv.tv_sec ^ tv.tv_usec);
-
-# else /* HAVE_GETTIMEOFDAY */
-#  warning "This system lacks a strong enough random numbers generator!"
-
-    /*
-     * The possible values of time over one year are 31536000, which is
-     * two orders of magnitude less than the allowed entropy range (2^32).
-     */
-    srand(time(NULL) + getpid());
-
-# endif /* HAVE_GETTIMEOFDAY */
-
-    for (i = 0; i < len; i++)
-	buf[i] = valid_salts[rand() % (sizeof valid_salts - 1)];
-    buf[i] = '\0';
-}
-
-#endif /* RANDOM_DEVICE */
-
-void display_help(int error)
-{
-    fprintf((EXIT_SUCCESS == error) ? stdout : stderr,
-	    _("Usage: mkpasswd [OPTIONS]... [PASSWORD [SALT]]\n"
-	    "Crypts the PASSWORD using crypt(3).\n\n"));
-    fprintf(stderr, _(
-"      -m, --method=TYPE     select method TYPE\n"
-"      -5                    like --method=md5\n"
-"      -S, --salt=SALT       use the specified SALT\n"
-"      -R, --rounds=NUMBER   use the specified NUMBER of rounds\n"
-"      -P, --password-fd=NUM read the password from file descriptor NUM\n"
-"                            instead of /dev/tty\n"
-"      -s, --stdin           like --password-fd=0\n"
-"      -h, --help            display this help and exit\n"
-"      -V, --version         output version information and exit\n"
-"\n"
-"If PASSWORD is missing then it is asked interactively.\n"
-"If no SALT is specified, a random one is generated.\n"
-"If TYPE is 'help', available methods are printed.\n"
-"\n"
-"Report bugs to %s.\n"), "<md+whois@linux.it>");
-    exit(error);
-}
-
-void display_version(void)
-{
-    printf("mkpasswd %s\n\n", VERSION);
-    puts("Copyright (C) 2001-2008 Marco d'Itri\n"
-"This is free software; see the source for copying conditions.  There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
-}
-
-void display_methods(void)
-{
-    unsigned int i;
-
-    printf(_("Available methods:\n"));
-    for (i = 0; methods[i].method != NULL; i++)
-	printf("%s\t%s\n", methods[i].method, methods[i].desc);
-}
-
diff --git a/package/mkpasswd/mkpasswd.mk b/package/mkpasswd/mkpasswd.mk
deleted file mode 100644
index b013390572..0000000000
--- a/package/mkpasswd/mkpasswd.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-#
-# mkpasswd
-#
-################################################################################
-
-# source included in buildroot, taken from
-# https://github.com/rfc1036/whois/blob/master/
-# at revision 5a0f08500fa51608b6d3b73ee338be38c692eadb
-HOST_MKPASSWD_LICENSE = GPL-2.0+
-
-define HOST_MKPASSWD_BUILD_CMDS
-	$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
-		package/mkpasswd/mkpasswd.c package/mkpasswd/utils.c \
-		-o $(@D)/mkpasswd -lcrypt
-endef
-
-define HOST_MKPASSWD_INSTALL_CMDS
-	$(INSTALL) -D -m 755 $(@D)/mkpasswd $(HOST_DIR)/bin/mkpasswd
-endef
-
-$(eval $(host-generic-package))
-
-MKPASSWD = $(HOST_DIR)/bin/mkpasswd
diff --git a/package/mkpasswd/utils.c b/package/mkpasswd/utils.c
deleted file mode 100644
index 254bf2ac68..0000000000
--- a/package/mkpasswd/utils.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 1999-2008 by Marco d'Itri <md@linux.it>.
- *
- * do_nofail and merge_args come from the module-init-tools package.
- * Copyright 2001 by Rusty Russell.
- * Copyright 2002, 2003 by Rusty Russell, IBM Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/* for strdup */
-#define _XOPEN_SOURCE 500
-
-/* System library */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-
-/* Application-specific */
-#include "utils.h"
-
-void *do_nofail(void *ptr, const char *file, const int line)
-{
-    if (ptr)
-	return ptr;
-
-    err_quit("Memory allocation failure at %s:%d.", file, line);
-}
-
-/* Prepend options from a string. */
-char **merge_args(char *args, char *argv[], int *argc)
-{
-    char *arg, *argstring;
-    char **newargs = NULL;
-    unsigned int i, num_env = 0;
-
-    if (!args)
-	return argv;
-
-    argstring = NOFAIL(strdup(args));
-    for (arg = strtok(argstring, " "); arg; arg = strtok(NULL, " ")) {
-	num_env++;
-	newargs = NOFAIL(realloc(newargs,
-		    sizeof(newargs[0]) * (num_env + *argc + 1)));
-	newargs[num_env] = arg;
-    }
-
-    if (!newargs)
-	return argv;
-
-    /* Append commandline args */
-    newargs[0] = argv[0];
-    for (i = 1; i <= *argc; i++)
-	newargs[num_env + i] = argv[i];
-
-    *argc += num_env;
-    return newargs;
-}
-
-/* Error routines */
-void err_sys(const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    fprintf(stderr, ": %s\n", strerror(errno));
-    va_end(ap);
-    exit(2);
-}
-
-void err_quit(const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    fputs("\n", stderr);
-    va_end(ap);
-    exit(2);
-}
-
diff --git a/package/mkpasswd/utils.h b/package/mkpasswd/utils.h
deleted file mode 100644
index 0f226aee2f..0000000000
--- a/package/mkpasswd/utils.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef WHOIS_UTILS_H
-#define WHOIS_UTILS_H
-
-/* Convenience macros */
-#define streq(a, b) (strcmp(a, b) == 0)
-#define strcaseeq(a, b) (strcasecmp(a, b) == 0)
-#define strneq(a, b, n) (strncmp(a, b, n) == 0)
-#define strncaseeq(a, b, n) (strncasecmp(a, b, n) == 0)
-
-#define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__)
-
-/* Portability macros */
-#ifdef __GNUC__
-# define NORETURN __attribute__((noreturn))
-#else
-# define NORETURN
-#endif
-
-#ifndef AI_IDN
-# define AI_IDN 0
-#endif
-
-#ifndef AI_ADDRCONFIG
-# define AI_ADDRCONFIG 0
-#endif
-
-#ifdef HAVE_GETOPT_LONG
-# define GETOPT_LONGISH(c, v, o, l, i) getopt_long(c, v, o, l, i)
-#else
-# define GETOPT_LONGISH(c, v, o, l, i) getopt(c, v, o)
-#endif
-
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# include <locale.h>
-# define _(a) (gettext(a))
-# ifdef gettext_noop
-#  define N_(a) gettext_noop(a)
-# else
-#  define N_(a) (a)
-# endif
-#else
-# define _(a) (a)
-# define N_(a) (a)
-# define ngettext(a, b, c) ((c==1) ? (a) : (b))
-#endif
-
-
-/* Prototypes */
-void *do_nofail(void *ptr, const char *file, const int line);
-char **merge_args(char *args, char *argv[], int *argc);
-
-void err_quit(const char *fmt, ...) NORETURN;
-void err_sys(const char *fmt, ...) NORETURN;
-
-#endif
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCH proposal/next 1/2] package/busybox: add host variant
  2018-06-01 12:58                     ` [Buildroot] [PATCH proposal/next 1/2] package/busybox: add host variant Stefan Becker
@ 2018-06-01 13:03                       ` Thomas Petazzoni
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2018-06-01 13:03 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri,  1 Jun 2018 15:58:59 +0300, Stefan Becker wrote:
> Build stripped down version of busybox for the build host to provide
> "mkpasswd" for the build.
> 
> This is a replacement for host-mkpasswd.
> 
> Signed-off-by: Stefan Becker <chemobejk@gmail.com>
> ---
>  fs/common.mk                                  |  2 +-
>  package/Config.in.host                        |  2 +-
>  package/busybox/Config.in.host                |  2 ++
>  package/busybox/busybox.mk                    | 28 +++++++++++++++++++
>  .../skeleton-init-common.mk                   |  2 +-
>  5 files changed, 33 insertions(+), 3 deletions(-)

The addition of host-busybox should be split in a separate patch from
the patch changing to use host-busybox instead of host-mkpasswd.

Also, the commit log should explain the rationale for switching from
host-mkpasswd to host-busybox. I know it has been discussed on the
list, but a commit log is much easier to find in the Git history than
an e-mail discussion on the mailing list. So a summary of the
motivations for the change would be nice.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 propsal/next] replace host-mkpasswd
  2018-06-01 12:58                   ` [Buildroot] [PATCH proposal/next] replace host-mkpasswd Stefan Becker
  2018-06-01 12:58                     ` [Buildroot] [PATCH proposal/next 1/2] package/busybox: add host variant Stefan Becker
  2018-06-01 12:59                     ` [Buildroot] [PATCH proposal/next 2/2] package/mkpasswd: remove obsolete package Stefan Becker
@ 2018-06-01 13:30                     ` Stefan Becker
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 1/3] package/busybox: add host variant Stefan Becker
                                         ` (2 more replies)
  2 siblings, 3 replies; 38+ messages in thread
From: Stefan Becker @ 2018-06-01 13:30 UTC (permalink / raw)
  To: buildroot

As discussed in the mail thread add a host variant of busybox that
provides the "mkpasswd" tool for the build.

v2: split into 3 separate patches + add some reasoning to commit

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 1/3] package/busybox: add host variant
  2018-06-01 13:30                     ` [Buildroot] [PATCHv2 propsal/next] replace host-mkpasswd Stefan Becker
@ 2018-06-01 13:30                       ` Stefan Becker
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox Stefan Becker
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 3/3] package/mkpasswd: remove obsolete package Stefan Becker
  2 siblings, 0 replies; 38+ messages in thread
From: Stefan Becker @ 2018-06-01 13:30 UTC (permalink / raw)
  To: buildroot

Build stripped down version of busybox for the build host to provide
"mkpasswd" for the build.

This is a replacement for host-mkpasswd.

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
---
 package/busybox/Config.in.host |  2 ++
 package/busybox/busybox.mk     | 28 ++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 package/busybox/Config.in.host

diff --git a/package/busybox/Config.in.host b/package/busybox/Config.in.host
new file mode 100644
index 0000000000..93774bdf60
--- /dev/null
+++ b/package/busybox/Config.in.host
@@ -0,0 +1,2 @@
+config BR2_PACKAGE_HOST_MKPASSWD
+	bool "host mkpasswd"
diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk
index 75fe7e137b..aa89f1cc33 100644
--- a/package/busybox/busybox.mk
+++ b/package/busybox/busybox.mk
@@ -302,4 +302,32 @@ $(error No BusyBox configuration file specified, check your BR2_PACKAGE_BUSYBOX_
 endif
 endif
 
+#
+# Host version of busybox to provide "mkpasswd" for the build
+#
+HOST_BUSYBOX_BUILD_CONFIG = $(HOST_BUSYBOX_DIR)/.config
+define HOST_BUSYBOX_CONFIGURE_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) allnoconfig
+	$(call KCONFIG_ENABLE_OPT,CONFIG_MKPASSWD,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BB_CRYPT,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_USE_BR_CRYPT_SHA,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_BUILD_LIBBUSYBOX,$(HOST_BUSYBOX_BUILD_CONFIG))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_FEATURE_INDIVIDUAL,$(HOST_BUSYBOX_BUILD_CONFIG))
+endef
+
+define HOST_BUSYBOX_BUILD_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) -C $(@D) busybox
+endef
+
+define HOST_BUSYBOX_INSTALL_CMDS
+	$(HOST_MAKE_ENV) $(MAKE) \
+		CONFIG_PREFIX="$(HOST_DIR)" \
+		EXTRA_LDFLAGS="-Wl,-rpath,$(HOST_DIR)/lib" \
+		-C $(@D) install
+	rm -f $(HOST_DIR)/bin/sh $(HOST_DIR)/bin/busybox
+endef
+
 $(eval $(kconfig-package))
+$(eval $(host-generic-package))
+
+MKPASSWD = $(HOST_DIR)/bin/mkpasswd
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-01 13:30                     ` [Buildroot] [PATCHv2 propsal/next] replace host-mkpasswd Stefan Becker
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 1/3] package/busybox: add host variant Stefan Becker
@ 2018-06-01 13:30                       ` Stefan Becker
  2018-06-04 22:21                         ` Arnout Vandecappelle
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 3/3] package/mkpasswd: remove obsolete package Stefan Becker
  2 siblings, 1 reply; 38+ messages in thread
From: Stefan Becker @ 2018-06-01 13:30 UTC (permalink / raw)
  To: buildroot

host-mkpasswd was a fork from whois to provide a host version of
mkpasswd for the build. This has caused a maintenance headache.

Replace it with host-busybox which can provide "mkpasswd" functionality
from own source code. That causes less hassle for different build
platforms.

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
---
 fs/common.mk                                         | 2 +-
 package/Config.in.host                               | 2 +-
 package/skeleton-init-common/skeleton-init-common.mk | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/common.mk b/fs/common.mk
index 9baf367729..42d5dff569 100644
--- a/fs/common.mk
+++ b/fs/common.mk
@@ -63,7 +63,7 @@ ROOTFS_COMMON_TARGET_DIR = $(FS_DIR)/target
 
 ROOTFS_COMMON_DEPENDENCIES = \
 	host-fakeroot host-makedevs \
-	$(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-mkpasswd)
+	$(if $(PACKAGES_USERS)$(ROOTFS_USERS_TABLES),host-busybox)
 
 $(ROOTFS_COMMON_TAR): ROOTFS=COMMON
 $(ROOTFS_COMMON_TAR): FAKEROOT_SCRIPT=$(FS_DIR)/fakeroot.fs
diff --git a/package/Config.in.host b/package/Config.in.host
index 38543e7390..c524333671 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -2,6 +2,7 @@ menu "Host utilities"
 
 	source "package/aespipe/Config.in.host"
 	source "package/android-tools/Config.in.host"
+	source "package/busybox/Config.in.host"
 	source "package/cargo/Config.in.host"
 	source "package/cbootimage/Config.in.host"
 	source "package/checkpolicy/Config.in.host"
@@ -31,7 +32,6 @@ menu "Host utilities"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
 	source "package/mfgtools/Config.in.host"
-	source "package/mkpasswd/Config.in.host"
 	source "package/mtd/Config.in.host"
 	source "package/mtools/Config.in.host"
 	source "package/mxsldr/Config.in.host"
diff --git a/package/skeleton-init-common/skeleton-init-common.mk b/package/skeleton-init-common/skeleton-init-common.mk
index e8a0522052..99c87e3861 100644
--- a/package/skeleton-init-common/skeleton-init-common.mk
+++ b/package/skeleton-init-common/skeleton-init-common.mk
@@ -63,7 +63,7 @@ ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_INIT_COMMON_ROOT_PASSWD)),)
 SKELETON_INIT_COMMON_ROOT_PASSWORD = '$(SKELETON_INIT_COMMON_ROOT_PASSWD)'
 else ifneq ($(SKELETON_INIT_COMMON_ROOT_PASSWD),)
 # This variable will only be evaluated in the finalize stage, so we can
-# be sure that host-mkpasswd will have already been built by that time.
+# be sure that host-busybox will have already been built by that time.
 SKELETON_INIT_COMMON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_INIT_COMMON_PASSWD_METHOD)" "$(SKELETON_INIT_COMMON_ROOT_PASSWD)"`"
 endif
 else # !BR2_TARGET_ENABLE_ROOT_LOGIN
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 3/3] package/mkpasswd: remove obsolete package
  2018-06-01 13:30                     ` [Buildroot] [PATCHv2 propsal/next] replace host-mkpasswd Stefan Becker
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 1/3] package/busybox: add host variant Stefan Becker
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox Stefan Becker
@ 2018-06-01 13:30                       ` Stefan Becker
  2 siblings, 0 replies; 38+ messages in thread
From: Stefan Becker @ 2018-06-01 13:30 UTC (permalink / raw)
  To: buildroot

mkpasswd for the host is now provided by busybox.

Signed-off-by: Stefan Becker <chemobejk@gmail.com>
---
 package/mkpasswd/Config.in.host |   2 -
 package/mkpasswd/config.h       |  95 -------
 package/mkpasswd/mkpasswd.c     | 461 --------------------------------
 package/mkpasswd/mkpasswd.mk    |  24 --
 package/mkpasswd/utils.c        |  96 -------
 package/mkpasswd/utils.h        |  56 ----
 6 files changed, 734 deletions(-)
 delete mode 100644 package/mkpasswd/Config.in.host
 delete mode 100644 package/mkpasswd/config.h
 delete mode 100644 package/mkpasswd/mkpasswd.c
 delete mode 100644 package/mkpasswd/mkpasswd.mk
 delete mode 100644 package/mkpasswd/utils.c
 delete mode 100644 package/mkpasswd/utils.h

diff --git a/package/mkpasswd/Config.in.host b/package/mkpasswd/Config.in.host
deleted file mode 100644
index 93774bdf60..0000000000
--- a/package/mkpasswd/Config.in.host
+++ /dev/null
@@ -1,2 +0,0 @@
-config BR2_PACKAGE_HOST_MKPASSWD
-	bool "host mkpasswd"
diff --git a/package/mkpasswd/config.h b/package/mkpasswd/config.h
deleted file mode 100644
index f345074121..0000000000
--- a/package/mkpasswd/config.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Program version */
-#define VERSION "5.0.26"
-
-/* Configurable features */
-
-/* Always hide legal disclaimers */
-#undef ALWAYS_HIDE_DISCL
-
-/* Default server */
-#define DEFAULTSERVER   "whois.arin.net"
-
-/* Configuration file */
-/*
-#define CONFIG_FILE "/etc/whois.conf"
-*/
-
-
-/* autoconf in cpp macros */
-#ifdef linux
-# define ENABLE_NLS
-#endif
-
-#ifdef __FreeBSD__
-/* which versions? */
-# define HAVE_GETOPT_LONG
-# define HAVE_GETADDRINFO
-# define ENABLE_NLS
-# ifndef LOCALEDIR
-#  define LOCALEDIR "/usr/local/share/locale"
-# endif
-#endif
-
-/* needs unistd.h */
-#if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE >= 200112L
-# define HAVE_GETADDRINFO
-# define HAVE_REGEXEC
-#endif
-
-#if defined __APPLE__ && defined __MACH__
-# define HAVE_GETOPT_LONG
-# define HAVE_GETADDRINFO
-#endif
-
-#if defined __GLIBC__
-# define HAVE_GETOPT_LONG
-# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
-#  define HAVE_GETADDRINFO
-# endif
-# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 7
-#  define HAVE_SHA_CRYPT
-# endif
-#endif
-
-/* Unknown versions of Solaris */
-#if defined __SVR4 && defined __sun
-# define HAVE_SHA_CRYPT
-# define HAVE_SOLARIS_CRYPT_GENSALT
-#endif
-
-/* FIXME: which systems lack this? */
-#define HAVE_GETTIMEOFDAY
-/* FIXME: disabled because it does not parse addresses with a netmask length.
- * The code using it needs to be either fixed or removed.
-#define HAVE_INET_PTON
-*/
-
-/*
- * Please send patches to correctly ignore old releases which lack a RNG
- * and add more systems which have one.
- */
-#ifdef RANDOM_DEVICE
-#elif defined __GLIBC__ \
-	|| defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__ \
-	/* AIX >= 5.2? */ \
-	|| defined _AIX52 \
-	/* HP-UX >= B.11.11.09? */ \
-	|| defined  __hpux \
-	/* OS X: */ \
-	|| (defined __APPLE__ && defined __MACH__) \
-	/* Solaris >= 9 (this is >= 7): */ \
-	|| (defined __SVR4 && defined __sun && defined SUSv2) \
-	/* Tru64 UNIX >= 5.1B? */ \
-	|| defined __osf
-# define RANDOM_DEVICE "/dev/urandom"
-#endif
-
-#ifdef ENABLE_NLS
-# ifndef NLS_CAT_NAME
-#  define NLS_CAT_NAME   "whois"
-# endif
-# ifndef LOCALEDIR
-#  define LOCALEDIR     "/usr/share/locale"
-# endif
-#endif
-
diff --git a/package/mkpasswd/mkpasswd.c b/package/mkpasswd/mkpasswd.c
deleted file mode 100644
index fd16230468..0000000000
--- a/package/mkpasswd/mkpasswd.c
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- * Copyright (C) 2001-2008  Marco d'Itri
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-/* for crypt, snprintf and strcasecmp */
-#define _XOPEN_SOURCE
-#define _BSD_SOURCE
-
-/* System library */
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "config.h"
-#ifdef HAVE_GETOPT_LONG
-#include <getopt.h>
-#endif
-#include <fcntl.h>
-#include <string.h>
-#include <time.h>
-#include <sys/types.h>
-#ifdef HAVE_XCRYPT
-#include <xcrypt.h>
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_LINUX_CRYPT_GENSALT
-#define _OW_SOURCE
-#include <crypt.h>
-#endif
-#ifdef HAVE_GETTIMEOFDAY
-#include <sys/time.h>
-#endif
-
-/* glibc without crypt() */
-#ifndef _XOPEN_CRYPT
-#include <crypt.h>
-#endif
-
-/* Application-specific */
-#include "utils.h"
-
-/* Global variables */
-#ifdef HAVE_GETOPT_LONG
-static const struct option longopts[] = {
-    {"method",		optional_argument,	NULL, 'm'},
-    /* for backward compatibility with versions < 4.7.25 (< 20080321): */
-    {"hash",		optional_argument,	NULL, 'H'},
-    {"help",		no_argument,		NULL, 'h'},
-    {"password-fd",	required_argument,	NULL, 'P'},
-    {"stdin",		no_argument,		NULL, 's'},
-    {"salt",		required_argument,	NULL, 'S'},
-    {"rounds",		required_argument,	NULL, 'R'},
-    {"version",		no_argument,		NULL, 'V'},
-    {NULL,		0,			NULL, 0  }
-};
-#else
-extern char *optarg;
-extern int optind;
-#endif
-
-static const char valid_salts[] = "abcdefghijklmnopqrstuvwxyz"
-"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
-
-struct crypt_method {
-    const char *method;		/* short name used by the command line option */
-    const char *prefix;		/* salt prefix */
-    const unsigned int minlen;	/* minimum salt length */
-    const unsigned int maxlen;	/* maximum salt length */
-    const unsigned int rounds;	/* supports a variable number of rounds */
-    const char *desc;		/* long description for the methods list */
-};
-
-static const struct crypt_method methods[] = {
-    /* method		prefix	minlen,	maxlen	rounds description */
-    { "des",		"",	2,	2,	0,
-	N_("standard 56 bit DES-based crypt(3)") },
-    { "md5",		"$1$",	8,	8,	0, "MD5" },
-#if defined OpenBSD || defined FreeBSD || (defined __SVR4 && defined __sun)
-    { "bf",		"$2a$", 22,	22,	1, "Blowfish" },
-#endif
-#if defined HAVE_LINUX_CRYPT_GENSALT
-    { "bf",		"$2a$", 22,	22,	1, "Blowfish, system-specific on 8-bit chars" },
-    /* algorithm 2y fixes CVE-2011-2483 */
-    { "bfy",		"$2y$", 22,	22,	1, "Blowfish, correct handling of 8-bit chars" },
-#endif
-#if defined FreeBSD
-    { "nt",		"$3$",  0,	0,	0, "NT-Hash" },
-#endif
-#if defined HAVE_SHA_CRYPT
-    /* http://people.redhat.com/drepper/SHA-crypt.txt */
-    { "sha-256",	"$5$",	8,	16,	1, "SHA-256" },
-    { "sha-512",	"$6$",	8,	16,	1, "SHA-512" },
-#endif
-    /* http://www.crypticide.com/dropsafe/article/1389 */
-    /*
-     * Actually the maximum salt length is arbitrary, but Solaris by default
-     * always uses 8 characters:
-     * http://cvs.opensolaris.org/source/xref/onnv/onnv-gate/ \
-     *   usr/src/lib/crypt_modules/sunmd5/sunmd5.c#crypt_gensalt_impl
-     */
-#if defined __SVR4 && defined __sun
-    { "sunmd5",		"$md5$", 8,	8,	1, "SunMD5" },
-#endif
-    { NULL,		NULL,	0,	0,	0, NULL }
-};
-
-void generate_salt(char *const buf, const unsigned int len);
-void *get_random_bytes(const int len);
-void display_help(int error);
-void display_version(void);
-void display_methods(void);
-
-int main(int argc, char *argv[])
-{
-    int ch, i;
-    int password_fd = -1;
-    unsigned int salt_minlen = 0;
-    unsigned int salt_maxlen = 0;
-    unsigned int rounds_support = 0;
-    const char *salt_prefix = NULL;
-    const char *salt_arg = NULL;
-    unsigned int rounds = 0;
-    char *salt = NULL;
-    char rounds_str[30];
-    char *password = NULL;
-
-#ifdef ENABLE_NLS
-    setlocale(LC_ALL, "");
-    bindtextdomain(NLS_CAT_NAME, LOCALEDIR);
-    textdomain(NLS_CAT_NAME);
-#endif
-
-    /* prepend options from environment */
-    argv = merge_args(getenv("MKPASSWD_OPTIONS"), argv, &argc);
-
-    while ((ch = GETOPT_LONGISH(argc, argv, "hH:m:5P:R:sS:V", longopts, 0))
-	    > 0) {
-	switch (ch) {
-	case '5':
-	    optarg = (char *) "md5";
-	    /* fall through */
-	case 'm':
-	case 'H':
-	    if (!optarg || strcaseeq("help", optarg)) {
-		display_methods();
-		exit(0);
-	    }
-	    for (i = 0; methods[i].method != NULL; i++)
-		if (strcaseeq(methods[i].method, optarg)) {
-		    salt_prefix = methods[i].prefix;
-		    salt_minlen = methods[i].minlen;
-		    salt_maxlen = methods[i].maxlen;
-		    rounds_support = methods[i].rounds;
-		    break;
-		}
-	    if (!salt_prefix) {
-		fprintf(stderr, _("Invalid method '%s'.\n"), optarg);
-		exit(1);
-	    }
-	    break;
-	case 'P':
-	    {
-		char *p;
-		password_fd = strtol(optarg, &p, 10);
-		if (p == NULL || *p != '\0' || password_fd < 0) {
-		    fprintf(stderr, _("Invalid number '%s'.\n"), optarg);
-		    exit(1);
-		}
-	    }
-	    break;
-	case 'R':
-	    {
-		char *p;
-		rounds = strtol(optarg, &p, 10);
-		if (p == NULL || *p != '\0' || rounds < 0) {
-		    fprintf(stderr, _("Invalid number '%s'.\n"), optarg);
-		    exit(1);
-		}
-	    }
-	    break;
-	case 's':
-	    password_fd = 0;
-	    break;
-	case 'S':
-	    salt_arg = optarg;
-	    break;
-	case 'V':
-	    display_version();
-	    exit(0);
-	case 'h':
-	    display_help(EXIT_SUCCESS);
-	default:
-	    fprintf(stderr, _("Try '%s --help' for more information.\n"),
-		    argv[0]);
-	    exit(1);
-	}
-    }
-    argc -= optind;
-    argv += optind;
-
-    if (argc == 2 && !salt_arg) {
-	password = argv[0];
-	salt_arg = argv[1];
-    } else if (argc == 1) {
-	password = argv[0];
-    } else if (argc == 0) {
-    } else {
-	display_help(EXIT_FAILURE);
-    }
-
-    /* default: DES password */
-    if (!salt_prefix) {
-	salt_minlen = methods[0].minlen;
-	salt_maxlen = methods[0].maxlen;
-	salt_prefix = methods[0].prefix;
-    }
-
-    if (streq(salt_prefix, "$2a$") || streq(salt_prefix, "$2y$")) {
-	/* OpenBSD Blowfish and derivatives */
-	if (rounds <= 5)
-	    rounds = 5;
-	/* actually for 2a/2y it is the logarithm of the number of rounds */
-	snprintf(rounds_str, sizeof(rounds_str), "%02u$", rounds);
-    } else if (rounds_support && rounds)
-	snprintf(rounds_str, sizeof(rounds_str), "rounds=%u$", rounds);
-    else
-	rounds_str[0] = '\0';
-
-    if (salt_arg) {
-	unsigned int c = strlen(salt_arg);
-	if (c < salt_minlen || c > salt_maxlen) {
-	    if (salt_minlen == salt_maxlen)
-		fprintf(stderr, ngettext(
-			"Wrong salt length: %d byte when %d expected.\n",
-			"Wrong salt length: %d bytes when %d expected.\n", c),
-			c, salt_maxlen);
-	    else
-		fprintf(stderr, ngettext(
-			"Wrong salt length: %d byte when %d <= n <= %d"
-			" expected.\n",
-			"Wrong salt length: %d bytes when %d <= n <= %d"
-			" expected.\n", c),
-			c, salt_minlen, salt_maxlen);
-	    exit(1);
-	}
-	while (c-- > 0) {
-	    if (strchr(valid_salts, salt_arg[c]) == NULL) {
-		fprintf(stderr, _("Illegal salt character '%c'.\n"),
-			salt_arg[c]);
-		exit(1);
-	    }
-	}
-
-	salt = NOFAIL(malloc(strlen(salt_prefix) + strlen(rounds_str)
-		+ strlen(salt_arg) + 1));
-	*salt = '\0';
-	strcat(salt, salt_prefix);
-	strcat(salt, rounds_str);
-	strcat(salt, salt_arg);
-    } else {
-#ifdef HAVE_SOLARIS_CRYPT_GENSALT
-#error "This code path is untested on Solaris. Please send a patch."
-	salt = crypt_gensalt(salt_prefix, NULL);
-	if (!salt)
-		perror(stderr, "crypt_gensalt");
-#elif defined HAVE_LINUX_CRYPT_GENSALT
-	void *entropy = get_random_bytes(64);
-
-	salt = crypt_gensalt(salt_prefix, rounds, entropy, 64);
-	if (!salt) {
-		fprintf(stderr, "crypt_gensalt failed.\n");
-		exit(2);
-	}
-	free(entropy);
-#else
-	unsigned int salt_len = salt_maxlen;
-
-	if (salt_minlen != salt_maxlen) { /* salt length can vary */
-	    srand(time(NULL) + getpid());
-	    salt_len = rand() % (salt_maxlen - salt_minlen + 1) + salt_minlen;
-	}
-
-	salt = NOFAIL(malloc(strlen(salt_prefix) + strlen(rounds_str)
-		+ salt_len + 1));
-	*salt = '\0';
-	strcat(salt, salt_prefix);
-	strcat(salt, rounds_str);
-	generate_salt(salt + strlen(salt), salt_len);
-#endif
-    }
-
-    if (password) {
-    } else if (password_fd != -1) {
-	FILE *fp;
-	char *p;
-
-	if (isatty(password_fd))
-	    fprintf(stderr, _("Password: "));
-	password = NOFAIL(malloc(128));
-	fp = fdopen(password_fd, "r");
-	if (!fp) {
-	    perror("fdopen");
-	    exit(2);
-	}
-	if (!fgets(password, 128, fp)) {
-	    perror("fgets");
-	    exit(2);
-	}
-
-	p = strpbrk(password, "\n\r");
-	if (p)
-	    *p = '\0';
-    } else {
-	password = getpass(_("Password: "));
-	if (!password) {
-	    perror("getpass");
-	    exit(2);
-	}
-    }
-
-    {
-	const char *result;
-	result = crypt(password, salt);
-	/* xcrypt returns "*0" on errors */
-	if (!result || result[0] == '*') {
-	    fprintf(stderr, "crypt failed.\n");
-	    exit(2);
-	}
-	/* yes, using strlen(salt_prefix) on salt. It's not
-	 * documented whether crypt_gensalt may change the prefix */
-	if (!strneq(result, salt, strlen(salt_prefix))) {
-	    fprintf(stderr, _("Method not supported by crypt(3).\n"));
-	    exit(2);
-	}
-	printf("%s\n", result);
-    }
-
-    exit(0);
-}
-
-#ifdef RANDOM_DEVICE
-void* get_random_bytes(const int count)
-{
-    char *buf;
-    int fd;
-
-    buf = NOFAIL(malloc(count));
-    fd = open(RANDOM_DEVICE, O_RDONLY);
-    if (fd < 0) {
-	perror("open(" RANDOM_DEVICE ")");
-	exit(2);
-    }
-    if (read(fd, buf, count) != count) {
-	if (count < 0)
-	    perror("read(" RANDOM_DEVICE ")");
-	else
-	    fprintf(stderr, "Short read of %s.\n", RANDOM_DEVICE);
-	exit(2);
-    }
-    close(fd);
-
-    return buf;
-}
-#endif
-
-#ifdef RANDOM_DEVICE
-
-void generate_salt(char *const buf, const unsigned int len)
-{
-    unsigned int i;
-
-    unsigned char *entropy = get_random_bytes(len * sizeof(unsigned char));
-    for (i = 0; i < len; i++)
-	buf[i] = valid_salts[entropy[i] % (sizeof valid_salts - 1)];
-    buf[i] = '\0';
-}
-
-#else /* RANDOM_DEVICE */
-
-void generate_salt(char *const buf, const unsigned int len)
-{
-    unsigned int i;
-
-# ifdef HAVE_GETTIMEOFDAY
-    struct timeval tv;
-
-    gettimeofday(&tv, NULL);
-    srand(tv.tv_sec ^ tv.tv_usec);
-
-# else /* HAVE_GETTIMEOFDAY */
-#  warning "This system lacks a strong enough random numbers generator!"
-
-    /*
-     * The possible values of time over one year are 31536000, which is
-     * two orders of magnitude less than the allowed entropy range (2^32).
-     */
-    srand(time(NULL) + getpid());
-
-# endif /* HAVE_GETTIMEOFDAY */
-
-    for (i = 0; i < len; i++)
-	buf[i] = valid_salts[rand() % (sizeof valid_salts - 1)];
-    buf[i] = '\0';
-}
-
-#endif /* RANDOM_DEVICE */
-
-void display_help(int error)
-{
-    fprintf((EXIT_SUCCESS == error) ? stdout : stderr,
-	    _("Usage: mkpasswd [OPTIONS]... [PASSWORD [SALT]]\n"
-	    "Crypts the PASSWORD using crypt(3).\n\n"));
-    fprintf(stderr, _(
-"      -m, --method=TYPE     select method TYPE\n"
-"      -5                    like --method=md5\n"
-"      -S, --salt=SALT       use the specified SALT\n"
-"      -R, --rounds=NUMBER   use the specified NUMBER of rounds\n"
-"      -P, --password-fd=NUM read the password from file descriptor NUM\n"
-"                            instead of /dev/tty\n"
-"      -s, --stdin           like --password-fd=0\n"
-"      -h, --help            display this help and exit\n"
-"      -V, --version         output version information and exit\n"
-"\n"
-"If PASSWORD is missing then it is asked interactively.\n"
-"If no SALT is specified, a random one is generated.\n"
-"If TYPE is 'help', available methods are printed.\n"
-"\n"
-"Report bugs to %s.\n"), "<md+whois@linux.it>");
-    exit(error);
-}
-
-void display_version(void)
-{
-    printf("mkpasswd %s\n\n", VERSION);
-    puts("Copyright (C) 2001-2008 Marco d'Itri\n"
-"This is free software; see the source for copying conditions.  There is NO\n"
-"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.");
-}
-
-void display_methods(void)
-{
-    unsigned int i;
-
-    printf(_("Available methods:\n"));
-    for (i = 0; methods[i].method != NULL; i++)
-	printf("%s\t%s\n", methods[i].method, methods[i].desc);
-}
-
diff --git a/package/mkpasswd/mkpasswd.mk b/package/mkpasswd/mkpasswd.mk
deleted file mode 100644
index b013390572..0000000000
--- a/package/mkpasswd/mkpasswd.mk
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-#
-# mkpasswd
-#
-################################################################################
-
-# source included in buildroot, taken from
-# https://github.com/rfc1036/whois/blob/master/
-# at revision 5a0f08500fa51608b6d3b73ee338be38c692eadb
-HOST_MKPASSWD_LICENSE = GPL-2.0+
-
-define HOST_MKPASSWD_BUILD_CMDS
-	$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS) \
-		package/mkpasswd/mkpasswd.c package/mkpasswd/utils.c \
-		-o $(@D)/mkpasswd -lcrypt
-endef
-
-define HOST_MKPASSWD_INSTALL_CMDS
-	$(INSTALL) -D -m 755 $(@D)/mkpasswd $(HOST_DIR)/bin/mkpasswd
-endef
-
-$(eval $(host-generic-package))
-
-MKPASSWD = $(HOST_DIR)/bin/mkpasswd
diff --git a/package/mkpasswd/utils.c b/package/mkpasswd/utils.c
deleted file mode 100644
index 254bf2ac68..0000000000
--- a/package/mkpasswd/utils.c
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright 1999-2008 by Marco d'Itri <md@linux.it>.
- *
- * do_nofail and merge_args come from the module-init-tools package.
- * Copyright 2001 by Rusty Russell.
- * Copyright 2002, 2003 by Rusty Russell, IBM Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
-
-/* for strdup */
-#define _XOPEN_SOURCE 500
-
-/* System library */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <errno.h>
-
-/* Application-specific */
-#include "utils.h"
-
-void *do_nofail(void *ptr, const char *file, const int line)
-{
-    if (ptr)
-	return ptr;
-
-    err_quit("Memory allocation failure at %s:%d.", file, line);
-}
-
-/* Prepend options from a string. */
-char **merge_args(char *args, char *argv[], int *argc)
-{
-    char *arg, *argstring;
-    char **newargs = NULL;
-    unsigned int i, num_env = 0;
-
-    if (!args)
-	return argv;
-
-    argstring = NOFAIL(strdup(args));
-    for (arg = strtok(argstring, " "); arg; arg = strtok(NULL, " ")) {
-	num_env++;
-	newargs = NOFAIL(realloc(newargs,
-		    sizeof(newargs[0]) * (num_env + *argc + 1)));
-	newargs[num_env] = arg;
-    }
-
-    if (!newargs)
-	return argv;
-
-    /* Append commandline args */
-    newargs[0] = argv[0];
-    for (i = 1; i <= *argc; i++)
-	newargs[num_env + i] = argv[i];
-
-    *argc += num_env;
-    return newargs;
-}
-
-/* Error routines */
-void err_sys(const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    fprintf(stderr, ": %s\n", strerror(errno));
-    va_end(ap);
-    exit(2);
-}
-
-void err_quit(const char *fmt, ...)
-{
-    va_list ap;
-
-    va_start(ap, fmt);
-    vfprintf(stderr, fmt, ap);
-    fputs("\n", stderr);
-    va_end(ap);
-    exit(2);
-}
-
diff --git a/package/mkpasswd/utils.h b/package/mkpasswd/utils.h
deleted file mode 100644
index 0f226aee2f..0000000000
--- a/package/mkpasswd/utils.h
+++ /dev/null
@@ -1,56 +0,0 @@
-#ifndef WHOIS_UTILS_H
-#define WHOIS_UTILS_H
-
-/* Convenience macros */
-#define streq(a, b) (strcmp(a, b) == 0)
-#define strcaseeq(a, b) (strcasecmp(a, b) == 0)
-#define strneq(a, b, n) (strncmp(a, b, n) == 0)
-#define strncaseeq(a, b, n) (strncasecmp(a, b, n) == 0)
-
-#define NOFAIL(ptr) do_nofail((ptr), __FILE__, __LINE__)
-
-/* Portability macros */
-#ifdef __GNUC__
-# define NORETURN __attribute__((noreturn))
-#else
-# define NORETURN
-#endif
-
-#ifndef AI_IDN
-# define AI_IDN 0
-#endif
-
-#ifndef AI_ADDRCONFIG
-# define AI_ADDRCONFIG 0
-#endif
-
-#ifdef HAVE_GETOPT_LONG
-# define GETOPT_LONGISH(c, v, o, l, i) getopt_long(c, v, o, l, i)
-#else
-# define GETOPT_LONGISH(c, v, o, l, i) getopt(c, v, o)
-#endif
-
-#ifdef ENABLE_NLS
-# include <libintl.h>
-# include <locale.h>
-# define _(a) (gettext(a))
-# ifdef gettext_noop
-#  define N_(a) gettext_noop(a)
-# else
-#  define N_(a) (a)
-# endif
-#else
-# define _(a) (a)
-# define N_(a) (a)
-# define ngettext(a, b, c) ((c==1) ? (a) : (b))
-#endif
-
-
-/* Prototypes */
-void *do_nofail(void *ptr, const char *file, const int line);
-char **merge_args(char *args, char *argv[], int *argc);
-
-void err_quit(const char *fmt, ...) NORETURN;
-void err_sys(const char *fmt, ...) NORETURN;
-
-#endif
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox Stefan Becker
@ 2018-06-04 22:21                         ` Arnout Vandecappelle
  2018-06-05 11:22                           ` Carlos Santos
  2018-06-05 16:08                           ` Yann E. MORIN
  0 siblings, 2 replies; 38+ messages in thread
From: Arnout Vandecappelle @ 2018-06-04 22:21 UTC (permalink / raw)
  To: buildroot



On 01-06-18 15:30, Stefan Becker wrote:
> host-mkpasswd was a fork from whois to provide a host version of
> mkpasswd for the build. This has caused a maintenance headache.
> 
> Replace it with host-busybox which can provide "mkpasswd" functionality
> from own source code. That causes less hassle for different build
> platforms.

 Just to be clear: does everybody agree that it is a good idea to use
weakly-random numbers as salt, rather than real random numbers like whois does?

 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-04 22:21                         ` Arnout Vandecappelle
@ 2018-06-05 11:22                           ` Carlos Santos
  2018-06-05 16:15                             ` Yann E. MORIN
  2018-06-05 16:08                           ` Yann E. MORIN
  1 sibling, 1 reply; 38+ messages in thread
From: Carlos Santos @ 2018-06-05 11:22 UTC (permalink / raw)
  To: buildroot

> From: "Arnout Vandecappelle" <arnout@mind.be>
> To: "Stefan Becker" <chemobejk@gmail.com>, "buildroot" <buildroot@buildroot.org>
> Cc: "Yann Morin" <yann.morin.1998@free.fr>, "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
> Sent: Monday, June 4, 2018 7:21:10 PM
> Subject: Re: [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox

> On 01-06-18 15:30, Stefan Becker wrote:
>> host-mkpasswd was a fork from whois to provide a host version of
>> mkpasswd for the build. This has caused a maintenance headache.
>> 
>> Replace it with host-busybox which can provide "mkpasswd" functionality
>> from own source code. That causes less hassle for different build
>> platforms.
> 
> Just to be clear: does everybody agree that it is a good idea to use
> weakly-random numbers as salt, rather than real random numbers like whois does?

Wouldn't it be better to add a host version of the whois package that
installs mkpasswd, only?

-- 
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.? ? Epitaph of a volunteer

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-04 22:21                         ` Arnout Vandecappelle
  2018-06-05 11:22                           ` Carlos Santos
@ 2018-06-05 16:08                           ` Yann E. MORIN
  2018-06-18  5:13                             ` Peter Korsgaard
  1 sibling, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2018-06-05 16:08 UTC (permalink / raw)
  To: buildroot

Arnout, All,

On 2018-06-05 00:21 +0200, Arnout Vandecappelle spake thusly:
> On 01-06-18 15:30, Stefan Becker wrote:
> > host-mkpasswd was a fork from whois to provide a host version of
> > mkpasswd for the build. This has caused a maintenance headache.
> > 
> > Replace it with host-busybox which can provide "mkpasswd" functionality
> > from own source code. That causes less hassle for different build
> > platforms.
> 
>  Just to be clear: does everybody agree that it is a good idea to use
> weakly-random numbers as salt, rather than real random numbers like whois does?

Not really, no. That is definitely no good. I was not aware of how bad
the busybox salt generator was.. Sigh....

(note: I did see your previous reply, but did not get enough time to
properly reply so far; sorry.)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-05 11:22                           ` Carlos Santos
@ 2018-06-05 16:15                             ` Yann E. MORIN
  2018-06-05 16:35                               ` Christopher McCrory
  0 siblings, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2018-06-05 16:15 UTC (permalink / raw)
  To: buildroot

Carlos, All,

On 2018-06-05 08:22 -0300, Carlos Santos spake thusly:
> > From: "Arnout Vandecappelle" <arnout@mind.be>
> > To: "Stefan Becker" <chemobejk@gmail.com>, "buildroot" <buildroot@buildroot.org>
> > Cc: "Yann Morin" <yann.morin.1998@free.fr>, "Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
> > Sent: Monday, June 4, 2018 7:21:10 PM
> > Subject: Re: [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
> 
> > On 01-06-18 15:30, Stefan Becker wrote:
> >> host-mkpasswd was a fork from whois to provide a host version of
> >> mkpasswd for the build. This has caused a maintenance headache.
> >> 
> >> Replace it with host-busybox which can provide "mkpasswd" functionality
> >> from own source code. That causes less hassle for different build
> >> platforms.
> > 
> > Just to be clear: does everybody agree that it is a good idea to use
> > weakly-random numbers as salt, rather than real random numbers like whois does?
> 
> Wouldn't it be better to add a host version of the whois package that
> installs mkpasswd, only?

That's what I initially suggested, but whois' mkpasswd uses some
optional glibc features, which have been disabled in some distros,
like Fedora28, which can then no longer build our mkpasswd. And our
own mkasswd is an extract from way back then, when we did not have
the whois package in busybox.

So, switching to host-whois is not an imporovement over the current
situation.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-05 16:15                             ` Yann E. MORIN
@ 2018-06-05 16:35                               ` Christopher McCrory
  2018-06-05 16:50                                 ` Yann E. MORIN
  0 siblings, 1 reply; 38+ messages in thread
From: Christopher McCrory @ 2018-06-05 16:35 UTC (permalink / raw)
  To: buildroot

Sorry for top post, on mobile.

What about using openssl?

https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html

On Tue, Jun 5, 2018, 9:15 AM Yann E. MORIN <yann.morin.1998@free.fr> wrote:

> Carlos, All,
>
> On 2018-06-05 08:22 -0300, Carlos Santos spake thusly:
> > > From: "Arnout Vandecappelle" <arnout@mind.be>
> > > To: "Stefan Becker" <chemobejk@gmail.com>, "buildroot" <
> buildroot at buildroot.org>
> > > Cc: "Yann Morin" <yann.morin.1998@free.fr>, "Thomas Petazzoni" <
> thomas.petazzoni at bootlin.com>
> > > Sent: Monday, June 4, 2018 7:21:10 PM
> > > Subject: Re: [Buildroot] [PATCHv2 proposal/next 2/3] build: replace
> host-mkpasswd with host-busybox
> >
> > > On 01-06-18 15:30, Stefan Becker wrote:
> > >> host-mkpasswd was a fork from whois to provide a host version of
> > >> mkpasswd for the build. This has caused a maintenance headache.
> > >>
> > >> Replace it with host-busybox which can provide "mkpasswd"
> functionality
> > >> from own source code. That causes less hassle for different build
> > >> platforms.
> > >
> > > Just to be clear: does everybody agree that it is a good idea to use
> > > weakly-random numbers as salt, rather than real random numbers like
> whois does?
> >
> > Wouldn't it be better to add a host version of the whois package that
> > installs mkpasswd, only?
>
> That's what I initially suggested, but whois' mkpasswd uses some
> optional glibc features, which have been disabled in some distros,
> like Fedora28, which can then no longer build our mkpasswd. And our
> own mkasswd is an extract from way back then, when we did not have
> the whois package in busybox.
>
> So, switching to host-whois is not an imporovement over the current
> situation.
>
> Regards,
> Yann E. MORIN.
>
> --
>
> .-----------------.--------------------.------------------.--------------------.
> |  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics'
> conspiracy: |
> | +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___
>      |
> | +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is
> no  |
> | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v
>  conspiracy.  |
>
> '------------------------------^-------^------------------^--------------------'
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180605/dde121ac/attachment.html>

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-05 16:35                               ` Christopher McCrory
@ 2018-06-05 16:50                                 ` Yann E. MORIN
  2018-06-07 21:29                                   ` Arnout Vandecappelle
  0 siblings, 1 reply; 38+ messages in thread
From: Yann E. MORIN @ 2018-06-05 16:50 UTC (permalink / raw)
  To: buildroot

Christopher, All,

On 2018-06-05 09:35 -0700, Christopher McCrory spake thusly:
> Sorry for top post, on mobile.
> What about using openssl?
> [1]https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html

Since we do not require that openssl be installed on the build machine,
we'd have to build our own one. We do have a host-openssl package, but
it takes quite a bit of time to build: on my relativelty fast laptop,
it adds about 32s to the build time. This is a pretty big hit...

So, not an option IMHO...

Regards,
Yann E. MORIN.

> On Tue, Jun 5, 2018, 9:15 AM Yann E. MORIN < [2]yann.morin.1998@free.fr> wrote:
> 
>   Carlos, All,
> 
>   On 2018-06-05 08:22 -0300, Carlos Santos spake thusly:
>   > > From: "Arnout Vandecappelle" < [3]arnout@mind.be>
>   > > To: "Stefan Becker" < [4]chemobejk@gmail.com>, "buildroot" < [5]buildroot@buildroot.org>
>   > > Cc: "Yann Morin" < [6]yann.morin.1998@free.fr>, "Thomas Petazzoni" < [7]thomas.petazzoni@bootlin.com>
>   > > Sent: Monday, June 4, 2018 7:21:10 PM
>   > > Subject: Re: [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
>   >
>   > > On 01-06-18 15:30, Stefan Becker wrote:
>   > >> host-mkpasswd was a fork from whois to provide a host version of
>   > >> mkpasswd for the build. This has caused a maintenance headache.
>   > >>
>   > >> Replace it with host-busybox which can provide "mkpasswd" functionality
>   > >> from own source code. That causes less hassle for different build
>   > >> platforms.
>   > >
>   > > Just to be clear: does everybody agree that it is a good idea to use
>   > > weakly-random numbers as salt, rather than real random numbers like whois does?
>   >
>   > Wouldn't it be better to add a host version of the whois package that
>   > installs mkpasswd, only?
> 
>   That's what I initially suggested, but whois' mkpasswd uses some
>   optional glibc features, which have been disabled in some distros,
>   like Fedora28, which can then no longer build our mkpasswd. And our
>   own mkasswd is an extract from way back then, when we did not have
>   the whois package in busybox.
> 
>   So, switching to host-whois is not an imporovement over the current
>   situation.
> 
>   Regards,
>   Yann E. MORIN.
> 
>   --
>   .-----------------.--------------------.------------------.--------------------.
>   |? Yann E. MORIN? | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
>   | +33 662 376 056 | Software? Designer | \ / CAMPAIGN? ? ?|? ___? ? ? ? ? ?
>   ? ?|
>   | +33 223 225 172 `------------.-------:? X? AGAINST? ? ? |? \e/? There is no? |
>   | [8]http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL? ? |? ?v? ?conspiracy.? |
>   '------------------------------^-------^------------------^--------------------'
>   _______________________________________________
>   buildroot mailing list
>   [9]buildroot at busybox.net
>   [10]http://lists.busybox.net/mailman/listinfo/buildroot
> 
> Links:
> 1. https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html
> 2. mailto:yann.morin.1998 at free.fr
> 3. mailto:arnout at mind.be
> 4. mailto:chemobejk at gmail.com
> 5. mailto:buildroot at buildroot.org
> 6. mailto:yann.morin.1998 at free.fr
> 7. mailto:thomas.petazzoni at bootlin.com
> 8. http://ymorin.is-a-geek.org/
> 9. mailto:buildroot at busybox.net
> 10. http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-05 16:50                                 ` Yann E. MORIN
@ 2018-06-07 21:29                                   ` Arnout Vandecappelle
  2018-06-08 11:40                                     ` Stefan Becker
  0 siblings, 1 reply; 38+ messages in thread
From: Arnout Vandecappelle @ 2018-06-07 21:29 UTC (permalink / raw)
  To: buildroot



On 05-06-18 18:50, Yann E. MORIN wrote:
> Christopher, All,
> 
> On 2018-06-05 09:35 -0700, Christopher McCrory spake thusly:
>> Sorry for top post, on mobile.
>> What about using openssl?
>> [1]https://www.openssl.org/docs/manmaster/man1/openssl-passwd.html
> 
> Since we do not require that openssl be installed on the build machine,
> we'd have to build our own one. We do have a host-openssl package, but
> it takes quite a bit of time to build: on my relativelty fast laptop,
> it adds about 32s to the build time. This is a pretty big hit...
> 
> So, not an option IMHO...

 So, not whois, not busybox, not openssl... What about python, which we anyway
require to be installed on the host? I remember that someone has posted a
one-liner that would do the job :-P

 Regards,
 Arnout

[snip]
-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-07 21:29                                   ` Arnout Vandecappelle
@ 2018-06-08 11:40                                     ` Stefan Becker
  2018-06-08 17:13                                       ` Yann E. MORIN
  0 siblings, 1 reply; 38+ messages in thread
From: Stefan Becker @ 2018-06-08 11:40 UTC (permalink / raw)
  To: buildroot

Hi Arnout, All,

On Fri, Jun 8, 2018 at 12:29 AM Arnout Vandecappelle <arnout@mind.be> wrote:
>
>  So, not whois, not busybox, not openssl... What about python, which we anyway
> require to be installed on the host? I remember that someone has posted a
> one-liner that would do the job :-P

Because a python one-liner is not enough. F.ex. from support/scripts/mkuser:

   # Encode a password
   encode_password() {
       local passwd="${1}"

       mkpasswd -m "${PASSWD_METHOD}" "${passwd}"
   }

i.e. you need at least a python script with mkpasswd-compatible
command line parameters.

Regards, Stefan

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-08 11:40                                     ` Stefan Becker
@ 2018-06-08 17:13                                       ` Yann E. MORIN
  0 siblings, 0 replies; 38+ messages in thread
From: Yann E. MORIN @ 2018-06-08 17:13 UTC (permalink / raw)
  To: buildroot

Stefan, Arnout, All,

On 2018-06-08 14:40 +0300, Stefan Becker spake thusly:
> On Fri, Jun 8, 2018 at 12:29 AM Arnout Vandecappelle <arnout@mind.be> wrote:
> >  So, not whois, not busybox, not openssl... What about python, which we anyway
> > require to be installed on the host? I remember that someone has posted a
> > one-liner that would do the job :-P

Well, I'd still prefer we had a script, and especially I did not like
that it would read the random bytes from stdin, when python provides a
proper random abstraction:

    import os
    os.urandom(64) # 64 random bytes

This is even portable, using various backends on various OSes... Then
your previous proposal becomes acceptable. Now. ;-)

> Because a python one-liner is not enough. F.ex. from support/scripts/mkuser:
> 
>    # Encode a password
>    encode_password() {
>        local passwd="${1}"
> 
>        mkpasswd -m "${PASSWD_METHOD}" "${passwd}"
>    }

Well, that one is an internal script of oours (I wrote it), so we can
very well change it to use another tool without problem.

> i.e. you need at least a python script with mkpasswd-compatible
> command line parameters.

Ideally, a mkpasswd-compatible tool would be nice, but as long as we use
it internally, we don't care much, in fact.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-05 16:08                           ` Yann E. MORIN
@ 2018-06-18  5:13                             ` Peter Korsgaard
  2018-06-18  6:53                               ` Thomas Petazzoni
  0 siblings, 1 reply; 38+ messages in thread
From: Peter Korsgaard @ 2018-06-18  5:13 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Arnout, All,
 > On 2018-06-05 00:21 +0200, Arnout Vandecappelle spake thusly:
 >> On 01-06-18 15:30, Stefan Becker wrote:
 >> > host-mkpasswd was a fork from whois to provide a host version of
 >> > mkpasswd for the build. This has caused a maintenance headache.
 >> > 
 >> > Replace it with host-busybox which can provide "mkpasswd" functionality
 >> > from own source code. That causes less hassle for different build
 >> > platforms.
 >> 
 >> Just to be clear: does everybody agree that it is a good idea to use
 >> weakly-random numbers as salt, rather than real random numbers like whois does?

 > Not really, no. That is definitely no good. I was not aware of how bad
 > the busybox salt generator was.. Sigh....

If that is the only problem then we could still use it and pass our own
salt, but that leaves the problem of coming up with a sufficiently
random salt. I guess we could do something with reading /dev/urandom and
base64 encoding it.

But yeah, just going for the python implementation may be the easiest.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 38+ messages in thread

* [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox
  2018-06-18  5:13                             ` Peter Korsgaard
@ 2018-06-18  6:53                               ` Thomas Petazzoni
  0 siblings, 0 replies; 38+ messages in thread
From: Thomas Petazzoni @ 2018-06-18  6:53 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 18 Jun 2018 07:13:25 +0200, Peter Korsgaard wrote:

>  >> Just to be clear: does everybody agree that it is a good idea to use
>  >> weakly-random numbers as salt, rather than real random numbers like whois does?  
> 
>  > Not really, no. That is definitely no good. I was not aware of how bad
>  > the busybox salt generator was.. Sigh....  
> 
> If that is the only problem then we could still use it and pass our own
> salt, but that leaves the problem of coming up with a sufficiently
> random salt. I guess we could do something with reading /dev/urandom and
> base64 encoding it.
> 
> But yeah, just going for the python implementation may be the easiest.

Once again, what is the problem with the current solution we have ?

We have been happy with it for several years, and the only thing that
prompted this discussion is that it failed to build on Fedora 28, which
was fixed by a 3 lines change. Is it really worth it changing this
stuff ?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2018-06-18  6:53 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02  9:05 [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host Stefan Becker
2018-05-02 17:57 ` Yann E. MORIN
2018-05-02 18:23   ` Stefan Becker
2018-05-02 20:38     ` Arnout Vandecappelle
2018-05-02 21:04       ` Yann E. MORIN
2018-05-03  6:11       ` Stefan Becker
2018-05-02 21:06     ` Yann E. MORIN
2018-05-03 19:56 ` Thomas Petazzoni
2018-05-03 20:04   ` Yann E. MORIN
2018-05-06 16:19     ` Stefan Becker
2018-05-07 15:00       ` M ZV
2018-05-08 21:37         ` Arnout Vandecappelle
2018-05-09 20:22           ` Yann E. MORIN
2018-05-10 16:02             ` M ZV
2018-05-29  7:37             ` Peter Korsgaard
2018-05-30 15:31               ` Yann E. MORIN
2018-05-30 16:45                 ` Arnout Vandecappelle
2018-06-01 12:58                   ` [Buildroot] [PATCH proposal/next] replace host-mkpasswd Stefan Becker
2018-06-01 12:58                     ` [Buildroot] [PATCH proposal/next 1/2] package/busybox: add host variant Stefan Becker
2018-06-01 13:03                       ` Thomas Petazzoni
2018-06-01 12:59                     ` [Buildroot] [PATCH proposal/next 2/2] package/mkpasswd: remove obsolete package Stefan Becker
2018-06-01 13:30                     ` [Buildroot] [PATCHv2 propsal/next] replace host-mkpasswd Stefan Becker
2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 1/3] package/busybox: add host variant Stefan Becker
2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 2/3] build: replace host-mkpasswd with host-busybox Stefan Becker
2018-06-04 22:21                         ` Arnout Vandecappelle
2018-06-05 11:22                           ` Carlos Santos
2018-06-05 16:15                             ` Yann E. MORIN
2018-06-05 16:35                               ` Christopher McCrory
2018-06-05 16:50                                 ` Yann E. MORIN
2018-06-07 21:29                                   ` Arnout Vandecappelle
2018-06-08 11:40                                     ` Stefan Becker
2018-06-08 17:13                                       ` Yann E. MORIN
2018-06-05 16:08                           ` Yann E. MORIN
2018-06-18  5:13                             ` Peter Korsgaard
2018-06-18  6:53                               ` Thomas Petazzoni
2018-06-01 13:30                       ` [Buildroot] [PATCHv2 proposal/next 3/3] package/mkpasswd: remove obsolete package Stefan Becker
2018-05-29  6:43     ` [Buildroot] [PATCH] host-mkpasswd: fix crash on Fedora 28 build host Stefan Becker
2018-05-03 21:26 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.