Install cryptpasswd as "radcrypt"
authorAlan T. DeKok <aland@freeradius.org>
Tue, 8 Jun 2010 14:28:23 +0000 (16:28 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 10 Jun 2010 08:30:18 +0000 (10:30 +0200)
scripts/Makefile
scripts/cryptpasswd.in

index 57de46f..4938da4 100644 (file)
@@ -12,5 +12,6 @@ install:
        $(INSTALL) -m 755 radsqlrelay           $(R)$(bindir)
        $(INSTALL) -m 755 radwatch              $(R)$(sbindir)
        $(INSTALL) -m 755 raddebug              $(R)$(sbindir)
+       $(INSTALL) -m 755 cryptpassword         $(R)$(bindir)/radcrypt
 
 clean:
index 905442e..dbc0f4f 100755 (executable)
@@ -34,7 +34,10 @@ sub check_md5 {
 }
 
 sub usage {
-       die "Usage: cryptpasswd [--des|--md5|--check] plaintext_password [crypted_password]\n";
+       $name = $0;
+       $name =~ s,.*/,,;
+
+       die "Usage: $name [--des|--md5|--check] plaintext_password [crypted_password]\n";
 }
 
 @saltc = ( '.', '/', '0'..'9', 'A'..'Z', 'a'..'z' );
@@ -59,7 +62,7 @@ sub main {
                }
        }
 
-       usage() unless ($opt_des || $opt_md5);
+       $opt_des = 1 unless ($opt_des || $opt_md5);
        usage() unless ($#ARGV == 0);
 
        die "DES password hashing not available\n"