From af75f9b864b8e157ede38256206c929c3dd35852 Mon Sep 17 00:00:00 2001 From: hjp Date: Wed, 3 Nov 2004 14:18:39 +0000 Subject: [PATCH] Added crypt.pl --- tiny/GNUmakefile | 16 ++++++++++++---- tiny/crypt.pl | 11 +++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 tiny/crypt.pl 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);