while read line; do
n=`./busybox cryptpw -a des -- "$line"`
- o=`./busybox_old cryptpw -a des -- "$line"`
+ o=`./busybox_org cryptpw -a des -- "$line"`
test "$n" != "$o" && {
echo n="$n"
echo o="$o"
exit
}
n=`./busybox cryptpw -- "$line"`
- o=`./busybox_old cryptpw -- "$line"`
+ o=`./busybox_org cryptpw -- "$line"`
test "$n" != "$o" && {
echo n="$n"
echo o="$o"
*/
int cryptpw_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int cryptpw_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int cryptpw_main(int argc UNUSED_PARAM, char **argv)
{
char salt[sizeof("$N$XXXXXXXX")];
+ char *opt_a;
- if (!getopt32(argv, "a:", NULL) || argv[optind - 1][0] != 'd') {
- strcpy(salt, "$1$");
- /* Too ugly, and needs even more magic to handle endianness: */
- //((uint32_t*)&salt)[0] = '$' + '1'*0x100 + '$'*0x10000;
- /* Hope one day gcc will do it itself (inlining strcpy) */
+ if (!getopt32(argv, "a:", &opt_a) || opt_a[0] != 'd') {
+ salt[0] = '$';
+ salt[1] = '1';
+ salt[2] = '$';
crypt_make_salt(salt + 3, 4, 0); /* md5 */
#if TESTING
strcpy(salt + 3, "ajg./bcf");