[IRC-Dev CVS] [CVS] Module ircd-ircdev: Change committed
Brought to you by:
zolty
From: Toni G. <zo...@us...> - 2005-03-21 17:12:51
|
CVSROOT : /cvsroot/irc-dev Module : ircd-ircdev Commit time: 2005-03-21 17:12:28 UTC Modified files: tools/convert-conf.py Removed files: tools/Makefile.crypt tools/README tools/mkpasswd.c tools/transition Log message: Borrando archivos innecesarios. ---------------------- diff included ---------------------- Index: ircd-ircdev/tools/Makefile.crypt diff -u ircd-ircdev/tools/Makefile.crypt:1.3 ircd-ircdev/tools/Makefile.crypt:removed --- ircd-ircdev/tools/Makefile.crypt:1.3 Mon Jan 10 04:30:03 2005 +++ ircd-ircdev/tools/Makefile.crypt Mon Mar 21 09:12:28 2005 @@ -1,41 +0,0 @@ -# -# IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/Makefile.crypt -# -# Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> -# Copyright (C) 1991 Darren Reed -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# $Id: Makefile.crypt,v 1.3 2005/01/10 12:30:03 zolty Exp $ -# - -# Change this to the path of your local ircd.conf file -# -IRCDCONF = /usr/local/lib/irc/ircd.conf - -LIBS = -lcrypt - -all: mkpasswd -crypt: install - -mkpasswd: mkpasswd.c - gcc -Wall -O2 mkpasswd.c -o mkpasswd ${LIBS} - -install: - crypter ${IRCDCONF} - @echo 'done.' - -clean: - /bin/rm -f mkpasswd Index: ircd-ircdev/tools/README diff -u ircd-ircdev/tools/README:1.3 ircd-ircdev/tools/README:removed --- ircd-ircdev/tools/README:1.3 Mon Jan 10 04:30:03 2005 +++ ircd-ircdev/tools/README Mon Mar 21 09:12:28 2005 @@ -1,67 +0,0 @@ -/* - * IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/README - * - * Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> - * Copyright (C) 1991 Nelson Minar - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: README,v 1.3 2005/01/10 12:30:03 zolty Exp $ - * - */ - -The change implemented here is that the operator passwords in the ircd.conf -file are no longer stored in plaintext form, but are encrypted the same way -that user passwords are encrypted on normal UNIX systems. For example, -instead of having: - - O:nelson@nelson:goodboy:Nelson::10 - -in your ircd.conf file, you have: - - O:nelson@nelson:sCnvYRmbFJ7oI:Nelson::10 - -You still would type "/oper Nelson goodboy" to become operator. However, -if someone gets ahold of your ircd.conf file, they can no longer figure -out what the password for that oper is from reading it. There are still -other security holes, namely server-server passwords, but this closes one -very obvious problem. - -So, how do you generate these icky looking strings for passwords? -There's a simple program called mkpasswd to do that for you. To -compile mkpasswd, just "make -f Makefile.crypt" in this directory. After it -compiles, just run mkpasswd, and at the prompt type in your plaintext -password. It will spit out the encrypted password, which you should then -just copy into your ircd.conf file. This should be done only when adding -new passwords to your ircd.conf file. Crypting of oper passwords is -automatically done with the new F:lines so there is nothing to enable to -be able to use crypted oper passwords. All you have to do is edit the -Makefile.crypt in this directory and change "IRCDCONF = -/usr/local/lib/irc/ircd.conf" to the full path to your ircd.conf file. -Then "make -f Makefile.crypt install" in this directory to replace all the -operator passwords in your ircd.conf file with the encrypted format. - -Choose your passwords carefully! Do NOT choose something in a -dictionary, make SURE it's at least 5 characters. Anything past 8 -characters is ignored. - -One thing to note about crypt() passwords - for every plaintext, there -are 4096 different passwords. Some valid encryptions of "goodboy" -include t1Ub2RhRQHd4g, sCnvYRmbFJ7oI and Xr4Z.Kg5tcdy6. The first -two characters (the "salt") determine which of the 4096 passwords -you will get. mkpasswd chooses the salt randomly, or alternately you -can specify one on the command line. - -see also - crypt(3) Index: ircd-ircdev/tools/convert-conf.py diff -u ircd-ircdev/tools/convert-conf.py:1.1 ircd-ircdev/tools/convert-conf.py:1.2 --- ircd-ircdev/tools/convert-conf.py:1.1 Mon Feb 21 02:20:16 2005 +++ ircd-ircdev/tools/convert-conf.py Mon Mar 21 09:12:17 2005 @@ -19,7 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# $Id: convert-conf.py,v 1.1 2005/02/21 10:20:16 zolty Exp $ +# $Id: convert-conf.py,v 1.2 2005/03/21 17:12:17 zolty Exp $ # # Configuration file converter from 2.10.11 to 2.10.12 format @@ -251,7 +251,7 @@ if connects[i].has_key("hub"): print "\thub = \"%s\";" % qstr(connects[i]["hub"]) else: - print "\tleaf = \"yes\";" + print "\tleaf;" print "};" print Index: ircd-ircdev/tools/mkpasswd.c diff -u ircd-ircdev/tools/mkpasswd.c:1.3 ircd-ircdev/tools/mkpasswd.c:removed --- ircd-ircdev/tools/mkpasswd.c:1.3 Mon Jan 10 04:32:41 2005 +++ ircd-ircdev/tools/mkpasswd.c Mon Mar 21 09:12:41 2005 @@ -1,57 +0,0 @@ -/* - * IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/mkpasswd.c - * - * Copyright (C) 2002-2005 IRC-Dev Development Team <de...@ir...> - * Copyright (C) 1991 Nelson Minar (mi...@re...) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * $Id: mkpasswd.c,v 1.3 2005/01/10 12:32:41 zolty Exp $ - * - */ -#define _XOPEN_SOURCE -#define _XOPEN_VERSION 4 -#define _XOPEN_SOURCE_EXTENDED -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <time.h> -#include <unistd.h> - -int main(int argc, char *argv[]) -{ - static char saltChars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./"; - char salt[3]; - char * plaintext; - - if (argc < 2) { - srandom(time(0)); /* may not be the BEST salt, but its close */ - salt[0] = saltChars[random() % 64]; - salt[1] = saltChars[random() % 64]; - salt[2] = 0; - } - else { - salt[0] = argv[1][0]; - salt[1] = argv[1][1]; - salt[2] = '\0'; - if ((strchr(saltChars, salt[0]) == NULL) || (strchr(saltChars, salt[1]) == NULL)) - fprintf(stderr, "illegal salt %s\n", salt), exit(1); - } - - plaintext = getpass("plaintext: "); - - printf("%s\n", crypt(plaintext, salt)); - return 0; -} Index: ircd-ircdev/tools/transition diff -u ircd-ircdev/tools/transition:1.2 ircd-ircdev/tools/transition:removed --- ircd-ircdev/tools/transition:1.2 Sun Feb 22 08:14:25 2004 +++ ircd-ircdev/tools/transition Mon Mar 21 09:12:42 2005 @@ -1,484 +0,0 @@ -#!/bin/sh -# -# IRC-Dev IRCD - An advanced and innovative IRC Daemon, tools/transition -# -# Copyright (C) 2002-2004 IRC-Dev Development Team <de...@ir...> -# Copyright (C) 2001 Kevin L. Mitchell <kl...@mi...> -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# $Id: transition,v 1.2 2004/02/22 16:14:25 zolty Exp $ -# - -# Better than having evals all over the place -setvar () { - eval $1=\$2 -} -getvar () { - eval echo \$$1 -} - -# Set up an echo that doesn't newline-terminate -if test x`echo -n` = x-n; then - echo_n () { - echo "$@"'\c' - } -else - echo_n () { - echo -n "$@" - } -fi - -# Debugging notices, enabled only if $DEBUG has something in it -if test x"$DEBUG" = x; then - deb () { - : - } - deb_n () { - : - } -else - deb () { - echo "$@" - } - deb_n () { - echo_n "$@" - } -fi - -# Get base directory; first step, how were we called? -case $0 in -*/*) - basedir=`echo $0 | sed -e 's@/[^/]*@@g'` - ;; - -*) - basedir=`pwd` - ;; -esac - -# Now locate the ircd subdirectory -if test -d $basedir/ircd; then - : -elif test -d $basedir/../ircd; then - basedir=$basedir/.. -elif test -d ./ircd; then - basedir=`pwd` -else - echo "Cannot find base ircd directory!" >&2 - exit 1 -fi - -# Finally, canonicalize it -cwd=`pwd` -cd $basedir -basedir=`pwd` -cd $cwd - -deb "Base directory: $basedir" - -# This is where our ./configure-parsable results will go -cache_file=$basedir/config.cache - -# Now locate .config and config.cache -config_in= -config_cache_in= - -# If the config subdirectory isn't there anymore, don't bother checking there -if test -d $basedir/config; then - if test -r $basedir/config/.config; then - config_in=$basedir/config/.config - fi - - if test -r $basedir/config/config.cache; then - config_cache_in=$basedir/config/config.cache - fi -fi - -# Last ditch effort...try ../.config -if test x"$config_in" = x; then - if test -r $basedir/../.config; then - config_in=$basedir/../.config - else - echo "Cannot find original .config file!" >&2 - exit 2 - fi -fi - -# Last ditch effort...try ../.config.cache -if test x"$config_cache_in" = x; then - if test -r $basedir/../.config.cache; then - config_cache_in=$basedir/../.config.cache - else - echo "Cannot find original config.cache file!" >&2 - exit 3 - fi -fi - -# Now load the two data files -echo "Loading old config.cache file $config_cache_in" -. $config_cache_in -echo "Loading old .config file $config_in" -. $config_in - -# Now we have to track down the defaults so we will know what to generate -# F-lines for -if test ! -r $basedir/ircd/ircd_features.c; then - echo "Cannot find default features!" >&2 - exit 4 -fi - -echo_n "Loading feature default values; please be patient... " -deb "" -features= -exec 4<$basedir/ircd/ircd_features.c -while read line <&4; do - # if a line has '(' but not ')', then we hang them until we find the - # matching ')'; this is not robust! - if test x"$hangline" != x; then - line="$hangline $line" - hangline= - fi - - if test x"`echo "$line" | grep '(' 2>/dev/null`" != x -a \ - x"`echo "$line" | grep ')' 2>/dev/null`" = x; then - hangline=$line - continue - fi - - # Now we process the line we read... - case $line in - \#*) # We want to ignore the #define, since it's a false positive - ;; - - F_[NIBS]*) # Found one of the feature define macros - type=`echo "$line" | sed -e 's/^F_\([NIBS]\).*$/\1/g'` - arglist=`echo "$line" | sed -e 's/^F_[NIBS](\(.*\)),.*/\1/g' \ - -e 's/ | /|/g'` - - # Now we must parse the arguments - tIFS=$IFS - IFS=,$IFS - name= - value= - argnum=0 - for arg in $arglist; do - case $type$argnum in - [NIBS]0) # First argument is always the name of the feature - name=$arg - ;; - - I2) # Second argument of F_I() is the numerical value - value=$arg - ;; - - B2) # Second argument of F_B() is a numerical value - # We must convert this numerical value to "y" or "n" - if test x"$arg" = x0; then - value=n - else - value=y - fi - ;; - - [ST]2) # Second argument of F_S() is a string value; must - # take into account unquoted possibilities, though - dequote=`echo "$arg" | sed -e 's/^"\(.*\)"$/\1/g'` - if test x"$dequote" = x"$arg"; then - type=T - value=$arg - else - value=$dequote - fi - ;; - esac - - # Next time through, we'll be testing the next argument - argnum=`expr $argnum + 1` - done - IFS=$tIFS - - deb "Loaded feature \"$name\" of type \"$type\"; default: \"$value\"" - - # Store the information we extracted - setvar type_$name $type - setvar def_$name "$value" - - # Keep a list of features we've checked - features="$features $name" - ;; - esac -done -exec 4<&- -echo "done" - -echo "Converting some options that are still compile-time" - -unet_cv_prefix=`echo $SPATH | sed -e 's@/bin/ircd@@g'` -deb "Installation directory (derived from SPATH)... $unet_cv_prefix" - -deb_n "Enable debugging (DEBUGMODE)... " -if test x"$DEBUGMODE" = xy; then - unet_cv_enable_debug=yes -else - unet_cv_enable_debug=no -fi -deb "$unet_cv_enable_debug" - -deb_n "Enable assertion checking (CONFIG_NDEBUG)... " -if test x"$CONFIG_NDEBUG" = xy; then - unet_cv_enable_asserts=yes -else - unet_cv_enable_asserts=no -fi -deb "$unet_cv_enable_asserts" - -deb_n "Force inlining of some critical functions (FORCEINLINE)... " -if test x"$FORCEINLINE" = xy; then - unet_cv_enable_inlines=yes -else - unet_cv_enable_inlines=no -fi -deb "$unet_cv_enable_inlines" - -unet_cv_with_symlink=$SYMLINK -deb "Symlink name (SYMLINK)... $unet_cv_with_symlink" - -unet_cv_with_mode=$IRCDMODE -deb "Binary permissions (IRCDMODE)... $unet_cv_with_mode" - -unet_cv_with_owner=$IRCDOWN -deb "Binary owner (IRCDOWN)... $unet_cv_with_owner" - -unet_cv_with_group=$IRCDGRP -deb "Binary group owner (IRCDGRP)... $unet_cv_with_group" - -unet_cv_with_domain=$DOMAINNAME -deb "Local domain name (DOMAINNAME)... $unet_cv_with_domain" - -deb_n "Enable CHROOT operation (CHROOTDIR)... " -if test x"$CHROOTDIR" = xy; then - deb_n "yes, path " - unet_cv_with_chroot=$DPATH -else - unet_cv_with_chroot=no -fi -deb "$unet_cv_with_chroot" - -unet_cv_with_dpath=$DPATH -deb "Data path (DPATH)... $unet_cv_with_dpath" - -unet_cv_with_cpath=$CPATH -deb "Configuration file (CPATH)... $unet_cv_with_cpath" - -# LPATH may not be set; if it's not, we'll just ignore it here and let -# ./configure fill it in appropriately -if test x"$LPATH" != x; then - unet_cv_with_lpath=$LPATH - deb "Debug log file (LPATH)... $unet_cv_with_lpath" -fi - -unet_cv_with_maxcon=$MAXCONNECTIONS -deb "Maximum number of connections (MAXCONNECTIONS)... $unet_cv_with_maxcon" - -# Shouldn't run ./configure before the transition script, but we can deal -if test -r "$cache_file"; then - echo "WARNING: Destroying new config.cache file $cache_file" >&2 - rm $cache_file -fi - -# Create the cache file... -echo "Creating new config.cache file $cache_file" -> $cache_file - -# This section is copied from a GNU autoconf-generated configure script -############################################################################### -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# 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 | 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 \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache -############################################################################### - -# If they ran ./configure before, there'll be a config.status hanging around; -# if so, we can run that to integrate the config.cache we just generated. -if test -x $basedir/config.status; then - echo "Running $basedir/config.status to update configuration" - cwd=`pwd` - cd $basedir - # Have to run it twice to get the Makefile recreated - ./config.status --recheck - ./config.status - cd $cwd -fi - -# Now we need to track down ircd.conf so we can add the F-lines. -echo_n "Locating IRCD configuration file... " -case $unet_cv_with_cpath in -/*) # CPATH is absolute - conf_file=$unet_cv_with_cpath - ;; - -*) # CPATH is relative to DPATH - conf_file=$unet_cv_with_dpath/$unet_cv_with_cpath - ;; -esac -# suppress duplicate '/' -conf_file=`echo "$conf_file" | sed -e 's@//*@/@g'` -echo "$conf_file" - -# if we can't find the .conf, use "flines.conf" in the base directory (so -# they'll be easy to find). -if test ! -r $conf_file; then - fline_conf=yes - conf_file=$basedir/flines.conf - if test ! -r $conf_file; then - > $conf_file - fi - echo "WARNING: Unable to read ircd.conf; you will need to add the" >&2 - echo " F-lines manually. For your convenience, they will be" >&2 - echo " placed in $conf_file." >&2 -fi - -# here's where we take the old .config and compare it to the feature defaults -echo_n "Building feature table... " -for feature in $features; do - defval=`getvar def_$feature` - value=`getvar $feature` - - if test x"$value" = x -o x"$value" = x"$defval"; then - setvar FEAT_$feature $defval - else - setvar FEAT_$feature $value - fi -done - -# We won't add an F-line for DOMAINNAME, since (hopefully) the right one is -# already compiled in -FEAT_DOMAINNAME=DOMAINNAME - -# Have to make sure we have a RANDOM_SEED to enhance randomness... -FEAT_RANDOM_SEED=$RANDOM_SEED - -# This feature changed names to be consistent... -FEAT_OPER_LBADCHAN=$LOCAL_BADCHAN - -# DEFAULT_LIST_PARAM is perhaps the most complicated to transition, but -# this'll do the trick... -if test x"$CONFIG_LIST" = xy; then - FEAT_DEFAULT_LIST_PARAM=$DEFAULT_LIST_PARAM -else - FEAT_DEFAULT_LIST_PARAM=0 -fi - -echo "done" - -# Now we just generate the F-lines -echo_n "Generating F-lines... " -exec 4>>$conf_file - -# The various log files are set up first--these are all that were defined -# in u2.10.10.pl15 -if test x"$CONFIG_LOG_WHOX" = xy; then - echo "F:LOG:WHO:FILE:$WPATH" >&4 -fi -if test x"$CONFIG_LOG_GLINES" = xy; then - echo "F:LOG:GLINE:FILE:$GPATH" >&4 -fi -if test x"$CONFIG_LOG_USERS" = xy; then - echo "F:LOG:USER:FILE:$FNAME_USERLOG" >&4 -fi -if test x"$CONFIG_LOG_OPERS" = xy; then - echo "F:LOG:OPER:FILE:$FNAME_OPERLOG" >&4 -fi - -# Now we traverse the entire feature table and compare values with their -# defaults -for feature in $features; do - type=`getvar type_$feature` - defval=`getvar def_$feature` - value=`getvar FEAT_$feature` - - if test x"$defval" != x"$value"; then - if test x"$type" = xB; then - # Must map booleans yet again; I prefer TRUE/FALSE - if test x"$value" = xy; then - value=TRUE - else - value=FALSE - fi - fi - - # Write the F-line - echo "F:$feature:$value" >&4 - fi -done -exec 4>&- -echo "done" - -echo_n "Transition is complete." -if test ! -r $basedir/config.status; then - echo_n " You should now run ./configure." -fi - -echo "" - -if test x"$fline_conf" = xyes; then - echo "Don't forget to add the F-lines to your ircd.conf. They can be" - echo "found in $conf_file." -else - echo "Don't forget to verify the F-lines in your ircd.conf!" -fi ----------------------- End of diff ----------------------- |