diff --git a/tiny/GNUmakefile b/tiny/GNUmakefile index e7e6ad9..78bfd06 100644 --- a/tiny/GNUmakefile +++ b/tiny/GNUmakefile @@ -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 diff --git a/tiny/crypt.pl b/tiny/crypt.pl new file mode 100644 index 0000000..05589ba --- /dev/null +++ b/tiny/crypt.pl @@ -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);