Commits

Palmer, 2E0EOL committed 72220d5

This is the current version of the ocquery telnet server

  • Participants

Comments (0)

Files changed (44)

+#
+# Makefile for OCQuery
+# Building on GNU Make, UNIX
+# OCQuery is a UNIX program, there are no plans to port it to NT.
+# OCQuery & OverChat are (C)2001-2006 Daybo Logic, all rights reserved.
+# Maintainer is D. D. R. Palmer <daybologic.co.uk/mailddrp>
+#
+
+include ../MasterMake.gnu
+
+ERASE=perl -w $(DAYBO_SHARED)scripts/erase.pl
+LINELEN=perl -w $(DAYBO_SHARED)scripts/linelen.pl
+IPATH=\
+  -I../blake \
+  -I../src \
+  -I$(PREFIX_INC) \
+  -I$(DAYBO_SHARED)stds
+
+CFLAGS=$(MASTER_CFLAGS) $(CWARNINGS)
+LFLAGS=$(MASTER_LFLAGS)
+TARGET=ocquery
+
+ifdef DAYBOTHREADS_PTH
+THREADLIB=$(PTH_LIB)
+else
+THREADLIB=$(PTHREAD)
+endif
+
+OBJS=\
+  ocquery$(O) \
+  cmd_title$(O) \
+  cmd_help$(O) \
+  cmd_tos$(O) \
+  cmd_version$(O) \
+  cmd_login$(O) \
+  cmd_die$(O) \
+  cmd_restart$(O) \
+  cmd_passwd$(O) \
+  cmd_passwdf$(O) \
+  cmd_nicks$(O) \
+  cmd_kill$(O) \
+  cmd_passrec$(O) \
+  cmd_register$(O) \
+  cmd_motd$(O) \
+  cmd_ll$(O) \
+  cmd_bel$(O) \
+  cmd_whois$(O) \
+  cmd_lang$(O) \
+  cmd_chlang$(O) \
+  cmd_chmail$(O) \
+  cmd_chpriv$(O) \
+  sup_mailrecord$(O) \
+  sup_mailregistered$(O) \
+  sup_clearance$(O) \
+  sup_language$(O) \
+  sup_antispam$(O) \
+  sup_printer$(O) \
+  sup_die$(O)
+
+LIBS=../libblake$(LIB) \
+     $(PREFIX_LIB)libdpcrtlmm$(LIB) \
+     $(PREFIX_LIB)libdlini$(LIB) \
+     $(PREFIX_LIB)libdybocryp$(LIB) \
+     $(PREFIX_LIB)librttb$(LIB) \
+     $(PREFIX_LIB)libdaybothreads$(LIB) \
+     $(THREADLIB) \
+     $(RESOLV)
+
+all : update $(TARGET)
+
+# This rule ensures the build time/date inside the version module is always bang up to date
+update:
+	@echo Touching cmd_version.c
+	@-touch cmd_version.c
+
+$(TARGET) : $(OBJS)
+	@echo Linking $@
+	@$(CPPC) $(LFLAGS) -o $(TARGET) $(OBJS) $(LIBS)
+ifndef DEBUG
+	@echo Stripping $(TARGET)
+	@$(STRIP) $(TARGET)
+endif
+
+$(C)$(O) : ocquery$(H) ../blake/blake$(H)
+	@echo Compiling $<
+	@$(LINELEN) $<
+	@$(CC) $(CFLAGS) $(IPATH) $<
+
+clean:
+	-$(ERASE) $(RESPFILE)
+	-$(ERASE) $(OBJS)
+	-$(ERASE) core ocquery.core
+	-$(ERASE) DPCRTLMM.LOG
+	-$(ERASE) ocquery
+	echo " " > $(DEPSFILE)
+
+depend:
+	@echo Generating dependencies for ./ocquery
+	@$(DIR) *$(C) *$(H) > $(RESPFILE)
+	@$(PREFIX_DAYBODEP_BIN)daybodep $(IPATH) @$(RESPFILE) > $(DEPSFILE)
+
+
+include $(DEPSFILE)

File Makefile.bor

+all : message
+depend : message
+clean : message
+
+message:
+        @echo ocquery is supported only on UNIX platforms
+
+
+cmd_bel.o : cmd_bel.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h /usr/local/include/dpcrtlmm.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_chlang.o : cmd_chlang.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_chmail.o : cmd_chmail.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_chpriv.o : cmd_chpriv.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_die.o : cmd_die.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_help.o : cmd_help.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_kill.o : cmd_kill.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_lang.o : cmd_lang.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_ll.o : cmd_ll.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_login.o : cmd_login.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h /usr/local/include/dpcrtlmm.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_motd.o : cmd_motd.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_nicks.o : cmd_nicks.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h /usr/local/include/dpcrtlmm.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_passrec.o : cmd_passrec.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_passwd.o : cmd_passwd.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_passwdf.o : cmd_passwdf.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_register.o : cmd_register.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h /usr/local/include/dpcrtlmm.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_restart.o : cmd_restart.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_title.o : cmd_title.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_tos.o : cmd_tos.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_version.o : cmd_version.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+cmd_whois.o : cmd_whois.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+ocquery.o : ocquery.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h /usr/local/include/dpcrtlmm.h ocquery.h sup_language.h sup_printer.h 
+
+ocquery.o : ocquery.h sup_language.h sup_printer.h 
+
+sup_antispam.o : sup_antispam.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+sup_clearance.o : sup_clearance.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+sup_die.o : sup_die.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+sup_language.o : sup_language.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+sup_language.o : sup_language.h 
+
+sup_mailrecord.o : sup_mailrecord.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+sup_mailregistered.o : sup_mailregistered.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+sup_printer.o : sup_printer.c ../src/overchat_config.h /usr/local/share/daybo_logic/stds/dlstdinc.h ../blake/ /usr/local/share/daybo_logic/stds/dlstdinc_cboolean.h /usr/local/share/daybo_logic/stds/dlstdinc_stdbool.h /usr/local/share/daybo_logic/stds/dlstdinc_pcintern.h /usr/local/share/daybo_logic/stds/dlstdinc_morelmts.h /usr/local/share/daybo_logic/stds/dlstdinc_inttypes.h /usr/local/share/daybo_logic/stds/dlstdinc_stdint.h /usr/local/share/daybo_logic/stds/dlstdinc_dlrnd.h /usr/local/share/daybo_logic/stds/dlstdinc_minmax.h /usr/local/share/daybo_logic/stds/dlstdinc_farptr.h /usr/local/share/daybo_logic/stds/dlstdinc_voidptr.h ../blake/blake.h /usr/local/include/daybothreads.h ocquery.h sup_language.h sup_printer.h 
+
+sup_printer.o : sup_printer.h 
+cmd_bel.c
+cmd_chlang.c
+cmd_chmail.c
+cmd_chpriv.c
+cmd_die.c
+cmd_help.c
+cmd_kill.c
+cmd_lang.c
+cmd_ll.c
+cmd_login.c
+cmd_motd.c
+cmd_nicks.c
+cmd_passrec.c
+cmd_passwd.c
+cmd_passwdf.c
+cmd_register.c
+cmd_restart.c
+cmd_title.c
+cmd_tos.c
+cmd_version.c
+cmd_whois.c
+ocquery.c
+ocquery.h
+sup_antispam.c
+sup_clearance.c
+sup_die.c
+sup_language.c
+sup_language.h
+sup_mailrecord.c
+sup_mailregistered.c
+sup_printer.c
+sup_printer.h
+/*
+Copyright (C) 2001-2003 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  OCQuery - BEL (Blake Error Lookup)
+  This command takes into account your current language and displays
+  a Blake error by number.
+*/
+
+#define OCQUERY_SOURCE
+#define USING_DPCRTLMM
+#include "overchat_config.h"
+#include <limits.h>
+#include <stdio.h>
+#include <time.h>
+#include <stdlib.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "dpcrtlmm.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static char rcsid[] = "$Id: cmd_bel.c,v 0.2 2004/08/14 21:04:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+
+bool CmdBel(FILE* ClientIn, FILE* ClientOut)
+{
+  char buff[MAX_CMD_LEN+1];
+  int errnum;
+  char* errstr;
+  int errstrlen;
+  bool success = false;
+  
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  fprintf(
+    ClientOut,
+    "Supported errors are 0-%u\r\n",
+    blake_GetNumberOfErrorMessages() - 1
+  );
+
+  fprintf(ClientOut, "Enter number: ");
+  if ( !fgets(buff, MAX_CMD_LEN, ClientIn) )
+    return false;
+    
+  errnum = atoi(buff); /* Convert input to number */
+  errstrlen = blake_GetErrorMessage(errnum, NULL, 0, CurrentLanguage);
+  if ( errstrlen ) {
+    errstr = (char*)malloc( ++errstrlen );
+    if ( errstr ) {
+      blake_GetErrorMessage(errnum, errstr, errstrlen, CurrentLanguage);
+
+      fprintf(
+        ClientOut,
+        "\r\nBlake error %d in %s means:\r\n\t%s\r\n",
+        errnum,
+        blake_LangName(CurrentLanguage, CurrentLanguage),
+        errstr
+      );
+
+      success = true;
+      free(errstr);
+    }
+    else {
+      fprintf(
+        ClientOut,
+        "Failed to allocate the %u bytes of necessary memory\r\n",
+        errstrlen
+      );
+    }
+  }
+  else {
+    fprintf(ClientOut, "Error %d\r\n (It doesn\'t exist)\r\n", errnum);
+  }
+
+  return success;
+}

File cmd_chlang.c

+/*
+Copyright (C) 2001-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command to change language of OCQuery.
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+#include <stdlib.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+/*-------------------------------------------------------------------------*/
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_chlang.c,v 0.3 2004/08/21 00:01:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+
+static bool ChLang(enum blakeLang NewLang);
+static void ListLangs(FILE* ClientOut);
+/*-------------------------------------------------------------------------*/
+bool CmdChLang(FILE* ClientIn, FILE* ClientOut)
+{
+  int newLang;
+  char newLangStr[MAX_CMD_LEN+1];
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  CmdLang(ClientIn, ClientOut); /* Print current language */
+  ListLangs(ClientOut);
+  fprintf(ClientOut, "Enter new language number: ");
+  if ( fgets(newLangStr, MAX_CMD_LEN, ClientIn) ) {
+    fputs("\r\n", ClientOut);
+    newLang = atoi(newLangStr);
+    if ( ChLang(newLang) ) {
+      CmdLang(ClientIn, ClientOut); /* Print the new language */
+    }
+    else {
+      fputs("The language is not valid.\r\n", ClientOut);
+      return false;
+    }
+  }
+  else {
+    fputs("User did not want to change the language\r\n", ClientOut);
+  }
+  return true;
+}
+/*-------------------------------------------------------------------------*/
+static bool ChLang(enum blakeLang NewLang)
+{
+  if ( NewLang < OVERCHAT_NUMLANGUAGES ) {
+    CurrentLanguage = NewLang;
+    return true;
+  }
+  return false;
+}
+/*-------------------------------------------------------------------------*/
+static void ListLangs(FILE* ClientOut)
+{
+  unsigned int i;
+
+   for ( i = 0U; i < OVERCHAT_NUMLANGUAGES; i++ )
+     fprintf(ClientOut, "%u - %s\r\n", i, blake_LangName(i, CurrentLanguage));
+}
+/*-------------------------------------------------------------------------*/

File cmd_chmail.c

+/*
+Copyright (C) 2001-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command chmail (change email address) user
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+#include <string.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDRSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+/*-------------------------------------------------------------------------*/
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_chmail.c,v 0.3 2004/08/21 00:02:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdChmail(FILE* ClientIn, FILE* ClientOut)
+{
+  char nick[MAX_CMD_LEN+1];
+  char pass[MAX_CMD_LEN+1];
+  char newemail[MAX_CMD_LEN+1];
+  BLAKE_DATABASE_HANDLE dbh;
+  struct blakedb_User userEntry;
+  bool status = false;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  fputs(MsgFromID(MSG_ENTERDETAILS), ClientOut);
+  if ( AskNickname(ClientIn, ClientOut, nick, MAX_CMD_LEN) ) {
+    if ( AskPass(ClientIn, ClientOut, pass, MAX_CMD_LEN, pmCurrent) ) {
+      if ( 1 ) { /* This does nothing at the moment */
+        enum blakeError err = blakedb_CreateDBHandle(DATABASE, &dbh);
+        if ( err == blakeSuccess ) {
+          err = blakedb_LockDatabase(dbh);
+          if ( err == blakeSuccess ) {
+            unsigned int userIndex = blakedb_GetUserIndex(dbh, nick);
+
+            err = blakedb_GetUserData(
+              dbh,
+              userIndex,
+              &userEntry,
+              sizeof(userEntry)
+            );
+
+            if ( err == blakeSuccess ) {
+              if ( userEntry.TimeOf.Registration ) { /* User exists */
+                if ( userEntry.ClearanceLevel != CLEARANCE_ROOT ) {
+                  if (
+                    strcmp(
+                      userEntry.Password,
+                      pass
+                    ) == 0
+                  ) { /* Password is correct */
+                    char badChar;
+                    blake_bool_t tooLong;
+                    if ( blake_PassTest(pass, &tooLong, &badChar) ) {
+                      fprintf(
+                        ClientOut,
+                        MsgFromID(MSG_OLDEMAILADDRESS),
+                        userEntry.Email
+                      ); /* Tell the user their old email address */
+
+                      if (
+                        AskEmail(
+                          ClientIn,
+                          ClientOut,
+                          newemail,
+                          MAX_CMD_LEN
+                        )
+                      ) { /* Ask for new email address */
+                        userEntry.Email[0] = '\0';
+
+                        strncat(
+                          userEntry.Email,
+                          newemail,
+                          sizeof(userEntry.Email)-1
+                        );
+
+                        err = blakedb_UpdateUser(
+                          dbh,
+                          userIndex,
+                          &userEntry,
+                          sizeof(userEntry)
+                        );
+
+                        if ( err == blakeSuccess ) status = true;
+                        fprintf(
+                          ClientOut,
+                          MsgFromID(MSG_OLDEMAILADDRESS),
+                          userEntry.Email
+                        ); /* Show updated email address */
+                      }
+                    }
+                    else { /* New password is invalid in some way */
+                      if ( tooLong ) {
+                        fprintf(
+                          ClientOut,
+                          MsgFromID(MSG_PASSTOOLONG),
+                          OVERCHAT_PASS_LIMIT
+                        );
+                      }
+                      else { /* Bad character */
+                        fprintf(
+                          ClientOut,
+                          MsgFromID(MSG_BADCHARACTER),
+                          badChar
+                        );
+                      }
+                    }
+                  }
+                  else {
+                    /* Password is incorrect */
+                    fprintf(
+                      ClientOut,
+                      MsgFromID(MSG_UNKNOWN_PASSWORD)
+                    );
+                  }
+                }
+                else {
+                  /* Cannot change password for ROOT user */
+                  fprintf(
+                    ClientOut,
+                    MsgFromID(MSG_ROOT_CHANGE_PROHIBIT)
+                  );
+                }
+              }
+              else {
+                fprintf(
+                  ClientOut,
+                  MsgFromID(MSG_USERUNKNOWN),
+                  nick
+                );
+              }
+            }
+            else {
+              MsgBlakeError(
+                ClientOut,
+                MsgFromID(MSG_CANTGETUSERDATA),
+                err
+              );
+            }
+            blakedb_UnlockDatabase(dbh);
+          }
+          else {
+            MsgBlakeError(
+              ClientOut,
+              MsgFromID(MSG_LOCKDBFAIL),
+              err
+            );
+          }
+          blakedb_DestroyDBHandle(dbh);
+        }
+        else {
+          MsgBlakeError(
+            ClientOut,
+            MsgFromID(MSG_FAILHANDLECREATE),
+            err
+          );
+        }
+      }
+    }
+  }
+
+  return status;
+}
+/*-------------------------------------------------------------------------*/
+

File cmd_chpriv.c

+/*
+Copyright (C) 2001-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command chpriv (change priveleges) admin command only
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDRSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+/*-------------------------------------------------------------------------*/
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_chpriv.c,v 0.4 2004/08/21 00:08:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdChpriv(FILE* ClientIn, FILE* ClientOut)
+{
+  char nick[MAX_CMD_LEN+1];
+  BLAKE_DATABASE_HANDLE dbh;
+  struct blakedb_User userEntry;
+  bool status = false;
+  int newpriv;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  if ( Clearance > CLEARANCE_UNAUTHORISED ) {
+    if ( Clearance > CLEARANCE_SUPERIOR_MYSTIC_CONTROLLER ) {
+      if (
+        AskNickname(ClientIn, ClientOut, nick, MAX_CMD_LEN)
+      ) { /* Ask nickname of person to change privilege of */
+
+        enum blakeError err =
+        blakedb_CreateDBHandle(
+          DATABASE,
+          &dbh
+        ); /* Get a database handle */
+
+        if ( err == blakeSuccess ) {
+          err = blakedb_LockDatabase(dbh); /* Lock it */
+          if ( err == blakeSuccess ) {
+            unsigned int userIndex = blakedb_GetUserIndex(dbh, nick);
+
+            err = blakedb_GetUserData(
+              dbh,
+              userIndex,
+              &userEntry,
+              sizeof(userEntry)
+            );
+
+            if ( err == blakeSuccess ) {
+              if ( userEntry.TimeOf.Registration ) { /* User exists */
+                PrintClearance(ClientOut, userEntry.ClearanceLevel);
+
+                printf(
+                  "%s L%u: (%u < %u)\n",
+                  __FILE__,
+                  __LINE__,
+                  userEntry.ClearanceLevel,
+                  Clearance
+                );
+
+                /* They must not be better than you! */
+                if ( userEntry.ClearanceLevel < Clearance ) {
+                  newpriv = AskClearance(ClientIn, ClientOut);
+                  /* The new privilege must not be better than you! */
+                  if ( newpriv <= Clearance ) {
+                    /* The privilege must be within the valid range */
+                    if (
+                      newpriv <= CLEARANCE_ROOT &&
+                      newpriv >= CLEARANCE_ZERO
+                    ) {
+                      userEntry.ClearanceLevel =
+                        newpriv; /* Set new privilege */
+
+                      if (
+                        blakedb_UpdateUser(
+                          dbh,
+                          userIndex,
+                          &userEntry,
+                          sizeof(userEntry)
+                        ) == blakeSuccess
+                      ) {
+                        /* Show user the modified person's new privilege */
+                        PrintClearance(ClientOut, newpriv);
+                        status = true; /* OK */
+                      }
+                    }
+                    else {
+                      /* Print message saying the privilege number is bad */
+                      fprintf(
+                        ClientOut,
+                        MsgFromID(MSG_BADPRIVILEGE),
+                        newpriv
+                      );
+                    }
+                  }
+                  else {
+                    fputs(
+                      MsgFromID(MSG_CANNOT_PROMOTE_TO_YOUR_OWN_BOSS),
+                      ClientOut
+                    ); /* Can't promote people to be your own boss! */
+                  }
+                }
+                else {
+                  fputs(
+                    MsgFromID(MSG_CANNOT_MOTE_BOSS),
+                    ClientOut
+                  ); /* You can't promote or demote your boss! */
+                }
+              }
+              else {
+                fprintf(
+                  ClientOut,
+                  MsgFromID(MSG_USERUNKNOWN),
+                  nick
+                ); /* The specified user is unknown */
+              }
+            }
+            else {
+              fputs(
+                MsgFromID(MSG_CANTGETUSERDATA),
+                ClientOut
+              ); /* Failed to get the user data */
+            }
+          }
+          else {
+            fputs(
+              MsgFromID(MSG_LOCKDBFAIL),
+              ClientOut
+            ); /* Failed to lock the database */
+          }
+        }
+        else {
+          fputs(
+            MsgFromID(MSG_FAILHANDLECREATE),
+            ClientOut
+          ); /* Can't get a handle */
+        }
+      }
+    }
+    else {
+      Printer(
+        ClientOut,
+        "Only a superior mystic controller (or better) "
+        "may use this command\n"
+      );
+    }
+  }
+  else {
+    Printer(
+      ClientOut,
+      "Please login before using this command\n"
+    );
+  }
+
+  return status;
+}
+/*-------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command to kill the server remotely (die).
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_die.c,v 0.3 2005/09/23 14:10:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdDie(
+  FILE *ClientIn,
+  FILE *ClientOut
+)
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+  blake_Unused(ClientIn);
+
+  if ( Clearance >= CLEARANCE_SUPERIOR_MYSTIC_CONTROLLER )
+    Die(false);
+  else {
+
+    fputs(
+      "Access denied.\r\n"
+      "You must be a sufficiently privileged lord "
+      "to cause the server to die\r\n",
+      ClientOut
+    );
+
+    return false;
+  }
+
+  return true;
+}
+/*-------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command to display help for OCQuery
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <time.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_help.c,v 0.4 2006/02/01 22:55:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdHelp(
+  FILE *ClientIn,
+  FILE *ClientOut
+)
+{
+  unsigned int idx = 0U;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+  blake_Unused(ClientIn);
+
+  while ( CommandTable[idx].command ) {
+    fprintf(
+      ClientOut,
+      "%s - %s\r\n\r\n",
+      CommandTable[idx].command,
+      CommandTable[idx].helpInfo
+    );
+    idx++;
+  }
+  return true; /* Is all good */
+}
+/*-------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Erase a user account for OCQuery.
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+#include <stdlib.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_kill.c,v 0.4 2005/09/28 14:21:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdKill(
+  FILE *ClientIn,
+  FILE *ClientOut
+)
+{
+  bool status = false;
+  BLAKE_DATABASE_HANDLE dbh;
+  struct blakedb_User userEntry;
+  enum blakeError err;
+  char nick[MAX_CMD_LEN+1];
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  if ( Clearance <= CLEARANCE_UNAUTHORISED ) {
+    fputs("Login before using kill\r\n", ClientOut);
+    return false;
+  }
+  if ( Clearance < CLEARANCE_FLOATING_SPECTARE ) {
+    fputs(
+      "Sorry, it is currrent policy that a minimum of a floating spectare "
+      "should use this command.\r\n",
+      ClientOut
+    );
+    return false;
+  }
+
+  if ( !AskNickname(ClientIn, ClientOut, nick, MAX_CMD_LEN) ) return false;
+  err = blakedb_CreateDBHandle(DATABASE, &dbh);
+  if ( err == blakeSuccess ) {
+    err = blakedb_LockDatabase(dbh);
+    if ( err == blakeSuccess ) {
+      unsigned int index = blakedb_GetUserIndex(dbh, nick);
+      err = blakedb_GetUserData(dbh, index, &userEntry, sizeof(userEntry));
+      if ( err == blakeSuccess ) {
+        if ( userEntry.TimeOf.Registration ) { /* User exists? */
+          if ( userEntry.ClearanceLevel < Clearance ) {
+            userEntry.Deleted = true; /* Die mofo! */
+            err = blakedb_UpdateUser(
+              dbh,
+              index,
+              &userEntry,
+              sizeof(userEntry)
+            );
+            if ( err == blakeSuccess ) status = true;
+            else fputs("Failed to update user record\r\n", ClientOut);
+          }
+          else {
+            fputs(
+              "You may not kill a person with a higher or equal clearance "
+              "than yourself\r\n",
+              ClientOut
+            );
+          }
+        }
+        else
+          fprintf(ClientOut, "No such user - \"%s\"\r\n", nick);
+      }
+      else
+        fputs("Can\'t get user data\r\n", ClientOut);
+
+      blakedb_UnlockDatabase(dbh);
+    }
+    else
+      fputs("ERROR: Cannot lock database\r\n", ClientOut);
+
+    blakedb_DestroyDBHandle(dbh);
+  }
+  else
+    fputs("ERROR: Cannot generate a database handle\r\n", ClientOut);
+
+  if ( status )
+    fprintf(ClientOut, "User \"%s\" successfully deleted.\r\n", nick);
+
+  return status;
+}
+/*-------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command to display current language of OCQuery.
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static char rcsid[] = "$Id: cmd_lang.c,v 0.2 2004/08/14 20:17:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdLang(FILE* ClientIn, FILE* ClientOut)
+{
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+  blake_Unused(ClientIn);
+
+  fprintf(
+    ClientOut,
+    "The current language is: %s (%s)\r\n",
+    blake_LangName(CurrentLanguage, CurrentLanguage),
+    blake_LangName(CurrentLanguage, langEnglish)
+  );
+
+  return true;
+}
+/*-------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  OCQuery, LL command.  LL == Level Lookup
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <time.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+/*--------------------------------------------------------------------------*/
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_ll.c,v 0.3 2004/08/21 00:23:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*--------------------------------------------------------------------------*/
+bool CmdLevelLookup(FILE* ClientIn, FILE* ClientOut)
+{
+  char buff[MAX_CMD_LEN+1];
+  int number;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  fprintf(ClientOut, "Enter number, 0-255: ");
+  if ( fgets(buff, MAX_CMD_LEN, ClientIn) ) {
+    number = atoi(buff);
+
+    fprintf(
+      ClientOut,
+      "\r\nLevel %u is %s\r\n",
+      number,
+      GetClearanceString(number)
+    );
+
+    return true;
+  }
+  return false;
+}
+/*--------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2006 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command to login to OCQuery for OverChat and aquire applicable rights.
+*/
+
+#define OCQUERY_SOURCE
+#define USING_DPCRTLMM
+#include "overchat_config.h"
+#include <stdio.h>
+#include <time.h>
+#include <limits.h>
+#include <string.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "dpcrtlmm.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_login.c,v 0.5 2006/02/10 19:00:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdLogin(
+  FILE *ClientIn,
+  FILE *ClientOut
+)
+{
+  char nick[MAX_CMD_LEN+1];
+  char pass[MAX_CMD_LEN+1];
+  BLAKE_DATABASE_HANDLE dbh;
+  struct blakedb_User userEntry;
+  bool status = false;
+  enum blakeError err;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  if ( Clearance > CLEARANCE_UNAUTHORISED ) {
+    fputs(
+      "NOTE: You are already logged in, only enter details again to change "
+      "clearance\r\n\r\n",
+      ClientOut
+    );
+  }
+
+  fputs(
+    "Welcome to OverChat, please log in to enable extra privileges\r\n",
+    ClientOut
+  );
+  if ( !AskNickname(ClientIn, ClientOut, nick, MAX_CMD_LEN) ) return false;
+  if (
+    !AskPass(
+      ClientIn,
+      ClientOut,
+      pass,
+      MAX_CMD_LEN,
+      pmCurrent
+    )
+  )
+    return false;
+
+  fputs("OK, now logging you in to ocquery...\r\n", ClientOut);
+  err = blakedb_CreateDBHandle(DATABASE, &dbh);
+  if ( err == blakeSuccess ) {
+    err = blakedb_LockDatabase(dbh);
+    if ( err == blakeSuccess ) {
+      unsigned int userIndex = blakedb_GetUserIndex(dbh, nick);
+      err = blakedb_GetUserData(
+        dbh,
+        userIndex,
+        &userEntry,
+        sizeof(userEntry)
+      );
+      if ( err == blakeSuccess ) {
+        if ( userEntry.TimeOf.Registration ) { /* User exists */
+          if ( userEntry.ClearanceLevel < CLEARANCE_ROOT ) {
+            if (
+              userEntry.Password[0] != '*' &&
+              userEntry.Password[1] != '\0'
+            ) {
+              if ( strcmp(userEntry.Password, pass) == 0 ) {
+                /* Password is correct */
+                Clearance = userEntry.ClearanceLevel;
+                status = true;
+              }
+              else
+                fputs("ERROR: Wrong password, nice try. ;)\r\n", ClientOut);
+            }
+            else {
+              fputs(
+                "ERROR: I\'m sorry but one cannot log in to accounts with a "
+                "password of '*'\r\n",
+                ClientOut
+              );
+            }
+          }
+          else {
+            fputs(
+              "ERROR: Users with \"ROOT\" privilege may not log in to "
+              "OCQuery\r\n",
+              ClientOut
+            );
+          }
+        }
+        else
+          fputs("ERROR: No such user\r\n", ClientOut);
+      }
+      else
+        MsgBlakeError(ClientOut, "ERROR: Failed to get user data", err);
+
+      blakedb_UnlockDatabase(dbh);
+    }
+    else
+      MsgBlakeError(ClientOut, "Cannot lock database", err);
+
+    blakedb_DestroyDBHandle(dbh);
+  }
+  else
+    MsgBlakeError(ClientOut, "Cannot get a database handle", err);
+
+  if ( status ) {
+    char* clls = NULL;
+    unsigned int cllsl =
+      blake_GetClearanceString(Clearance, NULL, (size_t)0U);
+
+    if ( cllsl ) {
+      clls = (char*)malloc(++cllsl);
+      if ( clls )
+        blake_GetClearanceString(Clearance, clls, cllsl);
+    }
+    fprintf(
+      ClientOut,
+      "You have successfully logged in as %s (privilege level %u) - %s\r\n",
+      nick,
+      Clearance,
+      (clls) ? (clls) : ("OOPS")
+    );
+    if ( clls ) free(clls);
+  }
+
+  return status;
+}
+/*-------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2004 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command to display the server MOTD
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <time.h>
+#include <limits.h>
+#include <string.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static char rcsid[] = "$Id: cmd_motd.c,v 0.2 2004/08/14 20:14:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdMotd(FILE* ClientIn, FILE* ClientOut)
+{
+  FILE* tos;
+  char motdFile[64] = "ocqmotd.txt.";
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+  blake_Unused(ClientIn);
+
+  strncat(motdFile, blake_LangShortcut(CurrentLanguage), sizeof(motdFile));
+  tos = fopen(motdFile, "rt");
+  if ( tos ) {
+    int byte;
+    do {
+      byte = fgetc(tos);
+      if ( byte != EOF ) {
+        if ( byte == '\n' )
+          fputs("\r\n", ClientOut);
+        else
+          fputc(byte, ClientOut);
+      }
+    } while ( byte != EOF );
+    fclose(tos);
+  }
+  else {
+    fputs("There is no MOTD.\r\n", ClientOut);
+    return false;
+  }
+
+  return true;
+}
+/*-------------------------------------------------------------------------*/
+/*
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Nicks from email address "nicks" command for OCQuery.
+*/
+
+#define OCQUERY_SOURCE
+#define USING_DPCRTLMM
+#include "overchat_config.h"
+#include <assert.h>
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+#include <string.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "dpcrtlmm.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_nicks.c,v 0.4 2005/09/28 14:19:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdNicks(
+  FILE *ClientIn,
+  FILE *ClientOut
+)
+{
+  char mailaddy[MAX_CMD_LEN+1];
+  struct blakedb_User userRecord;
+  enum blakeError err;
+  BLAKE_DATABASE_HANDLE dbHandle;
+  struct blake_link_ptrs nameLinkedList;
+  bool ret = false;
+  unsigned int loopi, count;
+  char* dynamicName;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  nameLinkedList.size = sizeof(nameLinkedList);
+  blake_InitLinkPtrs(&nameLinkedList, sizeof(dynamicName));
+  if ( AskEmail(ClientIn, ClientOut, mailaddy, MAX_CMD_LEN) ) {
+    fprintf(ClientOut, "Looking for %s\'s nicks...\r\n\r\n", mailaddy);
+    err = blakedb_CreateDBHandle(DATABASE, &dbHandle);
+    if ( dbHandle == BLAKE_INVALID_HANDLE ) {
+      MsgBlakeError(ClientOut, "Cannot create a database handle", err);
+      return false;
+    }
+    err = blakedb_LockDatabase(dbHandle);
+    if ( err != blakeSuccess ) {
+      MsgBlakeError(ClientOut, "Cannot lock database", err);
+      blakedb_DestroyDBHandle(dbHandle);
+      return false;
+    }
+    /* All possible user records */
+    for ( loopi = 0U; loopi < UINT_MAX; loopi++ ) {
+
+      err = blakedb_GetUserData(
+        dbHandle,
+        loopi,
+        &userRecord,
+        sizeof(userRecord)
+      );
+
+      if ( err == blakeSuccess ) { /* No error getting user */
+        if ( userRecord.TimeOf.Registration ) { /* Does this user exist? */
+          /* This is an instance of the same user */
+          if ( blake_EmailCompare(userRecord.Email, mailaddy) ) {
+            dynamicName = (char*)malloc( strlen(userRecord.UserName) + 1 );
+            if ( dynamicName ) {
+              strcpy(dynamicName, userRecord.UserName);
+              /* Add this person's nickname */
+              nameLinkedList.AddToTail(&nameLinkedList, &dynamicName);
+            }
+          }
+        }
+        else break; /* Reached end of database */
+      }
+      else {
+        MsgBlakeError(ClientOut, "Get user data", err);
+      }
+    }
+    blakedb_UnlockDatabase(dbHandle);
+    blakedb_DestroyDBHandle(dbHandle);
+    /* OK now we've collected all the names for this person by email */
+    count = nameLinkedList.Count(&nameLinkedList);
+    if ( count ) { /* Any matches? */
+      for ( loopi = 0U; loopi < count; loopi++ ) {
+        nameLinkedList.Get(&nameLinkedList, loopi, &dynamicName);
+        assert(dynamicName);
+        fprintf(ClientOut, "Found: %s\r\n", dynamicName);
+        free(dynamicName);
+      }
+      nameLinkedList.DelAll(&nameLinkedList);
+      fputs("Finished matches.\r\n", ClientOut);
+    }
+    else
+     fputs("No matches found.\r\n", ClientOut);
+
+    ret = true;
+  }
+  else
+    fputs("No address provided\r\n", ClientOut);
+
+  return ret;
+}
+/*-------------------------------------------------------------------------*/

File cmd_passrec.c

+/*
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command to recover a user password even if not logged in.
+  The password is mailed to the registered user account.
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <time.h>
+#include <limits.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static char const *rcsid =
+  "$Id: cmd_passrec.c,v 0.3 2005/09/28 14:18:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdPassRec(
+  FILE *ClientIn,
+  FILE *ClientOut
+)
+{
+  struct blakedb_User user;
+  char nickname[MAX_CMD_LEN+1];
+  BLAKE_DATABASE_HANDLE dbHandle;
+  enum blakeError err;
+  unsigned int userIndex;
+  bool ret = false;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  fputs(
+    "Caution: Abuse of this feature will be pursued.  "
+    "Use it only to mail\r\n"
+    "yourself a password you have forgotten.  "
+    "Harrassing other users is not\r\n"
+    "permitted.\r\n\r\n",
+    ClientOut
+  );
+
+  if ( !AskNickname(ClientIn, ClientOut, nickname, MAX_CMD_LEN) )
+    return false;
+
+  /* Nickname has been gathered, let's just check it's valid */
+  if ( !TestNickname(ClientOut, nickname) ) return false;
+
+  err = blakedb_CreateDBHandle(DATABASE, &dbHandle);
+  if ( dbHandle == BLAKE_INVALID_HANDLE ) {
+    MsgBlakeError(ClientOut, "Creating database handle", err);
+    return false;
+  }
+
+  err = blakedb_LockDatabase(dbHandle);
+  if ( err != blakeSuccess ) {
+    MsgBlakeError(ClientOut, "Cannot lock database", err);
+    blakedb_DestroyDBHandle(dbHandle);
+    return false;
+  }
+  userIndex = blakedb_GetUserIndex(dbHandle, nickname);
+  err = blakedb_GetUserData(dbHandle, userIndex, &user, sizeof(user));
+  blakedb_UnlockDatabase(dbHandle);
+  if ( err == blakeSuccess ) {
+    if ( !user.TimeOf.Registration ) { /* User does not exist? */
+      fprintf(
+        ClientOut,
+        MsgFromID(MSG_USERUNKNOWN),
+        nickname
+      );
+    }
+    else { /* User does exist and was read back correctly */
+      ret = EmailUserDetails(ClientOut, &user, true);
+      ret = true;
+    }
+  }
+  else {
+    MsgBlakeError(ClientOut, "Getting user data", err);
+  }
+
+  err = blakedb_DestroyDBHandle(dbHandle);
+  if ( err != blakeSuccess )
+    MsgBlakeError(ClientOut, "Destroy database handle", err);
+
+  return ret;
+}
+/*-------------------------------------------------------------------------*/

File cmd_passwd.c

+/*
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
+*/
+/*
+  Command passwd (change user password) by user
+*/
+
+#define OCQUERY_SOURCE
+#include "overchat_config.h"
+#include <stdio.h>
+#include <limits.h>
+#include <time.h>
+#include <string.h>
+
+#if defined(DAYBOTHREADS_NT)
+# include <windows.h>
+#elif defined(DAYBOTHREADS_PTH)
+# include <pth.h>
+#else
+# include <errno.h>
+# include <pthread.h>
+#endif /*DAYBOTHREADS_NT*/
+
+#ifdef HDRSTOP
+# pragma hdrstop
+#endif /*HDTSTOP*/
+
+#include "dlstdinc.h"
+#include "blake.h"
+#include "ocquery.h"
+
+#ifdef OVERCHAT_RCS_STAMPS
+static const char *rcsid =
+  "$Id: cmd_passwd.c,v 0.3 2005/09/23 14:12:00 ddrp Exp $";
+#endif /*OVERCHAT_RCS_STAMPS*/
+/*-------------------------------------------------------------------------*/
+bool CmdPasswd(
+  FILE *ClientIn,
+  FILE *ClientOut
+)
+{
+  char nick[MAX_CMD_LEN+1];
+  char oldpass[MAX_CMD_LEN+1];
+  char newpass1[MAX_CMD_LEN+1];
+  char newpass2[MAX_CMD_LEN+1];
+  BLAKE_DATABASE_HANDLE dbh;
+  struct blakedb_User userEntry;
+  bool status = false;
+
+  #ifdef OVERCHAT_RCS_STAMPS
+    blake_Unused(rcsid);
+  #endif /*OVERCHAT_RCS_STAMPS*/
+
+  fputs(MsgFromID(MSG_ENTERDETAILS), ClientOut);
+  if ( AskNickname(ClientIn, ClientOut, nick, MAX_CMD_LEN) ) {
+    if ( AskPass(ClientIn, ClientOut, oldpass, MAX_CMD_LEN, pmOld) ) {
+      if ( AskPass(ClientIn, ClientOut, newpass1, MAX_CMD_LEN, pmNew) ) {
+        if (
+          AskPass(ClientIn, ClientOut, newpass2, MAX_CMD_LEN, pmReEnter)
+        ) {
+          if ( 1 ) { /* This does nothing at the moment */
+            enum blakeError err = blakedb_CreateDBHandle(DATABASE, &dbh);
+            if ( err == blakeSuccess ) {
+              err = blakedb_LockDatabase(dbh);
+              if ( err == blakeSuccess ) {
+                unsigned int userIndex = blakedb_GetUserIndex(dbh, nick);
+                err = blakedb_GetUserData(
+                  dbh,
+                  userIndex,
+                  &userEntry,
+                  sizeof(userEntry)
+                );
+                if ( err == blakeSuccess ) {
+                  if ( userEntry.TimeOf.Registration ) { /* User exists */
+                    if ( userEntry.ClearanceLevel != CLEARANCE_ROOT ) {
+                      if ( strcmp(userEntry.Password, oldpass) == 0 ) {
+                        /* Password is correct */
+                        if ( strcmp(newpass1, newpass2) == 0 ) {
+                          /* New password has been verified by user */
+                          char badChar;
+                          blake_bool_t tooLong;
+                          if (
+                            blake_PassTest(newpass1, &tooLong, &badChar)
+                          ) {
+                            userEntry.Password[0] = '\0';
+                            strncat(
+                              userEntry.Password,
+                              newpass1,
+                              sizeof(userEntry.Password)-1
+                            );
+                            err = blakedb_UpdateUser(
+                              dbh,
+                              userIndex,
+                              &userEntry,
+                              sizeof(userEntry)
+                            );
+                            if ( err == blakeSuccess ) status = true;
+                          }
+                          else { /* New password is invalid in some way */
+                            if ( tooLong ) {
+                              fprintf(
+                                ClientOut,
+                                MsgFromID(MSG_PASSTOOLONG),
+                                OVERCHAT_PASS_LIMIT
+                              );
+                            }
+                            else { /* Bad character */
+                              fprintf(
+                                ClientOut,
+                                MsgFromID(MSG_BADCHARACTER),
+                                badChar
+                              );
+                            }
+                          }
+                        }
+                        else {
+                          /* New passwords mismatch */
+                          fprintf(
+                            ClientOut,
+                            MsgFromID(MSG_NEWMISMATCH)
+                          );
+                        }
+                      }
+                      else {
+                        /* Password is incorrect */
+                        fprintf(
+                          ClientOut,
+                          MsgFromID(MSG_UNKNOWN_PASSWORD)
+                        );
+                      }
+                    }
+                    else {
+                      /* Cannot change password for ROOT user */
+                      fprintf(
+                        ClientOut,
+                        MsgFromID(MSG_ROOT_CHANGE_PROHIBIT)
+                      );
+                    }
+                  }
+                  else {
+                    fprintf(
+                      ClientOut,
+                      MsgFromID(MSG_USERUNKNOWN),
+                      nick
+                    );
+                  }
+                }
+                else {
+                  MsgBlakeError(
+                    ClientOut,
+                    MsgFromID(MSG_CANTGETUSERDATA),
+                    err
+                  );
+                }
+                blakedb_UnlockDatabase(dbh);
+              }
+              else {
+                MsgBlakeError(
+                  ClientOut,
+                  MsgFromID(MSG_LOCKDBFAIL),
+                  err
+                );
+              }
+              blakedb_DestroyDBHandle(dbh);
+            }
+            else {
+              MsgBlakeError(
+                ClientOut,
+                MsgFromID(MSG_FAILHANDLECREATE),
+                err
+              );
+            }
+          }
+        }
+      }
+    }
+  }
+
+  return status;
+}
+/*-------------------------------------------------------------------------*/

File cmd_passwdf.c

+/*
+Copyright (C) 2001-2005 Daybo Logic.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+3. Neither the name of the project nor the names of its contributors
+   may be used to endorse or promote products derived from this software
+   without specific prior written permission.