Added crypt.pl
This commit is contained in:
parent
e8c3f76218
commit
af75f9b864
|
@ -3,13 +3,15 @@ include GNUmakevars
|
|||
CONFDIR=../../configure
|
||||
CONFDIR_exists=$(shell [ -d $(CONFDIR) ] && echo ok)
|
||||
|
||||
all: configure dus fnp fnpa fnpc isodate psg save
|
||||
all: configure dus fnp fnpa fnpc isodate psg save crypt
|
||||
|
||||
clean:
|
||||
rm fnp fnpa fnpc customize
|
||||
rm fnp fnpa fnpc customize crypt
|
||||
|
||||
install: \
|
||||
$(BINDIR)/crypt \
|
||||
$(BINDIR)/dus \
|
||||
$(BINDIR)/findsock \
|
||||
$(BINDIR)/fnp \
|
||||
$(BINDIR)/fnpa \
|
||||
$(BINDIR)/fnpc \
|
||||
|
@ -17,22 +19,28 @@ install: \
|
|||
$(BINDIR)/psg \
|
||||
$(BINDIR)/save \
|
||||
$(BINDIR)/savedate \
|
||||
$(BINDIR)/findsock \
|
||||
|
||||
fnp: fnp.sh
|
||||
fnpa: fnpa.sh
|
||||
fnpc: fnpc.sh
|
||||
crypt: crypt.pl
|
||||
|
||||
%: %.sh customize
|
||||
sh ./customize < $< > $@
|
||||
chmod +x $@
|
||||
|
||||
%: %.pl customize
|
||||
sh ./customize < $< > $@
|
||||
chmod +x $@
|
||||
|
||||
customize: configure
|
||||
sh ./configure
|
||||
|
||||
ifeq ($(CONFDIR_exists),ok)
|
||||
|
||||
configure: $(CONFDIR)/start $(CONFDIR)/find-printf $(CONFDIR)/finish
|
||||
configure: $(CONFDIR)/start \
|
||||
$(CONFDIR)/find-printf $(CONFDIR)/perl \
|
||||
$(CONFDIR)/finish
|
||||
cat $^ > $@
|
||||
|
||||
endif
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
#!@@@perl@@@
|
||||
use warnings;
|
||||
use strict;
|
||||
|
||||
unless (@ARGV == 2) {
|
||||
print STDERR "Usage: $0 password salt\n";
|
||||
exit(2);
|
||||
}
|
||||
my $encpwd = crypt($ARGV[0], $ARGV[1]);
|
||||
print "$encpwd\n";
|
||||
exit($ARGV[1] eq $encpwd ? 0 : 1);
|
Loading…
Reference in New Issue