lprng-3.8.27-certs.diff 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --- LPRng-3.8.27/src/lprng_certs.orig 2004-12-20 00:29:21.000000000 +0100
  2. +++ LPRng-3.8.27/src/lprng_certs.sh 2004-12-20 00:33:49.000000000 +0100
  3. @@ -320,7 +320,9 @@
  4. # set default values
  5. -CFG=/tmp/$$.sslcfg
  6. +TMPDIR=`mktemp -d -t lprng.XXXXXX` || { echo "$0: Cannot create temporary directory!" >&2 ; exit 1; }
  7. +trap "/bin/rm -rf ${TMPDIR}" 0 1 2 3 13 15
  8. +CFG=$TMPDIR/sslcfg
  9. OPENSSL=/usr/bin/openssl
  10. CA_KEY=//etc/lprng/ssl.ca/ca.key
  11. @@ -508,14 +510,14 @@
  12. shift
  13. if [ "$1" = "" ] ; then usage; fi;
  14. if [ ! -f "$1" ] ; then useage; fi;
  15. - sed -n -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/p' $1 >/tmp/$$.key
  16. - sed -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/d' $1 >/tmp/$$.crt
  17. - STEP="" encrypt /tmp/$$.key
  18. + sed -n -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/p' $1 >$TMPDIR/key
  19. + sed -e '/BEGIN.*PRIVATE KEY/,/END.*PRIVATE KEY/d' $1 >$TMPDIR/crt
  20. + STEP="" encrypt $TMPDIR/key
  21. status=$?
  22. echo STATUS $status
  23. if [ $status = 0 ] ; then
  24. mv $1 $1.orig
  25. - cat /tmp/$$.crt /tmp/$$.key >$1
  26. + cat $TMPDIR/crt $TMPDIR/key >$1
  27. fi
  28. ;;
  29. @@ -845,5 +847,4 @@
  30. exit 1
  31. ;;
  32. esac
  33. -rm -f ${CFG}
  34. exit $RET