[patch] New-applet howto. (and new applet)

Denis Vlasenko vda.linux at googlemail.com
Sun May 6 23:07:38 UTC 2007


On Sunday 06 May 2007 10:49, Thomas Lundquist wrote:
> On Sun, May 06, 2007 at 10:17:42AM +0200, Thomas Lundquist wrote:
> > 
> > Well, did it anyway.
> > 
> > cryptpw, tried it before, trying again :=)
> > 
> > also a little change to the howto.
> 
> and this time, the patch.

+#define cryptpw_trivial_usage \
+        "[-a des|md5] string"
+#define cryptpw_full_usage \
+        "Outputs a crypted version of the string.\n" \
+        "Options:\n" \
+        "\t-a\tDefine which algorithm shall be used for the password.\n" \
+        "\t\t\t(Choices: des, md5" \
+        ". Default is md5.)"

\t's invariably get incorrectly lined up without any fast way to see it.
Please read the comment on top of include/usage.h.


+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "busybox.h"

busybox.h already includes most "usual" things. Drop #include <stdio.h> etc.


-static void crypt_make_salt(char *p, int cnt)

You seem to delete crypt_make_salt() from passwd.c, but never add it anywhere.
Where is crypt_make_salt.c?


+       if (argc) {
+
+               clear = argv[0];
+
+       } else {
+
+               clear = xmalloc_fgets(stdin);
+               clen = strlen(clear);
+
+               if(clear[clen-1]=='\n')
+                       clear[--clen] = '\0';
+
+       }
+
+
+       /*
+
+       These two used to be in obscure.c but have now been removed.

Well, why so many empty lines?
--
vda



More information about the busybox mailing list