head	1.3;
access;
symbols
	RELEASE_5_0_0:1.2;
locks; strict;
comment	@# @;


1.3
date	2003.01.27.05.28.50;	author dinoex;	state dead;
branches;
next	1.2;

1.2
date	2002.12.24.10.40.10;	author dinoex;	state Exp;
branches;
next	1.1;

1.1
date	2002.12.18.03.49.07;	author dinoex;	state Exp;
branches;
next	;


desc
@@


1.3
log
@- Update to 1.5
@
text
@--- src/lsh-authorize.orig	Tue Mar 26 16:40:49 2002
+++ src/lsh-authorize	Wed Dec 18 05:01:48 2002
@@@@ -1,4 +1,4 @@@@
-#! /bin/sh
+#!/bin/sh
 
 usage () {
     echo Usage: $0 key-file
@@@@ -29,7 +29,7 @@@@
     exit 0
 fi
 
-create_dir () {
+create-dir () {
     if mkdir $1 2>/dev/null; then
 	echo Created $1
 	chmod $2 $1 || exit 1
@@@@ -40,23 +40,25 @@@@
 create_dir $HOME/.lsh 0700
 create_dir $HOME/.lsh/authorized_keys_sha1 0700
 
-if type sexp-conv >/dev/null 2>&1 ; then
-    SEXP_CONV=sexp-conv
-else
-    SEXP_CONV=./sexp-conv
-fi
+PATH=$PATH:`dirname $0`
 
-if type $SEXP_CONV >/dev/null 2>&1 ; then : ; else
-    echo "Can't find the sexp-conv program"
-    exit 1
-fi
+SEXP_CONV="sexp-conv"
 
 while [ $# != 0 ]; do
-    hash=`$SEXP_CONV < $1 --once --hash sha1 --raw-hash`
-    if [ -z $hash ] ; then
-	echo $0: File $1 not found.
-    else
+    if [ -f $1 ]; then
+       hash=`$SEXP_CONV < $1 --once --hash sha1 --raw-hash`
+       if [ $? = 127 ]; then
+ 	echo "Can't find the sexp_conv program"
+        exit 1
+       fi
+       if [ -z "$hash" ] ; then
+ 	echo $0: File $1 not readable
+       else
         $SEXP_CONV < $1 -f canonical --once > $HOME/.lsh/authorized_keys_sha1/$hash
+       fi
+    else
+       echo $0: File $1 not found.
     fi
     shift
 done
+
@


1.2
log
@- Fix build with threads
- Fix build under current
- Fix build with krb5
@
text
@@


1.1
log
@- Fix some of the build problems on CURRENT, not all.
- make PREFIX aware
- mark BROKEN for conflicts with getopt.h
- take maintainership
@
text
@d1 2
a2 2
--- src/lsh-authorize.orig	Tue Jul 11 13:56:07 2000
+++ src/lsh-authorize	Tue Jul 11 14:00:58 2000
d18 3
a20 2
@@@@ -37,26 +37,27 @@@@
 }
d22 2
a23 8
 # Create directories
-create_dir ~/.lsh 0700
-create_dir ~/.lsh/authorized_keys_sha1 0700
+create-dir ~/.lsh 0700
+create-dir ~/.lsh/authorized_keys_sha1 0700
 
-if type sexp-conv ; then
-    SEXP_CONV=sexp_conv
d25 1
a25 1
-    SEXP_CONV=./sexp_conv
d29 2
a30 2
-if ! type $SEXP_CONV ; then
-    echo "Can't find the sexp_conv program"
d33 1
a33 1
+SEXP_CONV="sexp_conv"
d41 10
a50 10
+      hash=`$SEXP_CONV < $1 --once --hash sha1 --raw-hash`
+      if [ $? = 127 ]; then
+	echo "Can't find the sexp_conv program"
+       exit 1
+      fi
+      if [ -z "$hash" ] ; then
+	echo $0: File $1 not readable
+      else
         $SEXP_CONV < $1 -f canonical --once > ~/.lsh/authorized_keys_sha1/$hash
+      fi
d52 1
a52 1
+      echo $0: File $1 not found.
d56 1
@

