Fix for bug 128747: Bonsai should be made architecture independent.

Convert trapdoor to being a perl file that uses builtin crypt(), and
fix pretty much everything that treated it specially. We now no longer
depend on gcc or anything else. Also fixes by consequence bug 263242,
How about if trapdoor didn't SEGV with no arguments?  which caused me
much embarassment this week. r=cls.
This commit is contained in:
kiko%async.com.br 2004-10-08 01:06:46 +00:00
Родитель 51b4394903
Коммит 4f52134c24
8 изменённых файлов: 69 добавлений и 301 удалений

Просмотреть файл

@ -4,5 +4,4 @@ config.cache
config.log
config.status
params
trapdoor
treeconfig.pl

Просмотреть файл

@ -25,10 +25,6 @@
# to where you will install the running Bonsai. Then "make install" should
# copy things for you.
CC = @CC@
CFLAGS = @CFLAGS@
# -lcrypt
LDFLAGS = @LIBS@
# /usr/bin/perl
PERL = @PERL@
# /var/www/bonsai
@ -87,12 +83,10 @@ FILES = CGI.pl \
showcheckins.cgi \
switchtree.cgi \
toplevel.cgi \
viewold.cgi
viewold.cgi \
trapdoor
all: trapdoor treeconfig.pl params
trapdoor: trapdoor.o
$(CC) -o trapdoor trapdoor.o $(LDFLAGS)
all: treeconfig.pl params
treeconfig.pl: treeconfig.pl.in
cp treeconfig.pl.in treeconfig.pl
@ -114,9 +108,10 @@ install: all
$$I > $(PREFIX)/$$I && \
chmod 755 $(PREFIX)/$$I; done
-mkdir -p $(PREFIX)/data && chmod 755 $(PREFIX)/data
cp trapdoor $(PREFIX)/data
cp bonsai.gif $(PREFIX)
chmod 755 $(PREFIX)/bonsai.gif
# put trapdoor into data
mv $(PREFIX)/trapdoor $(PREFIX)/data
@if test ! -r $(PREFIX)/data/treeconfig.pl ; then \
echo "Installing treeconfig.pl" && \
cp treeconfig.pl $(PREFIX)/data ; \
@ -150,4 +145,4 @@ install: all
@echo "Bonsai configuration in $(PREFIX)/data/treeconfig.pl"
clean:
rm -f trapdoor trapdoor.o treeconfig.pl params
rm -f treeconfig.pl params

Просмотреть файл

@ -492,7 +492,7 @@ toplevel.cgi Perl. Main interface to the bonsai hook.
contacthelp.html
http://warp/client/dogbert/buildlore/index.html
trapdoor.c Runs crypt on passwd
trapdoor Runs crypt on passwd
utils.pl Ancient globals.pl. DELETE
Called by: testlock.pl whohastouchedwhat.cgi

Просмотреть файл

@ -70,9 +70,9 @@ you set up.
o How do I set up my administration password?
When you build bonsai, the program "trapdoor" is built and installed
into the data directory in your Bonsai installation tree. Change to
the data directory in your installation and run the command:
When you build bonsai, the program "trapdoor" is installed into the data
directory in your Bonsai installation tree. Change to the data
directory in your installation and run the command:
trapdoor <your admin password> > passwd

320
webtools/bonsai/configure поставляемый
Просмотреть файл

@ -1,7 +1,7 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated automatically using autoconf version 2.12
# Generated automatically using autoconf version 2.13
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@ -49,6 +49,7 @@ mandir='${prefix}/man'
# Initialize some other variables.
subdirs=
MFLAGS= MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
# Maximum number of lines to put in a shell here document.
ac_max_here_lines=12
@ -332,7 +333,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
echo "configure generated by autoconf version 2.12"
echo "configure generated by autoconf version 2.13"
exit 0 ;;
-with-* | --with-*)
@ -450,7 +451,7 @@ echo > confdefs.h
# A filename unique to this package, relative to the directory that
# configure is in, which we can look for to find out if srcdir is correct.
ac_unique_file=trapdoor.c
ac_unique_file=
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
@ -502,9 +503,11 @@ ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
ac_exeext=
ac_objext=o
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
@ -519,180 +522,10 @@ fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:526: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_prog_CC="gcc"
break
fi
done
IFS="$ac_save_ifs"
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:555: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
ac_prog_rejected=no
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
break
fi
done
IFS="$ac_save_ifs"
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# -gt 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
set dummy "$ac_dir/$ac_word" "$@"
shift
ac_cv_prog_CC="$@"
fi
fi
fi
fi
CC="$ac_cv_prog_CC"
if test -n "$CC"; then
echo "$ac_t""$CC" 1>&6
else
echo "$ac_t""no" 1>&6
fi
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:603: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
ac_cpp='$CPP $CPPFLAGS'
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
#line 613 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:617: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
ac_cv_prog_cc_cross=no
else
ac_cv_prog_cc_cross=yes
fi
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_prog_cc_works=no
fi
rm -fr conftest*
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:637: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:642: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
fi
fi
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
if test $ac_cv_prog_gcc = yes; then
GCC=yes
ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:666: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
ac_cv_prog_cc_g=yes
else
ac_cv_prog_cc_g=no
fi
rm -f conftest*
fi
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
elif test $ac_cv_prog_cc_g = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-O2"
fi
else
GCC=
test "${CFLAGS+set}" = set || CFLAGS="-g"
fi
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:696: checking for $ac_word" >&5
echo "configure:529: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -700,9 +533,13 @@ else
/*)
ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_PERL="$ac_dir/$ac_word"
@ -722,7 +559,7 @@ fi
echo $ac_n "checking for perl DBD::mysql module""... $ac_c" 1>&6
echo "configure:726: checking for perl DBD::mysql module" >&5
echo "configure:563: checking for perl DBD::mysql module" >&5
$PERL -w -c -e 'use DBD::mysql' 2>/dev/null; has_dbd=$?
if test "x$has_dbd" = "x0" ; then
echo "$ac_t""yes" 1>&6
@ -735,7 +572,7 @@ echo "configure:726: checking for perl DBD::mysql module" >&5
echo $ac_n "checking for perl Date::Parse module""... $ac_c" 1>&6
echo "configure:739: checking for perl Date::Parse module" >&5
echo "configure:576: checking for perl Date::Parse module" >&5
$PERL -w -c -e 'use Date::Parse' 2>/dev/null; has_dateparse=$?
if test "x$has_dateparse" = "x0" ; then
echo "$ac_t""yes" 1>&6
@ -750,7 +587,7 @@ echo "configure:739: checking for perl Date::Parse module" >&5
# Extract the first word of "co", so it can be a program name with args.
set dummy co; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:754: checking for $ac_word" >&5
echo "configure:591: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CO'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -758,9 +595,13 @@ else
/*)
ac_cv_path_CO="$CO" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_CO="$CO" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_CO="$ac_dir/$ac_word"
@ -781,7 +622,7 @@ fi
# Extract the first word of "cvs", so it can be a program name with args.
set dummy cvs; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:785: checking for $ac_word" >&5
echo "configure:626: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CVS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -789,9 +630,13 @@ else
/*)
ac_cv_path_CVS="$CVS" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_CVS="$CVS" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_CVS="$ac_dir/$ac_word"
@ -812,7 +657,7 @@ fi
# Extract the first word of "rlog", so it can be a program name with args.
set dummy rlog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:816: checking for $ac_word" >&5
echo "configure:661: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RLOG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -820,9 +665,13 @@ else
/*)
ac_cv_path_RLOG="$RLOG" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_RLOG="$RLOG" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_RLOG="$ac_dir/$ac_word"
@ -843,7 +692,7 @@ fi
# Extract the first word of "rcsdiff", so it can be a program name with args.
set dummy rcsdiff; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:847: checking for $ac_word" >&5
echo "configure:696: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_RCSDIFF'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -851,9 +700,13 @@ else
/*)
ac_cv_path_RCSDIFF="$RCSDIFF" # Let the user override the test with a path.
;;
?:/*)
ac_cv_path_RCSDIFF="$RCSDIFF" # Let the user override the test with a dos path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
ac_dummy="$PATH"
for ac_dir in $ac_dummy; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_RCSDIFF="$ac_dir/$ac_word"
@ -871,85 +724,8 @@ else
echo "$ac_t""no" 1>&6
fi
# Extract the first word of "cvsgraph", so it can be a program name with args.
set dummy cvsgraph; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:847: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_CVSGRAPH'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$CVSGRAPH" in
/*)
ac_cv_path_CVSGRAPH="$CVSGRAPH" # Let the user override the test with a path.
;;
*)
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$ac_word; then
ac_cv_path_CVSGRAPH="$ac_dir/$ac_word"
break
fi
done
IFS="$ac_save_ifs"
;;
esac
fi
CVSGRAPH="$ac_cv_path_CVSGRAPH"
if test -n "$CVSGRAPH"; then
echo "$ac_t""$CVSGRAPH" 1>&6
else
echo "$ac_t""no" 1>&6
fi
echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
echo "configure:878: checking for crypt in -lcrypt" >&5
ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lcrypt $LIBS"
cat > conftest.$ac_ext <<EOF
#line 886 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char crypt();
int main() {
crypt()
; return 0; }
EOF
if { (eval echo configure:897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_lib=HAVE_LIB`echo crypt | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
EOF
LIBS="-lcrypt $LIBS"
else
echo "$ac_t""no" 1>&6
fi
@ -977,7 +753,7 @@ EOF
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(set) 2>&1 |
case `(ac_space=' '; set) 2>&1` in
case `(ac_space=' '; set | grep ac_space) 2>&1` in
*ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote substitution
# turns \\\\ into \\, and sed turns \\ into \).
@ -1056,7 +832,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
echo "$CONFIG_STATUS generated by autoconf version 2.12"
echo "$CONFIG_STATUS generated by autoconf version 2.13"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@ -1075,9 +851,11 @@ sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
$ac_vpsub
$extrasub
s%@SHELL@%$SHELL%g
s%@CFLAGS@%$CFLAGS%g
s%@CPPFLAGS@%$CPPFLAGS%g
s%@CXXFLAGS@%$CXXFLAGS%g
s%@FFLAGS@%$FFLAGS%g
s%@DEFS@%$DEFS%g
s%@LDFLAGS@%$LDFLAGS%g
s%@LIBS@%$LIBS%g
@ -1096,13 +874,11 @@ s%@includedir@%$includedir%g
s%@oldincludedir@%$oldincludedir%g
s%@infodir@%$infodir%g
s%@mandir@%$mandir%g
s%@CC@%$CC%g
s%@PERL@%$PERL%g
s%@CO@%$CO%g
s%@CVS@%$CVS%g
s%@RLOG@%$RLOG%g
s%@RCSDIFF@%$RCSDIFF%g
s%@CVSGRAPH@%$CVSGRAPH%g
CEOF
EOF

Просмотреть файл

@ -1,8 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(trapdoor.c)
AC_INIT
dnl Checks for programs.
AC_PROG_CC
AC_PATH_PROG(PERL,perl)
AC_PERL_DB
AC_PERL_DATEPARSE
@ -14,8 +13,6 @@ AC_PATH_PROG(RCSDIFF,rcsdiff)
dnl Checks for libraries.
dnl Replace `main' with a function in -lcrypt:
AC_CHECK_LIB(crypt, crypt)
dnl Checks for header files.

10
webtools/bonsai/trapdoor Executable file
Просмотреть файл

@ -0,0 +1,10 @@
#!/usr/bonsaitools/bin/perl -wT
if (!defined $ARGV[0]) {
print "Usage: trapdoor PASSWORD\n";
exit 2;
}
# XXX We are using salt as 'aa' for now, but ideally it should be
# something like:
# chr(int (rand 26) + 65) . chr(int (rand 26) + 65);
my $salt = 'aa';
print crypt($ARGV[0], $salt) . "\n";

Просмотреть файл

@ -1,9 +0,0 @@
#include <stdio.h>
#ifndef __bsdi__
#include <crypt.h>
#endif
main(int argc, char** argv) {
printf("%s\n", crypt(argv[1], "aa"));
return 0;
}