diff --git a/AUTHORS b/AUTHORS index dc02093c..9cf718d8 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,7 +20,7 @@ Jan van de Werken Sean Rima Juergen Heisel Jim Hansen -Ken Bowley kbowley@users.sourceforge.net, 1:114/485@fidonet +Ken Bowley Redy Rodriguez 2:283/613.6 Johannes Lundberg 2:206/149@fidonet, Vincent Danen diff --git a/ChangeLog b/ChangeLog index c89e14f9..349f2ef6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4060,3 +4060,86 @@ v0.33.17 21-May-2001 Replaced the internet menu and txtfiles with versions that work with the current menu structure. + +v0.33.18 27-Jul-2001 + + Upgrade: + In your Mail Transport Agent (if you use it) replace the line + "mbmail -r (recipients)" to mbmail "(recipients)". + In postfix this is in the master.cf file. + + SETUP.sh: + Doesn't create .huslogin anymore for user bbs. + Script does now work on FreeBSD. + + common.a: + Corrected some defines in parsedate.c to include/exclude the + right code. + Changed the rawio to termios style instead of termio. + Added ufs filesystem as normal filesystem to the diskfree + function. + + mbftpd: + Removed the subdirectory for this not finished program. It may + or may not return later. + + mbfido: + Filefind replies had a wrong ^aREPLY kludge. + Rewrote a lot of code so that similar functions are only once + present. This will make bughunting and maintaining much easier. + Scanned netmail from point addresses created with GoldED are + now always checked for missing FMPT, TOPT and INTL kludges and + they are inserted when missing. + The checkdupe switch also work in uucp mode (mbnews). + The code for mbmail is now merged into mbfido. A symlink from + mbmail to mbfido is created to let mbfido run in mail mode. + The syntax to call mbmail is changed. + + mbmail: + Obsolete, the functions are now in mbfido. + + mbtask: + Removed all references to the Memwatch debugger, mbtask is oke + but the debugger fills up the harddisk (very fast). + Does now respond again to external semafore's mailout, mailin + and scanout in the semafore directory. + Removes stale socket file if found. + + mbpasswd: + Added CLOSE_SESSIONS and ENV_ROOTPATH to getdef to prevent new + user error messages on some distributions. + Ported to work on FreeBSD. + + mbindex: + Patched by Ken Bowley to prevent a crash when the 300 baud + field is the last item on the nodelist line. + + mbmon: + Changed the rawio to termios style instead of termio. + Shows the OS name in the info screen. + + mbsetup: + Shows the OS name in the info screen. + Creates default tty records with tty names for the right + OS (I hope). + + mbcico: + Renamed sendfile function in zmsend.c to sendzfile to prevent a + conflict with an excisting library call on FreeBSD. + + mball: + Removed some compiler warnings on some systems. + + mbsebbs: + Removed some compiler warnings on some systems. + + mbuseradd: + Ported to work on FreeBSD. + + mbpasswd: + Ported to work on FreeBSD. + + htmldoc: + Upgraded the FTSC documents to the current state. + + diff --git a/FILE_ID.DIZ.in b/FILE_ID.DIZ.in index f0842fc0..b4f928e1 100644 --- a/FILE_ID.DIZ.in +++ b/FILE_ID.DIZ.in @@ -1,21 +1,22 @@ --= MBSE BBS System v@VERSION@ for Linux =- +-= MBSE BBS System v@VERSION@ for Unix =- MBSE BBS is a full Fidonet capable ANSI bbs -package including a mailer (ifcico clone), -tosser, ticfile processor, filefind and other -utilities. +package including a mailer, tosser, ticfile +processor, filefind and other utilities. The bbs supports full configurable ANSI menus, multiple languages, IEMSI, standard -file transfer protocols, native Linux doors -and BlueWave and QWK offline readers. +file transfer protocols, native Linux doors, +DOS doors using dosemu and BlueWave and QWK +offline readers. The mailer supports FTS-0001, YooHoo/2U2, -EMSI protocols over modem, TCP/IP IFC and -Binkd protocol. Zedzap, Zmodem, Telink and -Hydra file transfer protocols. Full FTN mail -support, including automatic routing for hub +EMSI protocols over modem, TCP/IP IFC and +Binkp protocols. Zedzap, Zmodem, Telink and +Hydra file transfer protocols. Full FTN mail +support, including automatic routing for hub and host systems. Internal mail format is JAM (c) messagebase. Full tic file support, including extended -tic files. Costsharing will be added later. +tic files. +OS: Linux and FreeBSD (untested). Originating sites 2:280/2802@fidonet and http://mbse.sourceforge.net/ Copyright by Michiel Broek. diff --git a/Makefile.am b/Makefile.am index f8e838f5..cb18e06f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -9,22 +9,88 @@ SUBDIRS = @SUBDIRS@ install-exec-local: @./checkbasic - @if [ "$(shell whoami)" != "root" ] ; then \ + @if [ "`id -un`" != "root" ] ; then \ echo; echo " Must be root to install!"; echo; exit 3; \ fi - $(mkinstalldirs) $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} - $(mkinstalldirs) $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} - $(mkinstalldirs) $(prefix)/{english,english/txtfiles,english/menus,english/macro} - $(mkinstalldirs) $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} - $(mkinstalldirs) $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} - chown @OWNER@.@GROUP@ $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} - chown @OWNER@.@GROUP@ $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} - chown @OWNER@.@GROUP@ $(prefix)/{english,english/txtfiles,english/menus,english/macro} - chown @OWNER@.@GROUP@ $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} - chown @OWNER@.@GROUP@ $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} - chmod 777 $(prefix)/{sema,tmp} - $(mkinstalldirs) /var/spool/mbse - $(mkinstalldirs) /var/spool/mbse/{nodelist,unknown,inbound,outbound,badtic,ticqueue,ftp,mail} - chown -R @OWNER@.@GROUP@ /var/spool/mbse - chmod -R 755 /var/spool/mbse + @if [ ! -d $(prefix)/bin ] ; then \ + $(mkinstalldirs) $(prefix)/bin ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/bin ; \ + fi + @if [ ! -d $(prefix)/etc ] ; then \ + $(mkinstalldirs) $(prefix)/etc ; \ + $(mkinstalldirs) $(prefix)/etc/maptabs ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc/maptabs ; \ + fi + @if [ ! -d $(prefix)/doc ] ; then \ + $(mkinstalldirs) $(prefix)/doc ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/doc ; \ + fi + @if [ ! -d $(prefix)/fdb ] ; then \ + $(mkinstalldirs) $(prefix)/fdb ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/fdb ; \ + fi + @if [ ! -d $(prefix)/log ] ; then \ + $(mkinstalldirs) $(prefix)/log ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/log ; \ + fi + @if [ ! -d $(prefix)/magic ] ; then \ + $(mkinstalldirs) $(prefix)/magic ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/magic ; \ + fi + @if [ ! -d $(prefix)/sema ] ; then \ + $(mkinstalldirs) $(prefix)/sema ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/sema ; \ + chmod 0777 $(prefix)/sema ; \ + fi + @if [ ! -d $(prefix)/var ] ; then \ + $(mkinstalldirs) $(prefix)/var ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/var ; \ + fi + @if [ ! -d $(prefix)/tmp ] ; then \ + $(mkinstalldirs) $(prefix)/tmp ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/tmp ; \ + chmod 0777 $(prefix)/tmp ; \ + fi + @if [ ! -d $(prefix)/dutch ] ; then \ + $(mkinstalldirs) $(prefix)/dutch ; \ + $(mkinstalldirs) $(prefix)/dutch/txtfiles ; \ + $(mkinstalldirs) $(prefix)/dutch/menus ; \ + $(mkinstalldirs) $(prefix)/dutch/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/dutch ; \ + fi + @if [ ! -d $(prefix)/english ] ; then \ + $(mkinstalldirs) $(prefix)/english ; \ + $(mkinstalldirs) $(prefix)/english/txtfiles ; \ + $(mkinstalldirs) $(prefix)/english/menus ; \ + $(mkinstalldirs) $(prefix)/english/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/english ; \ + fi + @if [ ! -d $(prefix)/italian ] ; then \ + $(mkinstalldirs) $(prefix)/italian ; \ + $(mkinstalldirs) $(prefix)/italian/txtfiles ; \ + $(mkinstalldirs) $(prefix)/italian/menus ; \ + $(mkinstalldirs) $(prefix)/italian/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/italian ; \ + fi + @if [ ! -d $(prefix)/spanish ] ; then \ + $(mkinstalldirs) $(prefix)/spanish ; \ + $(mkinstalldirs) $(prefix)/spanish/txtfiles ; \ + $(mkinstalldirs) $(prefix)/spanish/menus ; \ + $(mkinstalldirs) $(prefix)/spanish/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/spanish ; \ + fi + @if [ ! -d /var/spool/mbse ] ; then \ + $(mkinstalldirs) /var/spool/mbse ; \ + $(mkinstalldirs) /var/spool/mbse/nodelist ; \ + $(mkinstalldirs) /var/spool/mbse/unknown ; \ + $(mkinstalldirs) /var/spool/mbse/inbound ; \ + $(mkinstalldirs) /var/spool/mbse/outbound ; \ + $(mkinstalldirs) /var/spool/mbse/badtic ; \ + $(mkinstalldirs) /var/spool/mbse/ticqueue ; \ + $(mkinstalldirs) /var/spool/mbse/ftp ; \ + $(mkinstalldirs) /var/spool/mbse/mail ; \ + ${CHOWN} -R @OWNER@.@GROUP@ /var/spool/mbse ; \ + chmod -R 0755 /var/spool/mbse ; \ + fi diff --git a/Makefile.in b/Makefile.in index 30d9e12f..a7b3eb93 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,7 +71,6 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ AUTOMAKE_OPTIONS = foreign dist-zip no-installinfo no-installman EXTRA_DIST = COPYING DEBUG CRON.sh FILE_ID.DIZ.in README README.GoldED SETUP.sh TODO UPGRADE files.css checkbasic @@ -94,9 +94,9 @@ GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile + cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -272,6 +272,11 @@ distdir: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ @@ -371,24 +376,90 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean install-exec-local: @./checkbasic - @if [ "$(shell whoami)" != "root" ] ; then \ + @if [ "`id -un`" != "root" ] ; then \ echo; echo " Must be root to install!"; echo; exit 3; \ fi - $(mkinstalldirs) $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} - $(mkinstalldirs) $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} - $(mkinstalldirs) $(prefix)/{english,english/txtfiles,english/menus,english/macro} - $(mkinstalldirs) $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} - $(mkinstalldirs) $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} - chown @OWNER@.@GROUP@ $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} - chown @OWNER@.@GROUP@ $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} - chown @OWNER@.@GROUP@ $(prefix)/{english,english/txtfiles,english/menus,english/macro} - chown @OWNER@.@GROUP@ $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} - chown @OWNER@.@GROUP@ $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} - chmod 777 $(prefix)/{sema,tmp} - $(mkinstalldirs) /var/spool/mbse - $(mkinstalldirs) /var/spool/mbse/{nodelist,unknown,inbound,outbound,badtic,ticqueue,ftp,mail} - chown -R @OWNER@.@GROUP@ /var/spool/mbse - chmod -R 755 /var/spool/mbse + @if [ ! -d $(prefix)/bin ] ; then \ + $(mkinstalldirs) $(prefix)/bin ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/bin ; \ + fi + @if [ ! -d $(prefix)/etc ] ; then \ + $(mkinstalldirs) $(prefix)/etc ; \ + $(mkinstalldirs) $(prefix)/etc/maptabs ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc/maptabs ; \ + fi + @if [ ! -d $(prefix)/doc ] ; then \ + $(mkinstalldirs) $(prefix)/doc ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/doc ; \ + fi + @if [ ! -d $(prefix)/fdb ] ; then \ + $(mkinstalldirs) $(prefix)/fdb ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/fdb ; \ + fi + @if [ ! -d $(prefix)/log ] ; then \ + $(mkinstalldirs) $(prefix)/log ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/log ; \ + fi + @if [ ! -d $(prefix)/magic ] ; then \ + $(mkinstalldirs) $(prefix)/magic ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/magic ; \ + fi + @if [ ! -d $(prefix)/sema ] ; then \ + $(mkinstalldirs) $(prefix)/sema ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/sema ; \ + chmod 0777 $(prefix)/sema ; \ + fi + @if [ ! -d $(prefix)/var ] ; then \ + $(mkinstalldirs) $(prefix)/var ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/var ; \ + fi + @if [ ! -d $(prefix)/tmp ] ; then \ + $(mkinstalldirs) $(prefix)/tmp ; \ + ${CHOWN} @OWNER@.@GROUP@ $(prefix)/tmp ; \ + chmod 0777 $(prefix)/tmp ; \ + fi + @if [ ! -d $(prefix)/dutch ] ; then \ + $(mkinstalldirs) $(prefix)/dutch ; \ + $(mkinstalldirs) $(prefix)/dutch/txtfiles ; \ + $(mkinstalldirs) $(prefix)/dutch/menus ; \ + $(mkinstalldirs) $(prefix)/dutch/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/dutch ; \ + fi + @if [ ! -d $(prefix)/english ] ; then \ + $(mkinstalldirs) $(prefix)/english ; \ + $(mkinstalldirs) $(prefix)/english/txtfiles ; \ + $(mkinstalldirs) $(prefix)/english/menus ; \ + $(mkinstalldirs) $(prefix)/english/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/english ; \ + fi + @if [ ! -d $(prefix)/italian ] ; then \ + $(mkinstalldirs) $(prefix)/italian ; \ + $(mkinstalldirs) $(prefix)/italian/txtfiles ; \ + $(mkinstalldirs) $(prefix)/italian/menus ; \ + $(mkinstalldirs) $(prefix)/italian/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/italian ; \ + fi + @if [ ! -d $(prefix)/spanish ] ; then \ + $(mkinstalldirs) $(prefix)/spanish ; \ + $(mkinstalldirs) $(prefix)/spanish/txtfiles ; \ + $(mkinstalldirs) $(prefix)/spanish/menus ; \ + $(mkinstalldirs) $(prefix)/spanish/macro ; \ + ${CHOWN} -R @OWNER@.@GROUP@ $(prefix)/spanish ; \ + fi + @if [ ! -d /var/spool/mbse ] ; then \ + $(mkinstalldirs) /var/spool/mbse ; \ + $(mkinstalldirs) /var/spool/mbse/nodelist ; \ + $(mkinstalldirs) /var/spool/mbse/unknown ; \ + $(mkinstalldirs) /var/spool/mbse/inbound ; \ + $(mkinstalldirs) /var/spool/mbse/outbound ; \ + $(mkinstalldirs) /var/spool/mbse/badtic ; \ + $(mkinstalldirs) /var/spool/mbse/ticqueue ; \ + $(mkinstalldirs) /var/spool/mbse/ftp ; \ + $(mkinstalldirs) /var/spool/mbse/mail ; \ + ${CHOWN} -R @OWNER@.@GROUP@ /var/spool/mbse ; \ + chmod -R 0755 /var/spool/mbse ; \ + fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/README b/README index 3bb58a64..2714a7a6 100644 --- a/README +++ b/README @@ -1,25 +1,16 @@ MBSE BBS Packages. -This needs changes. Distribution naming scheme: -mbd0_30a.tgz -^^^^ ^^^ - ||| || - ||| |+---- Alpha, Beta, Gamma or none for stable version. - ||| +----- Minor version number (2 digits). - ||+-------- Major version number. - |+--------- Package type, see next section. - +---------- Always mb (2 alpha characters). +mbsebbs-0.33.18.tar.gz + | | | | + | | | +-------- minor patchlevel + | | +----------- minor version + | +------------- major version + +------------------- package name -Package types: - - b - The complete MBSE BBS package, including mailer and utilities. - i - Internet <> Fidonet gateway software. - p - Pointlist processing software. +For fidonet distribution, the tar archive and FILE_ID.DIZ are +zipped together in a file like mbb03318.zip -Note that for distribution via Fidonet Technology networks the naming scheme -is restricted to dos 8.3 conventions, while longer names would be nicer. - diff --git a/SETUP.sh b/SETUP.sh index a8eadb62..9d6134d3 100644 --- a/SETUP.sh +++ b/SETUP.sh @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash # # Basic setup script for MBSE BBS # -# (C) Michiel Broek, v0.17 26-May-2001 +# (C) Michiel Broek, v0.18 05-Aug-2001 # # Customisation section, change the next variables to your need. # However, all docs refer to the setup below. @@ -13,6 +13,7 @@ MHOME=/opt/mbse PATH=/bin:/sbin:/usr/bin:/usr/sbin: DISTNAME= DISTVERS= +OSTYPE=`uname -s` #------------------------------------------------------------------------ # @@ -42,48 +43,73 @@ read junk log "+" "MBSE BBS $0 started by `whoami`" log "+" "Current directory is `pwd`" +# Check the OS type, only Linux for now. +# +if [ "$OSTYPE" != "Linux" ] && [ "$OSTYPE" != "FreeBSD" ]; then + + cat << EOF + +Your are trying to install MBSE BBS on a $OSTYPE system, however +at this time only Linux or FreeBSD is supported. + +EOF + log "!" "Aborted, OS is $OSTYPE" + exit 2 +fi + # # First do various tests to see which Linux distribution this is. # -if [ -f /etc/slackware-version ]; then - # Slackware 7.0 and later - DISTNAME="Slackware" - DISTVERS=`cat /etc/slackware-version` -else - if [ -f /etc/debian_version ]; then - # Debian, at least since version 2.2 - DISTNAME="Debian" - DISTVERS=`cat /etc/debian_version` +if [ "$OSTYPE" = "Linux" ]; then + PW= + if [ -f /etc/slackware-version ]; then + # Slackware 7.0 and later + DISTNAME="Slackware" + DISTVERS=`cat /etc/slackware-version` + DISTVERS=${DISTVERS:0:3} else - if [ -f /etc/SuSE-release ]; then - DISTNAME="SuSE" - DISTVERS=`cat /etc/SuSE-release | grep VERSION | awk '{ print $3 }'` - else - if [ -f /etc/redhat-release ]; then - DISTNAME="RedHat" - DISTVERS=`cat /etc/redhat-release | awk '{ print $5 }'` + if [ -f /etc/debian_version ]; then + # Debian, at least since version 2.2 + DISTNAME="Debian" + DISTVERS=`cat /etc/debian_version` + else + if [ -f /etc/SuSE-release ]; then + DISTNAME="SuSE" + DISTVERS=`cat /etc/SuSE-release | grep VERSION | awk '{ print $3 }'` else - if [ -f /etc/mandrake-release ]; then - DISTNAME="Mandrake" - # Format: Linux Mandrake release 8.0 (Cooker) for i586 - DISTVERS=`cat /etc/mandrake-release | awk '{ print $4 }'` - else - if [ -f /etc/rc.d/rc.0 ] && [ -f /etc/rc.d/rc.local ]; then - # If Slackware wasn't detected yet it is version 4.0 or older. - DISTNAME="Slackware" - DISTVERS="Old" + if [ -f /etc/redhat-release ]; then + DISTNAME="RedHat" + DISTVERS=`cat /etc/redhat-release | awk '{ print $5 }'` + else + if [ -f /etc/mandrake-release ]; then + DISTNAME="Mandrake" + # Format: Linux Mandrake release 8.0 (Cooker) for i586 + DISTVERS=`cat /etc/mandrake-release | awk '{ print $4 }'` else - DISTNAME="Unknown" + if [ -f /etc/rc.d/rc.0 ] && [ -f /etc/rc.d/rc.local ]; then + # If Slackware wasn't detected yet it is version 4.0 or older. + DISTNAME="Slackware" + DISTVERS="Old" + else + DISTNAME="Unknown" + fi fi - fi + fi fi - fi + fi fi +fi # Linux +if [ "$OSTYPE" = "FreeBSD" ]; then + DISTNAME="FreeBSD" + DISTVERS=`uname -r` + DISTVERS=${DISTVERS:0:3} + PW="pw " fi -log "+" "Detected \"${DISTNAME}\" version \"${DISTVERS}\"" +log "+" "Detected \"${OSTYPE}\" (${HOSTTYPE}) \"${DISTNAME}\" version \"${DISTVERS}\"" + # Basic checks. if [ `whoami` != "root" ]; then @@ -129,19 +155,44 @@ if [ -f /etc/passwd.lock ]; then fi clear -if [ -d /opt ]; then - log "+" "Directory /opt already present" -else - mkdir /opt +if [ "$OSTYPE" = "Linux" ]; then + if [ -d /opt ]; then + log "+" "Directory /opt already present" + else + mkdir /opt + log "+" "[$?] Directory /opt created" echo "Directory /opt created." - log "+" "Directory /opt created" + fi +fi + +if [ "$OSTYPE" = "FreeBSD" ]; then + # + # FreeBSD uses /usr/local for extra packages and doesn't use /opt + # Also using /opt means that we are in the root partition which + # by default is very small. We put everything in /usr/local/opt + # and create symlinks to it. + # + if [ -d /opt ]; then + log "+" "Directory /opt already present" + else + if [ -d /usr/local/opt ]; then + log "+" "Directory /usr/local/opt already present" + else + mkdir -p /usr/local/opt + log "+" "[$?] Directory /usr/local/opt created" + echo "Directory /usr/local/opt created." + fi + ln -s /usr/local/opt /opt + log "+" "[$?] Link /opt to /usr/local/opt created" + echo "Link /opt to /usr/local/opt created." + fi fi cat << EOF Basic checks done. - The detected Linux distribution is $DISTNAME $DISTVERS + The detected $OSTYPE distribution is $DISTNAME $DISTVERS Everything looks allright to start the installation now. Next the script will install a new group 'bbs' and two new @@ -164,7 +215,6 @@ echo -n " press Enter to start the installation " read junk clear - #------------------------------------------------------------------------ # # The real work starts here @@ -173,10 +223,15 @@ log "+" "Starting installation" echo "Installing MBSE BBS for the first time..." echo "" echo -n "Adding group 'bbs'" -groupadd bbs +$PW groupadd bbs log "+" "[$?] Added group bbs" echo -n ", user 'mbse'" -useradd -c "MBSE BBS Admin" -d $MHOME -g bbs -G uucp -m -s /bin/bash mbse +if [ "$OSTYPE" = "Linux" ]; then + useradd -c "MBSE BBS Admin" -d $MHOME -g bbs -G uucp -m -s /bin/bash mbse +fi +if [ "$OSTYPE" = "FreeBSD" ]; then + pw useradd mbse -c "MBSE BBS Admin" -d $MHOME -g bbs -G dialer -m -s /usr/local/bin/bash +fi log "+" "[$?] Added user mbse" chmod 770 $MHOME log "+" "[$?] chmod 770 $MHOME" @@ -207,34 +262,41 @@ echo "Now set the login password for user 'mbse'" passwd mbse log "+" "[$?] Password is set for user mbse" + echo -n "Adding user 'bbs'" -mkdir $MHOME/home -log "+" "[$?] Created directory $MHOME/home" +if [ ! -d $MHOME/home ]; then + mkdir $MHOME/home + log "+" "[$?] Created directory $MHOME/home" +fi chown mbse.bbs $MHOME/home -log "+" "[$?] chown mbse.bbs $MHOME/home +log "+" "[$?] chown mbse.bbs $MHOME/home" chmod 775 $MHOME/home -log "+" "[$?] chmod 775 $MHOME/home -useradd -c "MBSE BBS Login" -d $MHOME/home/bbs -g bbs -s $MHOME/bin/mbsebbs bbs -log "+" "[$?] Added user bbs" +log "+" "[$?] chmod 775 $MHOME/home" +if [ "$OSTYPE" = "Linux" ]; then + useradd -c "MBSE BBS Login" -d $MHOME/home/bbs -g bbs -s $MHOME/bin/mbsebbs bbs + log "+" "[$?] Added user bbs" +fi +if [ "$OSTYPE" = "FreeBSD" ]; then + pw useradd bbs -c "MBSE BBS Login" -d $MHOME/home/bbs -g bbs -s $MHOME/bin/mbsebbs + log "+" "[$?] Added user bbs" +fi # Some systems (RedHat and Mandrake) insist on creating a users homedir. # These are full of garbage we don't need. Kill it first. if [ -d $MHOME/home/bbs ]; then rm -Rf $MHOME/home/bbs log "+" "[$?] Removed $MHOME/home/bbs" fi -mkdir $MHOME/home/bbs +mkdir -m 0770 $MHOME/home/bbs log "+" "[$?] mkdir $MHOME/home/bbs" -chmod 770 $MHOME/home/bbs -log "+" "[$?] chmod 770 $MHOME/home/bbs" chown mbse.bbs $MHOME/home/bbs log "+" "[$?] chown mbse.bbs $MHOME/home/bbs" -touch $MHOME/home/bbs/.hushlogin -log "+" "[$?] touch $MHOME/home/bbs/.hushlogin" + echo ", removing password:" -echo -n "$$" >/etc/passwd.lock -if [ -f /etc/shadow ]; then - log "+" "Shadow password system" +if [ "$OSTYPE" = "Linux" ]; then + echo -n "$$" >/etc/passwd.lock + if [ -f /etc/shadow ]; then + log "+" "Standard shadow password system" # Not all systems are the same... if [ "`grep bbs:\!\!: /etc/shadow`" != "" ]; then sed /bbs:\!\!:/s/bbs:\!\!:/bbs::/ /etc/shadow >/etc/shadow.bbs @@ -256,7 +318,7 @@ if [ -f /etc/shadow ]; then log "+" "[$?] Default style owner of /etc/shadow (0600 root.root)" fi echo " File /etc/shadow.mbse is your backup of /etc/shadow" -else + else log "+" "Not a shadow password system" if [ "`grep bbs:\!\!: /etc/passwd`" != "" ]; then sed /bbs:\!\!:/s/bbs:\!\!:/bbs::/ /etc/passwd >/etc/passwd.bbs @@ -271,10 +333,19 @@ else chmod 644 /etc/passwd log "+" "[$?] Changed owner of /etc/passwd" echo " File /etc/passwd.mbse is your backup of /etc/passwd" + fi + rm /etc/passwd.lock +fi +if [ "$OSTYPE" = "FreeBSD" ]; then + # + # FreeBSD has a util to remove a password + # + chpass -p "" bbs + log "+" "[$?] Removed password of user bbs" fi -rm /etc/passwd.lock echo "" + if [ "`grep binkp /etc/services`" = "" ]; then BINKD=TRUE else @@ -358,8 +429,15 @@ cat << EOF or /etc/shadow, the backup copies have the extension '.mbse'. Then issue (as root of course) the following commands: - userdel bbs - userdel -r mbse - groupdel bbs EOF +if [ "$OSTYPE" = "Linux" ]; then + echo " userdel bbs" + echo " userdel -r mbse" + echo " groupdel bbs" +fi +if [ "$OSTYPE" = "FreeBSD" ]; then + echo " pw userdel bbs -r" + echo " pw userdel mbse -r" + echo " pw groupdel bbs" +fi diff --git a/TODO b/TODO index 19d00855..421fb67d 100644 --- a/TODO +++ b/TODO @@ -1,4 +1,4 @@ - MBSE BBS V0.33.17 TODO list. + MBSE BBS V0.33.18 TODO list. ---------------------------- These are a list of things that must be implemented one way or @@ -42,9 +42,13 @@ mbsebbs: N: Deleting a line in the FS editor with the BS key gives a SEGFAULT. mbfido: + U: postnetmail doesn't set msgid and reply for storenet. + U: Code cleanup and make a structure in this program. Remove duplicate or similar functions. + N: Received files not in an archive are not scanned for virusses. + N: Remove memory leak during toss. (It's ok for less 5000 messages for each run). @@ -56,6 +60,14 @@ mbfido: To: address in the message, the gate doesn't see that and uses the name to "All". + U: GoldED netmail from points, FMPT kludge is missing. + + U: GoldED messages to internet becomes null. + + U: E-mail for points get status normal in the outbound. + + N: Wish: internet addresses in the From: field. + mbcico: L: Implement modem connect response translation for ISDN lines, i.e. make the CAUSE responses human readable. see McMail for this diff --git a/acconfig.h b/acconfig.h index 1af3260c..a4bfe0a8 100644 --- a/acconfig.h +++ b/acconfig.h @@ -12,10 +12,8 @@ #undef HAVE_MKSTEMP /* If you have gettimeofday function */ -#undef HAVE_GETTIMEOFDAY #undef HAVE_DECLARED_TIMEZONE #undef HAVE_TM_GMTOFF -#undef HAVE_TM_ZONE /* If you don't have pid_t */ #undef DONT_HAVE_PID_T @@ -56,11 +54,6 @@ #undef AUTH_METHODS #undef CKDEFS #undef DOUBLESIZE -#undef HAVE_A64L -#undef HAVE_FCHMOD -#undef HAVE_FCHOWN -#undef HAVE_FSYNC -#undef HAVE_LCKPWDF #undef HAVE_LIBCRACK #undef HAVE_LIBCRACK_HIST #undef KEEP_NIS_AT_END diff --git a/config.h.in b/config.h.in index 01df6d68..abd75065 100644 --- a/config.h.in +++ b/config.h.in @@ -37,6 +37,9 @@ /* Define if you have the vprintf function. */ #undef HAVE_VPRINTF +/* Define to `int' if doesn't define. */ +#undef mode_t + /* Define to `long' if doesn't define. */ #undef off_t @@ -52,6 +55,9 @@ /* Define to `unsigned' if doesn't define. */ #undef size_t +/* Define if the `S_IS*' macros in do not work properly. */ +#undef STAT_MACROS_BROKEN + /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -67,18 +73,9 @@ /* Define vfork as fork if vfork does not work. */ #undef vfork -/* Define if lex declares yytext as a char * by default, not a char[]. */ -#undef YYTEXT_POINTER - /* Memory debugging */ #undef MEMWATCH -/* If you have gettimeofday function */ -#undef HAVE_GETTIMEOFDAY -#undef HAVE_DECLARED_TIMEZONE -#undef HAVE_TM_GMTOFF -#undef HAVE_TM_ZONE - /* If you don't have pid_t */ #undef DONT_HAVE_PID_T @@ -102,6 +99,20 @@ #undef SHADOW_PASSWORD #undef SO_OOBINLINE +/* mbuseradd */ +#undef AGING +#undef ATT_AGE +#undef ATT_COMMENTS +#undef AUTH_METHODS +#undef CKDEFS +#undef DOUBLESIZE +#undef HAVE_LIBCRACK +#undef HAVE_LIBCRACK_HIST +#undef KEEP_NIS_AT_END +#undef MD5_CRYPT +#undef PAM +#undef SW_CRYPT + /* Define if you have the a64l function. */ #undef HAVE_A64L @@ -114,6 +125,9 @@ /* Define if you have the fchown function. */ #undef HAVE_FCHOWN +/* Define if you have the fdatasync function. */ +#undef HAVE_FDATASYNC + /* Define if you have the fsync function. */ #undef HAVE_FSYNC @@ -144,6 +158,9 @@ /* Define if you have the putenv function. */ #undef HAVE_PUTENV +/* Define if you have the putpwent function. */ +#undef HAVE_PUTPWENT + /* Define if you have the re_comp function. */ #undef HAVE_RE_COMP @@ -198,6 +215,9 @@ /* Define if you have the header file. */ #undef HAVE_FCNTL_H +/* Define if you have the header file. */ +#undef HAVE_GSHADOW_H + /* Define if you have the header file. */ #undef HAVE_MALLOC_H @@ -207,6 +227,12 @@ /* Define if you have the header file. */ #undef HAVE_NETINET_IN_H +/* Define if you have the header file. */ +#undef HAVE_REGEX_H + +/* Define if you have the header file. */ +#undef HAVE_SHADOW_H + /* Define if you have the header file. */ #undef HAVE_SYS_DIR_H @@ -219,18 +245,33 @@ /* Define if you have the header file. */ #undef HAVE_SYS_NDIR_H +/* Define if you have the header file. */ +#undef HAVE_SYS_RESOURCE_H + /* Define if you have the header file. */ #undef HAVE_SYS_TIME_H +/* Define if you have the header file. */ +#undef HAVE_SYS_VFS_H + /* Define if you have the header file. */ #undef HAVE_SYSLOG_H -/* Define if you have the header file. */ -#undef HAVE_TERMIO_H +/* Define if you have the header file. */ +#undef HAVE_TERMIOS_H + +/* Define if you have the header file. */ +#undef HAVE_ULIMIT_H /* Define if you have the header file. */ #undef HAVE_UNISTD_H +/* Define if you have the header file. */ +#undef HAVE_USERSEC_H + +/* Define if you have the header file. */ +#undef HAVE_UTIME_H + /* Name of package */ #undef PACKAGE diff --git a/configure b/configure index e24a5388..3ca42c26 100755 --- a/configure +++ b/configure @@ -533,11 +533,11 @@ fi -SUBDIRS=". lib mbcico mbfido mbftpd mbmon mbsebbs mbtask mbsetup fbutil import lang examples html script" +SUBDIRS=". lib mbcico mbfido mbmon mbsebbs mbtask mbsetup fbutil import lang examples html script" MBSE_PACKAGE=mbsebbs -MBSE_VERSION=0.33.17 +MBSE_VERSION=0.33.18 ac_aux_dir= @@ -1228,297 +1228,42 @@ else echo "$ac_t""no" 1>&6 fi -for ac_prog in 'bison -y' byacc -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +# Extract the first word of "chown", so it can be a program name with args. +set dummy chown; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1237: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then +echo "configure:1235: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_CHOWN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else + case "$CHOWN" in + /*) + ac_cv_path_CHOWN="$CHOWN" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_CHOWN="$CHOWN" # Let the user override the test with a dos path. + ;; + *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do + ac_dummy="/bin:/sbin:/usr/bin:/usr/sbin:" + for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_prog_YACC="$ac_prog" + ac_cv_path_CHOWN="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" + test -z "$ac_cv_path_CHOWN" && ac_cv_path_CHOWN="chown" + ;; +esac fi -fi -YACC="$ac_cv_prog_YACC" -if test -n "$YACC"; then - echo "$ac_t""$YACC" 1>&6 +CHOWN="$ac_cv_path_CHOWN" +if test -n "$CHOWN"; then + echo "$ac_t""$CHOWN" 1>&6 else echo "$ac_t""no" 1>&6 fi -test -n "$YACC" && break -done -test -n "$YACC" || YACC="yacc" - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1268: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1289: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1306: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* -fi -rm -f conftest* -fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" -fi - CPP="$ac_cv_prog_CPP" -else - ac_cv_prog_CPP="$CPP" -fi -echo "$ac_t""$CPP" 1>&6 - -missing_dir=`cd $ac_aux_dir && pwd` -for ac_prog in flex lex -do -# Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1353: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -LEX="$ac_cv_prog_LEX" -if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$LEX" && break -done -test -n "$LEX" || LEX=""$missing_dir/missing flex"" - -# Extract the first word of "flex", so it can be a program name with args. -set dummy flex; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1386: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_LEX="flex" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" -fi -fi -LEX="$ac_cv_prog_LEX" -if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$LEXLIB" -then - case "$LEX" in - flex*) ac_lib=fl ;; - *) ac_lib=l ;; - esac - echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1420: checking for yywrap in -l$ac_lib" >&5 -ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-l$ac_lib $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LEXLIB="-l$ac_lib" -else - echo "$ac_t""no" 1>&6 -fi - -fi - -echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:1462: checking lex output file root" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_lex_root'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # The minimal lex program is just a single line: %%. But some broken lexes -# (Solaris, I think it was) want two %% lines, so accommodate them. -echo '%% -%%' | $LEX -if test -f lex.yy.c; then - ac_cv_prog_lex_root=lex.yy -elif test -f lexyy.c; then - ac_cv_prog_lex_root=lexyy -else - { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } -fi -fi - -echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 -LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root - -echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:1483: checking whether yytext is a pointer" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_lex_yytext_pointer'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # POSIX says lex can declare yytext either as a pointer or an array; the -# default is implementation-dependent. Figure out which it is, since -# not all implementations provide the %pointer and %array declarations. -ac_cv_prog_lex_yytext_pointer=no -echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS="$LIBS" -LIBS="$LIBS $LEXLIB" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_prog_lex_yytext_pointer=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -rm -f "${LEX_OUTPUT_ROOT}.c" - -fi - -echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 -if test $ac_cv_prog_lex_yytext_pointer = yes; then - cat >> confdefs.h <<\EOF -#define YYTEXT_POINTER 1 -EOF - -fi - CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe" # Check whether --enable-memwatch or --disable-memwatch was given. @@ -1574,8 +1319,119 @@ cat >> confdefs.h <<\EOF EOF +echo $ac_n "checking for re_comp in -lcompat""... $ac_c" 1>&6 +echo "configure:1324: checking for re_comp in -lcompat" >&5 +ac_lib_var=`echo compat'_'re_comp | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lcompat $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + result=yes +else + echo "$ac_t""no" 1>&6 +result=no +fi + +if test "$result" = "yes"; then + LIBS="$LIBS -lcompat" +fi + +echo $ac_n "checking for pw_age in struct passwd""... $ac_c" 1>&6 +echo "configure:1369: checking for pw_age in struct passwd" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_passwd_pw_age'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { + struct passwd pw; pw.pw_age = ""; +; return 0; } +EOF +if { (eval echo configure:1381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_passwd_pw_age=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_passwd_pw_age=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_passwd_pw_age" 1>&6 +if test "$ac_cv_struct_passwd_pw_age" = "yes"; then + cat >> confdefs.h <<\EOF +#define ATT_AGE 1 +EOF + +fi + +echo $ac_n "checking for pw_comment in struct passwd""... $ac_c" 1>&6 +echo "configure:1402: checking for pw_comment in struct passwd" >&5 +if eval "test \"`echo '$''{'ac_cv_struct_passwd_pw_comment'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +int main() { + struct passwd pw; pw.pw_comment = ""; +; return 0; } +EOF +if { (eval echo configure:1414: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_struct_passwd_pw_comment=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_struct_passwd_pw_comment=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_struct_passwd_pw_comment" 1>&6 +if test "$ac_cv_struct_passwd_pw_comment" = "yes"; then + cat >> confdefs.h <<\EOF +#define ATT_COMMENT 1 +EOF + +fi + echo $ac_n "checking for setspent in -lshadow""... $ac_c" 1>&6 -echo "configure:1579: checking for setspent in -lshadow" >&5 +echo "configure:1435: checking for setspent in -lshadow" >&5 ac_lib_var=`echo shadow'_'setspent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1583,7 +1439,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lshadow $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1621,7 +1477,7 @@ if test "$result" = "yes"; then LIBSHADOW=1 else echo $ac_n "checking for getspnam in -lshadow""... $ac_c" 1>&6 -echo "configure:1625: checking for getspnam in -lshadow" >&5 +echo "configure:1481: checking for getspnam in -lshadow" >&5 ac_lib_var=`echo shadow'_'getspnam | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1629,7 +1485,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lshadow $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1667,7 +1523,7 @@ fi LIBSHADOW=1 else echo $ac_n "checking for setspent in -lc""... $ac_c" 1>&6 -echo "configure:1671: checking for setspent in -lc" >&5 +echo "configure:1527: checking for setspent in -lc" >&5 ac_lib_var=`echo c'_'setspent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1675,7 +1531,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1714,10 +1570,11 @@ fi fi fi fi + if test "$SHADOW_PASSWORD" = "1"; then if test "$ac_cv_func_fgetspent" != "yes"; then echo $ac_n "checking for fgetspent in -lshadow""... $ac_c" 1>&6 -echo "configure:1721: checking for fgetspent in -lshadow" >&5 +echo "configure:1578: checking for fgetspent in -lshadow" >&5 ac_lib_var=`echo shadow'_'fgetspent | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1725,7 +1582,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lshadow $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1768,8 +1625,9 @@ fi EOF fi + echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 -echo "configure:1773: checking for crypt in -lcrypt" >&5 +echo "configure:1631: checking for crypt in -lcrypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1777,7 +1635,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1650: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1811,21 +1669,101 @@ fi if test "$result" = "yes"; then LIBS="$LIBS -lcrypt" - for ac_hdr in crypt.h + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1674: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1729: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +for ac_hdr in crypt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1819: checking for $ac_hdr" >&5 +echo "configure:1757: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1829: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1767: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1858,12 +1796,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1862: checking for $ac_hdr that defines DIR" >&5 +echo "configure:1800: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -1871,7 +1809,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:1875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -1896,7 +1834,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:1900: checking for opendir in -ldir" >&5 +echo "configure:1838: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1904,7 +1842,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1937,7 +1875,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:1941: checking for opendir in -lx" >&5 +echo "configure:1879: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1945,7 +1883,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1979,12 +1917,12 @@ fi fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1983: checking for ANSI C header files" >&5 +echo "configure:1921: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1992,7 +1930,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1934: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2009,7 +1947,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2027,7 +1965,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2048,7 +1986,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2059,7 +1997,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2083,12 +2021,12 @@ EOF fi echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:2087: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:2025: checking for sys/wait.h that is POSIX.1 compatible" >&5 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2104,7 +2042,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:2108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -2124,21 +2062,61 @@ EOF fi -for ac_hdr in fcntl.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h netinet/in.h +for ac_hdr in fcntl.h malloc.h sys/file.h sys/ioctl.h sys/time.h termios.h syslog.h sys/vfs.h unistd.h netinet/in.h regex.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2132: checking for $ac_hdr" >&5 +echo "configure:2070: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2080: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +fi +done + +for ac_hdr in sys/resource.h usersec.h utime.h ulimit.h gshadow.h shadow.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2110: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2165,12 +2143,12 @@ fi done echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2169: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:2147: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2178,7 +2156,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2182: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2160: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2199,12 +2177,12 @@ EOF fi echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6 -echo "configure:2203: checking for tm_zone in struct tm" >&5 +echo "configure:2181: checking for tm_zone in struct tm" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_cv_struct_tm> @@ -2212,7 +2190,7 @@ int main() { struct tm tm; tm.tm_zone; ; return 0; } EOF -if { (eval echo configure:2216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2194: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm_zone=yes else @@ -2232,12 +2210,12 @@ EOF else echo $ac_n "checking for tzname""... $ac_c" 1>&6 -echo "configure:2236: checking for tzname" >&5 +echo "configure:2214: checking for tzname" >&5 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #ifndef tzname /* For SGI. */ @@ -2247,7 +2225,7 @@ int main() { atoi(*tzname); ; return 0; } EOF -if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_var_tzname=yes else @@ -2270,12 +2248,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2274: checking for working const" >&5 +echo "configure:2252: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2345,12 +2323,12 @@ EOF fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:2349: checking for uid_t in sys/types.h" >&5 +echo "configure:2327: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -2379,12 +2357,12 @@ EOF fi echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2383: checking for off_t" >&5 +echo "configure:2361: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2412,12 +2390,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2416: checking for pid_t" >&5 +echo "configure:2394: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2444,13 +2422,46 @@ EOF fi +echo $ac_n "checking for mode_t""... $ac_c" 1>&6 +echo "configure:2427: checking for mode_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#if STDC_HEADERS +#include +#include +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_mode_t=yes +else + rm -rf conftest* + ac_cv_type_mode_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_mode_t" 1>&6 +if test $ac_cv_type_mode_t = no; then + cat >> confdefs.h <<\EOF +#define mode_t int +EOF + +fi + echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2449: checking for size_t" >&5 +echo "configure:2460: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2478,12 +2489,12 @@ EOF fi echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 -echo "configure:2482: checking for st_blksize in struct stat" >&5 +echo "configure:2493: checking for st_blksize in struct stat" >&5 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2491,7 +2502,7 @@ int main() { struct stat s; s.st_blksize; ; return 0; } EOF -if { (eval echo configure:2495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_st_blksize=yes else @@ -2511,13 +2522,69 @@ EOF fi +echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 +echo "configure:2527: checking whether stat file-mode macros are broken" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +#include + +#if defined(S_ISBLK) && defined(S_IFDIR) +# if S_ISBLK (S_IFDIR) +You lose. +# endif +#endif + +#if defined(S_ISBLK) && defined(S_IFCHR) +# if S_ISBLK (S_IFCHR) +You lose. +# endif +#endif + +#if defined(S_ISLNK) && defined(S_IFREG) +# if S_ISLNK (S_IFREG) +You lose. +# endif +#endif + +#if defined(S_ISSOCK) && defined(S_IFREG) +# if S_ISSOCK (S_IFREG) +You lose. +# endif +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "You lose" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_header_stat_broken=yes +else + rm -rf conftest* + ac_cv_header_stat_broken=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_header_stat_broken" 1>&6 +if test $ac_cv_header_stat_broken = yes; then + cat >> confdefs.h <<\EOF +#define STAT_MACROS_BROKEN 1 +EOF + +fi + echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2516: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:2583: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2526,7 +2593,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:2530: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -2547,12 +2614,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:2551: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:2618: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2560,7 +2627,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:2564: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2631: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -2581,15 +2648,15 @@ EOF fi -for ac_func in c64i a64l fchmod fchown fsync lckpwdf strcasestr mkstemp +for ac_func in c64i a64l fchmod fchown fdatasync fsync lckpwdf strcasestr mkstemp putpwent do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2588: checking for $ac_func" >&5 +echo "configure:2655: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2683: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2637,7 +2704,7 @@ fi done echo $ac_n "checking for working fnmatch""... $ac_c" 1>&6 -echo "configure:2641: checking for working fnmatch" >&5 +echo "configure:2708: checking for working fnmatch" >&5 if eval "test \"`echo '$''{'ac_cv_func_fnmatch_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2648,11 +2715,11 @@ if test "$cross_compiling" = yes; then ac_cv_func_fnmatch_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_fnmatch_works=yes else @@ -2676,13 +2743,13 @@ fi if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:2680: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:2747: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -2700,7 +2767,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -2722,7 +2789,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:2726: checking for 8-bit clean memcmp" >&5 +echo "configure:2793: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2730,7 +2797,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -2758,7 +2825,7 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:2762: checking whether setpgrp takes no argument" >&5 +echo "configure:2829: checking whether setpgrp takes no argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2766,7 +2833,7 @@ else { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_setpgrp_void=no else @@ -2810,12 +2877,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2814: checking return type of signal handlers" >&5 +echo "configure:2881: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2832,7 +2899,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2836: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2903: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2851,12 +2918,12 @@ EOF echo $ac_n "checking for strftime""... $ac_c" 1>&6 -echo "configure:2855: checking for strftime" >&5 +echo "configure:2922: checking for strftime" >&5 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strftime=yes" else @@ -2901,7 +2968,7 @@ else echo "$ac_t""no" 1>&6 # strftime is in -lintl on SCO UNIX. echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6 -echo "configure:2905: checking for strftime in -lintl" >&5 +echo "configure:2972: checking for strftime in -lintl" >&5 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2909,7 +2976,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2947,7 +3014,7 @@ fi fi echo $ac_n "checking whether utime accepts a null argument""... $ac_c" 1>&6 -echo "configure:2951: checking whether utime accepts a null argument" >&5 +echo "configure:3018: checking whether utime accepts a null argument" >&5 if eval "test \"`echo '$''{'ac_cv_func_utime_null'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2957,7 +3024,7 @@ if test "$cross_compiling" = yes; then ac_cv_func_utime_null=no else cat > conftest.$ac_ext < #include @@ -2968,7 +3035,7 @@ exit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 && t.st_mtime - s.st_mtime < 120)); } EOF -if { (eval echo configure:2972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_utime_null=yes else @@ -2993,17 +3060,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2997: checking for vfork.h" >&5 +echo "configure:3064: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3028,18 +3095,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:3032: checking for working vfork" >&5 +echo "configure:3099: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:3038: checking for vfork" >&5 +echo "configure:3105: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -3084,7 +3151,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -3179,7 +3246,7 @@ main() { } } EOF -if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -3202,12 +3269,12 @@ EOF fi echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:3206: checking for vprintf" >&5 +echo "configure:3273: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3301: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -3254,12 +3321,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:3258: checking for _doprnt" >&5 +echo "configure:3325: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3353: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -3309,12 +3376,12 @@ fi for ac_func in getcwd gethostname gettimeofday getwd mkdir mktime putenv re_comp regcmp regcomp rmdir select socket strcspn strdup strerror strspn strstr strtol strtoul uname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3313: checking for $ac_func" >&5 +echo "configure:3380: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3365,7 +3432,7 @@ done # Extract the first word of "compress", so it can be a program name with args. set dummy compress; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3369: checking for $ac_word" >&5 +echo "configure:3436: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_COMPRESS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3403,7 +3470,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3407: checking for $ac_word" >&5 +echo "configure:3474: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3567,7 +3634,6 @@ trap 'rm -fr `echo "Makefile mbcico/Makefile mbfido/Makefile mbfido/paths.h - mbftpd/Makefile mbmon/Makefile mbsebbs/Makefile mbtask/Makefile @@ -3629,11 +3695,8 @@ s%@OWNER@%$OWNER%g s%@CC@%$CC%g s%@AWK@%$AWK%g s%@RANLIB@%$RANLIB%g -s%@YACC@%$YACC%g -s%@LEX@%$LEX%g -s%@LEXLIB@%$LEXLIB%g +s%@CHOWN@%$CHOWN%g s%@CPP@%$CPP%g -s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g s%@LIBOBJS@%$LIBOBJS%g s%@COMPRESS@%$COMPRESS%g s%@GZIP@%$GZIP%g @@ -3685,7 +3748,6 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile mbcico/Makefile mbfido/Makefile mbfido/paths.h - mbftpd/Makefile mbmon/Makefile mbsebbs/Makefile mbtask/Makefile diff --git a/configure.in b/configure.in index c73f639f..a73f9d33 100644 --- a/configure.in +++ b/configure.in @@ -1,12 +1,12 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(lib/libs.h) AM_CONFIG_HEADER(config.h) -SUBDIRS=". lib mbcico mbfido mbftpd mbmon mbsebbs mbtask mbsetup fbutil import lang examples html script" +SUBDIRS=". lib mbcico mbfido mbmon mbsebbs mbtask mbsetup fbutil import lang examples html script" AC_SUBST(SUBDIRS) dnl General settings for MBSE BBS MBSE_PACKAGE=mbsebbs -MBSE_VERSION=0.33.17 +MBSE_VERSION=0.33.18 AC_SUBST(PACKAGE, $MBSE_PACKAGE) AC_SUBST(VERSION, $MBSE_VERSION) AM_INIT_AUTOMAKE($MBSE_PACKAGE, $MBSE_VERSION) @@ -25,8 +25,7 @@ AC_CHECK_PROG(AWK, awk, awk) AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_RANLIB -AC_PROG_YACC -AM_PROG_LEX +AC_PATH_PROG(CHOWN, chown, chown, /bin:/sbin:/usr/bin:/usr/sbin:) CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe" dnl Additional commandline switches @@ -49,6 +48,23 @@ AC_DEFINE_UNQUOTED(RESTAMP_OLD_POSTINGS, 21) AC_DEFINE(RESTAMP_FUTURE_POSTINGS) dnl Checks for libraries. +AC_CHECK_LIB(compat,re_comp,result=yes,result=no) +if test "$result" = "yes"; then + LIBS="$LIBS -lcompat" +fi + +AC_CACHE_CHECK(for pw_age in struct passwd, ac_cv_struct_passwd_pw_age, AC_TRY_COMPILE([#include ], +[ struct passwd pw; pw.pw_age = ""; ], ac_cv_struct_passwd_pw_age=yes, ac_cv_struct_passwd_pw_age=no)) +if test "$ac_cv_struct_passwd_pw_age" = "yes"; then + AC_DEFINE(ATT_AGE) +fi + +AC_CACHE_CHECK(for pw_comment in struct passwd, ac_cv_struct_passwd_pw_comment, AC_TRY_COMPILE([#include ], +[ struct passwd pw; pw.pw_comment = ""; ], ac_cv_struct_passwd_pw_comment=yes, ac_cv_struct_passwd_pw_comment=no)) +if test "$ac_cv_struct_passwd_pw_comment" = "yes"; then + AC_DEFINE(ATT_COMMENT) +fi + AC_CHECK_LIB(shadow,setspent,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lshadow" @@ -70,6 +86,7 @@ else fi fi fi + if test "$SHADOW_PASSWORD" = "1"; then if test "$ac_cv_func_fgetspent" != "yes"; then AC_CHECK_LIB(shadow,fgetspent,result=yes,result=no) @@ -81,6 +98,7 @@ if test "$SHADOW_PASSWORD" = "1"; then fi AC_DEFINE(SHADOW_PASSWORD) fi + AC_CHECK_LIB(crypt,crypt,result=yes,result=no) if test "$result" = "yes"; then LIBS="$LIBS -lcrypt" @@ -91,7 +109,8 @@ dnl Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(fcntl.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h netinet/in.h) +AC_CHECK_HEADERS(fcntl.h malloc.h sys/file.h sys/ioctl.h sys/time.h termios.h syslog.h sys/vfs.h unistd.h netinet/in.h regex.h) +AC_CHECK_HEADERS(sys/resource.h usersec.h utime.h ulimit.h gshadow.h shadow.h) AC_STRUCT_TIMEZONE dnl Checks for typedefs, structures, and compiler characteristics. @@ -99,13 +118,15 @@ AC_C_CONST AC_TYPE_UID_T AC_TYPE_OFF_T AC_TYPE_PID_T +AC_TYPE_MODE_T AC_TYPE_SIZE_T AC_STRUCT_ST_BLKSIZE +AC_HEADER_STAT AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. -AC_CHECK_FUNCS(c64i a64l fchmod fchown fsync lckpwdf strcasestr mkstemp) +AC_CHECK_FUNCS(c64i a64l fchmod fchown fdatasync fsync lckpwdf strcasestr mkstemp putpwent) AC_FUNC_FNMATCH AC_PROG_GCC_TRADITIONAL AC_FUNC_MEMCMP @@ -143,7 +164,6 @@ AC_OUTPUT( mbcico/Makefile mbfido/Makefile mbfido/paths.h - mbftpd/Makefile mbmon/Makefile mbsebbs/Makefile mbtask/Makefile diff --git a/examples/Makefile.in b/examples/Makefile.in index 301fa5c2..a6bace46 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,7 +71,6 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ SUBDIRS = . @@ -88,9 +88,9 @@ GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps examples/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -189,6 +189,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = examples distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu examples/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ diff --git a/html/Makefile.am b/html/Makefile.am index 69b2338a..65b7fc6b 100644 --- a/html/Makefile.am +++ b/html/Makefile.am @@ -3,11 +3,12 @@ SUBDIRS = . -EXTRA_DIST = basic.html date.html dist.html manual.css \ +H_BASE = basic.html date.html dist.html manual.css \ flow.html postfix.html gwnews.html index.htm ups.html \ install.html intergate.html intro.html invoking.html \ -known_bugs.html mgetty.html routing.html nodelist.html \ -ftsc/fsc-0039.html ftsc/fsc-0056.html ftsc/fsc-0087.html \ +known_bugs.html mgetty.html routing.html nodelist.html + +H_FTSC = ftsc/fsc-0039.html ftsc/fsc-0056.html ftsc/fsc-0087.html \ ftsc/fsp-1003.html ftsc/fsp-1009.html ftsc/fts-0007.html \ ftsc/fsc-0046.html ftsc/fsc-0057.html ftsc/fsc-0091.html \ ftsc/fsp-1004.html ftsc/fta-1005.html ftsc/fts-0008.html \ @@ -16,12 +17,13 @@ ftsc/fsp-1005.html ftsc/fts-0001.html ftsc/fts-0009.html \ ftsc/fsc-0049.html ftsc/fsc-0062.html ftsc/fsc-0093.html \ ftsc/fsp-1006.html ftsc/fts-0004.html ftsc/index.htm \ ftsc/fsc-0050.html ftsc/fsc-0070.html ftsc/fsp-1001.html \ -ftsc/fsp-1007.html ftsc/fts-0005.html ftsc/fsc-0053.html \ +ftsc/fsp-1007.html ftsc/fts-5000.html ftsc/fsc-0053.html \ ftsc/fsc-0072.html ftsc/fsp-1002.html ftsc/fsp-1008.html \ ftsc/fts-0006.html ftsc/fsc-0035.html ftsc/fsp-1010.html \ ftsc/fsp-1011.html ftsc/ftscprod.html ftsc/fsc-0088.html \ -ftsc/fts-4001.html \ -images/b_arrow.gif images/magic.gif images/nodes1.gif \ +ftsc/fts-4001.html ftsc/fts-5001.html + +H_IMAGES = images/b_arrow.gif images/magic.gif images/nodes1.gif \ images/connec.gif images/mbsetup0.gif images/nodes2.gif \ images/domains.gif images/mbsetup1.6.S.gif images/nodes3.gif \ images/e_menu.gif images/mbsetup1.6.gif images/nodes4.gif \ @@ -36,17 +38,21 @@ images/go_to.gif images/nodelist3.gif images/tty2.gif \ images/hatch.gif images/nodelist4.gif images/tty3.gif \ images/language.gif images/nodelist5.gif images/uarrow.gif \ images/larrow.gif images/nodes.gif images/users.gif \ -images/mbse.jpg images/taskmgr.gif \ -license/copying.html license/hydracom.html license/index.htm \ -license/jam.html \ -menus/control.html menus/index.htm menus/menu100.html \ +images/mbse.jpg images/taskmgr.gif + +H_LICENSE = license/copying.html license/hydracom.html license/index.htm \ +license/jam.html + +H_MENUS = menus/control.html menus/index.htm menus/menu100.html \ menus/menu300.html menus/menu500.html \ -menus/menu0.html menus/menu200.html menus/menu400.html \ -misc/dropfile.html misc/fileid.html misc/index.htm \ +menus/menu0.html menus/menu200.html menus/menu400.html + +H_MISC = misc/dropfile.html misc/fileid.html misc/index.htm \ misc/jam.html misc/semafore.html misc/filefind.html \ misc/ftpserver.html misc/ipmailer.html misc/outbound.html \ -misc/usleep.html \ -programs/import.html programs/mbchat.html \ +misc/usleep.html + +H_PROGS = programs/import.html programs/mbchat.html \ programs/mbfido.html programs/mbmon.html \ programs/mbtoberep.html \ programs/index.htm programs/mbcico.html \ @@ -58,8 +64,9 @@ programs/mbsetup.html programs/mbuseradd.html \ programs/mball.html programs/mbfbgen.html \ programs/mblang.html programs/mbsebbs.html \ programs/mbstat.html programs/mbpasswd.html \ -programs/mbtask.html programs/mbmail.html \ -setup/archiver.html setup/index.htm setup/bbs.html \ +programs/mbtask.html programs/mbmail.html + +H_SETUP = setup/archiver.html setup/index.htm setup/bbs.html \ setup/bbslist.html setup/language.html setup/oneliner.html \ setup/emareas.html setup/magic.html setup/mail.html \ setup/protocol.html setup/emgroup.html setup/safe.html \ @@ -72,13 +79,34 @@ setup/ttyinfo.html setup/global.html setup/users.html \ setup/hatch.html setup/virscan.html setup/services.html \ setup/domains.html setup/taskmgr.html +EXTRA_DIST = $(H_BASE) $(H_FTSC) $(H_IMAGES) $(H_LICENSE) $(H_MENUS) $(H_MISC) $(H_PROGS) $(H_SETUP) + install-exec-local: - rm -Rf $(prefix)/html - $(mkinstalldirs) $(prefix)/html @echo "Installing html documentation in $(prefix)/html" - @cp -Pr $(EXTRA_DIST) $(prefix)/html - chown -R @OWNER@.@GROUP@ $(prefix)/html - chmod -R 0644 $(prefix)/html/*.htm* - chmod -R 0644 $(prefix)/html/images/*.gif + @rm -Rf $(prefix)/html + @$(mkinstalldirs) $(prefix)/html + @$(mkinstalldirs) $(prefix)/html/ftsc + @$(mkinstalldirs) $(prefix)/html/images + @$(mkinstalldirs) $(prefix)/html/license + @$(mkinstalldirs) $(prefix)/html/menus + @$(mkinstalldirs) $(prefix)/html/misc + @$(mkinstalldirs) $(prefix)/html/programs + @$(mkinstalldirs) $(prefix)/html/setup + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/ftsc + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/images + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/license + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/menus + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/misc + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/programs + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/setup + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_BASE) $(prefix)/html + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_FTSC) $(prefix)/html/ftsc + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_IMAGES) $(prefix)/html/images + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_LICENSE) $(prefix)/html/license + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_MENUS) $(prefix)/html/menus + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_MISC) $(prefix)/html/misc + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_PROGS) $(prefix)/html/programs + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_SETUP) $(prefix)/html/setup diff --git a/html/Makefile.in b/html/Makefile.in index 52d8bb4d..3f78d5cf 100644 --- a/html/Makefile.in +++ b/html/Makefile.in @@ -61,6 +61,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -72,12 +73,34 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ SUBDIRS = . -EXTRA_DIST = basic.html date.html dist.html manual.css flow.html postfix.html gwnews.html index.htm ups.html install.html intergate.html intro.html invoking.html known_bugs.html mgetty.html routing.html nodelist.html ftsc/fsc-0039.html ftsc/fsc-0056.html ftsc/fsc-0087.html ftsc/fsp-1003.html ftsc/fsp-1009.html ftsc/fts-0007.html ftsc/fsc-0046.html ftsc/fsc-0057.html ftsc/fsc-0091.html ftsc/fsp-1004.html ftsc/fta-1005.html ftsc/fts-0008.html ftsc/fsc-0048.html ftsc/fsc-0059.html ftsc/fsc-0092.html ftsc/fsp-1005.html ftsc/fts-0001.html ftsc/fts-0009.html ftsc/fsc-0049.html ftsc/fsc-0062.html ftsc/fsc-0093.html ftsc/fsp-1006.html ftsc/fts-0004.html ftsc/index.htm ftsc/fsc-0050.html ftsc/fsc-0070.html ftsc/fsp-1001.html ftsc/fsp-1007.html ftsc/fts-0005.html ftsc/fsc-0053.html ftsc/fsc-0072.html ftsc/fsp-1002.html ftsc/fsp-1008.html ftsc/fts-0006.html ftsc/fsc-0035.html ftsc/fsp-1010.html ftsc/fsp-1011.html ftsc/ftscprod.html ftsc/fsc-0088.html ftsc/fts-4001.html images/b_arrow.gif images/magic.gif images/nodes1.gif images/connec.gif images/mbsetup0.gif images/nodes2.gif images/domains.gif images/mbsetup1.6.S.gif images/nodes3.gif images/e_menu.gif images/mbsetup1.6.gif images/nodes4.gif images/emareas.gif images/mbsetup2.gif images/nodes5.gif images/emgroup.gif images/modems0.gif images/oneliner.gif images/fdb.gif images/newfiles.gif images/protocol.gif images/fegroup.gif images/newgroups.gif images/rarrow.gif images/fileecho.gif images/nodelist.gif images/security.gif images/filefind.gif images/nodelist1.gif images/tty.gif images/files.gif images/nodelist2.gif images/tty1.gif images/go_to.gif images/nodelist3.gif images/tty2.gif images/hatch.gif images/nodelist4.gif images/tty3.gif images/language.gif images/nodelist5.gif images/uarrow.gif images/larrow.gif images/nodes.gif images/users.gif images/mbse.jpg images/taskmgr.gif license/copying.html license/hydracom.html license/index.htm license/jam.html menus/control.html menus/index.htm menus/menu100.html menus/menu300.html menus/menu500.html menus/menu0.html menus/menu200.html menus/menu400.html misc/dropfile.html misc/fileid.html misc/index.htm misc/jam.html misc/semafore.html misc/filefind.html misc/ftpserver.html misc/ipmailer.html misc/outbound.html misc/usleep.html programs/import.html programs/mbchat.html programs/mbfido.html programs/mbmon.html programs/mbtoberep.html programs/index.htm programs/mbcico.html programs/mbfile.html programs/mbmsg.html programs/mbseq.html programs/mbuser.html programs/mbaff.html programs/mbdiff.html programs/mbindex.html programs/mbout.html programs/mbsetup.html programs/mbuseradd.html programs/mball.html programs/mbfbgen.html programs/mblang.html programs/mbsebbs.html programs/mbstat.html programs/mbpasswd.html programs/mbtask.html programs/mbmail.html setup/archiver.html setup/index.htm setup/bbs.html setup/bbslist.html setup/language.html setup/oneliner.html setup/emareas.html setup/magic.html setup/mail.html setup/protocol.html setup/emgroup.html setup/safe.html setup/fdb.html setup/security.html setup/sitedoc.html setup/fegroup.html setup/modems.html setup/softinfo.html setup/fidonet.html setup/tic.html setup/timebank.html setup/fileecho.html setup/newfiles.html setup/filefind.html setup/newgroups.html setup/files.html setup/nodes.html setup/ttyinfo.html setup/global.html setup/users.html setup/hatch.html setup/virscan.html setup/services.html setup/domains.html setup/taskmgr.html +H_BASE = basic.html date.html dist.html manual.css flow.html postfix.html gwnews.html index.htm ups.html install.html intergate.html intro.html invoking.html known_bugs.html mgetty.html routing.html nodelist.html + +H_FTSC = ftsc/fsc-0039.html ftsc/fsc-0056.html ftsc/fsc-0087.html ftsc/fsp-1003.html ftsc/fsp-1009.html ftsc/fts-0007.html ftsc/fsc-0046.html ftsc/fsc-0057.html ftsc/fsc-0091.html ftsc/fsp-1004.html ftsc/fta-1005.html ftsc/fts-0008.html ftsc/fsc-0048.html ftsc/fsc-0059.html ftsc/fsc-0092.html ftsc/fsp-1005.html ftsc/fts-0001.html ftsc/fts-0009.html ftsc/fsc-0049.html ftsc/fsc-0062.html ftsc/fsc-0093.html ftsc/fsp-1006.html ftsc/fts-0004.html ftsc/index.htm ftsc/fsc-0050.html ftsc/fsc-0070.html ftsc/fsp-1001.html ftsc/fsp-1007.html ftsc/fts-5000.html ftsc/fsc-0053.html ftsc/fsc-0072.html ftsc/fsp-1002.html ftsc/fsp-1008.html ftsc/fts-0006.html ftsc/fsc-0035.html ftsc/fsp-1010.html ftsc/fsp-1011.html ftsc/ftscprod.html ftsc/fsc-0088.html ftsc/fts-4001.html ftsc/fts-5001.html + + +H_IMAGES = images/b_arrow.gif images/magic.gif images/nodes1.gif images/connec.gif images/mbsetup0.gif images/nodes2.gif images/domains.gif images/mbsetup1.6.S.gif images/nodes3.gif images/e_menu.gif images/mbsetup1.6.gif images/nodes4.gif images/emareas.gif images/mbsetup2.gif images/nodes5.gif images/emgroup.gif images/modems0.gif images/oneliner.gif images/fdb.gif images/newfiles.gif images/protocol.gif images/fegroup.gif images/newgroups.gif images/rarrow.gif images/fileecho.gif images/nodelist.gif images/security.gif images/filefind.gif images/nodelist1.gif images/tty.gif images/files.gif images/nodelist2.gif images/tty1.gif images/go_to.gif images/nodelist3.gif images/tty2.gif images/hatch.gif images/nodelist4.gif images/tty3.gif images/language.gif images/nodelist5.gif images/uarrow.gif images/larrow.gif images/nodes.gif images/users.gif images/mbse.jpg images/taskmgr.gif + + +H_LICENSE = license/copying.html license/hydracom.html license/index.htm license/jam.html + + +H_MENUS = menus/control.html menus/index.htm menus/menu100.html menus/menu300.html menus/menu500.html menus/menu0.html menus/menu200.html menus/menu400.html + + +H_MISC = misc/dropfile.html misc/fileid.html misc/index.htm misc/jam.html misc/semafore.html misc/filefind.html misc/ftpserver.html misc/ipmailer.html misc/outbound.html misc/usleep.html + + +H_PROGS = programs/import.html programs/mbchat.html programs/mbfido.html programs/mbmon.html programs/mbtoberep.html programs/index.htm programs/mbcico.html programs/mbfile.html programs/mbmsg.html programs/mbseq.html programs/mbuser.html programs/mbaff.html programs/mbdiff.html programs/mbindex.html programs/mbout.html programs/mbsetup.html programs/mbuseradd.html programs/mball.html programs/mbfbgen.html programs/mblang.html programs/mbsebbs.html programs/mbstat.html programs/mbpasswd.html programs/mbtask.html programs/mbmail.html + + +H_SETUP = setup/archiver.html setup/index.htm setup/bbs.html setup/bbslist.html setup/language.html setup/oneliner.html setup/emareas.html setup/magic.html setup/mail.html setup/protocol.html setup/emgroup.html setup/safe.html setup/fdb.html setup/security.html setup/sitedoc.html setup/fegroup.html setup/modems.html setup/softinfo.html setup/fidonet.html setup/tic.html setup/timebank.html setup/fileecho.html setup/newfiles.html setup/filefind.html setup/newgroups.html setup/files.html setup/nodes.html setup/ttyinfo.html setup/global.html setup/users.html setup/hatch.html setup/virscan.html setup/services.html setup/domains.html setup/taskmgr.html + + +EXTRA_DIST = $(H_BASE) $(H_FTSC) $(H_IMAGES) $(H_LICENSE) $(H_MENUS) $(H_MISC) $(H_PROGS) $(H_SETUP) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = @@ -91,9 +114,9 @@ GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps html/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu html/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -192,6 +215,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = html distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu html/Makefile $(mkinstalldirs) $(distdir)/ftsc $(distdir)/images $(distdir)/license \ $(distdir)/menus $(distdir)/misc $(distdir)/programs \ $(distdir)/setup @@ -286,13 +314,32 @@ mostlyclean distclean maintainer-clean install-exec-local: - rm -Rf $(prefix)/html - $(mkinstalldirs) $(prefix)/html @echo "Installing html documentation in $(prefix)/html" - @cp -Pr $(EXTRA_DIST) $(prefix)/html - chown -R @OWNER@.@GROUP@ $(prefix)/html - chmod -R 0644 $(prefix)/html/*.htm* - chmod -R 0644 $(prefix)/html/images/*.gif + @rm -Rf $(prefix)/html + @$(mkinstalldirs) $(prefix)/html + @$(mkinstalldirs) $(prefix)/html/ftsc + @$(mkinstalldirs) $(prefix)/html/images + @$(mkinstalldirs) $(prefix)/html/license + @$(mkinstalldirs) $(prefix)/html/menus + @$(mkinstalldirs) $(prefix)/html/misc + @$(mkinstalldirs) $(prefix)/html/programs + @$(mkinstalldirs) $(prefix)/html/setup + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/ftsc + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/images + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/license + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/menus + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/misc + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/programs + @$(CHOWN) @OWNER@.@GROUP@ $(prefix)/html/setup + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_BASE) $(prefix)/html + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_FTSC) $(prefix)/html/ftsc + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_IMAGES) $(prefix)/html/images + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_LICENSE) $(prefix)/html/license + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_MENUS) $(prefix)/html/menus + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_MISC) $(prefix)/html/misc + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_PROGS) $(prefix)/html/programs + @$(INSTALL) -o mbse -g bbs -m 0444 $(H_SETUP) $(prefix)/html/setup # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/html/basic.html b/html/basic.html index 16beffc6..33e02ab8 100755 --- a/html/basic.html +++ b/html/basic.html @@ -11,7 +11,7 @@
-
Last update 27-May-2001
+
Last update 07-Aug-2001

 

MBSE BBS Basic Installation

@@ -27,13 +27,13 @@ environment. If you don't do this, things will fail. MBSE BBS is default installed in /opt/mbse. The spoolfiles (in and outbound, message bases) go into /var/spool/mbse. In the /opt/mbse path are several subdirectories, bin for the binaries, etc for the -configuration and some scripts, english and dutch for the language +configuration and some scripts, english, spanish, italian and dutch for the language files and menus, home for the users homedirectories, log for the logfiles, magic for the filerequest magicnames, fdb for the files database, var for some statistic files and tmp as temp directory.

Don't use UMSDOS or SAMBA filesystems for the bbs, stick by the standard Linux -filesystems (ext2). If you intent to make your bbs also accessible +filesystems (ext2 or reiserfs). If you intent to make your bbs also accessible by FTP and WWW you must create the directory structure under the ftp user behind the pub directory. Read the ftp server doc for details. If you don't follow these guidlines, you @@ -63,8 +63,10 @@ tar xfvz /path/to/the/mbsebbs-0.33.nn.tar.gz To start the script type:

 cd mbsebbs-0.33.nn
-sh ./SETUP.sh
+bash ./SETUP.sh
 
+Yes, use bash as shell here. On some systems root doesn't use bash +as login shell, calling the script with bash forces the use of bash. The script does the following:
  1. Create the group bbs @@ -80,6 +82,7 @@ easy to guess of course. The script will then continue again:
  2. The user bbs is added.
  3. The password will be removed from user bbs This action will make changes in /etc/shadow (if you have that) otherwise in /etc/passwd. +On FreeBSD it uses other tools to modify the master database.
  4. If they don't exist in the file /etc/services the services fido, tfido and binkp will be added.
  5. If they don't exist in the file /etc/inetd.conf the internet protocols @@ -94,6 +97,11 @@ The last screen of the script is about sanity checks. Perform those checks! If something is wrong, now is the time to fix it. Don't panic and remember the backups of the system files that are changed are in /etc with the extension .mbse i.e: those were the original files. +If everythings is allright, then remove the directory /tmp/mbsebbs-0.33.nn: +
    +cd /tmp
    +rm -Rf mbsebbs-0.33.nn
    +

     

    Step 4: Install the basic packages.

    @@ -103,9 +111,7 @@ archives:
     tar xfvz /path/to/mbsebbs-0.33.nn.tar.gz
     
    -You now have the subdirectory with sources in the right place. Indeed, if you -have a new installation, you also have unpacked the archive somewere else -to run the installation script. That one can be removed. +You now have the subdirectory with sources in the right place. Next build the binaries and install them using the folowing commands:
     cd ~/mbsebbs-0.33.nn
    @@ -119,7 +125,7 @@ exit
     The last part of the installation procedure shows you the location of the bbs
     startup script that is added to your system.  Because this is your first
     time installation, example menus, textfiles and some databases are installed. 
    -If they already excist on your systems (when you do an upgrade) they
    +If they already exist on your systems (when you do an upgrade) they
     will not be installed again.
     

    Now you must start the mbtask daemon by hand by typing /opt/mbse/bin/mbtask. diff --git a/html/flow.html b/html/flow.html index 0adb03cd..4fb4212d 100644 --- a/html/flow.html +++ b/html/flow.html @@ -87,7 +87,7 @@ root. You might consider installing SSH on your system for remote maintenance. Installing a PPP server on your system is beyound the scope of this project. However if you did install it, users can login your bbs with their favourite browser and use your bbs. Note that the necessary tools to automatic create -newsgroups don't excist at this time. With the proper setup you can automatic +newsgroups don't exist at this time. With the proper setup you can automatic create and maintain html pages for the file areas.

     

    diff --git a/html/ftsc/index.htm b/html/ftsc/index.htm index 34343c7c..719bbb52 100644 --- a/html/ftsc/index.htm +++ b/html/ftsc/index.htm @@ -11,7 +11,7 @@

    -
    Last update 08-Jun-2001
    +
    Last update 11-Aug-2001

     

    Fidonet Technical Standards

    @@ -82,12 +82,14 @@ Michiel Broek.
  6. FTS-0002 Obsoleted by FTS-0005
  7. FTS-0003 Obsoleted by FTS-0006
  8. FTS-0004 Echomail specification, B.Hartman -
  9. FTS-0005 The distribution nodelist, B.Baker, R.Moore, D.Nugent +
  10. FTS-0005 Obsoleted by FTS-5000
  11. FTS-0006 YOOHOO and YOOHOO/2U2, V.Perriello
  12. FTS-0007 SEAlink protocol extension, P.Becker
  13. FTS-0008 Bark file-request protocol extension, P.Becker
  14. FTS-0009 Message identification and reply linkage, J.Nutt
  15. FTS-4001 Addressing Control Paragraphs, Goran Eriksson +
  16. FTS-5000 The distribution nodelist, David Hallford +
  17. FTS-5001 Nodelist flags and user flags, David Hallford
    diff --git a/html/index.htm b/html/index.htm index a7aa940d..72db1ee2 100755 --- a/html/index.htm +++ b/html/index.htm @@ -12,10 +12,10 @@
    -

    MBSE BBS System Guide v0.33.17

    +

    MBSE BBS System Guide v0.33.18


    -
    Last update 07-Jul-2001

    +

    Last update 27-Jul-2001

    Introduction

    diff --git a/html/intergate.html b/html/intergate.html index bb1ef0b4..6b341f27 100644 --- a/html/intergate.html +++ b/html/intergate.html @@ -56,7 +56,7 @@ name of that area and echomail received in that area will automatic be posted to that newsgroup. The command mbfido news will check all configured newsgroups for new newsarticles. If you set it up for the first time you need to run mbfido news -learn to fill the dupes -database for news with all the already excisting news articles. If you skip +database for news with all the already existing news articles. If you skip that, you may get a lot of old articles that will be gated. Just run that command once after you have set this up. Later when you receive fresh articles the command mbfido news will only gate new arrived articles. diff --git a/html/misc/semafore.html b/html/misc/semafore.html index 19dcefc0..edf1a0ca 100644 --- a/html/misc/semafore.html +++ b/html/misc/semafore.html @@ -11,7 +11,7 @@
    -
    Last update 22-jul-2001
    +
    Last update 27-jul-2001

     

    Semafore files with MBSE BBS.

    @@ -19,7 +19,7 @@ The directory $MBSE_ROOT/sema is the hardcoded semafore directory where all semafore's must be created, tested and removed. When the system is booting, the init script will erase all semafore's just before the BBS is started. -This description is valid from MBSE BBS v0.33.17 and newer. +This description is valid from MBSE BBS v0.33.18 and newer.
     zmh		Purpose: to mark the state of Zone Mail Hour. 
    @@ -40,6 +40,18 @@ newnews		Purpose: Signal that there are new articles on the news server.
     		Checked by mbtask to start news processing.
     		Removed by mbtask as soon as it is detected.
     
    +mailout		Purpose: Signal that there is mail posted in the message base.
    +		Checked by mbtask to start scan the message base.
    +		Removed by mbtask as soon as it is detected.
    +
    +mailin		Purpose: Signal that there is new mail in the inbound.
    +		Checked by mbtask to start the tosser.
    +		Removed by mbtask as soon as it is detected.
    +
    +scanout		Purpose: Signal that the outbound must be rescanned.
    +		Checked by mbtask to check the outbound.
    +		Removed by mbtask as soon as it is detected.
    +
     mbtask.last	Purpose: A timestamp created and touched by "mbtask" every
     		minute so you can check it is running.
     
    diff --git a/html/postfix.html b/html/postfix.html index 44ad60cb..5331ecb7 100644 --- a/html/postfix.html +++ b/html/postfix.html @@ -11,7 +11,7 @@
    -
    Last update 21-Jun-2001
    +
    Last update 25-Aug-2001

     

    MBSE BBS - Internet Gateway - Postfix setup.

    @@ -97,7 +97,7 @@ uucp unix - n n - - pipe ifmail unix - n n - 1 pipe flags=F user=fido argv=/usr/local/bin/ifmail -r $nexthop ($recipient) mbmail unix - n n - 1 pipe - flags=F user=mbse argv=/opt/mbse/bin/mbmail -r $nexthop ($recipient) + flags=F user=mbse argv=/opt/mbse/bin/mbmail ($recipient) bsmtp unix - n n - - pipe flags=F. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
  18. diff --git a/html/programs/mbfido.html b/html/programs/mbfido.html index 50a133a9..380e37d0 100644 --- a/html/programs/mbfido.html +++ b/html/programs/mbfido.html @@ -119,7 +119,7 @@ the temporary file is removed.

    Alias file.

    -If the file /opt/mbse/etc/aliases excists, mbfido will try to fetch ftn-style +If the file /opt/mbse/etc/aliases exists, mbfido will try to fetch ftn-style aliases from there. If "from" address of a message from FidoNet matches right side of some entry in alias file, then the Reply-To: header is created @@ -217,7 +217,7 @@ day is adviced to catch any missed messages. Scan the newsserver for news articles, and update the news dupes database only. Use this switch if you start using mbfido to gate news articles for the first time. Articles will not be gated with this switch, mbfido will just learn which articles -already excist. Normally you only need to use this switch once. +already exist. Normally you only need to use this switch once.

    mbfido [command] -nodupe Disable checking for duplicate's. Normally you should not use this switch. diff --git a/html/programs/mbpasswd.html b/html/programs/mbpasswd.html index 487838df..fd4dbabd 100644 --- a/html/programs/mbpasswd.html +++ b/html/programs/mbpasswd.html @@ -29,7 +29,7 @@ is present on all Linux systems. To use passwd to change the password of another user is only allowed by root. The mbpasswd program overcomes this limitation. The wrapper mbpasswd is run from the bbs by user mbse when an ordinary user is logged in the bbs. The program is called when a new user logs in the bbs or -when an excisting user changes his password. His password under Unix is then always the same as his +when an existing user changes his password. His password under Unix is then always the same as his password in the bbs program. This is necessary for the user to be able to get his email using the pop3 protocol.

    You never need to run mbpasswd by hand, in fact it is protected so that only diff --git a/html/programs/mbtask.html b/html/programs/mbtask.html index bc0cfebc..e648721b 100644 --- a/html/programs/mbtask.html +++ b/html/programs/mbtask.html @@ -54,7 +54,7 @@ But before any program is started a number of things are checked:

  19. The UPS semafore upsalarm will be checked. This means that the system is running on battery power and no new jobs are started.
  20. The UPS semafore upsdown will be checked. This is the fatal one, if - this one excists mbtask will try to stop all current running jobs. + this one exists mbtask will try to stop all current running jobs. If there are no jobs left running then mbtask will stop itself. The upsdown semafore means that the system will shutdown and power off, that's why it's fatal and there is no way back.
    @@ -86,7 +86,7 @@ The checks and actions are: mailoutFastmbfidoMax. 1 mbfido taskmbfido scan web -quiet mailinFastmbfidoMax. 1 mbfido taskmbfido tic toss web -quiet newnewsFastmbfidoMax. 1 mbfido taskmbfido news web -quiet -mbindexFastmbindexNo other tasksmbindex -quiet and if excist: goldnode +mbindexFastmbindexNo other tasksmbindex -quiet and if exist: goldnode msglinkFastmbfidoNo other tasksmbmsg link -quiet reqindexFastmbfileNo other tasksmbfile index -quiet scanoutSlowcallOnly 1 call taskmbcico -r1 diff --git a/html/setup/services.html b/html/setup/services.html index 0259cf35..5b19df8b 100644 --- a/html/setup/services.html +++ b/html/setup/services.html @@ -29,7 +29,7 @@ and incoming netmail will be converted to email and send to listserv If you should want to run some votemanager on your system you can do that by creating a service votemgr with the type set to email. -You also need to setup a valid unix user votemgr so that there will be an excisting +You also need to setup a valid unix user votemgr so that there will be an existing mailbox. Then with some external scripts you can process all received messages.

     

    diff --git a/html/ups.html b/html/ups.html index e225b5c6..249a3cce 100644 --- a/html/ups.html +++ b/html/ups.html @@ -34,7 +34,7 @@ they are: not logged out, they will be disconnected anyway.

I know not all UPS software can do this but most UPS software is open source so you can change it to create -these semafore's. It is not a problem that UPS semafore's still excist if the systems boots, the MBSE BBS +these semafore's. It is not a problem that UPS semafore's still exist if the systems boots, the MBSE BBS startup scripts will remove them before the bbs is started.

 

diff --git a/lang/Makefile.in b/lang/Makefile.in index d95fb97e..dfe167e5 100644 --- a/lang/Makefile.in +++ b/lang/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,7 +71,6 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ SUBDIRS = . LIBS = @@ -123,9 +123,9 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lang/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu lang/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -139,9 +139,6 @@ distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: -.c.o: - $(COMPILE) -c $< - .s.o: $(COMPILE) -c $< @@ -252,6 +249,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = lang distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu lang/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ diff --git a/lib/Makefile.in b/lib/Makefile.in index 4484a319..7f687e6f 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,7 +71,6 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ SUBDIRS = . @@ -138,6 +138,20 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best +DEP_FILES = .deps/attach.P .deps/batchrd.P .deps/charconv.P \ +.deps/charconv_hz.P .deps/charconv_jp.P .deps/charconv_utf.P \ +.deps/charset.P .deps/clcomm.P .deps/client.P .deps/crc.P .deps/dbcfg.P \ +.deps/dbdupe.P .deps/dbftn.P .deps/dbmsgs.P .deps/dbnode.P \ +.deps/dbtic.P .deps/dbuser.P .deps/dostran.P .deps/execute.P \ +.deps/expipe.P .deps/faddr.P .deps/falists.P .deps/ftn.P .deps/ftnmsg.P \ +.deps/ftscprod.P .deps/getheader.P .deps/gmtoffset.P .deps/hdr.P \ +.deps/jammsg.P .deps/mbfile.P .deps/memwatch.P .deps/mime.P .deps/msg.P \ +.deps/msgflags.P .deps/msgtext.P .deps/nntp.P .deps/nodelist.P \ +.deps/nodelock.P .deps/noderecord.P .deps/packet.P .deps/parsedate.P \ +.deps/pktname.P .deps/pop3.P .deps/rawio.P .deps/rfcaddr.P \ +.deps/rfcdate.P .deps/rfcmsg.P .deps/semafore.P .deps/signame.P \ +.deps/smtp.P .deps/strcasestr.P .deps/strutil.P .deps/term.P \ +.deps/unpacker.P SOURCES = $(libclcomm_a_SOURCES) $(libcommon_a_SOURCES) $(libdbase_a_SOURCES) $(libmsgbase_a_SOURCES) $(libmbinet_a_SOURCES) $(libmemwatch_a_SOURCES) OBJECTS = $(libclcomm_a_OBJECTS) $(libcommon_a_OBJECTS) $(libdbase_a_OBJECTS) $(libmsgbase_a_OBJECTS) $(libmbinet_a_OBJECTS) $(libmemwatch_a_OBJECTS) @@ -145,9 +159,9 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps lib/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -161,9 +175,6 @@ distclean-noinstLIBRARIES: maintainer-clean-noinstLIBRARIES: -.c.o: - $(COMPILE) -c $< - .s.o: $(COMPILE) -c $< @@ -304,6 +315,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = lib distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu lib/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ @@ -324,101 +340,38 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done -attach.o: attach.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h common.h -batchrd.o: batchrd.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - common.h -charconv.o: charconv.c libs.h ../config.h memwatch.h structs.h records.h \ - common.h clcomm.h -charconv_hz.o: charconv_hz.c libs.h ../config.h memwatch.h structs.h \ - common.h clcomm.h -charconv_jp.o: charconv_jp.c libs.h ../config.h memwatch.h structs.h \ - common.h -charconv_utf.o: charconv_utf.c libs.h ../config.h memwatch.h structs.h \ - common.h -charset.o: charset.c libs.h ../config.h memwatch.h structs.h common.h \ - clcomm.h -clcomm.o: clcomm.c libs.h ../config.h memwatch.h clcomm.h -client.o: client.c libs.h ../config.h memwatch.h clcomm.h -crc.o: crc.c libs.h ../config.h memwatch.h clcomm.h -dbcfg.o: dbcfg.c libs.h ../config.h memwatch.h mbse.h structs.h \ - records.h dbcfg.h -dbdupe.o: dbdupe.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - dbdupe.h -dbftn.o: dbftn.c libs.h ../config.h memwatch.h structs.h records.h \ - dbcfg.h dbftn.h -dbmsgs.o: dbmsgs.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h dbcfg.h dbmsgs.h -dbnode.o: dbnode.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h dbcfg.h dbnode.h -dbtic.o: dbtic.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h dbcfg.h dbtic.h -dbuser.o: dbuser.c libs.h ../config.h memwatch.h structs.h records.h \ - dbcfg.h dbuser.h -dostran.o: dostran.c libs.h ../config.h memwatch.h structs.h records.h \ - common.h -execute.o: execute.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - common.h -expipe.o: expipe.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h common.h -faddr.o: faddr.c libs.h ../config.h memwatch.h structs.h common.h -falists.o: falists.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - common.h -ftn.o: ftn.c libs.h ../config.h memwatch.h structs.h records.h clcomm.h \ - dbftn.h common.h -ftnmsg.o: ftnmsg.c libs.h ../config.h memwatch.h structs.h common.h \ - clcomm.h -ftscprod.o: ftscprod.c libs.h ../config.h memwatch.h structs.h common.h -getheader.o: getheader.c libs.h ../config.h memwatch.h structs.h \ - records.h clcomm.h common.h -gmtoffset.o: gmtoffset.c libs.h ../config.h memwatch.h structs.h \ - common.h -hdr.o: hdr.c libs.h ../config.h memwatch.h structs.h common.h -jammsg.o: jammsg.c libs.h ../config.h memwatch.h clcomm.h msgtext.h \ - msg.h jam.h jamsys.h jammsg.h -mbfile.o: mbfile.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - common.h -memwatch.o: memwatch.c ../config.h libs.h memwatch.h memwatch.h -mime.o: mime.c libs.h ../config.h memwatch.h structs.h clcomm.h common.h -msg.o: msg.c libs.h ../config.h memwatch.h msgtext.h msg.h jammsg.h -msgflags.o: msgflags.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - common.h -msgtext.o: msgtext.c libs.h ../config.h memwatch.h msgtext.h msg.h -nntp.o: nntp.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h mbinet.h -nodelist.o: nodelist.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h common.h -nodelock.o: nodelock.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - common.h -noderecord.o: noderecord.c libs.h ../config.h memwatch.h structs.h \ - records.h dbnode.h common.h -packet.o: packet.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h common.h dbnode.h -parsedate.o: parsedate.c libs.h ../config.h memwatch.h structs.h \ - common.h -pktname.o: pktname.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h common.h -pop3.o: pop3.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h mbinet.h -rawio.o: rawio.c libs.h ../config.h memwatch.h structs.h common.h -rfcaddr.o: rfcaddr.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h common.h -rfcdate.o: rfcdate.c libs.h ../config.h memwatch.h structs.h common.h \ - clcomm.h -rfcmsg.o: rfcmsg.c libs.h ../config.h memwatch.h structs.h records.h \ - common.h clcomm.h -semafore.o: semafore.c libs.h ../config.h memwatch.h structs.h clcomm.h \ - common.h -signame.o: signame.c libs.h ../config.h memwatch.h clcomm.h -smtp.o: smtp.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h mbinet.h -strcasestr.o: strcasestr.c libs.h ../config.h memwatch.h -strutil.o: strutil.c libs.h ../config.h memwatch.h structs.h common.h -term.o: term.c libs.h ../config.h memwatch.h structs.h ansi.h records.h \ - common.h -unpacker.o: unpacker.c libs.h ../config.h memwatch.h structs.h records.h \ - clcomm.h common.h +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp info-am: info: info-recursive dvi-am: @@ -457,23 +410,25 @@ distclean-generic: maintainer-clean-generic: -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic + mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive -clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ - mostlyclean-am +clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-noinstLIBRARIES distclean-compile \ - distclean-tags distclean-generic clean-am + distclean-tags distclean-depend distclean-generic \ + clean-am distclean: distclean-recursive maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am + maintainer-clean-depend maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -488,12 +443,14 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ -install-exec install-data-am install-data install-am install \ -uninstall-am uninstall all-redirect all-am all installdirs-am \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs-am installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean ftscprod.c: ftscprod.??? diff --git a/lib/common.h b/lib/common.h index 818f442b..d6c479dd 100644 --- a/lib/common.h +++ b/lib/common.h @@ -351,8 +351,8 @@ extern struct _pkey { extern char SigName[32][16]; -int ttyfd; /* Filedescriptor for raw mode */ -struct termio tbuf, tbufsav; /* Structure for raw mode */ +int ttyfd; /* Filedescriptor for raw mode */ +struct termios tbufs, tbufsavs; /* Structure for raw mode */ @@ -399,7 +399,7 @@ fidoaddr str2aka(char *addr); * From falists.c */ void tidy_falist(fa_list **); -void fill_list(fa_list **,char *,fa_list **, int); +void fill_list(fa_list **,char *,fa_list **); void fill_path(fa_list **,char *); void sort_list(fa_list **); void uniq_list(fa_list **); diff --git a/lib/falists.c b/lib/falists.c index d461754b..7152527c 100644 --- a/lib/falists.c +++ b/lib/falists.c @@ -2,7 +2,7 @@ * * File ..................: falists.c * Purpose ...............: SEEN-BY and PATH lists - * Last modification date : 25-Mar-2001 + * Last modification date : 31-Jul-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -76,7 +76,7 @@ int in_list(faddr *addr, fa_list **fap, int fourd) -void fill_list(fa_list **fap, char *str, fa_list **omit, int force) +void fill_list(fa_list **fap, char *str, fa_list **omit) { fa_list *tmp; faddr *ta; @@ -109,7 +109,6 @@ void fill_list(fa_list **fap, char *str, fa_list **omit, int force) tmp = (fa_list *)malloc(sizeof(fa_list)); tmp->next = *fap; tmp->addr = ta; - tmp->force = force; *fap = tmp; } } diff --git a/lib/jammsg.c b/lib/jammsg.c index 0e9a2038..e0e6ad75 100644 --- a/lib/jammsg.c +++ b/lib/jammsg.c @@ -2,7 +2,7 @@ * * File ..................: jammsg.c * Purpose ...............: JAM message base functions - * Last modification date : 23-Jun-2001 + * Last modification date : 03-Aug-2001 * ***************************************************************************** * @@ -363,8 +363,6 @@ unsigned long JAM_Highest(void) int JAM_Lock(unsigned long ulTimeout) { -// char *File; -// int fd = -1, Tries = 0; int Tries = 0; struct flock fl; @@ -383,23 +381,6 @@ int JAM_Lock(unsigned long ulTimeout) usleep(250000); Syslog('m', "JAM messagebase lock attempt %d", Tries); } - -// File = calloc(PATH_MAX, sizeof(char)); -// sprintf(File, "%s%s", BaseName, ".LCK"); - -// while ((fd = creat(File, 0)) == -1 && errno == EACCES) { -// if (++Tries >= ulTimeout) { -// free(File); -// return FALSE; -// } -// sleep(1); -// } -// free(File); - -// if (fd == -1) -// return FALSE; - -// close(fd); return TRUE; } @@ -1301,15 +1282,6 @@ void JAM_UnLock(void) if (fcntl(fdHdr, F_SETLK, &fl)) { WriteError("$Can't unlock JAM message base"); } - -// char *File; - -// File = calloc(PATH_MAX, sizeof(char)); -// sprintf(File, "%s%s", BaseName, ".LCK"); - -// if (unlink(File) == -1) -// WriteError("jammsg: unlock error"); -// free(File); } diff --git a/lib/libs.h b/lib/libs.h index e3f2a744..950c05bf 100644 --- a/lib/libs.h +++ b/lib/libs.h @@ -2,7 +2,7 @@ * * File ..................: libs.h * Purpose ...............: Libraries include list - * Last modification date : 23-May-2001 + * Last modification date : 05-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include @@ -63,9 +63,13 @@ #include #include #include +#ifdef SHADOW_PASSWORD #include +#endif #include +#ifdef HAVE_SYS_VFS_H #include +#endif #include #include #include diff --git a/lib/mbfile.c b/lib/mbfile.c index fefc4449..3641c11e 100644 --- a/lib/mbfile.c +++ b/lib/mbfile.c @@ -2,7 +2,7 @@ * * File ..................: mbfile * Purpose ...............: Basic File I/O - * Last modification date : 05-Jul-2001 + * Last modification date : 12-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -255,14 +255,22 @@ int mkdirs(char *name) +/* + * Check free diskspace on most filesystems. Exclude check on floppyies, + * CD's and /boot partition. The amount of needed space is given in MBytes. + * Currently only Linux is supported. + */ int diskfree(int needed) { +#ifdef __linux__ char *mtab, *dev, *fs, *type; FILE *fp; struct statfs sfs; int RetVal = TRUE; unsigned long temp; +#endif +#ifdef __linux__ if (! needed) return TRUE; @@ -283,7 +291,8 @@ int diskfree(int needed) */ if (strncmp((char *)"/dev/fd", dev, 7) && strncmp((char *)"/boot", fs, 5) && (!strncmp((char *)"ext2", type, 4) || !strncmp((char *)"reiserfs", type, 8) || - !strncmp((char *)"vfat", type, 4) || !strncmp((char *)"msdos", type, 5))) { + !strncmp((char *)"ufs", type, 3) || + !strncmp((char *)"vfat", type, 4) || !strncmp((char *)"msdos", type, 5))) { if (statfs(fs, &sfs) == 0) { temp = (unsigned long)(sfs.f_bsize / 512L); if (((unsigned long)(sfs.f_bavail * temp) / 2048L) < needed) { @@ -299,6 +308,9 @@ int diskfree(int needed) free(mtab); return RetVal; +#else /* ifdef __linux__ */ + return TRUE; /* Assume enough */ +#endif } diff --git a/lib/parsedate.c b/lib/parsedate.c index ce58b0c3..28effcef 100644 --- a/lib/parsedate.c +++ b/lib/parsedate.c @@ -1414,10 +1414,10 @@ int GetTimeInfo(TIMEINFO *Now) #if defined(HAVE_GETTIMEOFDAY) struct timeval tv; #endif /* defined(HAVE_GETTIMEOFDAY) */ -#if !defined(HAVE_TM_GMTOFF) +#if !defined(HAVE_TM_ZONE) struct tm local; struct tm gmt; -#endif /* !defined(HAVE_TM_GMTOFF) */ +#endif /* !defined(HAVE_TM_ZONE) */ /* Get the basic time. */ #if defined(HAVE_GETTIMEOFDAY) @@ -1436,7 +1436,7 @@ int GetTimeInfo(TIMEINFO *Now) if ((tm = localtime(&Now->time)) == NULL) return -1; secondsUntilNextHour = 60 * (60 - tm->tm_min) - tm->tm_sec; -#if !defined(HAVE_TM_GMTOFF) +#if !defined(HAVE_TM_ZONE) /* To get the timezone, compare localtime with GMT. */ local = *tm; if ((tm = gmtime(&Now->time)) == NULL) @@ -1458,7 +1458,7 @@ int GetTimeInfo(TIMEINFO *Now) LastTzone += gmt.tm_min - local.tm_min; #else LastTzone = (0 - tm->tm_gmtoff) / 60; -#endif /* defined(HAVE_TM_GMTOFF) */ +#endif /* defined(HAVE_TM_ZONE) */ NextHour = Now->time + secondsUntilNextHour; } Now->tzone = LastTzone; @@ -1739,7 +1739,7 @@ time_t parsedate(char *p, TIMEINFO *now) yyYear = tm->tm_year + 1900; yyMonth = tm->tm_mon + 1; yyDay = tm->tm_mday; -#ifdef HAVE_TM_GMTOFF +#ifdef HAVE_TM_ZONE yyTimezone = tm->tm_gmtoff/60; #else yyTimezone = timezone/60; diff --git a/lib/rawio.c b/lib/rawio.c index 96f750eb..886bf937 100644 --- a/lib/rawio.c +++ b/lib/rawio.c @@ -2,10 +2,10 @@ * * File ..................: rawio.c * Purpose ...............: Raw I/O routines. - * Last modification date : 18-Dec-1999 + * Last modification date : 07-Aug-2001 * ***************************************************************************** - * Copyright (C) 1997-1999 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -42,26 +42,39 @@ int rawset = FALSE; */ void Setraw() { - if (ioctl(ttyfd, TCGETA, &tbuf) == -1) { - perror("TCGETA Failed"); - exit(1); /* ERROR - could not set get tty ioctl */ + int rc; + +// if (ioctl(ttyfd, TCGETA, &tbuf) == -1) { +// perror("TCGETA Failed"); +// exit(1); /* ERROR - could not set get tty ioctl */ +// } + if ((rc = tcgetattr(ttyfd, &tbufs))) { + perror(""); + printf("$tcgetattr(0, save) return %d\n", rc); + exit(1); } - tbufsav = tbuf; - tbuf.c_iflag &= ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON ); - /* - * Map CRNL modes strip control characters and flow control - */ - tbuf.c_oflag &= ~OPOST; /* Don't do ouput character translation */ - tbuf.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */ - tbuf.c_cc[VMIN] = 1; /* Receive 1 character at a time */ - tbuf.c_cc[VTIME] = 0; /* No time limit per character */ + tbufsavs = tbufs; + tbufs.c_iflag &= ~(INLCR | ICRNL | ISTRIP | IXON ); /* IUCLC removed for FreeBSD */ + /* + * Map CRNL modes strip control characters and flow control + */ + tbufs.c_oflag &= ~OPOST; /* Don't do ouput character translation */ + tbufs.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */ + tbufs.c_cc[VMIN] = 1; /* Receive 1 character at a time */ + tbufs.c_cc[VTIME] = 0; /* No time limit per character */ - if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) { - perror("TCSETAF failed"); - exit(1); /* ERROR - could not set tty ioctl */ + if ((rc = tcsetattr(ttyfd, TCSADRAIN, &tbufs))) { + perror(""); + printf("$tcsetattr(%d, TCSADRAIN, raw) return %d\n", ttyfd, rc); + exit(1); } +// if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) { +// perror("TCSETAF failed"); +// exit(1); /* ERROR - could not set tty ioctl */ +// } + rawset = TRUE; } @@ -72,13 +85,20 @@ void Setraw() */ void Unsetraw() { + int rc; + /* * Only unset the mode if it is set to raw mode */ if (rawset == TRUE) { - if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) { - perror("TCSETAF Normal Failed"); - exit(1); /* ERROR - could not save original tty ioctl */ +// if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) { +// perror("TCSETAF Normal Failed"); +// exit(1); /* ERROR - could not save original tty ioctl */ +// } + if ((rc = tcsetattr(ttyfd, TCSAFLUSH, &tbufsavs))) { + perror(""); + printf("$tcsetattr(%d, TCSAFLUSH, save) return %d\n", ttyfd, rc); + exit(1); } } rawset = FALSE; @@ -114,14 +134,17 @@ unsigned char Getone() */ int Speed(void) { - int mspeed; - struct termio ttyhold; +// int mspeed; +// struct termio ttyhold; + speed_t mspeed; - static int baud[16] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400}; +// static int baud[16] = {0, 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400}; - ioctl(0, TCGETA, &ttyhold); - mspeed = baud[ttyhold.c_cflag & 017]; - ioctl(0, TCSETAF, &ttyhold); +// ioctl(0, TCGETA, &ttyhold); +// mspeed = baud[ttyhold.c_cflag & 017]; +// ioctl(0, TCSETAF, &ttyhold); + + mspeed = cfgetospeed(&tbufs); return(mspeed); } diff --git a/mbcico/Makefile.am b/mbcico/Makefile.am index 4779f331..27c2500c 100644 --- a/mbcico/Makefile.am +++ b/mbcico/Makefile.am @@ -29,7 +29,6 @@ LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a \ ../lib/libmsgbase.a ../lib/libdbase.a install-exec-local: - $(mkinstalldirs) $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbcico $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbout $(bindir) diff --git a/mbcico/Makefile.in b/mbcico/Makefile.in index a5699638..6a8f758c 100644 --- a/mbcico/Makefile.in +++ b/mbcico/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,7 +71,6 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ EXTRA_DIST = README SUBDIRS = . @@ -121,6 +121,17 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best +DEP_FILES = .deps/answer.P .deps/atoul.P .deps/binkp.P .deps/call.P \ +.deps/callall.P .deps/callstat.P .deps/chat.P .deps/dial.P \ +.deps/dietifna.P .deps/emsi.P .deps/emsidat.P .deps/filelist.P \ +.deps/filetime.P .deps/ftsc.P .deps/hydra.P .deps/lutil.P \ +.deps/m7recv.P .deps/m7send.P .deps/mbcico.P .deps/mbout.P \ +.deps/nlinfo.P .deps/openfile.P .deps/openport.P .deps/opentcp.P \ +.deps/outstat.P .deps/portsel.P .deps/rdoptions.P .deps/recvbark.P \ +.deps/respfreq.P .deps/scanout.P .deps/sendbark.P .deps/session.P \ +.deps/tcp.P .deps/tcpproto.P .deps/ttyio.P .deps/ulock.P .deps/wazoo.P \ +.deps/xmrecv.P .deps/xmsend.P .deps/yoohoo.P .deps/zmmisc.P \ +.deps/zmrecv.P .deps/zmrle.P .deps/zmsend.P SOURCES = $(mbcico_SOURCES) $(mbout_SOURCES) OBJECTS = $(mbcico_OBJECTS) $(mbout_OBJECTS) @@ -128,9 +139,9 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps mbcico/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu mbcico/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -144,9 +155,6 @@ distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: -.c.o: - $(COMPILE) -c $< - .s.o: $(COMPILE) -c $< @@ -265,6 +273,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = mbcico distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mbcico/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ @@ -285,170 +298,38 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done -answer.o: answer.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h lutil.h \ - session.h config.h answer.h openport.h portsel.h dial.h \ - rdoptions.h mbcico.h -atoul.o: atoul.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h atoul.h -binkp.o: binkp.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ttyio.h \ - session.h statetbl.h config.h emsi.h openfile.h respfreq.h \ - filelist.h opentcp.h rdoptions.h lutil.h binkp.h -call.o: call.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h ../lib/dbnode.h session.h callstat.h call.h \ - config.h dial.h lutil.h portsel.h openport.h opentcp.h \ - rdoptions.h -callall.o: callall.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - config.h ../lib/clcomm.h scanout.h lutil.h callstat.h callall.h -callstat.o: callstat.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/clcomm.h ../lib/common.h callstat.h -chat.o: chat.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h config.h portsel.h chat.h ttyio.h -dial.o: dial.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h ../lib/dbnode.h portsel.h config.h chat.h \ - ttyio.h session.h dial.h -dietifna.o: dietifna.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ttyio.h session.h emsi.h dietifna.h respfreq.h \ - filelist.h xmrecv.h xmsend.h -emsi.o: emsi.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/dbnode.h ../lib/clcomm.h ttyio.h session.h statetbl.h \ - config.h emsi.h emsidat.h hydra.h rdoptions.h tcp.h wazoo.h -emsidat.o: emsidat.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h emsi.h \ - session.h lutil.h config.h emsidat.h filetime.h -filelist.o: filelist.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/clcomm.h ../lib/common.h config.h session.h filelist.h -filetime.o: filetime.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h filetime.h -ftsc.o: ftsc.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h session.h ttyio.h statetbl.h config.h ftsc.h \ - rdoptions.h recvbark.h filelist.h sendbark.h respfreq.h \ - xmrecv.h xmsend.h -hydra.o: hydra.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h session.h filelist.h filetime.h ttyio.h \ - statetbl.h config.h emsi.h openfile.h lutil.h respfreq.h \ - mbcico.h hydra.h -lutil.o: lutil.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h lutil.h -m7recv.o: m7recv.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h statetbl.h ttyio.h m7recv.h -m7send.o: m7send.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h statetbl.h ttyio.h m7send.h -mbcico.o: mbcico.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h \ - ../lib/dbftn.h config.h answer.h portsel.h call.h callall.h \ - lutil.h mbcico.h session.h -mbout.o: mbout.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h \ - ../lib/dbftn.h outstat.h nlinfo.h -nlinfo.o: nlinfo.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h nlinfo.h -openfile.o: openfile.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h \ - ../lib/common.h config.h lutil.h openfile.h -openport.o: openport.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ulock.h ttyio.h openport.h -opentcp.o: opentcp.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h session.h \ - ttyio.h openport.h opentcp.h -outstat.o: outstat.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbnode.h \ - ../lib/dbftn.h scanout.h callstat.h outstat.h -portsel.o: portsel.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h portsel.h -rdoptions.o: rdoptions.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h portsel.h \ - session.h config.h -recvbark.o: recvbark.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ttyio.h session.h statetbl.h recvbark.h \ - respfreq.h filelist.h -respfreq.o: respfreq.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h session.h lutil.h config.h \ - atoul.h respfreq.h filelist.h -scanout.o: scanout.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbftn.h config.h \ - scanout.h lutil.h -sendbark.o: sendbark.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ttyio.h session.h statetbl.h sendbark.h \ - xmrecv.h -session.o: session.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ttyio.h statetbl.h emsi.h \ - ftsc.h session.h yoohoo.h mbcico.h binkp.h callstat.h -tcp.o: tcp.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/structs.h ../lib/common.h ../lib/clcomm.h ttyio.h \ - session.h statetbl.h config.h emsi.h respfreq.h filelist.h \ - tcpproto.h tcp.h -tcpproto.o: tcpproto.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ttyio.h session.h config.h emsi.h lutil.h \ - openfile.h filelist.h tcpproto.h -ttyio.o: ttyio.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ttyio.h lutil.h -ulock.o: ulock.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/clcomm.h -wazoo.o: wazoo.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ttyio.h session.h statetbl.h config.h emsi.h \ - respfreq.h filelist.h wazoo.h zmodem.h -xmrecv.o: xmrecv.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h session.h ttyio.h statetbl.h config.h lutil.h \ - openfile.h m7recv.h xmrecv.h filetime.h -xmsend.o: xmsend.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h session.h ttyio.h statetbl.h xmsend.h m7send.h \ - filelist.h filetime.h -yoohoo.o: yoohoo.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/clcomm.h ../lib/common.h ../lib/dbnode.h statetbl.h \ - ttyio.h session.h config.h emsi.h hydra.h rdoptions.h wazoo.h \ - dietifna.h yoohoo.h -zmmisc.o: zmmisc.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ttyio.h session.h zmodem.h -zmrecv.o: zmrecv.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h \ - ../lib/common.h lutil.h ttyio.h session.h zmodem.h config.h \ - emsi.h openfile.h openport.h -zmrle.o: zmrle.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/clcomm.h \ - ../lib/common.h ttyio.h session.h zmodem.h -zmsend.o: zmsend.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ttyio.h session.h zmodem.h lutil.h emsi.h \ - filelist.h +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp info-am: info: info-recursive dvi-am: @@ -486,23 +367,24 @@ distclean-generic: maintainer-clean-generic: mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic + mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive -clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ - mostlyclean-am +clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ - distclean-generic clean-am + distclean-depend distclean-generic clean-am distclean: distclean-recursive maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am + maintainer-clean-depend maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -517,17 +399,17 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck \ -install-exec-local install-exec-am install-exec install-data-am \ -install-data install-am install uninstall-am uninstall all-redirect \ -all-am all installdirs-am installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-local install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean install-exec-local: - $(mkinstalldirs) $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbcico $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbout $(bindir) diff --git a/mbcico/binkp.c b/mbcico/binkp.c index 658e69f2..c6edbe25 100644 --- a/mbcico/binkp.c +++ b/mbcico/binkp.c @@ -2,7 +2,7 @@ * * File ....................: mbcico/binkp.c * Purpose .................: Fidonet binkd protocol - * Last modification date ..: 07-Jul-2001 + * Last modification date ..: 07-Aug-2001 * Binkp protocol copyright : Dima Maloff. * ***************************************************************************** @@ -823,7 +823,8 @@ int binkp_batch(file_list *to_send) char *rname, *lname; long rsize, roffs, lsize; time_t rtime, ltime; - long rxbytes, written; + off_t rxbytes; + long written; binkp_list *bll = NULL, *tmp, *cursend = NULL; file_list *tsl; diff --git a/mbcico/callstat.c b/mbcico/callstat.c index acb306d9..83bf5755 100644 --- a/mbcico/callstat.c +++ b/mbcico/callstat.c @@ -2,10 +2,10 @@ * * File ..................: mbcico/callstat.c * Purpose ...............: Fidonet mailer - * Last modification date : 13-Aug-2000 + * Last modification date : 05-Aug-2001 * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -73,7 +73,7 @@ void putstatus(faddr *addr, int incr, int sts) fwrite(cst, sizeof(callstat), 1, fp); fclose(fp); if (cst->tryno >= 30) - WriteError("Node %s is marked undialble.", ascfnode(addr, 0x1f)); + WriteError("Node %s is marked undialable.", ascfnode(addr, 0x1f)); } else { WriteError("$Cannot create status file for node %s", ascfnode(addr,0x1f)); } diff --git a/mbcico/filelist.c b/mbcico/filelist.c index 5ea40f7a..687fe7cc 100644 --- a/mbcico/filelist.c +++ b/mbcico/filelist.c @@ -2,10 +2,10 @@ * * File ..................: mbcico/filelist.c * Purpose ...............: fidonet mailer - * Last modification date : 23-Dec-2000 + * Last modification date : 07-Aug-2001 * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -463,7 +463,13 @@ void execute_disposition(file_list *fl) WriteError("$Error writing '~' to .flo at %lu", (unsigned long)fl->floff); } fflush(fl->flofp); +#ifdef HAVE_FDATASYNC fdatasync(fileno(fl->flofp)); +#else +#ifdef HAVE_FSYNC + fsync(fileno(fl->flofp)); +#endif +#endif } else WriteError("$error seeking in .flo to %lu", (unsigned long)fl->floff); } diff --git a/mbcico/hydra.c b/mbcico/hydra.c index e4046007..1f645358 100644 --- a/mbcico/hydra.c +++ b/mbcico/hydra.c @@ -2,11 +2,11 @@ * * File ..................: mbcico/hydra.c * Purpose ...............: Fidonet mailer - * Last modification date : 30-Dec-2000 + * Last modification date : 07-Aug-2001 * Remark ................: See below for more copyright details and credits. * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -530,7 +530,8 @@ int hydra_batch(int role, file_list *to_send) char *inbuf, *outbuf; int rxlen, txlen; /* length of receive/transmit buffer */ long txwindow, rxwindow; /* window sizes */ - long txpos, rxpos; /* file positions */ + long txpos; + off_t rxpos; /* file positions */ long stxpos, srxpos; long longnum; int hdxlink = FALSE; @@ -865,7 +866,7 @@ int hydra_batch(int role, file_list *to_send) if (to_send) { txlen = sprintf(txbuf, "%08lx%08lx%08lx%08lx%08lx", mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)), - txstat.st_size, 0UL, 0UL, 0UL); + (long)(txstat.st_size), 0UL, 0UL, 0UL); /* * convert file name to DOS-format diff --git a/mbcico/openport.c b/mbcico/openport.c index 7d945a89..5f3c6d99 100644 --- a/mbcico/openport.c +++ b/mbcico/openport.c @@ -2,10 +2,10 @@ * * File ..................: mbcico/openport.c * Purpose ...............: Fidonet mailer - * Last modification date : 23-Dec-2000 + * Last modification date : 07-Aug-2001 * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -115,12 +115,6 @@ int openport(char *port, int speed) fflush(stderr); close(2); } - -// if (setpgrp() < 0) { -// WriteError("$openport: setpgrp failed"); -// ulock(pname); -// return 1; -// } } tty_status = 0; hanged_up = 0; @@ -282,14 +276,15 @@ void sendbrk(void) } -static struct termios savetios; -static struct termios tios; - char *bstr(speed_t); char *bstr(speed_t sp) { +#ifdef CBAUD switch(sp & CBAUD) { +#else + switch(sp) { +#endif case 0: return (char *)"0"; #if defined(B50) case B50: return (char *)"50"; @@ -387,6 +382,9 @@ char *bstr(speed_t sp) +static struct termios savetios; +static struct termios tios; + int tty_raw(int speed) { diff --git a/mbcico/respfreq.c b/mbcico/respfreq.c index edd52a79..2d08bbd6 100644 --- a/mbcico/respfreq.c +++ b/mbcico/respfreq.c @@ -2,7 +2,7 @@ * * File ..................: mbcico/respfreq.c * Purpose ...............: Fidonet mailer - * Last modification date : 07-Feb-2001 + * Last modification date : 08-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -269,6 +269,7 @@ file_list *respfreq(char *nm, char *pw, char *dt) Area = 0L; free(p); + Syslog('f', "Start search ..."); while (!no_more && (fread(&idx, sizeof(idx), 1, fi) == 1)) { if (re_exec(idx.Name) || re_exec(idx.LName)) { Syslog('f', "Index found %s area %d record %d", idx.LName, idx.AreaNum, idx.Record); @@ -380,7 +381,7 @@ file_list *respfreq(char *nm, char *pw, char *dt) fclose(fa); fclose(fi); - + if (fl == NULL) add_report((char *)"ER: No matching files found"); diff --git a/mbcico/tcpproto.c b/mbcico/tcpproto.c index f5877825..1b4f372b 100644 --- a/mbcico/tcpproto.c +++ b/mbcico/tcpproto.c @@ -2,10 +2,10 @@ * * File ..................: mbcico/tcpproto.c * Purpose ...............: Fidonet mailer - * Last modification date : 24-Dec-2000 + * Last modification date : 07-Aug-2001 * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -55,9 +55,10 @@ static FILE *in; static char txbuf[2048]; static char rxbuf[2048]; static int rx_type; -static long startime,endtime,rxbytes,sbytes; +static long startime,endtime,sbytes; +static off_t rxbytes; -static int sendfile(char *,char *); +static int sendtfile(char *,char *); static int finsend(void); static int receivefile(char *,time_t,off_t); static int resync(off_t); @@ -85,7 +86,7 @@ int tcpsndfiles(file_list *lst) for (tmpf = lst; tmpf && (maxrc == 0); tmpf = tmpf->next) { if (tmpf->remote) { - rc = sendfile(tmpf->local,tmpf->remote); + rc = sendtfile(tmpf->local,tmpf->remote); rc = abs(rc); if (rc > maxrc) maxrc=rc; @@ -158,7 +159,7 @@ next: -static int sendfile(char *ln, char *rn) +static int sendtfile(char *ln, char *rn) { int rc=0; struct stat st; diff --git a/mbcico/zmrecv.c b/mbcico/zmrecv.c index 9b15dd20..43dfa6ed 100644 --- a/mbcico/zmrecv.c +++ b/mbcico/zmrecv.c @@ -2,10 +2,10 @@ * * File ..................: mbcico/zmrecv.c * Purpose ...............: Fidonet mailer - * Last modification date : 27-Nov-2000 + * Last modification date : 10-Aug-2001 * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -514,7 +514,7 @@ int procheader(char *Name) strcpy(ctt,date(Modtime)); Syslog('+', "Zmodem: \"%s\" %ld bytes, %s mode %o", Name, Bytesleft, ctt, Filemode); - fout = openfile(Name,Modtime,Bytesleft,&rxbytes,resync); + fout = openfile(Name,Modtime,Bytesleft,&(long)(rxbytes),resync); (void)time(&startime); sbytes = rxbytes; diff --git a/mbcico/zmsend.c b/mbcico/zmsend.c index 23e4b432..97f35e83 100644 --- a/mbcico/zmsend.c +++ b/mbcico/zmsend.c @@ -2,7 +2,7 @@ * * File ..................: mbcico/zmsend.c * Purpose ...............: Fidonet mailer - * Last modification date : 07-Feb-2001 + * Last modification date : 07-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -41,7 +41,7 @@ #include "filelist.h" static int initsend(void); -static int sendfile(char*,char*); +static int sendzfile(char*,char*); static int finsend(void); static int getzrxinit(void); @@ -102,7 +102,7 @@ int zmsndfiles(file_list *lst) for (tmpf = lst; tmpf && (maxrc < 2); tmpf = tmpf->next) { if (tmpf->remote) { - rc = sendfile(tmpf->local, tmpf->remote); + rc = sendzfile(tmpf->local, tmpf->remote); rc = abs(rc); if (rc > maxrc) maxrc = rc; @@ -171,7 +171,7 @@ static int finsend(void) -static int sendfile(char *ln, char *rn) +static int sendzfile(char *ln, char *rn) { int rc=0; struct stat st; diff --git a/mbfido/Makefile.am b/mbfido/Makefile.am index 0ef3c30a..423bbe31 100644 --- a/mbfido/Makefile.am +++ b/mbfido/Makefile.am @@ -4,29 +4,22 @@ SUBDIRS = . EXTRA_DIST = maptabs.tgz paths.h.in README -noinst_PROGRAMS = mbfido mbmail mbseq mbaff mbindex mbdiff mbfile mbmsg +noinst_PROGRAMS = mbfido mbseq mbaff mbindex mbdiff mbfile mbmsg mbfido_SOURCES = flock.c tosspkt.c mbfido.c hatch.c maketags.c \ -importmsg.c echoout.c tracker.c makestat.c scannews.c lhash.c \ +tracker.c makestat.c scannews.c lhash.c \ pack.c ulock.c tic.c ptic.c utic.c mover.c hash.c mkftnhdr.c \ -addbbs.c magic.c fsort.c toberep.c mkrfcmsg.c atoul.c ping.c \ -cookie.c forward.c sendmail.c scan.c addpkt.c importnet.c \ -areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c \ -rnews.c newspost.c aliasdb.c postemail.c postnetmail.c backalias.c \ +addbbs.c magic.c fsort.c toberep.c ftn2rfc.c atoul.c ping.c \ +cookie.c forward.c sendmail.c scan.c addpkt.c storenet.c storeecho.c \ +areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c rfc2ftn.c \ +rnews.c newspost.c aliasdb.c postemail.c postnetmail.c postecho.c backalias.c \ flock.h tosspkt.h mbfido.h hatch.h maketags.h \ -importmsg.h echoout.h tracker.h makestat.h scannews.h lhash.h \ +tracker.h makestat.h scannews.h lhash.h \ pack.h ulock.h tic.h ptic.h utic.h mover.h hash.h mkftnhdr.h \ -addbbs.h magic.h fsort.h toberep.h mkrfcmsg.h atoul.h ping.h \ -cookie.h forward.h sendmail.h scan.h addpkt.h importnet.h \ -areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h \ -rnews.h newspost.h aliasdb.h postemail.h postnetmail.h backalias.h - -mbmail_SOURCES = message.c hash.c lhash.c atoul.c \ -bread.c bwrite.c flock.c mkftnhdr.c mbmail.c tracker.c \ -viadate.c importnet.c aliasdb.c \ -message.h hash.h lhash.h atoul.h \ -bread.h bwrite.h flock.h mkftnhdr.h mbmail.h tracker.h \ -viadate.h importnet.h aliasdb.h +addbbs.h magic.h fsort.h toberep.h ftn2rfc.h atoul.h ping.h \ +cookie.h forward.h sendmail.h scan.h addpkt.h storenet.h storeecho.h \ +areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h rfc2ftn.h \ +rnews.h newspost.h aliasdb.h postemail.h postnetmail.h postecho.h backalias.h mbseq_SOURCES = mbseq.c mbseq.h @@ -42,7 +35,6 @@ mbfile_SOURCES = mbfile.c mbfile.h mbmsg_SOURCES = post.c mbmsg.c post.h mbmsg.h mbfido_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a -mbmail_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a mbseq_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a mbaff_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a mbindex_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a @@ -52,14 +44,15 @@ mbmsg_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../li install-exec-local: $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbfido $(bindir) - $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbmail $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbseq $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbaff $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbindex $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbdiff $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbfile $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbmsg $(bindir) + rm -f $(bindir)/mbmail + ln -s $(bindir)/mbfido $(bindir)/mbmail rm -f $(bindir)/mbnews ln -s $(bindir)/mbfido $(bindir)/mbnews - (cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; chown mbse.bbs etc/maptabs/*) + (cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; $(CHOWN) @OWNER@.@GROUP@ etc/maptabs/*) diff --git a/mbfido/Makefile.in b/mbfido/Makefile.in index c05108f2..3f9441cb 100644 --- a/mbfido/Makefile.in +++ b/mbfido/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,18 +71,14 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ SUBDIRS = . EXTRA_DIST = maptabs.tgz paths.h.in README -noinst_PROGRAMS = mbfido mbmail mbseq mbaff mbindex mbdiff mbfile mbmsg +noinst_PROGRAMS = mbfido mbseq mbaff mbindex mbdiff mbfile mbmsg -mbfido_SOURCES = flock.c tosspkt.c mbfido.c hatch.c maketags.c importmsg.c echoout.c tracker.c makestat.c scannews.c lhash.c pack.c ulock.c tic.c ptic.c utic.c mover.c hash.c mkftnhdr.c addbbs.c magic.c fsort.c toberep.c mkrfcmsg.c atoul.c ping.c cookie.c forward.c sendmail.c scan.c addpkt.c importnet.c areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c rnews.c newspost.c aliasdb.c postemail.c postnetmail.c backalias.c flock.h tosspkt.h mbfido.h hatch.h maketags.h importmsg.h echoout.h tracker.h makestat.h scannews.h lhash.h pack.h ulock.h tic.h ptic.h utic.h mover.h hash.h mkftnhdr.h addbbs.h magic.h fsort.h toberep.h mkrfcmsg.h atoul.h ping.h cookie.h forward.h sendmail.h scan.h addpkt.h importnet.h areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h rnews.h newspost.h aliasdb.h postemail.h postnetmail.h backalias.h - - -mbmail_SOURCES = message.c hash.c lhash.c atoul.c bread.c bwrite.c flock.c mkftnhdr.c mbmail.c tracker.c viadate.c importnet.c aliasdb.c message.h hash.h lhash.h atoul.h bread.h bwrite.h flock.h mkftnhdr.h mbmail.h tracker.h viadate.h importnet.h aliasdb.h +mbfido_SOURCES = flock.c tosspkt.c mbfido.c hatch.c maketags.c tracker.c makestat.c scannews.c lhash.c pack.c ulock.c tic.c ptic.c utic.c mover.c hash.c mkftnhdr.c addbbs.c magic.c fsort.c toberep.c ftn2rfc.c atoul.c ping.c cookie.c forward.c sendmail.c scan.c addpkt.c storenet.c storeecho.c areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c rfc2ftn.c rnews.c newspost.c aliasdb.c postemail.c postnetmail.c postecho.c backalias.c flock.h tosspkt.h mbfido.h hatch.h maketags.h tracker.h makestat.h scannews.h lhash.h pack.h ulock.h tic.h ptic.h utic.h mover.h hash.h mkftnhdr.h addbbs.h magic.h fsort.h toberep.h ftn2rfc.h atoul.h ping.h cookie.h forward.h sendmail.h scan.h addpkt.h storenet.h storeecho.h areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h rfc2ftn.h rnews.h newspost.h aliasdb.h postemail.h postnetmail.h postecho.h backalias.h mbseq_SOURCES = mbseq.c mbseq.h @@ -98,7 +95,6 @@ mbfile_SOURCES = mbfile.c mbfile.h mbmsg_SOURCES = post.c mbmsg.c post.h mbmsg.h mbfido_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a -mbmail_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a mbseq_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a mbaff_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a mbindex_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a @@ -116,21 +112,16 @@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ mbfido_OBJECTS = flock.o tosspkt.o mbfido.o hatch.o maketags.o \ -importmsg.o echoout.o tracker.o makestat.o scannews.o lhash.o pack.o \ -ulock.o tic.o ptic.o utic.o mover.o hash.o mkftnhdr.o addbbs.o magic.o \ -fsort.o toberep.o mkrfcmsg.o atoul.o ping.o cookie.o forward.o \ -sendmail.o scan.o addpkt.o importnet.o areamgr.o filemgr.o notify.o \ -mgrutil.o rollover.o bwrite.o rnews.o newspost.o aliasdb.o postemail.o \ -postnetmail.o backalias.o +tracker.o makestat.o scannews.o lhash.o pack.o ulock.o tic.o ptic.o \ +utic.o mover.o hash.o mkftnhdr.o addbbs.o magic.o fsort.o toberep.o \ +ftn2rfc.o atoul.o ping.o cookie.o forward.o sendmail.o scan.o addpkt.o \ +storenet.o storeecho.o areamgr.o filemgr.o notify.o mgrutil.o \ +rollover.o bwrite.o rfc2ftn.o rnews.o newspost.o aliasdb.o postemail.o \ +postnetmail.o postecho.o backalias.o mbfido_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \ ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a \ ../lib/libmbinet.a mbfido_LDFLAGS = -mbmail_OBJECTS = message.o hash.o lhash.o atoul.o bread.o bwrite.o \ -flock.o mkftnhdr.o mbmail.o tracker.o viadate.o importnet.o aliasdb.o -mbmail_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \ -../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a -mbmail_LDFLAGS = mbseq_OBJECTS = mbseq.o mbseq_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \ ../lib/libcommon.a ../lib/libdbase.a @@ -167,16 +158,31 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best -SOURCES = $(mbfido_SOURCES) $(mbmail_SOURCES) $(mbseq_SOURCES) $(mbaff_SOURCES) $(mbindex_SOURCES) $(mbdiff_SOURCES) $(mbfile_SOURCES) $(mbmsg_SOURCES) -OBJECTS = $(mbfido_OBJECTS) $(mbmail_OBJECTS) $(mbseq_OBJECTS) $(mbaff_OBJECTS) $(mbindex_OBJECTS) $(mbdiff_OBJECTS) $(mbfile_OBJECTS) $(mbmsg_OBJECTS) +DEP_FILES = .deps/addbbs.P .deps/addpkt.P .deps/aliasdb.P \ +.deps/announce.P .deps/areamgr.P .deps/atoul.P .deps/backalias.P \ +.deps/bwrite.P .deps/cookie.P .deps/fflist.P .deps/filefind.P \ +.deps/filemgr.P .deps/flock.P .deps/forward.P .deps/fsort.P \ +.deps/ftn2rfc.P .deps/grlist.P .deps/hash.P .deps/hatch.P .deps/lhash.P \ +.deps/magic.P .deps/makestat.P .deps/maketags.P .deps/mbaff.P \ +.deps/mbdiff.P .deps/mbfido.P .deps/mbfile.P .deps/mbindex.P \ +.deps/mbmsg.P .deps/mbseq.P .deps/mgrutil.P .deps/mkftnhdr.P \ +.deps/mover.P .deps/msgutil.P .deps/newspost.P .deps/notify.P \ +.deps/pack.P .deps/ping.P .deps/post.P .deps/postecho.P \ +.deps/postemail.P .deps/postnetmail.P .deps/ptic.P .deps/rfc2ftn.P \ +.deps/rnews.P .deps/rollover.P .deps/scan.P .deps/scannews.P \ +.deps/sendmail.P .deps/storeecho.P .deps/storenet.P .deps/tic.P \ +.deps/toberep.P .deps/tosspkt.P .deps/tracker.P .deps/ulock.P \ +.deps/utic.P +SOURCES = $(mbfido_SOURCES) $(mbseq_SOURCES) $(mbaff_SOURCES) $(mbindex_SOURCES) $(mbdiff_SOURCES) $(mbfile_SOURCES) $(mbmsg_SOURCES) +OBJECTS = $(mbfido_OBJECTS) $(mbseq_OBJECTS) $(mbaff_OBJECTS) $(mbindex_OBJECTS) $(mbdiff_OBJECTS) $(mbfile_OBJECTS) $(mbmsg_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps mbfido/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu mbfido/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -192,9 +198,6 @@ distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: -.c.o: - $(COMPILE) -c $< - .s.o: $(COMPILE) -c $< @@ -215,10 +218,6 @@ mbfido: $(mbfido_OBJECTS) $(mbfido_DEPENDENCIES) @rm -f mbfido $(LINK) $(mbfido_LDFLAGS) $(mbfido_OBJECTS) $(mbfido_LDADD) $(LIBS) -mbmail: $(mbmail_OBJECTS) $(mbmail_DEPENDENCIES) - @rm -f mbmail - $(LINK) $(mbmail_LDFLAGS) $(mbmail_OBJECTS) $(mbmail_LDADD) $(LIBS) - mbseq: $(mbseq_OBJECTS) $(mbseq_DEPENDENCIES) @rm -f mbseq $(LINK) $(mbseq_LDFLAGS) $(mbseq_OBJECTS) $(mbseq_LDADD) $(LIBS) @@ -337,6 +336,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = mbfido distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mbfido/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ @@ -357,232 +361,38 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done -addbbs.o: addbbs.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h tic.h fsort.h addbbs.h -addpkt.o: addpkt.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/clcomm.h ../lib/common.h ../lib/dbnode.h ../lib/dbmsgs.h \ - pack.h addpkt.h -aliasdb.o: aliasdb.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h aliasdb.h -announce.o: announce.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \ - ../lib/msgtext.h grlist.h msgutil.h announce.h -areamgr.o: areamgr.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \ - ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h \ - ../lib/dbuser.h ../lib/dbftn.h sendmail.h mgrutil.h scan.h \ - areamgr.h -atoul.o: atoul.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h atoul.h -backalias.o: backalias.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ../lib/dbcfg.h backalias.h -bread.o: bread.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h bread.h -bwrite.o: bwrite.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h bwrite.h -cookie.o: cookie.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h cookie.h -echoout.o: echoout.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h \ - echoout.h -fflist.o: fflist.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/clcomm.h ../lib/msg.h fflist.h -filefind.o: filefind.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \ - ../lib/msgtext.h fflist.h filefind.h msgutil.h -filemgr.o: filemgr.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \ - ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h \ - ../lib/dbuser.h ../lib/dbftn.h sendmail.h mgrutil.h filemgr.h -flock.o: flock.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/clcomm.h flock.h -forward.o: forward.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbtic.h \ - tic.h cookie.h sendmail.h rollover.h forward.h -fsort.o: fsort.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/clcomm.h fsort.h -grlist.o: grlist.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/clcomm.h grlist.h -hash.o: hash.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h hash.h lhash.h -hatch.o: hatch.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbtic.h utic.h \ - rollover.h hatch.h -importmsg.o: importmsg.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \ - ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbdupe.h \ - ../lib/dbuser.h ../lib/dbftn.h echoout.h mkrfcmsg.h importmsg.h \ - postnetmail.h rollover.h -importnet.o: importnet.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \ - ../lib/dbmsgs.h ../lib/dbuser.h rollover.h importnet.h -lhash.o: lhash.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/clcomm.h lhash.h -magic.o: magic.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbtic.h tic.h utic.h \ - magic.h -makestat.o: makestat.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h makestat.h -maketags.o: maketags.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h maketags.h -mbaff.o: mbaff.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \ - announce.h filefind.h mbaff.h -mbdiff.o: mbdiff.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbdiff.h -mbfido.o: mbfido.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h \ - ../lib/dbdupe.h ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbmsgs.h \ - ../lib/dbuser.h ../lib/dbftn.h ../lib/dbtic.h ../lib/msg.h \ - flock.h tosspkt.h pack.h ulock.h tic.h fsort.h scan.h mbfido.h \ - tracker.h notify.h rollover.h hatch.h scannews.h maketags.h \ - makestat.h newspost.h rnews.h backalias.h -mbfile.o: mbfile.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbfile.h -mbindex.o: mbindex.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbftn.h \ - mbindex.h -mbmail.o: mbmail.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbftn.h ../lib/dbcfg.h \ - ../lib/dbnode.h ../lib/dbmsgs.h ../lib/dbuser.h hash.h \ - mkftnhdr.h message.h -mbmsg.o: mbmsg.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/dbcfg.h \ - post.h mbmsg.h -mbseq.o: mbseq.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbseq.h -message.o: message.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/dbuser.h \ - bread.h bwrite.h hash.h mkftnhdr.h tracker.h viadate.h \ - importnet.h -mgrutil.o: mgrutil.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h sendmail.h \ - mgrutil.h -mkftnhdr.o: mkftnhdr.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h atoul.h hash.h \ - aliasdb.h mkftnhdr.h -mkrfcmsg.o: mkrfcmsg.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/dbftn.h ../lib/dbdupe.h ../lib/dbuser.h ../lib/common.h \ - ../lib/clcomm.h rollover.h aliasdb.h postemail.h backalias.h \ - mkrfcmsg.h -mover.o: mover.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h tic.h mover.h -msgutil.o: msgutil.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \ - ../lib/msgtext.h msgutil.h -newspost.o: newspost.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h newspost.h -notify.o: notify.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \ - ../lib/dbnode.h filemgr.h areamgr.h sendmail.h notify.h -pack.o: pack.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/dbftn.h ../lib/clcomm.h ../lib/dbnode.h \ - pack.h -ping.o: ping.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/msg.h ../lib/msgtext.h \ - ../lib/dbcfg.h ../lib/dbnode.h ../lib/dbtic.h ../lib/dbdupe.h \ - ../lib/dbuser.h ../lib/dbftn.h sendmail.h mgrutil.h \ - postnetmail.h ping.h -post.o: post.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h ../lib/msg.h \ - ../lib/msgtext.h post.h -postemail.o: postemail.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/dbuser.h ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h \ - postemail.h -postnetmail.o: postnetmail.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/dbcfg.h ../lib/dbuser.h ../lib/dbnode.h ../lib/dbftn.h \ - ../lib/common.h ../lib/clcomm.h tracker.h addpkt.h importnet.h \ - mkrfcmsg.h areamgr.h filemgr.h ping.h postemail.h -ptic.o: ptic.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/dbtic.h ../lib/clcomm.h ../lib/dbnode.h \ - ../lib/dbdupe.h ulock.h mover.h toberep.h tic.h utic.h addbbs.h \ - magic.h forward.h rollover.h ptic.h -rnews.o: rnews.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h \ - ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h \ - pack.h scannews.h mbfido.h rnews.h -rollover.o: rollover.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h rollover.h -scan.o: scan.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/msg.h ../lib/clcomm.h ../lib/msgtext.h \ - ../lib/dbnode.h ../lib/dbmsgs.h addpkt.h pack.h tracker.h \ - mkrfcmsg.h postemail.h scan.h -scannews.o: scannews.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/mbinet.h ../lib/dbdupe.h \ - ../lib/dbnode.h ../lib/dbmsgs.h ../lib/msg.h ../lib/msgtext.h \ - mkftnhdr.h hash.h echoout.h rollover.h pack.h scannews.h -sendmail.o: sendmail.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/dbnode.h ../lib/clcomm.h ../lib/dbmsgs.h \ - addpkt.h rollover.h sendmail.h -tic.o: tic.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/dbftn.h ../lib/clcomm.h ulock.h ptic.h \ - fsort.h pack.h tic.h -toberep.o: toberep.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h tic.h toberep.h -tosspkt.o: tosspkt.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h importmsg.h \ - tosspkt.h -tracker.o: tracker.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbnode.h ../lib/dbftn.h \ - tracker.h -ulock.o: ulock.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h flock.h ulock.h -utic.o: utic.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h tic.h mover.h utic.h -viadate.o: viadate.c ../lib/libs.h ../lib/../config.h paths.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - viadate.h +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp info-am: info: info-recursive dvi-am: @@ -620,23 +430,24 @@ distclean-generic: maintainer-clean-generic: mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic + mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive -clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ - mostlyclean-am +clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ - distclean-generic clean-am + distclean-depend distclean-generic clean-am distclean: distclean-recursive maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am + maintainer-clean-depend maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -651,27 +462,29 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck \ -install-exec-local install-exec-am install-exec install-data-am \ -install-data install-am install uninstall-am uninstall all-redirect \ -all-am all installdirs-am installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-local install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean install-exec-local: $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbfido $(bindir) - $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbmail $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbseq $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbaff $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbindex $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbdiff $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbfile $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbmsg $(bindir) + rm -f $(bindir)/mbmail + ln -s $(bindir)/mbfido $(bindir)/mbmail rm -f $(bindir)/mbnews ln -s $(bindir)/mbfido $(bindir)/mbnews - (cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; chown mbse.bbs etc/maptabs/*) + (cd ${exec_prefix}; tar xfz @PACKAGE@-@VERSION@/mbfido/maptabs.tgz; $(CHOWN) @OWNER@.@GROUP@ etc/maptabs/*) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/mbfido/README b/mbfido/README index 35615030..7c8a95b8 100644 --- a/mbfido/README +++ b/mbfido/README @@ -13,4 +13,9 @@ | |--> mkrfcmsg --> postemail +---------------+ + +---------------+ + FTN | |--> Outbound + ------->| postecho |--> MsgBase + | |--> mkrfcmsg --> spool --> newspost + +---------------+ diff --git a/mbfido/addpkt.c b/mbfido/addpkt.c index e02e7f15..99ed58d3 100644 --- a/mbfido/addpkt.c +++ b/mbfido/addpkt.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/addpkt.c * Purpose ...............: Add mail to .pkt - * Last modification date : 02-Jun-2001 + * Last modification date : 31-Jul-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -198,8 +198,10 @@ int AddMsgHdr(FILE *fp, faddr *f, faddr *t, int flags, int cost, time_t date, ch if ((tname == NULL) || (strlen(tname) > 36) || (fname == NULL) || (strlen(fname) > 36) || - (subj == NULL) || (strlen(subj) > 72)) + (subj == NULL) || (strlen(subj) > 72)) { + WriteError("AddMsgHdr() error in To name, From name or Subject field"); return 1; + } buffer[0x00] = 2; buffer[0x01] = 0; diff --git a/mbfido/areamgr.c b/mbfido/areamgr.c index e7be7e70..9128c0de 100644 --- a/mbfido/areamgr.c +++ b/mbfido/areamgr.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/areamgr.c * Purpose ...............: AreaMgr - * Last modification date : 11-Mar-2001 + * Last modification date : 31-Jul-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -67,8 +67,6 @@ extern int echo_imp; /* Echomail imported */ extern int echo_out; /* Echomail forwarded */ extern int echo_bad; /* Bad echomail */ extern int echo_dupe; /* Dupe echomail */ -extern char *subj; /* Message subject */ -extern char *msgid; /* Original message id */ int areamgr = 0; /* Nr of AreaMgr messages */ int a_help = FALSE; @@ -81,14 +79,14 @@ unsigned long a_msgs = 0; -void A_Help(faddr *); -void A_Help(faddr *t) +void A_Help(faddr *, char *); +void A_Help(faddr *t, char *replyid) { FILE *fp; Syslog('+', "AreaMgr: Help"); - if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr help", msgid)) != NULL) { + if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr help", replyid)) != NULL) { fprintf(fp, "Address all requests to '%s' (without quotes)\r", (char *)"Areamgr"); fprintf(fp, "Youre AreaMgr password goes on the subject line.\r\r"); @@ -136,8 +134,8 @@ void A_Help(faddr *t) -void A_Query(faddr *); -void A_Query(faddr *t) +void A_Query(faddr *, char *); +void A_Query(faddr *t, char *replyid) { FILE *qp, *gp, *mp; char *temp, *Group; @@ -149,7 +147,7 @@ void A_Query(faddr *t) Syslog('+', "AreaMgr: Query"); f = bestaka_s(t); - if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your query request", msgid)) != NULL) { + if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your query request", replyid)) != NULL) { temp = calloc(128, sizeof(char)); @@ -243,7 +241,7 @@ void A_Query(faddr *t) -void A_List(faddr *t, int Notify) +void A_List(faddr *t, char *replyid, int Notify) { FILE *qp, *gp, *mp; char *temp, *Group; @@ -258,7 +256,7 @@ void A_List(faddr *t, int Notify) Syslog('+', "AreaMgr: List"); f = bestaka_s(t); - if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr List", msgid)) != NULL) { + if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr List", replyid)) != NULL) { WriteMailGroups(qp, f); temp = calloc(128, sizeof(char)); @@ -350,7 +348,7 @@ void A_List(faddr *t, int Notify) -void A_Flow(faddr *t, int Notify) +void A_Flow(faddr *t, char *replyid, int Notify) { FILE *qp, *gp, *mp; char *temp, *Group; @@ -377,7 +375,7 @@ void A_Flow(faddr *t, int Notify) Syslog('+', "AreaMgr: Flow report"); f = bestaka_s(t); - if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr Flow report", msgid)) != NULL) { + if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr Flow report", replyid)) != NULL) { temp = calloc(128, sizeof(char)); @@ -464,8 +462,8 @@ void A_Flow(faddr *t, int Notify) -void A_Status(faddr *); -void A_Status(faddr *t) +void A_Status(faddr *, char *); +void A_Status(faddr *t, char *replyid) { FILE *fp; int i; @@ -476,7 +474,7 @@ void A_Status(faddr *t) else i = Miy - 1; - if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr status", msgid)) != NULL) { + if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"AreaMgr status", replyid)) != NULL) { fprintf(fp, "Here is your (echo)mail status:\r\r"); @@ -504,8 +502,8 @@ void A_Status(faddr *t) -void A_Unlinked(faddr *); -void A_Unlinked(faddr *t) +void A_Unlinked(faddr *, char *); +void A_Unlinked(faddr *t, char *replyid) { FILE *qp, *gp, *mp; char *temp, *Group; @@ -517,7 +515,7 @@ void A_Unlinked(faddr *t) Syslog('+', "AreaMgr: Unlinked"); f = bestaka_s(t); - if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your unlinked request", msgid)) != NULL) { + if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your unlinked request", replyid)) != NULL) { WriteMailGroups(qp, f); temp = calloc(128, sizeof(char)); @@ -944,7 +942,7 @@ void A_Msgs(char *Buf, int skip) -int AreaMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp) +int AreaMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int flags, FILE *fp) { int i, rc = 0, spaces; char *Buf; @@ -1057,7 +1055,7 @@ int AreaMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp) * create a response netmail about what we did. */ if (ftell(tmp)) { - if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your AreaMgr request", msgid)) != NULL) { + if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Areamgr", (char *)"Your AreaMgr request", replyid)) != NULL) { fprintf(np, " Dear %s\r\r", nodes.Sysop); fprintf(np, "Here is the result of your AreaMgr request:\r\r"); @@ -1081,22 +1079,22 @@ int AreaMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp) fclose(tmp); if (a_stat) - A_Status(f); + A_Status(f, replyid); if (a_query) - A_Query(f); + A_Query(f, replyid); if (a_list) - A_List(f, FALSE); + A_List(f, replyid, FALSE); if (a_flow) - A_Flow(f, FALSE); + A_Flow(f, replyid, FALSE); if (a_unlnk) - A_Unlinked(f); + A_Unlinked(f, replyid); if (a_help) - A_Help(f); + A_Help(f, replyid); return rc; } diff --git a/mbfido/areamgr.h b/mbfido/areamgr.h index caef8df0..50b24568 100644 --- a/mbfido/areamgr.h +++ b/mbfido/areamgr.h @@ -2,10 +2,10 @@ #define _AREAMGR_H -void A_Status(faddr *); -void A_List(faddr *, int); -void A_Flow(faddr *, int); -int AreaMgr(faddr *, faddr *, time_t, int, FILE *); +void A_Status(faddr *, char *); +void A_List(faddr *, char *, int); +void A_Flow(faddr *, char *, int); +int AreaMgr(faddr *, faddr *, char *, char *, time_t, int, FILE *); #endif diff --git a/mbfido/filefind.c b/mbfido/filefind.c index 6c4183a3..e31ee2cf 100644 --- a/mbfido/filefind.c +++ b/mbfido/filefind.c @@ -2,10 +2,10 @@ * * File ..................: mbaff/filefind.c * Purpose ...............: Announce new files and FileFind - * Last modification date : 25-Aug-2000 + * Last modification date : 10-Aug-2001 * ***************************************************************************** - * Copyright (C) 1997-2000 + * Copyright (C) 1997-2001 * * Michiel Broek FIDO: 2:280/2802 * Beekmansbos 10 @@ -192,7 +192,7 @@ int StartReply(ff_list *ffl) * Start message text including kludges */ Msg_Id(scanmgr.Aka); - sprintf(temp, "\001REPLYID: %s", ffl->msgid); + sprintf(temp, "\001REPLY: %s", ffl->msgid); MsgText_Add2(temp); Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp)); Msg_Pid(); @@ -408,7 +408,8 @@ void ScanFiles(ff_list *tmp) if (!strcmp(rft->filename, file.Name)) break; fclose(pFile); - sprintf(temp, "%-12s %5lu Kb. %s", tu(file.Name), file.Size / 1024, To_Low(file.Desc[0],scanmgr.HiAscii)); + sprintf(temp, "%-12s %5lu Kb. %s", tu(file.Name), (long)(file.Size / 1024), + To_Low(file.Desc[0],scanmgr.HiAscii)); MsgText_Add2(temp); /* diff --git a/mbfido/filemgr.c b/mbfido/filemgr.c index 5c33e4b5..97347b7b 100644 --- a/mbfido/filemgr.c +++ b/mbfido/filemgr.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/filemgr.c * Purpose ...............: FileMgr - * Last modification date : 11-Mar-2001 + * Last modification date : 31-Jul-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -66,8 +66,6 @@ extern int echo_imp; /* Echomail imported */ extern int echo_out; /* Echomail forwarded */ extern int echo_bad; /* Bad fileecho */ extern int echo_dupe; /* Dupe fileecho */ -extern char *subj; /* Message subject */ -extern char *msgid; /* Original message id */ int filemgr = 0; /* Nr of FileMgr messages */ int f_help = FALSE; @@ -78,14 +76,14 @@ int f_unlnk = FALSE; -void F_Help(faddr *); -void F_Help(faddr *t) +void F_Help(faddr *, char *); +void F_Help(faddr *t, char *replyid) { FILE *fp; Syslog('+', "FileMgr: Help"); - if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr help", msgid)) != NULL) { + if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr help", replyid)) != NULL) { fprintf(fp, "Address all requests to '%s' (without quotes)\r", (char *)"Filemgr"); fprintf(fp, "Youre FileMgr password goes on the subject line.\r\r"); @@ -134,8 +132,8 @@ void F_Help(faddr *t) -void F_Query(faddr *); -void F_Query(faddr *t) +void F_Query(faddr *, char *); +void F_Query(faddr *t, char *replyid) { FILE *qp, *gp, *fp; char *temp, *Group; @@ -147,7 +145,7 @@ void F_Query(faddr *t) Syslog('+', "FileMgr: Query"); f = bestaka_s(t); - if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your query request", msgid)) != NULL) { + if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your query request", replyid)) != NULL) { temp = calloc(128, sizeof(char)); @@ -237,7 +235,7 @@ void F_Query(faddr *t) -void F_List(faddr *t, int Notify) +void F_List(faddr *t, char *replyid, int Notify) { FILE *qp, *gp, *fp; char *temp, *Group; @@ -252,7 +250,7 @@ void F_List(faddr *t, int Notify) Syslog('+', "FileMgr: List"); f = bestaka_s(t); - if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr List", msgid)) != NULL) { + if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr List", replyid)) != NULL) { WriteFileGroups(qp, f); temp = calloc(128, sizeof(char)); @@ -340,8 +338,8 @@ void F_List(faddr *t, int Notify) -void F_Status(faddr *); -void F_Status(faddr *t) +void F_Status(faddr *, char *); +void F_Status(faddr *t, char *replyid) { FILE *fp; int i; @@ -352,7 +350,7 @@ void F_Status(faddr *t) else i = Miy - 1; - if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr Status", msgid)) != NULL) { + if ((fp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"FileMgr Status", replyid)) != NULL) { fprintf(fp, "Here is your fileecho status:\r\r"); @@ -389,8 +387,8 @@ void F_Status(faddr *t) -void F_Unlinked(faddr *); -void F_Unlinked(faddr *t) +void F_Unlinked(faddr *, char *); +void F_Unlinked(faddr *t, char *replyid) { FILE *qp, *gp, *fp; char *temp, *Group; @@ -402,7 +400,7 @@ void F_Unlinked(faddr *t) Syslog('+', "FileMgr: Unlinked"); f = bestaka_s(t); - if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your unlinked request", msgid)) != NULL) { + if ((qp = SendMgrMail(t, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your unlinked request", replyid)) != NULL) { temp = calloc(128, sizeof(char)); @@ -823,7 +821,7 @@ void F_Tick(faddr *t, char *Buf, FILE *tmp) -int FileMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp) +int FileMgr(faddr *f, faddr *t, char *replyid, char *subj, time_t mdate, int flags, FILE *fp) { int i, rc = 0, spaces; char *Buf; @@ -930,7 +928,7 @@ int FileMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp) } if (ftell(tmp)) { - if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your FileMgr request", msgid)) != NULL) { + if ((np = SendMgrMail(f, CFG.ct_KeepMgr, FALSE, (char *)"Filemgr", (char *)"Your FileMgr request", replyid)) != NULL) { fprintf(np, " Dear %s\r\r", nodes.Sysop); fprintf(np, "Here is the result of your FileMgr request:\r\r"); @@ -954,19 +952,19 @@ int FileMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp) fclose(tmp); if (f_stat) - F_Status(f); + F_Status(f, replyid); if (f_query) - F_Query(f); + F_Query(f, replyid); if (f_list) - F_List(f, FALSE); + F_List(f, replyid, FALSE); if (f_unlnk) - F_Unlinked(f); + F_Unlinked(f, replyid); if (f_help) - F_Help(f); + F_Help(f, replyid); return rc; } diff --git a/mbfido/filemgr.h b/mbfido/filemgr.h index 306c2079..4bcf2f85 100644 --- a/mbfido/filemgr.h +++ b/mbfido/filemgr.h @@ -2,9 +2,9 @@ #define _FILEMGR_H -void F_Status(faddr *); -void F_List(faddr *, int); -int FileMgr(faddr *, faddr *, time_t, int, FILE *); +void F_Status(faddr *, char *); +void F_List(faddr *, char *, int); +int FileMgr(faddr *, faddr *, char *, char *, time_t, int, FILE *); #endif diff --git a/mbfido/forward.c b/mbfido/forward.c index 8e8a6376..e8e2c735 100644 --- a/mbfido/forward.c +++ b/mbfido/forward.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/forward.c * Purpose ...............: File forward to a node - * Last modification date : 11-Mar-2001 + * Last modification date : 10-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -133,7 +133,7 @@ void ForwardFile(fidoaddr Node, fa_list *sbl) fprintf(net, "File : %s\r", TIC.TicIn.OrgName); fprintf(net, "Description : %s\r", TIC.TicIn.Desc); fprintf(net, "Area : %s %s\r", TIC.TicIn.Area, TIC.TicIn.AreaDesc); - fprintf(net, "Size : %ld\r", TIC.FileSize); + fprintf(net, "Size : %ld\r", (long)(TIC.FileSize)); fprintf(net, "CRC : %s\r", TIC.TicIn.Crc); fprintf(net, "Origin : %s\r", TIC.TicIn.Origin); if (strlen(TIC.TicIn.Magic)) diff --git a/mbfido/mbfido.c b/mbfido/mbfido.c index 9806abc6..b6d4159a 100644 --- a/mbfido/mbfido.c +++ b/mbfido/mbfido.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/mbfido.c * Purpose ...............: Process Fidonet style mail and files. - * Last modification date : 10-Jul-2001 + * Last modification date : 14-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -61,6 +61,7 @@ #include "newspost.h" #include "rnews.h" #include "backalias.h" +#include "rfc2ftn.h" #define UNPACK_FACTOR 300 @@ -77,6 +78,7 @@ int do_stat = FALSE; /* Create statistic HTML pages */ int do_test = FALSE; /* Test routing */ int do_news = FALSE; /* Process NNTP news */ int do_uucp = FALSE; /* Process UUCP newsbatch */ +int do_mail = FALSE; /* Process MTA email message */ int do_unsec = FALSE; /* Unsecure tossing */ int do_learn = FALSE; /* News articles learnmode */ int check_crc = TRUE; /* Check .tic crc values */ @@ -115,6 +117,7 @@ void Help(void) colour(9, 0); printf(" Commands are:\n\n"); colour(3, 0); + printf(" m mail ... MTA Mail mode\n"); printf(" ne news Scan for new news\n"); printf(" no notify Send notify messages\n"); printf(" r roll Rollover statistic counters\n"); @@ -246,9 +249,13 @@ void die(int onsig) int main(int argc, char **argv) { int i, Loop; - char *p, *cmd, Options[81]; + char *p, *cmd, *temp, Options[81]; struct passwd *pw; struct tm *t; + fa_list **envrecip, *envrecip_start = NULL; + faddr *taddr; + int envrecip_count = 0; + FILE *ofp; #ifdef MEMWATCH mwInit(); @@ -256,9 +263,11 @@ int main(int argc, char **argv) /* * The next trick is to supply a fake environment variable - * MBSE_ROOT in case we are started from UUCP. + * MBSE_ROOT in case we are started from UUCP or the MTA. * this will setup the variable so InitConfig() will work. * The /etc/passwd must point to the correct homedirectory. + * Some programs can't set uid to mbse, so mbfido is installed + * setuid mbse. */ if (getenv("MBSE_ROOT") == NULL) { pw = getpwuid(getuid()); @@ -310,7 +319,11 @@ int main(int argc, char **argv) p++; else p = argv[0]; - if (!strcmp(p, "mbnews")) { + if (!strcmp(p, "mbmail")) { + do_quiet = TRUE; + do_mail = TRUE; + cmd = xstrcpy((char *)"Cmd: mbmail"); + } else if (!strcmp(p, "mbnews")) { do_quiet = TRUE; do_uucp = TRUE; cmd = xstrcpy((char *)"Cmd: mbnews"); @@ -320,9 +333,10 @@ int main(int argc, char **argv) cmd = xstrcpy((char *)"Cmd: mbfido"); } + envrecip = &envrecip_start; for (i = 1; i < argc; i++) { cmd = xstrcat(cmd, (char *)" "); - cmd = xstrcat(cmd, tl(argv[i])); + cmd = xstrcat(cmd, argv[i]); if (strncmp(tl(argv[i]), "ne", 2) == 0) do_news = TRUE; @@ -338,36 +352,52 @@ int main(int argc, char **argv) } if (strncmp(tl(argv[i]), "r", 1) == 0) do_roll = TRUE; - if (strncmp(tl(argv[i]), "s", 1) == 0) + else if (strncmp(tl(argv[i]), "s", 1) == 0) do_scan = TRUE; - if (strncmp(tl(argv[i]), "ta", 2) == 0) + else if (strncmp(tl(argv[i]), "ta", 2) == 0) do_tags = TRUE; - if (strncmp(tl(argv[i]), "ti", 2) == 0) + else if (strncmp(tl(argv[i]), "ti", 2) == 0) do_tic = TRUE; - if (strncmp(tl(argv[i]), "te", 2) == 0) + else if (strncmp(tl(argv[i]), "te", 2) == 0) do_test = TRUE; - if (strncmp(tl(argv[i]), "to", 2) == 0) + else if (strncmp(tl(argv[i]), "to", 2) == 0) do_toss = TRUE; - if (strncmp(tl(argv[i]), "u", 1) == 0) + else if (strncmp(tl(argv[i]), "u", 1) == 0) do_uucp = TRUE; - if (strncmp(tl(argv[i]), "w", 1) == 0) + else if (strncmp(tl(argv[i]), "m", 1) == 0) + do_mail = TRUE; + else if (strncmp(tl(argv[i]), "w", 1) == 0) do_stat = TRUE; - if (strncmp(tl(argv[i]), "-a", 2) == 0) + else if (strncmp(tl(argv[i]), "-a", 2) == 0) autocrea = TRUE; - if (strncmp(tl(argv[i]), "-f", 2) == 0) + else if (strncmp(tl(argv[i]), "-f", 2) == 0) do_full = TRUE; - if (strncmp(tl(argv[i]), "-l", 2) == 0) + else if (strncmp(tl(argv[i]), "-l", 2) == 0) do_learn = TRUE; - if (strncmp(tl(argv[i]), "-noc", 4) == 0) + else if (strncmp(tl(argv[i]), "-noc", 4) == 0) check_crc = FALSE; - if (strncmp(tl(argv[i]), "-nod", 4) == 0) + else if (strncmp(tl(argv[i]), "-nod", 4) == 0) check_dupe = FALSE; - if (strncmp(tl(argv[i]), "-q", 2) == 0) + else if (strncmp(tl(argv[i]), "-q", 2) == 0) do_quiet = TRUE; - if (strncmp(tl(argv[i]), "-unp", 4) == 0) + else if (strncmp(tl(argv[i]), "-unp", 4) == 0) do_unprot = TRUE; - if (strncmp(tl(argv[i]), "-uns", 4) == 0) + else if (strncmp(tl(argv[i]), "-uns", 4) == 0) do_unsec = TRUE; + else if (do_mail) { + /* + * Possible recipient address(es). + */ + if ((taddr = parsefaddr(argv[i]))) { + (*envrecip) = (fa_list*)malloc(sizeof(fa_list)); + (*envrecip)->next = NULL; + (*envrecip)->addr = taddr; + envrecip = &((*envrecip)->next); + envrecip_count++; + } else { + cmd = strcat(cmd, (char *)" <- unparsable recipient! "); + } + } } ProgName(); @@ -384,10 +414,11 @@ int main(int argc, char **argv) die(101); if (lockunpack()) - die(0); + die(101); if (initnl()) die(101); - Rollover(); + if (!do_mail && !do_uucp) + Rollover(); if (!do_quiet) printf("\n"); @@ -396,10 +427,36 @@ int main(int argc, char **argv) */ cmd = calloc(PATH_MAX, sizeof(char)); sprintf(cmd, "%s/etc/aliases", getenv("MBSE_ROOT")); - if ((do_news || do_scan || do_toss) && file_exist(cmd, R_OK) == 0) + if ((do_news || do_scan || do_toss || do_mail) && file_exist(cmd, R_OK) == 0) readalias(cmd); free(cmd); + if (do_mail) { + if (!envrecip_count) { + WriteError("No valid receipients specified, aborting"); + die(105); + } + + umask(066); + if ((ofp = tmpfile()) == NULL) { + WriteError("$Can't open tmpfile for RFC message"); + die(104); + } + temp = calloc(10240, sizeof(char)); + while (fgets(temp, 10240, stdin)) + fprintf(ofp, temp); + free(temp); + + for (envrecip = &envrecip_start; *envrecip; envrecip = &((*envrecip)->next)) { + Syslog('+', "Message to: %s", ascfnode((*envrecip)->addr, 0x7f)); + rfc2ftn(ofp, (*envrecip)->addr); + } + + fclose(ofp); + packmail(); + die(0); + } + if (do_notify) if (Notify(Options)) packmail(); @@ -410,8 +467,6 @@ int main(int argc, char **argv) * Hatch new files and process .tic files * until nothing left to do. */ - if (!diskfree(CFG.freespace)) - die(101); Loop = TRUE; do { Hatch(); @@ -446,7 +501,7 @@ int main(int argc, char **argv) if (do_stat) MakeStat(); if (do_uucp) - NewsUUCP(FALSE); + NewsUUCP(); die(0); return 0; } @@ -625,8 +680,7 @@ int TossPkts(void) } free(inbound); - if (diskfree(CFG.freespace)) - packmail(); + packmail(); return maxrc; } diff --git a/mbfido/mbindex.c b/mbfido/mbindex.c index 0c4569ac..9b0a8f82 100644 --- a/mbfido/mbindex.c +++ b/mbfido/mbindex.c @@ -2,7 +2,7 @@ * * File ..................: mbindex.c * Purpose ...............: Nodelist Compiler - * Last modification date : 25-May-2001 + * Last modification date : 08-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -628,20 +628,22 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n *q++ = '\0'; } if ((strlen(p) == 3) && (!strcmp(p, "300"))) { - if ((strstr(q, (char *)"X75")) || - (strstr(q, (char *)"V110L")) || - (strstr(q, (char *)"V110H")) || - (strstr(q, (char *)"V120L")) || - (strstr(q, (char *)"V120H")) || - (strstr(q, (char *)"ISDN"))) - ndx.pflag |= NL_ISDN; - if ((strstr(q, (char *)"IFC")) || - (strstr(q, (char *)"IBN")) || - (strstr(q, (char *)"ITN")) || - (strstr(q, (char *)"IVM")) || - (strstr(q, (char *)"IFT")) || - (strstr(q, (char *)"IP"))) - ndx.pflag |= NL_TCPIP; + if (q != NULL) { + if ((strstr(q, (char *)"X75")) || + (strstr(q, (char *)"V110L")) || + (strstr(q, (char *)"V110H")) || + (strstr(q, (char *)"V120L")) || + (strstr(q, (char *)"V120H")) || + (strstr(q, (char *)"ISDN"))) + ndx.pflag |= NL_ISDN; + if ((strstr(q, (char *)"IFC")) || + (strstr(q, (char *)"IBN")) || + (strstr(q, (char *)"ITN")) || + (strstr(q, (char *)"IVM")) || + (strstr(q, (char *)"IFT")) || + (strstr(q, (char *)"IP"))) + ndx.pflag |= NL_TCPIP; + } } Syslog('S',"put: %u:%u/%u.%u reg %u upl %u/%u typ %u flg %02X as (%u,%lu)", diff --git a/mbfido/message.c b/mbfido/message.c index 7c8e4123..c87221b8 100644 --- a/mbfido/message.c +++ b/mbfido/message.c @@ -2,7 +2,7 @@ * * File ..................: mbmail/message.c * Purpose ...............: MBSE BBS Mail Gate - * Last modification date : 02-May-2001 + * Last modification date : 27-Jul-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -54,7 +54,7 @@ #include "mkftnhdr.h" #include "tracker.h" #include "viadate.h" -#include "importnet.h" +#include "storenet.h" #define MAXHDRSIZE 2048 @@ -458,7 +458,7 @@ int putmessage(rfcmsg *msg, ftnmsg *fmsg, FILE *fp, faddr *route, char flavor,fa if (TrackMail(Dest, &Route) == R_LOCAL) { /* * Mail for our local system. Instead of adding the message to a .pkt create - * a temporary file which later will be send via the importnet function. + * a temporary file which later will be send via the storenet function. */ postlocal = TRUE; pkt = tmpfile(); @@ -856,9 +856,9 @@ int putmessage(rfcmsg *msg, ftnmsg *fmsg, FILE *fp, faddr *route, char flavor,fa fmsg->to->name = xstrcpy(CFG.sysop_name); } if (SearchUser(fmsg->to->name)) { - Syslog('m', "importnet(%s, %s, %s, %04x)", ascfnode(fmsg->from,0x7f), + Syslog('m', "storenet(%s, %s, %s, %04x)", ascfnode(fmsg->from,0x7f), ascfnode(fmsg->to,0x7f), ftndate(fmsg->date), fmsg->flags); - if (importnet(fmsg->from, fmsg->to, fmsg->date, fmsg->flags, pkt)) + if (storenet(fmsg->from, fmsg->to, fmsg->date, fmsg->flags, fmsg->subj, fmsg->msgid_a, fmsg->reply_a, pkt)) return 2; } else { WriteError("Unknown bbs user"); diff --git a/mbfido/mkftnhdr.c b/mbfido/mkftnhdr.c index 074c2ac5..8dffc2ed 100644 --- a/mbfido/mkftnhdr.c +++ b/mbfido/mkftnhdr.c @@ -2,7 +2,7 @@ * * File ..................: mbmail/mkftnhdr.c * Purpose ...............: MBSE BBS Mail Gate - * Last modification date : 25-Mar-2001 + * Last modification date : 14-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -206,7 +206,7 @@ int ftnmsgid(char *msgid, char **s, unsigned long *n, char *areaname) -ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode) +ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode, faddr *recipient) { char *freename = NULL, *rfcfrom = NULL, *p, *q, *l, *r; char *fbuf = NULL; @@ -228,8 +228,10 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode) p = xstrcpy(hdr((char *)"X-Fidonet-Comment-To",msg)); if (p == NULL) p = xstrcpy(hdr((char *)"X-Apparently-To",msg)); + if (p == NULL) + p = xstrcpy(hdr((char *)"To", msg)); /* 14-Aug-2001 MB */ if (p) { - Syslog('N', "getting `to' address from: \"%s\"",p); + Syslog('n', "getting `to' address from: \"%s\"",p); if ((tmsg->to = parsefaddr(p)) == NULL) tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0"); if ((l = strrchr(p,'<')) && (r = strchr(p,'>')) && (l < r)) { @@ -271,10 +273,55 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode) tmsg->to->name=xstrcpy(l); } free(p); - } else - tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0"); - Syslog('n', "TO: %s",ascinode(tmsg->to,0x7f)); - } + /* + * It will become echomail, the destination FTN address must + * be our address. 14-Aug-2001 MB. + */ + tmsg->to->zone = msgs.Aka.zone; + tmsg->to->net = msgs.Aka.net; + tmsg->to->node = msgs.Aka.node; + tmsg->to->point = msgs.Aka.point; + tmsg->to->domain = xstrcpy(msgs.Aka.domain); + } else { + Syslog('n', "Filling default To: address"); + tmsg->to = (faddr*)malloc(sizeof(faddr)); + tmsg->to->name = xstrcpy((char *)"All"); + tmsg->to->zone = msgs.Aka.zone; + tmsg->to->net = msgs.Aka.net; + tmsg->to->node = msgs.Aka.node; + tmsg->to->point = msgs.Aka.point; + tmsg->to->domain = xstrcpy(msgs.Aka.domain); + } + Syslog('n', "TO: %s",ascfnode(tmsg->to,0xff)); + } else { + if (recipient) { + /* + * In mbmail mode the recipient is valid and must be used + * as the destination address. The To: field is probably + * an RFC address an cannot be used to route the message. + */ + tmsg->to = (faddr *)malloc(sizeof(faddr)); + tmsg->to->point = recipient->point; + tmsg->to->node = recipient->node; + tmsg->to->net = recipient->net; + tmsg->to->zone = recipient->zone; + tmsg->to->name = xstrcpy(recipient->name); + if (tmsg->to->name && (strlen(tmsg->to->name) > MAXNAME)) + tmsg->to->name[MAXNAME]='\0'; + tmsg->to->domain = xstrcpy(recipient->domain); + Syslog('m', "Recipient TO: %s", ascfnode(tmsg->to,0xff)); + } else { + p = xstrcpy(hdr((char *)"To",msg)); + if (p == NULL) + p = xstrcpy(hdr((char *)"X-Apparently-To",msg)); + if (p) { + if ((tmsg->to = parsefaddr(p)) == NULL) + WriteError("Unparsable destination address"); + else + Syslog('m', "RFC parsed TO: %s",ascfnode(tmsg->to,0xff)); + } + } + } /* else (newsmode) */ p = fbuf = xstrcpy(hdr((char *)"Reply-To", msg)); if (fbuf == NULL) @@ -376,9 +423,12 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode) Syslog('m', "From address was%s distinguished as ftn", tmsg->from ? "" : " not"); - /* FIXME: received email from an Unix mailer comes here as well, only the From address is set. - The msgs.Aka next is not valid. */ - if ((tmsg->from == NULL) && ((bestaka = bestaka_s(fido2faddr(msgs.Aka))))) { + if (newsmode) + bestaka = bestaka_s(fido2faddr(msgs.Aka)); + else + bestaka = bestaka_s(tmsg->to); + + if ((tmsg->from == NULL) && (bestaka)) { if (CFG.dontregate) { p = xstrcpy(hdr((char *)"X-FTN-Sender",msg)); if (p == NULL) { @@ -522,7 +572,10 @@ ftnmsg *mkftnhdr(rfcmsg *msg, int incode, int outcode, int newsmode) Syslog('m', "DATE: %s, MSGID: %s %lx, REPLY: %s %lx", ftndate(tmsg->date), MBSE_SS(tmsg->msgid_a),tmsg->msgid_n, MBSE_SS(tmsg->reply_a),tmsg->reply_n); - if ((p = hdr((char *)"Organization",msg))) { + p = hdr((char *)"Organization",msg); + if (p == NULL) + p = hdr((char *)"Organisation",msg); + if (p) { while (isspace(*p)) p++; tmsg->origin = xstrcpy(hdrconv(p, incode, outcode)); diff --git a/mbfido/mkftnhdr.h b/mbfido/mkftnhdr.h index ad06c554..c84d42e1 100644 --- a/mbfido/mkftnhdr.h +++ b/mbfido/mkftnhdr.h @@ -3,7 +3,7 @@ int ftnmsgid(char *,char **,unsigned long *,char *); -ftnmsg *mkftnhdr(rfcmsg *, int, int, int); +ftnmsg *mkftnhdr(rfcmsg *, int, int, int, faddr *); #endif diff --git a/mbfido/notify.c b/mbfido/notify.c index 9ddeadc9..b7ea8d8b 100644 --- a/mbfido/notify.c +++ b/mbfido/notify.c @@ -140,12 +140,12 @@ int Notify(char *Options) } if (i == 0) { - F_Status(fido2faddr(nodes.Aka[i])); - A_Status(fido2faddr(nodes.Aka[i])); + F_Status(fido2faddr(nodes.Aka[i]), NULL); + A_Status(fido2faddr(nodes.Aka[i]), NULL); } - F_List(fido2faddr(nodes.Aka[i]), TRUE); - A_List(fido2faddr(nodes.Aka[i]), TRUE); - A_Flow(fido2faddr(nodes.Aka[i]), TRUE); + F_List(fido2faddr(nodes.Aka[i]), NULL, TRUE); + A_List(fido2faddr(nodes.Aka[i]), NULL, TRUE); + A_Flow(fido2faddr(nodes.Aka[i]), NULL, TRUE); notify++; } } diff --git a/mbfido/pack.c b/mbfido/pack.c index 19cf1417..b55b5606 100644 --- a/mbfido/pack.c +++ b/mbfido/pack.c @@ -2,7 +2,7 @@ * * File ..................: tosser/pack.c * Purpose ...............: Pack mail - * Last modification date : 11-Mar-2001 + * Last modification date : 05-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -370,6 +370,9 @@ void packmail() struct dirent *de; DIR *dp; + if (!diskfree(CFG.freespace)) + return; + IsDoing("Packing mail"); if (!do_quiet) { colour(9, 0); diff --git a/mbfido/ping.c b/mbfido/ping.c index ad6a41a6..98a2b721 100644 --- a/mbfido/ping.c +++ b/mbfido/ping.c @@ -62,7 +62,6 @@ extern int do_quiet; extern int net_in; /* Netmails received */ extern int net_out; /* Netmails forwarded */ extern int net_bad; /* Bad netmails (tracking errors */ -extern char *subj; /* Message subject */ extern char *msgid; /* Original message id */ diff --git a/mbfido/postnetmail.c b/mbfido/postnetmail.c index b0448f33..7f75a11f 100644 --- a/mbfido/postnetmail.c +++ b/mbfido/postnetmail.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/postnetmail.c * Purpose ...............: Post Netmail message from temp file - * Last modification date : 21-Jun-2001 + * Last modification date : 03-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -40,8 +40,8 @@ #include "../lib/clcomm.h" #include "tracker.h" #include "addpkt.h" -#include "importnet.h" -#include "mkrfcmsg.h" +#include "storenet.h" +#include "ftn2rfc.h" #include "areamgr.h" #include "filemgr.h" #include "ping.h" @@ -64,15 +64,16 @@ extern int most_debug; /* Headvy debugging flag */ * Post netmail message for temp file. The tempfile is an FTN style message. * * 0 - All seems well. - * 1 - Something went wrong. + * 1 - Can't access messagebase. + * 2 - Can't find netmail board. * */ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t mdate, int flags, int DoPing) { - char *p, *reply = NULL; - char name[36], *buf; + char *p, *msgid = NULL, *reply = NULL; + char name[36], *buf, *l, *r, *q; char System[36], ext[4]; - int result = 1, email = FALSE; + int result = 1, email = FALSE, fmpt = 0, topt = 0; faddr *ta, *ra; fidoaddr na, route, Orig; FILE *sfp, *net; @@ -84,6 +85,124 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t Syslog('m', "Post netmail subj: %s", MBSE_SS(subject)); net_in++; + /* + * Extract MSGID and REPLY kludges from this netmail. + */ + buf = calloc(2048, sizeof(char)); + rewind(fp); + while ((fgets(buf, 2048, fp)) != NULL) { + Striplf(buf); + Syslogp('m', printable(buf, 0)); + if (!strncmp(buf, "\001MSGID: ", 8)) { + msgid = xstrcpy(buf + 8); + /* + * Extra test to see if the mail comes from a pointaddress. + */ + l = strtok(buf," \n"); + l = strtok(NULL," \n"); + if ((ta = parsefnode(l))) { + if (ta->zone == f->zone && ta->net == f->net && ta->node == f->node && !fmpt && ta->point) { + Syslog('m', "Setting pointinfo (%d) from MSGID", ta->point); + fmpt = f->point = ta->point; + } + tidy_faddr(ta); + } + } + if (!strncmp(buf, "\001FMPT", 5)) { + p = strtok(buf, " \n"); + p = strtok(NULL, " \n"); + fmpt = atoi(p); + } + if (!strncmp(buf, "\001TOPT", 5)) { + p = strtok(buf, " \n"); + p = strtok(NULL, " \n"); + topt = atoi(p); + } + if (!strncmp(buf, "\001REPLY: ", 8)) + reply = xstrcpy(buf + 8); + + /* + * Check DOMAIN and INTL kludges + */ + if (!strncmp(buf, "\001DOMAIN", 7)) { + l = strtok(buf," \n"); + l = strtok(NULL," \n"); + p = strtok(NULL," \n"); + r = strtok(NULL," \n"); + q = strtok(NULL," \n"); + if ((ta = parsefnode(p))) { + t->point = ta->point; + t->node = ta->node; + t->net = ta->net; + t->zone = ta->zone; + tidy_faddr(ta); + } + t->domain = xstrcpy(l); + if ((ta = parsefnode(q))) { + f->point = ta->point; + f->node = ta->node; + f->net = ta->net; + f->zone = ta->zone; + tidy_faddr(ta); + } + f->domain = xstrcpy(r); + } else { + if (!strncmp(buf, "\001INTL", 5)) { + l = strtok(buf," \n"); + l = strtok(NULL," \n"); + r = strtok(NULL," \n"); + if ((ta = parsefnode(l))) { + t->point = ta->point; + t->node = ta->node; + t->net = ta->net; + t->zone = ta->zone; + if (ta->domain) { + if (t->domain) + free(t->domain); + t->domain = ta->domain; + ta->domain = NULL; + } + tidy_faddr(ta); + } + if ((ta = parsefnode(r))) { + f->point = ta->point; + f->node = ta->node; + f->net = ta->net; + f->zone = ta->zone; + if (ta->domain) { + if (f->domain) + free(f->domain); + f->domain = ta->domain; + ta->domain = NULL; + } + tidy_faddr(ta); + } + } + } + + /* + * Check for X-FTN- kludges, this could be gated email. + * This should be impossible. + */ + if (!strncmp(buf, "\001X-FTN-", 7)) { + email = TRUE; + Syslog('?', "Warning: detected ^aX-FTN- kludge in netmail"); + } + } + free(buf); + + /* + * Only set point info if there was any info. + * GoldED doesn't set FMPT and TOPT kludges. + */ + if (fmpt) + f->point = fmpt; + if (topt) + t->point = topt; + + Syslog('m', "Final netmail from: %s", ascfnode(f, 0xff)); + Syslog('m', "Final netmail to : %s", ascfnode(t, 0xff)); + memset(&na, 0, sizeof(na)); na.zone = t->zone; na.net = t->net; @@ -108,12 +227,10 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t if (email) { /* - * Send this netmail via mkrfcmsg -> postemail. + * Send this netmail via ftn2rfc -> postemail. */ - if (reply) - free(reply); most_debug = TRUE; - result = mkrfcmsg(f, t, subject, orig, mdate, flags, fp, 0L, FALSE); + result = ftn2rfc(f, t, subject, orig, mdate, flags, fp); most_debug = FALSE; return result; } @@ -142,18 +259,16 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t while (fread(&servrec, servhdr.recsize, 1, sfp) == 1) { if ((strncasecmp(servrec.Service, name, strlen(servrec.Service)) == 0) && servrec.Active) { switch (servrec.Action) { - case AREAMGR: result = AreaMgr(f, t, mdate, flags, fp); + case AREAMGR: result = AreaMgr(f, t, msgid, subject, mdate, flags, fp); break; - case FILEMGR: result = FileMgr(f, t, mdate, flags, fp); + case FILEMGR: result = FileMgr(f, t, msgid, subject, mdate, flags, fp); break; case EMAIL: most_debug = TRUE; - result = mkrfcmsg(f, t, subject, orig, mdate, flags, fp, 0L, FALSE); + result = ftn2rfc(f, t, subject, orig, mdate, flags, fp); most_debug = FALSE; break; } Syslog('m', "Handled service %s, rc=%d", servrec.Service, result); - if (reply) - free(reply); fclose(sfp); return result; } @@ -174,9 +289,7 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t * Import if one fits. */ if (SearchUser(name)) { - if (reply) - free(reply); - return importnet(f, t, mdate, flags, fp); + return storenet(f, t, mdate, flags, subject, msgid, reply, fp); } Syslog('+', " \"%s\" is not a known BBS user", name); @@ -187,9 +300,9 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t Syslog('+', " Readdress from %s to %s", name, CFG.sysop_name); sprintf(name, "%s", CFG.sysop_name); if (SearchUser(name)) { - return importnet(f, t, mdate, flags, fp); + return storenet(f, t, mdate, flags, subject, msgid, reply, fp); } else { - WriteError("Readdress import failed"); + WriteError("Readdress import failed, sysop doesn't exist. CHECK YOUR SETUP"); return 0; } break; @@ -291,8 +404,6 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t fclose(net); free(buf); net_out++; - if (reply) - free(reply); Syslog('m', "Forward done."); return 0; @@ -303,9 +414,7 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t */ WriteError("No ROUTE for this netmail"); net_bad++; - if (reply) - free(reply); - return importnet(f, t, mdate, flags, fp); + return storenet(f, t, mdate, flags, subject, msgid, reply, fp); break; } diff --git a/mbfido/ptic.c b/mbfido/ptic.c index b74a5df1..cc934feb 100644 --- a/mbfido/ptic.c +++ b/mbfido/ptic.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/ptic.c * Purpose ...............: Process 1 .tic file - * Last modification date : 08-Jul-2001 + * Last modification date : 31-Jul-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -730,7 +730,7 @@ int ProcessTic(fa_list *sbl, char *Realname) if (CFG.akavalid[i] && (tic.Aka.zone == CFG.aka[i].zone) && !((tic.Aka.net == CFG.aka[i].net) && (tic.Aka.node == CFG.aka[i].node))) { sprintf(sbe, "%u:%u/%u", CFG.aka[i].zone, CFG.aka[i].net, CFG.aka[i].node); - fill_list(&sbl, sbe, NULL, FALSE); + fill_list(&sbl, sbe, NULL); } } @@ -743,7 +743,7 @@ int ProcessTic(fa_list *sbl, char *Realname) if (!((TIC.Aka.zone == Link.aka.zone) && (TIC.Aka.net == Link.aka.net) && (TIC.Aka.node == Link.aka.node) && (TIC.Aka.point == Link.aka.point))) { sprintf(sbe, "%u:%u/%u", Link.aka.zone, Link.aka.net, Link.aka.node); - fill_list(&sbl, sbe, NULL, FALSE); + fill_list(&sbl, sbe, NULL); } } } diff --git a/mbfido/rnews.c b/mbfido/rnews.c index b59f12b7..dfc78412 100644 --- a/mbfido/rnews.c +++ b/mbfido/rnews.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/rnews.c * Purpose ...............: rnews function - * Last modification date : 19-Jul-2001 + * Last modification date : 14-Aug-2001 * Remarks ...............: Most of these functions are borrowed from inn. * ***************************************************************************** @@ -42,7 +42,7 @@ #include "../lib/msg.h" #include "../lib/msgtext.h" #include "pack.h" -#include "scannews.h" +#include "rfc2ftn.h" #include "mbfido.h" #include "paths.h" #include "rnews.h" @@ -88,6 +88,8 @@ static HEADER RequiredHeaders[] = { #define ISWHITE(c) ((c) == ' ' || (c) == '\t') #define caseEQn(a, b, n) (strncasecmp((a), (b), (size_t)(n)) == 0) + + /* * External variables */ @@ -95,6 +97,7 @@ extern int do_quiet; extern int most_debug; extern int news_in; extern int news_dupe; +extern int check_dupe; void ProcessOne(FILE *); @@ -109,9 +112,11 @@ const char *HeaderFindMem(const char *Article, const int ArtLen, const char *Hea const char *p; for (p = Article; ; ) { - /* Match first character, then colon, then whitespace (don't + /* + * Match first character, then colon, then whitespace (don't * delete that line -- meet the RFC!) then compare the rest - * of the word. */ + * of the word. + */ if (HeaderLen + 1 < Article + ArtLen - p && p[HeaderLen] == ':' && ISWHITE(p[HeaderLen + 1]) && caseEQn(p, Header, (size_t)HeaderLen)) { p += HeaderLen + 2; @@ -274,7 +279,6 @@ static int Process(char *article) char *id = NULL; FILE *fp; - Syslog('n', "Process article"); /* * Empty article? */ @@ -538,7 +542,7 @@ static int UnpackOne(int *fdp, int *countp) -void NewsUUCP(int unspool) +void NewsUUCP(void) { int fd = STDIN, i, rc; @@ -550,19 +554,11 @@ void NewsUUCP(int unspool) printf("Process UUCP Newsbatch\n"); } - if (unspool) { -// Unspool(); - } else { -// if (!UnpackOne(&fd, &i)) -// Spool(fd); - most_debug = TRUE; - rc = UnpackOne(&fd, &i); - most_debug = FALSE; - Syslog('+', "Batch result=%d", rc); - WaitForChildren(i); - } - - Syslog('+', "End of UUCP batch"); + most_debug = TRUE; + rc = UnpackOne(&fd, &i); + most_debug = FALSE; + WaitForChildren(i); + Syslog('+', "End of UUCP batch, rc=%d", rc); packmail(); if (!do_quiet) @@ -601,7 +597,7 @@ void ProcessOne(FILE *fp) groups[nrofgroups] = xstrcpy(group); nrofgroups++; } else { - Syslog('n', "Newsgroup %s doesn't exist", group); + Syslog('-', "Newsgroup %s doesn't exist", group); } } } @@ -620,19 +616,19 @@ void ProcessOne(FILE *fp) } else if (mbuf == NULL) { WriteError("No valid Message-ID found"); } else { - news_in++; IsDoing("Article %d", (news_in + 1)); for (i = 0; i < nrofgroups; i++) { Syslog('n', "Process %s", groups[i]); p = xstrcpy(mbuf); p = xstrcat(p, groups[i]); crc = str_crc32(p); - if (CheckDupe(crc, D_NEWS, CFG.nntpdupes)) { + if (check_dupe && CheckDupe(crc, D_NEWS, CFG.nntpdupes)) { news_dupe++; + news_in++; Syslog('+', "Duplicate article \"%s\" in group %s", mbuf, groups[i]); } else { if (SearchMsgsNews(groups[i])) { - do_article(fp); + rfc2ftn(fp, NULL); } } free(groups[i]); diff --git a/mbfido/rnews.h b/mbfido/rnews.h index 7f832492..03c8bdd8 100644 --- a/mbfido/rnews.h +++ b/mbfido/rnews.h @@ -13,7 +13,7 @@ #define SMBUF 256 -void NewsUUCP(int); +void NewsUUCP(void); #endif diff --git a/mbfido/scan.c b/mbfido/scan.c index 12792b3a..509f77ab 100644 --- a/mbfido/scan.c +++ b/mbfido/scan.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/scan.h * Purpose ...............: Scan for outgoing mail. - * Last modification date : 01-Jul-2001 + * Last modification date : 13-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -41,7 +41,7 @@ #include "addpkt.h" #include "pack.h" #include "tracker.h" -#include "mkrfcmsg.h" +#include "ftn2rfc.h" #include "postemail.h" #include "scan.h" @@ -52,8 +52,6 @@ extern int net_bad; extern int echo_in; extern int email_out; extern int echo_out; -extern int email_imp; -extern int email_bad; extern int most_debug; int scanned; @@ -252,7 +250,7 @@ void ScanFull() */ if ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS)) { echo_in++; - fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE); + fill_list(&sbl, aka2str(msgs.Aka), NULL); for (i = 0; i < 40; i++) { if (CFG.akavalid[i] && (msgs.Aka.zone == CFG.aka[i].zone) && @@ -260,14 +258,14 @@ void ScanFull() (msgs.Aka.node == CFG.aka[i].node))) { sprintf(sbe, "%u/%u", CFG.aka[i].net, CFG.aka[i].node); - fill_list(&sbl, sbe, NULL, FALSE); + fill_list(&sbl, sbe, NULL); } } fseek(pAreas, sysstart, SEEK_SET); for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) { fread(&Link, sizeof(sysconnect), 1, pAreas); if ((Link.aka.zone) && (Link.sendto) && (!Link.pause)) { - fill_list(&sbl, aka2str(Link.aka), NULL, FALSE); + fill_list(&sbl, aka2str(Link.aka), NULL); } } uniq_list(&sbl); @@ -404,7 +402,7 @@ void ScanOne(char *path, unsigned long MsgNum) */ if (msgs.Type == ECHOMAIL || msgs.Type == NEWS) { echo_in++; - fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE); + fill_list(&sbl, aka2str(msgs.Aka), NULL); for (i = 0; i < 40; i++) { if (CFG.akavalid[i] && (msgs.Aka.zone == CFG.aka[i].zone) && @@ -412,14 +410,14 @@ void ScanOne(char *path, unsigned long MsgNum) (msgs.Aka.node == CFG.aka[i].node))) { sprintf(sbe, "%u/%u", CFG.aka[i].net, CFG.aka[i].node); - fill_list(&sbl, sbe, NULL, FALSE); + fill_list(&sbl, sbe, NULL); } } fseek(pAreas, sysstart, SEEK_SET); for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) { fread(&Link, sizeof(sysconnect), 1, pAreas); if ((Link.aka.zone) && (Link.sendto) && (!Link.pause)) { - fill_list(&sbl, aka2str(Link.aka), NULL, FALSE); + fill_list(&sbl, aka2str(Link.aka), NULL); } } uniq_list(&sbl); @@ -530,8 +528,8 @@ int RescanOne(faddr *L, char *marea, unsigned long Num) while (MsgNum<=Total){ if (Msg_ReadHeader(MsgNum)) { if (Msg_Lock(15L)) { - fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE); - fill_list(&sbl, aka2str(Link.aka), NULL, FALSE); + fill_list(&sbl, aka2str(msgs.Aka), NULL); + fill_list(&sbl, aka2str(Link.aka), NULL); sort_list(&sbl); ExportEcho(Link, MsgNum, &sbl); tidy_falist(&sbl); @@ -753,7 +751,7 @@ void ExportNews(unsigned long MsgNum, fa_list **sbl) rewind(qp); most_debug = TRUE; - mkrfcmsg(from, dest, NULL, NULL, Msg.Written + (gmt_offset((time_t)0) * 60), flags, qp, 0L, FALSE); + ftn2rfc(from, dest, NULL, NULL, Msg.Written + (gmt_offset((time_t)0) * 60), flags, qp); most_debug = FALSE; tidy_faddr(from); fclose(qp); @@ -781,6 +779,26 @@ void ExportNet(unsigned long MsgNum, int UUCPgate) Syslog('m', "Export netmail to %s of %s (%s) %s mode", Msg.To, Msg.ToAddress, (Msg.Crash || Msg.Direct || Msg.FileAttach) ? "Direct" : "Routed", UUCPgate ? "UUCP" : "Netmail"); + /* + * Analyze this message if it contains INTL, FMPT and TOPT kludges + * and check if we need them. If they are missing they are inserted. + * GoldED doesn't insert them but MBSE does. + */ + if (Msg_Read(MsgNum, 78)) { + if ((p = (char *)MsgText_First()) != NULL) { + do { + if (strncmp(p, "\001FMPT", 5) == 0) + is_fmpt = TRUE; + if (strncmp(p, "\001TOPT", 5) == 0) + is_topt = TRUE; + if (strncmp(p, "\001INTL", 5) == 0) + is_intl = TRUE; + if (strncmp(p, "--- ", 4) == 0) + break; + } while ((p = (char *)MsgText_Next()) != NULL); + } + } + /* * Check if this a netmail to our own local UUCP gate. */ @@ -824,6 +842,14 @@ void ExportNet(unsigned long MsgNum, int UUCPgate) fprintf(fp, "Content-Transfer-Encoding: 8bit\n"); fprintf(fp, "X-Mailreader: MBSE BBS %s\r\n", VERSION); + if (msgs.Aka.point && !is_fmpt) + fprintf(fp, "X-FTN-FMPT: %d\r", msgs.Aka.point); + if (Dest.point && !is_topt) + fprintf(fp, "X-FTN-TOPT: %d\r", Dest.point); + if (!is_intl) + fprintf(fp, "X-FTN-INTL: %d:%d/%d %d:%d/%d\r", Dest.zone, Dest.net, Dest.node, + msgs.Aka.zone, msgs.Aka.net, msgs.Aka.node); + if (Msg_Read(MsgNum, 78)) { if ((p = (char *)MsgText_First()) != NULL) { do { @@ -947,25 +973,6 @@ void ExportNet(unsigned long MsgNum, int UUCPgate) return; } - /* - * Analyze this message if it contains INTL, FMPT and TOPT kludges - * and check if we need them. If they are missing they are inserted. - * GoldED doesn't insert them but MBSE does. - */ - if (Msg_Read(MsgNum, 78)) { - if ((p = (char *)MsgText_First()) != NULL) { - do { - if (strncmp(p, "\001FMPT", 5) == 0) - is_fmpt = TRUE; - if (strncmp(p, "\001TOPT", 5) == 0) - is_topt = TRUE; - if (strncmp(p, "\001INTL", 5) == 0) - is_intl = TRUE; - if (strncmp(p, "--- ", 4) == 0) - break; - } while ((p = (char *)MsgText_Next()) != NULL); - } - } if (msgs.Aka.point && !is_fmpt) fprintf(qp, "\001FMPT %d\r", msgs.Aka.point); if (Dest.point && !is_topt) @@ -1077,9 +1084,9 @@ void ExportEmail(unsigned long MsgNum) } rewind(qp); most_debug = TRUE; - retval = mkrfcmsg(from, too, Msg.Subject, NULL, Msg.Written, flags, qp, 0L, TRUE); + retval = ftn2rfc(from, too, Msg.Subject, NULL, Msg.Written, flags, qp); most_debug = FALSE; - Syslog('m', "mkrfcmsg rc=%d", retval); + Syslog('m', "ftn2rfc rc=%d", retval); email_out++; } diff --git a/mbfido/scannews.c b/mbfido/scannews.c index c7fe85d8..3fb3c332 100644 --- a/mbfido/scannews.c +++ b/mbfido/scannews.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/scannews.c * Purpose ...............: Scan for new News - * Last modification date : 01-Jul-2001 + * Last modification date : 04-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -42,9 +42,10 @@ #include "../lib/msgtext.h" #include "mkftnhdr.h" #include "hash.h" -#include "echoout.h" #include "rollover.h" #include "pack.h" +#include "storeecho.h" +#include "rfc2ftn.h" #include "scannews.h" @@ -58,16 +59,6 @@ */ POverview xoverview = NULL; int marker = 0; -static int ftnorigin; -static int removemime; -static int removemsgid; -static int removeref; -static int removeinreply; -static int removesupersedes; -static int removeapproved; -static int removereplyto; -static int removereturnto; -static int dirtyoutcode = CHRS_NOTSET; @@ -84,9 +75,6 @@ extern int echo_out; extern int echo_in; extern char *replyaddr; -extern char *toname; /* To user */ -extern char *fromname; /* From user */ -extern char *subj; /* Message subject */ /* @@ -99,7 +87,7 @@ void tidy_artlist(List **); void fill_artlist(List **, char *, long, int); void Marker(void); int get_article(char *, char *); -int needputrfc(rfcmsg *); + void tidy_artlist(List **fdp) @@ -134,49 +122,6 @@ void fill_artlist(List **fdp, char *id, long nr, int dupe) -/* - * write an arbitrary line to message body, - * if a line starts with three dashes, insert a dash and a blank - */ -int charwrite(char *, FILE *); -int charwrite(char *s, FILE *fp) -{ - if ((strlen(s) >= 3) && (strncmp(s,"---",3) == 0) && (s[3] != '-')) { - putc('-',fp); - putc(' ',fp); - } - while (*s) { - putc(*s, fp); - s++; - } - return 0; -} - - - -/* - * write (multiline) header to kluge: change \n to ' ' and end line with \n - */ -int kludgewrite(char *, FILE *); -int kludgewrite(char *s, FILE *fp) -{ - while (*s) { - if (*s == '\r') - putc('\n', fp); - else { - if (*s != '\n') - putc(*s, fp); - else if (*(s+1)) - putc(' ',fp); - } - s++; - } - putc('\n',fp); - return 0; -} - - - void Marker(void) { if (do_quiet) @@ -397,776 +342,13 @@ int get_article(char *msgid, char *ftntag) news_in++; IsDoing("Article %d", (news_in)); - retval = do_article(fp); + retval = rfc2ftn(fp, NULL); fclose(fp); return retval; } -int do_article(FILE *fp) -{ - char sbe[16], *p, *q, *temp; - int i, incode, outcode, pgpsigned; - int First = TRUE, seenlen, oldnet; - sysconnect Link; - rfcmsg *msg = NULL, *tmsg, *tmp; - ftnmsg *fmsg = NULL; - FILE *ofp; - fa_list *sbl = NULL, *ptl = NULL, *tmpl; - faddr *ta, *From; - unsigned long svmsgid, svreply; - int sot_kludge = FALSE, eot_kludge = FALSE, qp_or_base64 = FALSE, tinyorigin = FALSE; - int needsplit, hdrsize, datasize, splitpart, forbidsplit, rfcheaders; - char newsubj[4 * (MAXSUBJ+1)], *oldsubj, *acup_a = NULL; - unsigned long acup_n = 0, crc2; - int html_message = FALSE; - time_t Now; - - rewind(fp); - msg = parsrfc(fp); - incode = outcode = CHRS_NOTSET; - pgpsigned = FALSE; - - p = hdr((char *)"Content-Type",msg); - if (p) - incode=readcharset(p); - if (incode == CHRS_NOTSET) { - p = hdr((char *)"X-FTN-CHRS",msg); - if (p == NULL) - p = hdr((char *)"X-FTN-CHARSET", msg); - if (p == NULL) - p = hdr((char *)"X-FTN-CODEPAGE", msg); - if (p) - incode = readchrs(p); - } - - if ((p = hdr((char *)"Content-Type",msg)) && ((strcasestr(p,(char *)"multipart/signed")) || - (strcasestr(p,(char *)"application/pgp")))) { - pgpsigned = TRUE; - outcode = incode; - } else if ((p = hdr((char *)"X-FTN-ORIGCHRS", msg))) - outcode = readchrs(p); - else if (dirtyoutcode != CHRS_NOTSET) - outcode = dirtyoutcode; - else - outcode = getoutcode(incode); - for (tmsg = msg; tmsg; tmsg = tmsg->next) - if (strcasecmp(tmsg->key, "X-FTN-SEEN-BY") == 0) - fill_list(&sbl, tmsg->val, NULL, TRUE); - - if (!CFG.allowcontrol) { - if (hdr((char *)"Control",msg)) { - Syslog('n', "skipping news message"); - tidy_falist(&sbl); - tidyrfc(msg); - return RETVAL_OK; - } - } - - if ((fmsg = mkftnhdr(msg, incode, outcode, TRUE)) == NULL) { - WriteError("Unable to create FTN headers from RFC ones, aborting"); - tidy_falist(&sbl); - tidyrfc(msg); - return RETVAL_ERROR; - } - - /* - * Setup PATH line - */ - sprintf(sbe, "%u/%u", msgs.Aka.net, msgs.Aka.node); - fill_path(&ptl, sbe); - fmsg->area = xstrcpy(msgs.Tag); - svmsgid = fmsg->msgid_n; - svreply = fmsg->reply_n; - if ((p = hdr((char *)"Message-ID",msg))) { - ftnmsgid(p, &fmsg->msgid_a, &fmsg->msgid_n, fmsg->area); - hash_update_s(&fmsg->msgid_n, fmsg->area); - } - - if ((p = hdr((char *)"References",msg))) { - p = strrchr(p,' '); - ftnmsgid(p,&fmsg->reply_a, &fmsg->reply_n,fmsg->area); - if (!chkftnmsgid(p)) { - hash_update_s(&fmsg->reply_n, fmsg->area); - } - } else if ((p = hdr((char *)"In-Reply-To",msg))) { - ftnmsgid(p,&fmsg->reply_a, &fmsg->reply_n,fmsg->area); - if (!chkftnmsgid(p)) { - hash_update_s(&fmsg->reply_n, fmsg->area); - } - } - - if (incode == CHRS_NOTSET) - incode = msgs.Rfccode; - if (outcode == CHRS_NOTSET) - outcode = msgs.Ftncode; - if ((incode == CHRS_NOTSET) && (hdr((char *)"Message-ID",msg))) { - if (chkftnmsgid(hdr((char *)"Message-ID",msg))) - incode = CHRS_DEFAULT_FTN; - else - incode = CHRS_DEFAULT_RFC; - } - temp = calloc(4096, sizeof(char)); - removemime = FALSE; - removemsgid = FALSE; - removeref = FALSE; - removeinreply = FALSE; - removesupersedes = FALSE; - removeapproved = FALSE; - removereplyto = TRUE; - removereturnto = TRUE; - ftnorigin = fmsg->ftnorigin; - if ((hdr((char *)"X-PGP-Signed",msg))) - pgpsigned = TRUE; - if (pgpsigned) - Syslog('n', "pgpsigned = %s", pgpsigned ? "True":"False"); - - q = hdr((char *)"Content-Transfer-Encoding",msg); - if (q) - while (*q && isspace(*q)) - q++; - if (!(q)) - q = (char *)"8bit"; - if ((p = hdr((char *)"Content-Type",msg))) { - while (*p && isspace(*p)) - p++; - - /* - * turn the quoted-printable decode mode on; remember FTN is virtually 8-bit clean - */ - if ((strncasecmp(p, "text/plain", 10) == 0) && (strncasecmp(q, "quoted-printable", 16) == 0)) - qp_or_base64 = 1; - /* - * turn the base64 decode mode on - */ - else if ((strncasecmp(p, "text/plain", 10) == 0) && (strncasecmp(q, "base64", 6) == 0)) - qp_or_base64 = 2; - - /* - * text/html support from FSC-HTML 001 proposal of Odinn Sorensen (2:236/77) - */ - if (strncasecmp(p, "text/html", 9) == 0) - html_message = TRUE; - for (tmp = msg; tmp; tmp = tmp->next) - if (((strcasecmp(tmp->key,"X-FTN-KLUDGE") == 0) && (strcasecmp(tmp->val,"FSCHTML") == 0)) || - (strcasecmp(tmp->key,"X-FTN-HTML") == 0)) - html_message = FALSE; - - if ((readcharset(p) != CHRS_NOTSET ) && ((q == NULL) || (strncasecmp(q,"7bit",4) == 0) || - ((!pgpsigned) && (qp_or_base64==1)) || ((!pgpsigned) && (qp_or_base64==2)) || (strncasecmp(q,"8bit",4) == 0))) - removemime=1; /* no need in MIME headers */ - /* - * some old MUA puts "text" instead of "text/plain; charset=..." - */ - else if ((strcasecmp(p,"text\n") == 0)) - removemime = TRUE; - } - if (removemime || qp_or_base64 || html_message) - Syslog('n', "removemime=%s, qp_or_base64 = %d, html_message=%s", removemime ? "True":"False", qp_or_base64, - html_message ? "True":"False"); - - if ((p = hdr((char *)"Message-ID",msg))) { - if (!removemsgid) - removemsgid = chkftnmsgid(p); - } - Syslog('n', "removemsgid = %s", removemsgid ? "True":"False"); - - if ((!removeref) && (p = hdr((char *)"References",msg))) { - p = xstrcpy(p); - q = strtok(p," \t\n"); - if ((q) && (strtok(NULL," \t\n") == NULL)) - removeref = chkftnmsgid(q); - free(p); - } - if (removeref) - Syslog('n', "removeref = %s", removeref ? "True":"False"); - - if ((p = hdr((char *)"Supersedes",msg))) - removesupersedes = chkftnmsgid(p); - if (removesupersedes) - Syslog('n', "removesupersedes = %s", removesupersedes ? "True":"False"); - - if ((p = hdr((char *)"Approved",msg))) { - while (*p && isspace(*p)) - p++; - if ((q = strchr(p,'\n'))) - *q='\0'; - if (strlen(msgs.Moderator) && (strcasestr(msgs.Moderator,p))) - removeapproved = TRUE; - if (q) - *q='\n'; - } - if (removeapproved) - Syslog('n', "removeapproved = %s", removeapproved ? "True":"False"); - - if ((p = hdr((char *)"Reply-To",msg))) { - removereplyto = FALSE; - if ((q = hdr((char *)"From",msg))) { - char *r; - r = xstrcpy(p); - p = r; - while(*p && isspace(*p)) - p++; - if (p[strlen(p)-1] == '\n') - p[strlen(p)-1]='\0'; - if (strcasestr(q,p)) - removereplyto = TRUE; - free(r); - } - } - Syslog('n', "removereplyto = %s", removereplyto ? "True":"False"); - - if ((p = hdr((char *)"Return-Receipt-To",msg))) { - removereturnto = FALSE; - if ((q = hdr((char *)"From",msg))) { - char *r; - - r = xstrcpy(p); - p = r; - while (*p && isspace(*p)) - p++; - if (p[strlen(p)-1] == '\n') - p[strlen(p)-1]='\0'; - if (strcasestr(q,p)) - removereturnto = TRUE; -// free(r); - } - } - if (!removereturnto) - Syslog('n', "removereturnto = %s", removereturnto ? "True":"False"); - - p = ascfnode(fmsg->from,0x1f); - i = 79-11-3-strlen(p); - if (ftnorigin && fmsg->origin && (strlen(fmsg->origin) > i)) { - /* This is a kludge... I don't like it too much. But well, - if this is a message of FTN origin, the original origin (:) - line MUST have been short enough to fit in 79 chars... - So we give it a try. Probably it would be better to keep - the information about the address format from the origin - line in a special X-FTN-... header, but this seems even - less elegant. Any _good_ ideas, anyone? */ - - /* OK, I am keeping this, though if should never be used - al long as X-FTN-Origin is used now */ - - p = ascfnode(fmsg->from,0x0f); - Syslog('n', "checkorigin 3"); - i = 79-11-3-strlen(p); - tinyorigin = TRUE; - } - if (tinyorigin) - Syslog('n', "tinyorigin = %s", tinyorigin ? "True":"False"); - - if ((fmsg->origin) && (strlen(fmsg->origin) > i)) - fmsg->origin[i]='\0'; - forbidsplit = (ftnorigin || (hdr((char *)"X-FTN-Split",msg))); - needsplit = 0; - splitpart = 0; - hdrsize = 20; - hdrsize += (fmsg->subj)?strlen(fmsg->subj):0; - if (fmsg->from) - hdrsize += (fmsg->from->name)?strlen(fmsg->from->name):0; - if (fmsg->to) - hdrsize += (fmsg->to->name)?strlen(fmsg->to->name):0; - do { - Syslog('n', "split loop, splitpart = %d", splitpart); - datasize = 0; - - if (splitpart) { - sprintf(newsubj,"[part %d] ",splitpart+1); - strncat(newsubj,fmsg->subj,MAXSUBJ-strlen(newsubj)); - } else { - strncpy(newsubj,fmsg->subj,MAXSUBJ); - } - strcpy(newsubj, hdrnconv(newsubj, incode, outcode, MAXSUBJ)); - newsubj[MAXSUBJ]='\0'; - - if (splitpart) { - hash_update_n(&fmsg->msgid_n,splitpart); - } - oldsubj = fmsg->subj; - fmsg->subj = newsubj; - - /* - * Create a new temp message in FTN style format - */ - if ((ofp = tmpfile()) == NULL) { - WriteError("$Can't open second tmpfile"); - tidy_falist(&sbl); - tidy_falist(&ptl); - tidyrfc(msg); - return RETVAL_ERROR; - } - fprintf(ofp, "AREA:%s\n", msgs.Tag); - fprintf(ofp, "\001MSGID: %s %08lx\n", MBSE_SS(fmsg->msgid_a),fmsg->msgid_n); - if (fmsg->reply_s) - fprintf(ofp, "\1REPLY: %s\n", fmsg->reply_s); - else if (fmsg->reply_a) - fprintf(ofp, "\1REPLY: %s %08lx\n", fmsg->reply_a, fmsg->reply_n); - Now = time(NULL) - (gmt_offset((time_t)0) * 60); - fprintf(ofp, "\001TZUTC: %s\n", gmtoffset(Now)); - fmsg->subj = oldsubj; - if ((p = hdr((char *)"X-FTN-REPLYADDR",msg))) { - Syslog('n', "replyaddr 1 %s", p); - hdrsize += 10+strlen(p); - fprintf(ofp,"\1REPLYADDR:"); - kludgewrite(p,ofp); - } else if (replyaddr) { - Syslog('n', "replyaddr 2"); - hdrsize += 10+strlen(replyaddr); - fprintf(ofp,"\1REPLYADDR: "); - kludgewrite(replyaddr,ofp); - } - if ((p = hdr((char *)"X-FTN-REPLYTO",msg))) { - hdrsize += 8+strlen(p); - fprintf(ofp,"\1REPLYTO:"); - kludgewrite(p,ofp); - } else if (replyaddr) { - hdrsize += 15; - fprintf(ofp,"\1REPLYTO: %s UUCP\n", aka2str(msgs.Aka)); - } else if ((p = hdr((char *)"Reply-To",msg))) { - if ((ta = parsefaddr(p))) { - if ((q = hdr((char *)"From",msg))) { - if (!strcasestr(q,p)) { - fprintf(ofp,"\1REPLYTO: %s %s\n", ascfnode(ta,0x1f), ta->name); - } - tidy_faddr(ta); - } - } - } - if ((p=strip_flags(hdr((char *)"X-FTN-FLAGS",msg)))) { - hdrsize += 15; - fprintf(ofp,"\1FLAGS:%s\n",p); - free(p); - } - if (!hdr((char *)"X-FTN-PID", msg)) { - p = hdr((char *)"User-Agent", msg); - if (p == NULL) - p = hdr((char *)"X-Newsreader", msg); - if (p == NULL) - p = hdr((char *)"X-Mailer", msg); - if (p) { - hdrsize += 4 + strlen(p); - fprintf(ofp, "\1PID:"); - kludgewrite(p, ofp); - } else { - fprintf(ofp, "\001PID: MBSE-FIDO %s\n", VERSION); - } - } - - hdrsize += 8 + strlen(getchrs(outcode)); - fprintf(ofp, "\001CHRS: %s\n", getchrs(outcode)); - if (html_message) { - hdrsize += 9; - fprintf(ofp, "\1HTML: 5\n"); - } - - if (CFG.allowcontrol && (!hdr((char *)"X-FTN-ACUPDATE",msg)) && (p=hdr((char *)"Control",msg))) { - if (strstr(p,"cancel")) { - ftnmsgid(p,&acup_a,&acup_n,fmsg->area); - if (acup_a) { - hash_update_s(&acup_n,fmsg->area); - hdrsize += 26 + strlen(acup_a); - fprintf(ofp,"\1ACUPDATE: DELETE %s %08lx\n", acup_a,acup_n); - } - } - } - if ((!hdr((char *)"X-FTN-ACUPDATE",msg)) && (p=hdr((char *)"Supersedes",msg))) { - ftnmsgid(p,&acup_a,&acup_n,fmsg->area); - if (acup_a) { - hash_update_s(&acup_n,fmsg->area); - hdrsize += 26 + strlen(acup_a); - fprintf(ofp,"\1ACUPDATE: MODIFY %s %08lx\n", acup_a,acup_n); - } - } -#ifdef FSC_0070 - /* FSC-0070 */ - if((p = hdr((char *)"Message-ID", msg)) && !(hdr((char *)"X-FTN-RFCID", msg))) { - q = strdup(p); - fprintf(ofp,"\1RFCID:"); - if ((l = strrchr(q, '<')) && (r = strchr(q, '>')) && (l < r)) { - *l++ = ' '; - while(*l && isspace(*l)) - l++; - l--; /* leading ' ' */ - *r-- = '\0'; - while(*r && isspace(*r)) - *r-- = '\0'; - } else - l = q; - kludgewrite(l, ofp); - hdrsize += 6 + strlen(l); - free(q); - } -#endif /* FSC_0070 */ - - if (!(hdr((char *)"X-FTN-Tearline", msg)) && !(hdr((char *)"X-FTN-TID", msg))) { - sprintf(temp, " MBSE-FIDO %s", VERSION); - hdrsize += 4 + strlen(temp); - fprintf(ofp, "\1TID:"); - kludgewrite(temp, ofp); - } - if ((splitpart == 0) || (hdrsize < MAXHDRSIZE)) { - for (tmp = msg; tmp; tmp = tmp->next) { - if ((!strncmp(tmp->key,"X-Fsc-",6)) || - (!strncmp(tmp->key,"X-FTN-",6) && - strcasecmp(tmp->key,"X-FTN-Tearline") && - strcasecmp(tmp->key,"X-FTN-Origin") && - strcasecmp(tmp->key,"X-FTN-Sender") && - strcasecmp(tmp->key,"X-FTN-Split") && - strcasecmp(tmp->key,"X-FTN-FLAGS") && - strcasecmp(tmp->key,"X-FTN-AREA") && - strcasecmp(tmp->key,"X-FTN-MSGID") && - strcasecmp(tmp->key,"X-FTN-REPLY") && - strcasecmp(tmp->key,"X-FTN-SEEN-BY") && - strcasecmp(tmp->key,"X-FTN-PATH") && - strcasecmp(tmp->key,"X-FTN-REPLYADDR") && - strcasecmp(tmp->key,"X-FTN-REPLYTO") && - strcasecmp(tmp->key,"X-FTN-To") && - strcasecmp(tmp->key,"X-FTN-From") && - strcasecmp(tmp->key,"X-FTN-CHARSET") && - strcasecmp(tmp->key,"X-FTN-CHRS") && - strcasecmp(tmp->key,"X-FTN-CODEPAGE") && - strcasecmp(tmp->key,"X-FTN-ORIGCHRS") && - strcasecmp(tmp->key,"X-FTN-SOT") && - strcasecmp(tmp->key,"X-FTN-EOT") && - strcasecmp(tmp->key,"X-FTN-Via"))) { - if ((strcasecmp(tmp->key,"X-FTN-KLUDGE") == 0)) { - if (!strcasecmp(tmp->val," SOT:\n")) - sot_kludge = TRUE; - else if (!strcasecmp(tmp->val," EOT:\n")) - eot_kludge = TRUE; - else { - hdrsize += strlen(tmp->val); - fprintf(ofp,"\1"); - /* we should have restored the original string here... */ - kludgewrite((tmp->val)+1,ofp); - } - } else { - hdrsize += strlen(tmp->key)+strlen(tmp->val); - fprintf(ofp,"\1%s:",tmp->key+6); - kludgewrite(tmp->val,ofp); - } - } - } - /* ZConnect are X-ZC-*: in usenet, \1ZC-*: in FTN */ - for (tmp=msg;tmp;tmp=tmp->next) - if ((!strncmp(tmp->key,"X-ZC-",5))) { - hdrsize += strlen(tmp->key)+strlen(tmp->val); - fprintf(ofp,"\1%s:",tmp->key+2); - kludgewrite(tmp->val,ofp); - } - - /* mondo.org gateway uses ".MSGID: ..." in usenet */ - for (tmp=msg;tmp;tmp=tmp->next) - if ((!strncmp(tmp->key,".",1)) && (strcasecmp(tmp->key,".MSGID"))) { - hdrsize += strlen(tmp->key)+strlen(tmp->val); - fprintf(ofp,"\1%s:",tmp->key+1); - kludgewrite(tmp->val,ofp); - } - rfcheaders=0; - for (tmp = msg; tmp; tmp = tmp->next) { - if ((needputrfc(tmp) == 1)) { - if (strcasestr((char *)"X-Origin-Newsgroups",tmp->key)) { - hdrsize += 10+strlen(tmp->val); - fprintf(ofp,"\1RFC-Newsgroups:"); - } else { - hdrsize += strlen(tmp->key)+strlen(tmp->val); - fprintf(ofp,"\1RFC-%s:",tmp->key); - } - kludgewrite(hdrconv(tmp->val, incode, outcode),ofp); - } - } - - for (tmp=msg;tmp;tmp=tmp->next) { - if ((needputrfc(tmp) > 1)) { - rfcheaders++; - if (strcasestr((char *)"X-Origin-Newsgroups",tmp->key)) { - hdrsize += 10+strlen(tmp->val); - fprintf(ofp,"Newsgroups:"); - } else { - hdrsize += strlen(tmp->key)+strlen(tmp->val); - fprintf(ofp,"%s:",tmp->key); - } - charwrite(hdrconv(tmp->val, incode, outcode),ofp); - } - } - if (rfcheaders) - charwrite((char *)"\n",ofp); - if ((hdr((char *)"X-FTN-SOT",msg)) || (sot_kludge)) - fprintf(ofp,"\1SOT:\n"); - if ((splitpart == 0) && (hdr((char *)"X-PGP-Signed",msg))) - fprintf(ofp,PGP_SIGNED_BEGIN"\n"); - } - if (replyaddr) { -// free(replyaddr); /* Gives SIGSEGV */ - replyaddr = NULL; - } - if (needsplit) { - fprintf(ofp," * Continuation %d of a split message *\n\n", splitpart); - needsplit = FALSE; - } else if ((p=hdr((char *)"X-Body-Start",msg))) { - datasize += strlen(p); - if (qp_or_base64==1) - charwrite(strkconv(qp_decode(p), incode, outcode), ofp); - else if (qp_or_base64==2) - charwrite(strkconv(b64_decode(p), incode, outcode), ofp); - else - charwrite(strkconv(p, incode, outcode), ofp); - } - while (!(needsplit=(!forbidsplit) && (((splitpart && (datasize > (CFG.new_split * 1024))) || - (!splitpart && ((datasize+hdrsize) > (CFG.new_split * 1024)))))) && (bgets(temp,4096-1,fp))) { - datasize += strlen(temp); - if (qp_or_base64==1) - charwrite(strkconv(qp_decode(temp), incode, outcode), ofp); - else if (qp_or_base64==2) - charwrite(strkconv(b64_decode(temp), incode, outcode), ofp); - else - charwrite(strkconv(temp, incode, outcode), ofp); - } - if (needsplit) { - fprintf(ofp,"\n * Message split, to be continued *\n"); - splitpart++; - } else if ((p=hdr((char *)"X-PGP-Signed",msg))) { - fprintf(ofp,PGP_SIG_BEGIN"\n"); - if ((q=hdr((char *)"X-PGP-Version",msg))) { - fprintf(ofp,"Version:"); - charwrite(q,ofp); - } - if ((q=hdr((char *)"X-PGP-Charset",msg))) { - fprintf(ofp,"Charset:"); - charwrite(q,ofp); - } - if ((q=hdr((char *)"X-PGP-Comment",msg))) { - fprintf(ofp,"Comment:"); - charwrite(q,ofp); - } - fprintf(ofp,"\n"); - p=xstrcpy(p); - q=strtok(p," \t\n"); - fprintf(ofp,"%s\n",q); - while ((q=(strtok(NULL," \t\n")))) - fprintf(ofp,"%s\n",q); - fprintf(ofp,PGP_SIG_END"\n"); - } - if ((p=hdr((char *)"X-FTN-EOT",msg)) || (eot_kludge)) - fprintf(ofp,"\1EOT:\n"); - - if ((p=hdr((char *)"X-FTN-Tearline",msg))) { - fprintf(ofp,"---"); - if (strcasecmp(p," (none)\n") == 0) - charwrite((char *)"\n",ofp); - else - charwrite(p,ofp); - } else - fprintf(ofp,"--- MBSE BBSv.%s\n",VERSION); - - if ((p = hdr((char *)"X-FTN-Origin",msg))) { - if (*(q=p+strlen(p)-1) == '\n') - *q='\0'; - fprintf(ofp," * Origin:"); - charwrite(hdrconv(p, incode, outcode),ofp); - } else { - fprintf(ofp," * Origin: "); /* strlen=11 */ - if (fmsg->origin) - charwrite(hdrconv(fmsg->origin, incode, outcode), ofp); - else - charwrite(CFG.origin, ofp); - fprintf(ofp," (%s)", - ascfnode(fmsg->from,tinyorigin?0x0f:0x1f)); - } - /* - * Setup SEEN-BY lines - */ - for (i = 0; i < 40; i++) { - if (CFG.akavalid[i] && (msgs.Aka.zone == CFG.aka[i].zone) && - !((msgs.Aka.net == CFG.aka[i].net) && (msgs.Aka.node == CFG.aka[i].node))) { - sprintf(sbe, "%u/%u", CFG.aka[i].net, CFG.aka[i].node); - fill_list(&sbl, sbe, NULL, FALSE); - } - } - sprintf(sbe, "%u/%u", msgs.Aka.net, msgs.Aka.node); - First = TRUE; - /* - * Count downlinks, if there are none then no more SEEN-BY entries will be added. - */ - i = 0; - while (GetMsgSystem(&Link, First)) { - First = FALSE; - if ((Link.aka.zone) && (Link.sendto) && (!Link.pause) && (!Link.cutoff)) { - sprintf(sbe, "%u/%u", Link.aka.net, Link.aka.node); - fill_list(&sbl, sbe, NULL, FALSE); - i++; - } - } - uniq_list(&sbl); - sort_list(&sbl); - seenlen=MAXSEEN+1; - if (i) { - /* ensure it will not match for the first entry */ - oldnet = sbl->addr->net-1; - for (tmpl = sbl; tmpl; tmpl = tmpl->next) { - if (tmpl->addr->net == oldnet) - sprintf(sbe," %u",tmpl->addr->node); - else - sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node); - oldnet = tmpl->addr->net; - seenlen += strlen(sbe); - if (seenlen > MAXSEEN) { - seenlen = 0; - fprintf(ofp,"\nSEEN-BY:"); - sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node); - seenlen = strlen(sbe); - } - fprintf(ofp,"%s",sbe); - } - } else { - fprintf(ofp,"\nSEEN-BY: %s",sbe); - } - - for (tmp = msg; tmp; tmp = tmp->next) { - if (!strcasecmp(tmp->key,"X-FTN-PATH")) { - fill_path(&ptl,tmp->val); - } - } - sprintf(sbe,"%u/%u",msgs.Aka.net, msgs.Aka.node); - fill_path(&ptl,sbe); - uniq_list(&ptl); - seenlen = MAXPATH+1; - /* ensure it will not match for the first entry */ - oldnet = ptl->addr->net-1; - for (tmpl = ptl; tmpl; tmpl = tmpl->next) { - if (tmpl->addr->net == oldnet) - sprintf(sbe," %u",tmpl->addr->node); - else - sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node); - oldnet = tmpl->addr->net; - seenlen += strlen(sbe); - if (seenlen > MAXPATH) { - seenlen = 0; - fprintf(ofp,"\n\1PATH:"); - sprintf(sbe," %u/%u",tmpl->addr->net, tmpl->addr->node); - seenlen = strlen(sbe); - } - fprintf(ofp,"%s",sbe); - } - fprintf(ofp,"\n"); - - tidy_falist(&ptl); - fflush(ofp); - rewind(ofp); - Syslog('n', "========== Fido start"); - while (fgets(temp, 4096, ofp) != NULL) { - /* - * Only log kludges, skip the body - */ - if ((temp[0] == '\001') || !strncmp(temp, "AREA:", 5) || !strncmp(temp, "SEEN-BY", 7)) { - Striplf(temp); - Syslogp('n', printable(temp, 0)); - } - } - Syslog('n', "========== Fido end"); - - rewind(ofp); - Msg_New(); - - if ((fmsg->to != NULL) && (fmsg->to->name != NULL)) - strcpy(Msg.To, fmsg->to->name); - else - sprintf(Msg.To, "All"); - Syslog('n', "Msg.To: %s", printable(Msg.To, 0)); - toname = xstrcpy(Msg.To); - - if ((fmsg->from != NULL) && (fmsg->from->name != NULL)) { - strcpy(Msg.From, fmsg->from->name); - Syslog('n', "Msg.From: %s", printable(Msg.From, 0)); - fromname = xstrcpy(Msg.From); - } else { - Syslog('n', "Warning: no Msg.From name found"); - } - - strcpy(Msg.Subject, fmsg->subj); - subj = xstrcpy(Msg.Subject); - Msg.Echomail = TRUE; - Msg.Written = fmsg->date; - Msg.Arrived = time(NULL) - (gmt_offset((time_t)0) * 60); - sprintf(Msg.FromAddress, "%s", aka2str(msgs.Aka)); - /* - * These are the only usefull flags in echomail - */ - if ((fmsg->flags & M_PVT) && ((msgs.MsgKinds == BOTH) || (msgs.MsgKinds == PRIVATE))) - Msg.Private = TRUE; - if (fmsg->flags & M_FILE) - Msg.FileAttach = TRUE; - - /* - * Set MSGID and REPLYID crc. - */ - if (fmsg->msgid_a != NULL) { - crc2 = -1; - Msg.MsgIdCRC = upd_crc32(fmsg->msgid_a, crc2, strlen(fmsg->msgid_a)); - } - if (fmsg->reply_a != NULL) { - crc2 = -1; - Msg.ReplyCRC = upd_crc32(fmsg->reply_a, crc2, strlen(fmsg->reply_a)); - } - - if (Msg_Open(msgs.Base)) { - if (Msg_Lock(30L)) { - rewind(ofp); - fgets(temp, 2048, ofp); /* "Eat" the first line AREA:... */ - Msg_Write(ofp); - Msg_AddMsg(); - Msg_UnLock(); - echo_in++; - Syslog('+', "Newsgate %s => %s msg %ld", msgs.Newsgroup, msgs.Tag, Msg.Id); - } - Msg_Close(); - StatAdd(&msgs.Received, 1); - time(&msgs.LastRcvd); - StatAdd(&mgroup.MsgsRcvd, 1); - time(&mgroup.LastDate); - } - - /* - * Now start exporting this echomail. - */ - First = TRUE; - while (GetMsgSystem(&Link, First)) { - First = FALSE; - if ((Link.aka.zone) && (Link.sendto) && (!Link.pause) && (!Link.cutoff)) { - if (SearchNode(Link.aka)) { - StatAdd(&nodes.MailSent, 1L); - UpdateNode(); - SearchNode(Link.aka); - } - echo_out++; - Syslog('n', "Export to %s", aka2str(Link.aka)); - From = fido2faddr(msgs.Aka); - EchoOut(From, Link.aka, ofp, fmsg->flags, 0, fmsg->date); - tidy_faddr(From); - } - } - - free(fromname); - free(toname); - free(subj); - fclose(ofp); - } while (needsplit); - tidy_falist(&sbl); - tidy_falist(&ptl); - free(temp); - news_imp++; - tidyrfc(msg); - tidy_ftnmsg(fmsg); - UpdateMsgs(); - - return RETVAL_OK; -} - - - int get_xover(char *grpname, long startnr, long endnr, List **art) { char cmd[81], *ptr, *ptr2, *resp, *p; @@ -1319,119 +501,3 @@ int get_xoverview(void) } - -int needputrfc(rfcmsg *msg) -{ - faddr *ta; - - /* 0-junk, 1-kludge, 2-pass */ - -// Syslog('M', "needputrfc(%s)", printable(msg->key,0)); - if ((msg->key == NULL) || (strlen(msg->key) == 0)) return 0; - - if (!strcasecmp(msg->key,"X-UUCP-From")) return -1; - if (!strcasecmp(msg->key,"X-Body-Start")) return -1; - if (!strncasecmp(msg->key,".",1)) return 0; - if (!strncasecmp(msg->key,"X-FTN-",6)) return 0; - if (!strncasecmp(msg->key,"X-Fsc-",6)) return 0; - if (!strncasecmp(msg->key,"X-ZC-",5)) return 0; - if (!strcasecmp(msg->key,"X-Gateway")) return 0; - if (!strcasecmp(msg->key,"Path")) return 0; - if (!strcasecmp(msg->key,"Newsgroups")) { - if ((hdr((char *)"X-Origin-Newsgroups",msg))) - return 0; - else if (strstr(msg->val,",")) - return 1; - else - return 0; - } - - if (!strcasecmp(msg->key,"X-Origin-Newsgroups")) { - if (strstr(msg->val,",")) - return 1; - else - return 0; - } - - if (!strcasecmp(msg->key,"Control")) { - if (CFG.allowcontrol) { - if (strstr(msg->val,"cancel")) - return 1; - else - return 0; - } else - return 0; - } - if (!strcasecmp(msg->key,"Return-Path")) return 1; - if (!strcasecmp(msg->key,"Xref")) return 0; - if (!strcasecmp(msg->key,"Approved")) return removeapproved ? -1:2; - if (!strcasecmp(msg->key,"X-URL")) return 0; - if (!strcasecmp(msg->key,"Return-Receipt-To")) return removereturnto? 0:1; - if (!strcasecmp(msg->key,"Notice-Requested-Upon-Delivery-To")) return 0; - if (!strcasecmp(msg->key,"Received")) return 0; - if (!strcasecmp(msg->key,"From")) { - if ((ta = parsefaddr(msg->val))) { - tidy_faddr(ta); - return 0; - } else { - return 2; - } - } - if (!strcasecmp(msg->key,"To")) { - return 0; - } - if (!strcasecmp(msg->key,"Cc")) return 2; - if (!strcasecmp(msg->key,"Bcc")) return 0; - if (!strcasecmp(msg->key,"Reply-To")) { - if ((ta = parsefaddr(msg->val))) { - tidy_faddr(ta); - return -1; - } else - return removereplyto ?0:4; - } - if (!strcasecmp(msg->key,"Lines")) return 0; - if (!strcasecmp(msg->key,"Date")) return 0; - if (!strcasecmp(msg->key,"Subject")) { - if ((msg->val) && (strlen(msg->val) > MAXSUBJ)) - return 2; - else - return 0; - } - if (!strcasecmp(msg->key,"Organization")) return 1; - if (!strcasecmp(msg->key,"Comment-To")) return 0; - if (!strcasecmp(msg->key,"X-Comment-To")) return 0; - if (!strcasecmp(msg->key,"X-Apparently-To")) return 0; - if (!strcasecmp(msg->key,"Apparently-To")) return 0; - if (!strcasecmp(msg->key,"X-Fidonet-Comment-To")) return 0; - if (!strcasecmp(msg->key,"Keywords")) return 2; - if (!strcasecmp(msg->key,"Summary")) return 2; - if (!strcasecmp(msg->key,"MIME-Version")) return removemime ?0:1; - if (!strcasecmp(msg->key,"Content-Type")) return removemime ?0:1; - if (!strcasecmp(msg->key,"Content-Length")) return removemime ?0:1; - if (!strcasecmp(msg->key,"Content-Transfer-Encoding")) return removemime ?0:1; - if (!strcasecmp(msg->key,"Content-Name")) return 2; - if (!strcasecmp(msg->key,"Content-Description")) return 2; - if (!strcasecmp(msg->key,"Message-ID")) return removemsgid ?0:1; - if (!strcasecmp(msg->key,"References")) return removeref ?0:1; - if (!strcasecmp(msg->key,"Supersedes")) return removesupersedes ?0:1; - if (!strcasecmp(msg->key,"Distribution")) return ftnorigin ?0:0; - if (!strcasecmp(msg->key,"X-Newsreader")) return 0; - if (!strcasecmp(msg->key,"X-Mailer")) return 0; - if (!strcasecmp(msg->key,"User-Agent")) return 0; - if (!strncasecmp(msg->key,"NNTP-",5)) return 0; - if (!strncasecmp(msg->key,"X-Trace",7)) return 0; - if (!strncasecmp(msg->key,"X-Complaints",12)) return 0; - if (!strncasecmp(msg->key,"X-MSMail",9)) return 0; - if (!strncasecmp(msg->key,"X-MimeOLE",9)) return 0; - if (!strncasecmp(msg->key,"X-MIME-Autoconverted",20)) return 0; - if (!strcasecmp(msg->key,"X-Origin-Date")) return 0; - if (!strncasecmp(msg->key,"X-PGP-",6)) return 0; - if (!strncasecmp(msg->key,"Resent-",7)) return 0; - if (!strcasecmp(msg->key,"X-Mailing-List")) return 0; - if (!strcasecmp(msg->key,"X-Loop")) return 0; - if (!strcasecmp(msg->key,"Precedence")) return 0; - /*if (!strcasecmp(msg->key,"")) return ;*/ - return 1; -} - - diff --git a/mbfido/scannews.h b/mbfido/scannews.h index 739a8fba..4e6d8f51 100644 --- a/mbfido/scannews.h +++ b/mbfido/scannews.h @@ -32,7 +32,6 @@ enum { RETVAL_ERROR = -1, RETVAL_OK = 0, RETVAL_NOARTICLES, RETVAL_UNEXPECTEDANS void ScanNews(void); -int do_article(FILE *); #endif diff --git a/mbfido/tic.c b/mbfido/tic.c index 422e70e8..c6c2a91f 100644 --- a/mbfido/tic.c +++ b/mbfido/tic.c @@ -2,7 +2,7 @@ * * File ..................: mbfido/tic.c * Purpose ...............: Process .tic files - * Last modification date : 08-Jul-2001 + * Last modification date : 31-Jul-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -311,7 +311,7 @@ int LoadTic(char *inb, char *tfn) } if (strncasecmp(Temp, "seenby ", 7) == 0) { - fill_list(&sbl, Temp+7, NULL, FALSE); + fill_list(&sbl, Temp+7, NULL); Kwd = TRUE; } diff --git a/mbfido/tosspkt.c b/mbfido/tosspkt.c index ef9c36b6..5a68f071 100644 --- a/mbfido/tosspkt.c +++ b/mbfido/tosspkt.c @@ -2,7 +2,7 @@ * * File ..................: tosser/tosspkt.c * Purpose ...............: Toss a single *.pkt file - * Last modification date : 03-Jun-2001 + * Last modification date : 03-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -34,9 +34,18 @@ #include "../lib/records.h" #include "../lib/common.h" #include "../lib/clcomm.h" +#include "../lib/msg.h" +#include "../lib/msgtext.h" +#include "../lib/dbcfg.h" #include "../lib/dbnode.h" -#include "importmsg.h" +#include "../lib/dbmsgs.h" +#include "../lib/dbdupe.h" +#include "../lib/dbuser.h" +#include "../lib/dbftn.h" #include "tosspkt.h" +#include "postnetmail.h" +#include "postecho.h" +#include "rollover.h" @@ -44,6 +53,11 @@ * External declarations */ extern int do_quiet; +extern int do_unsec; +extern int check_dupe; +extern int autocrea; +extern time_t t_start; +extern int most_debug; @@ -68,15 +82,20 @@ int email_in = 0; /* Email received */ int email_imp = 0; /* Email imported */ int email_out = 0; /* Email forwarded */ int email_bad = 0; /* Bad email */ -char *toname = NULL; /* To user */ -char *fromname = NULL; /* From user */ -char *subj = NULL; /* Message subject */ -extern char *msgid; static int at_zero = 0; -char *aread(char *, int, FILE *); + +/* + * Internal prototypes + */ +char *aread(char *, int, FILE *); +int importmsg(faddr *, faddr *, faddr *, char *, char *, time_t, int, int, FILE *); +void autocreate(char *, faddr *); + + + char *aread(char *s, int count, FILE *fp) { int i,c,next; @@ -118,6 +137,220 @@ char *aread(char *s, int count, FILE *fp) +/* + * Import 1 message, forward if needed. + * pkt_from, from, to, subj, orig, mdate, flags, cost, file + * + * 0 - All Seems Well. + * 1 - Can't access messagebase. + * 2 - Cannot open mareas.data + * 3 - Echomail without Origin line. + * 4 - Echomail from unknown node, disconnected node. + * 5 - Locking error. + * + */ +int importmsg(faddr *p_from, faddr *f, faddr *t, char *orig, char *subj, + time_t mdate, int flags, int cost, FILE *fp) +{ + char *buf, *marea = NULL; + int echomail = FALSE, rc = 0, bad = FALSE, Known = FALSE, FirstLine; + sysconnect Link; + + if (CFG.slow_util && do_quiet) + usleep(1); + + memset(&Link, 0, sizeof(Link)); + + /* + * Increase uplink's statistic counter. + */ + Link.aka.zone = p_from->zone; + Link.aka.net = p_from->net; + Link.aka.node = p_from->node; + Link.aka.point = p_from->point; + if (SearchNode(Link.aka)) { + StatAdd(&nodes.MailRcvd, 1); + UpdateNode(); + SearchNode(Link.aka); + Known = TRUE; + } + + buf = calloc(2048, sizeof(char)); + marea = NULL; + + /* + * First read the message for kludges we need. + */ + rewind(fp); + + FirstLine = TRUE; + while ((fgets(buf, 2048, fp)) != NULL) { + + Striplf(buf); + + /* + * Check if message is echomail and if the areas exists. + */ + if (FirstLine && (!strncmp(buf, "AREA:", 5))) { + + marea = xstrcpy(tu(buf + 5)); + + if (orig == NULL) { + Syslog('!', "Echomail without Origin line"); + echo_bad++; + echo_in++; + bad = TRUE; + free(buf); + free(marea); + return 3; + } + + if (!SearchMsgs(marea)) { + WriteError("Unknown echo area %s", marea); + if (autocrea) { + autocreate(marea, p_from); + if (!SearchMsgs(marea)) { + WriteError("Autocreate of area %s failed.", area); + echo_bad++; + echo_in++; + bad = TRUE; + free(marea); + free(buf); + return 4; + } + } else { + echo_bad++; + echo_in++; + bad = TRUE; + free(buf); + free(marea); + return 4; + } + } + echomail = TRUE; + free(marea); + } + if (*buf != '\001') + FirstLine = FALSE; + } /* end of checking kludges */ + + + if (echomail) + rc = postecho(p_from, f, t, orig, subj, mdate, flags, cost, fp, TRUE); + else + rc = postnetmail(fp, f, t, orig, subj, mdate, flags, TRUE); + + free(buf); + return rc; +} + + + +/* + * Create echomail area if it doesn't excist and allowed. + * Contributed by Redy Rodriguez. + */ +void autocreate(char *marea, faddr *p_from) +{ + FILE *pMsgs; + char temp[250]; + int i; + struct _sysconnect syscon; + + if (!SearchMsgs((char *)"DEFAULT")){ + WriteError("Can't find DEFAULT area, can't autocreate:"); + autocrea = FALSE; + return; + } + sprintf(temp, "%s/etc/mareas.data", getenv("MBSE_ROOT")); + if ((pMsgs = fopen(temp, "r+")) == NULL) { + WriteError("$Database error: Can't create %s", temp); + return; + } + strncat(msgs.Name,marea,40-strlen(msgs.Name)); + strncpy(msgs.Tag,marea,50); + strncpy(msgs.QWKname,marea,20); + strncat(msgs.Base,marea,64-strlen(msgs.Base)); + fseek(pMsgs, 0, SEEK_END); + Syslog('+', "Autocreate area %s", marea); + + memset(&syscon, 0, sizeof(syscon)); + syscon.aka.zone = p_from->zone; + syscon.aka.node = p_from->node; + syscon.aka.net = p_from->net; + if (SearchFidonet(p_from->zone)) + strcpy(syscon.aka.domain,fidonet.domain); + else { + WriteError("New area %s from node of unknown zone %d not created.", marea,p_from->zone); + fclose(pMsgs); + return; + } + syscon.sendto = TRUE; + syscon.receivefrom = TRUE; + if (msgs.Aka.zone == 0) { + for (i = 0; i < 40; i++) { + if (CFG.akavalid[i]) { + msgs.Aka.zone=CFG.aka[i].zone; + msgs.Aka.net=CFG.aka[i].net; + msgs.Aka.node=CFG.aka[i].node; + msgs.Aka.point=CFG.aka[i].point; + strcpy(msgs.Aka.domain,CFG.aka[i].domain); + i=40; + } + } + for (i = 0; i < 40; i++) { + if (CFG.akavalid[i] && (strcmp(CFG.aka[i].domain,msgs.Aka.domain)==0)) { + msgs.Aka.zone=CFG.aka[i].zone; + msgs.Aka.net=CFG.aka[i].net; + msgs.Aka.node=CFG.aka[i].node; + msgs.Aka.point=CFG.aka[i].point; + strcpy(msgs.Aka.domain,CFG.aka[i].domain); + i=40; + } + } + for (i = 0; i < 40; i++) { + if ((CFG.akavalid[i]) && (CFG.aka[i].zone == p_from->zone)) { + msgs.Aka.zone=CFG.aka[i].zone; + msgs.Aka.net=CFG.aka[i].net; + msgs.Aka.node=CFG.aka[i].node; + msgs.Aka.point=CFG.aka[i].point; + strcpy(msgs.Aka.domain,CFG.aka[i].domain); + i=40; + } + } + for (i = 0; i < 40; i++) { + if ((CFG.akavalid[i]) && (CFG.aka[i].zone == p_from->zone) && (CFG.aka[i].net == p_from->net)) { + msgs.Aka.zone=CFG.aka[i].zone; + msgs.Aka.net=CFG.aka[i].net; + msgs.Aka.node=CFG.aka[i].node; + msgs.Aka.point=CFG.aka[i].point; + strcpy(msgs.Aka.domain,CFG.aka[i].domain); + i=40; + } + } + for (i = 0; i < 40; i++) { + if ((CFG.akavalid[i]) && (CFG.aka[i].zone == p_from->zone) && + (CFG.aka[i].net == p_from->net) && (CFG.aka[i].node == p_from->node)) { + msgs.Aka.zone=CFG.aka[i].zone; + msgs.Aka.net=CFG.aka[i].net; + msgs.Aka.node=CFG.aka[i].node; + msgs.Aka.point=CFG.aka[i].point; + strcpy(msgs.Aka.domain,CFG.aka[i].domain); + i=40; + } + } + } + fwrite(&msgs, msgshdr.recsize, 1, pMsgs); + fwrite(&syscon, sizeof(syscon), 1, pMsgs); + memset(&syscon, 0, sizeof(syscon)); + for (i = 1 ; i < CFG.toss_systems; i++ ) + fwrite(&syscon, sizeof(syscon), 1, pMsgs); + fclose(pMsgs); + return; +} + + + /* * Toss one packet. * @@ -198,11 +431,8 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) time_t mdate = 0L; FILE *fp; unsigned char buffer[0x0e]; - off_t orig_off; + char *subj = NULL; - subj = NULL; - toname = NULL; - fromname = NULL; result = fread(&buffer, 1, sizeof(buffer), pkt); if (result == 0) { Syslog('m', "Zero bytes message, assume end of pkt"); @@ -259,7 +489,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) if (strlen(buf) > 36) Syslog('!', "to name too long (%d) \"%s\"", strlen(buf), printable(buf, 0)); t.name = xstrcpy(buf); - toname = xstrcpy(buf); if (aread(buf, sizeof(buf)-1, pkt)) { if (*(p=t.name+strlen(t.name)-1) == '\n') *p = '\0'; @@ -272,7 +501,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) if (strlen(buf) > 36) Syslog('!', "from name too long (%d) \"%s\"", strlen(buf), printable(buf, 0)); f.name = xstrcpy(buf); - fromname = xstrcpy(buf); if (aread(buf, sizeof(buf)-1, pkt)) { if (*(p=f.name+strlen(f.name)-1) == '\n') *p = '\0'; @@ -307,7 +535,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) WriteError("$unable to open temporary file"); return 4; } - orig_off = 0L; /* * Read the text from the .pkt file @@ -320,7 +547,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) * Extract info from Origin line if found. */ if (!strncmp(buf," * Origin:",10)) { - orig_off = ftell(fp); p=buf+10; while (*p == ' ') p++; if ((l=strrchr(p,'(')) && (r=strrchr(p,')')) && (l < r)) { @@ -346,7 +572,7 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) } } - rc = importmsg(p_from, &f,&t,orig,mdate,flags,cost,fp,orig_off); + rc = importmsg(p_from, &f,&t,orig,subj,mdate,flags,cost,fp); if (rc) rc+=10; if (rc > maxrc) @@ -370,14 +596,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) free(t.domain); t.domain=NULL; - if (fromname) - free(fromname); - fromname = NULL; - - if (toname) - free(toname); - toname = NULL; - if (subj) free(subj); subj = NULL; @@ -386,10 +604,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to) free(orig); orig = NULL; - if (msgid) - free(msgid); - msgid = NULL; - if (feof(pkt) || ferror(pkt)) { WriteError("Unexpected end of packet"); return 5; diff --git a/mbmon/Makefile.in b/mbmon/Makefile.in index 9cceb016..60ab89f5 100644 --- a/mbmon/Makefile.in +++ b/mbmon/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,7 +71,6 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ SUBDIRS = . noinst_PROGRAMS = mbmon @@ -101,6 +101,7 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best +DEP_FILES = .deps/common.P .deps/mbmon.P .deps/mutil.P SOURCES = $(mbmon_SOURCES) OBJECTS = $(mbmon_OBJECTS) @@ -108,9 +109,9 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps mbmon/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu mbmon/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -124,9 +125,6 @@ distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: -.c.o: - $(COMPILE) -c $< - .s.o: $(COMPILE) -c $< @@ -241,6 +239,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = mbmon distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mbmon/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ @@ -261,13 +264,38 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done -common.o: common.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h common.h -mbmon.o: mbmon.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h common.h mutil.h -mutil.o: mutil.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h common.h mutil.h +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp info-am: info: info-recursive dvi-am: @@ -305,23 +333,24 @@ distclean-generic: maintainer-clean-generic: mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic + mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive -clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ - mostlyclean-am +clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ - distclean-generic clean-am + distclean-depend distclean-generic clean-am distclean: distclean-recursive maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am + maintainer-clean-depend maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -336,13 +365,14 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck \ -install-exec-local install-exec-am install-exec install-data-am \ -install-data install-am install uninstall-am uninstall all-redirect \ -all-am all installdirs-am installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-local install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean install-exec-local: diff --git a/mbmon/common.c b/mbmon/common.c index 2c8d60f1..04732877 100644 --- a/mbmon/common.c +++ b/mbmon/common.c @@ -2,7 +2,7 @@ * * File ..................: mbmon/common.c * Purpose ...............: Common utilities - * Last modification date : 25-May-2001 + * Last modification date : 10-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -39,6 +39,8 @@ unsigned long lcrc = 0, tcrc = 1; /* CRC value of logstring */ int lcnt = 0; /* Same message counter */ static char *pbuff = NULL; static int sock = -1; /* TCP/IP socket */ +int ttyfd; /* Filedescriptor for raw mode */ +struct termios tbufs, tbufsavs; /* Structure for raw mode */ struct sockaddr_un clntaddr; /* Client socket address */ struct sockaddr_un servaddr; /* Server socket address */ @@ -453,26 +455,40 @@ int rawset = FALSE; */ void Setraw() { - if (ioctl(ttyfd, TCGETA, &tbuf) == -1) { - perror("TCGETA Failed"); - exit(1); /* ERROR - could not set get tty ioctl */ + int rc; + + if ((rc = tcgetattr(ttyfd, &tbufs))) { + perror(""); + printf("$tcgetattr(0, save) return %d\n", rc); + exit(1); } - tbufsav = tbuf; - tbuf.c_iflag &= ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON ); +// if (ioctl(ttyfd, TCGETA, &tbuf) == -1) { +// perror("TCGETA Failed"); +// exit(1); /* ERROR - could not set get tty ioctl */ +// } + + tbufsavs = tbufs; + tbufs.c_iflag &= ~(INLCR | ICRNL | ISTRIP | IXON ); /* * Map CRNL modes strip control characters and flow control */ - tbuf.c_oflag &= ~OPOST; /* Don't do ouput character translation */ - tbuf.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */ - tbuf.c_cc[VMIN] = 1; /* Receive 1 character at a time */ - tbuf.c_cc[VTIME] = 0; /* No time limit per character */ + tbufs.c_oflag &= ~OPOST; /* Don't do ouput character translation */ + tbufs.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */ + tbufs.c_cc[VMIN] = 1; /* Receive 1 character at a time */ + tbufs.c_cc[VTIME] = 0; /* No time limit per character */ - if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) { - perror("TCSETAF failed"); - exit(1); /* ERROR - could not set tty ioctl */ + if ((rc = tcsetattr(ttyfd, TCSADRAIN, &tbufs))) { + perror(""); + printf("$tcsetattr(%d, TCSADRAIN, raw) return %d\n", ttyfd, rc); + exit(1); } +// if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) { +// perror("TCSETAF failed"); +// exit(1); /* ERROR - could not set tty ioctl */ +// } + rawset = TRUE; } @@ -483,13 +499,20 @@ void Setraw() */ void Unsetraw() { + int rc; + /* * Only unset the mode if it is set to raw mode */ if (rawset == TRUE) { - if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) { - perror("TCSETAF Normal Failed"); - exit(1); /* ERROR - could not save original tty ioctl */ +// if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) { +// perror("TCSETAF Normal Failed"); +// exit(1); /* ERROR - could not save original tty ioctl */ +// } + if ((rc = tcsetattr(ttyfd, TCSAFLUSH, &tbufsavs))) { + perror(""); + printf("$tcsetattr(%d, TCSAFLUSH, save) return %d\n", ttyfd, rc); + exit(1); } } rawset = FALSE; diff --git a/mbmon/common.h b/mbmon/common.h index 33a2d7b1..204ca9e6 100644 --- a/mbmon/common.h +++ b/mbmon/common.h @@ -59,10 +59,6 @@ extern char SigName[32][16]; -int ttyfd; /* Filedescriptor for raw mode */ -struct termio tbuf, tbufsav; /* Structure for raw mode */ - - void InitClient(char *); void ExitClient(int); void SockS(const char *, ...); diff --git a/mbmon/mbmon.c b/mbmon/mbmon.c index ebb9dae8..3d2773b9 100644 --- a/mbmon/mbmon.c +++ b/mbmon/mbmon.c @@ -2,7 +2,7 @@ * * File ..................: mbmon/mbmon.c * Purpose ...............: Monitor Program - * Last modification date : 29-Jun-2001 + * Last modification date : 11-Aug-2001 * Todo ..................: Trace logfiles * Chat with user via server * @@ -366,7 +366,13 @@ void soft_info(void) { clr_index(); set_color(YELLOW, BLACK); - center_addstr( 7, (char *)"MBSE BBS"); +#ifdef __linux__ + center_addstr( 7, (char *)"MBSE BBS (Linux)"); +#elif __FreeBSD__ + center_addstr( 7, (char *)"MBSE BBS (FreeBSD)"); +#else + center_addstr( 7, (char *)"MBSE BBS (Unknown)"); +#endif set_color(WHITE, BLACK); center_addstr( 9, (char *)"(c) Michiel Broek"); set_color(YELLOW, BLACK); diff --git a/mbmon/mutil.c b/mbmon/mutil.c index bd578c67..655253b9 100644 --- a/mbmon/mutil.c +++ b/mbmon/mutil.c @@ -2,7 +2,7 @@ * * File ..................: mutil.c * Purpose ...............: Utilities - * Last modification date : 25-May-2001 + * Last modification date : 07-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -33,6 +33,8 @@ #include "common.h" #include "mutil.h" +extern int ttyfd; + unsigned char readkey(int y, int x, int fg, int bg) { diff --git a/mbsebbs/Makefile.am b/mbsebbs/Makefile.am index 8fec03e6..c7ca5c29 100644 --- a/mbsebbs/Makefile.am +++ b/mbsebbs/Makefile.am @@ -31,9 +31,9 @@ mbuser_SOURCES = mbuser.c mbuser.h mbuseradd_SOURCES = mbuseradd.c mbuseradd.h mbpasswd_SOURCES = mbpasswd.c commonio.c pwio.c shadowio.c sgetpwent.c \ -xmalloc.c myname.c rad64.c salt.c getdef.c encrypt.c \ +xmalloc.c myname.c rad64.c salt.c getdef.c encrypt.c putpwent.c \ mbpasswd.h commonio.h pwio.h shadowio.h sgetpwent.h \ -xmalloc.h myname.h rad64.h salt.h getdef.h encrypt.h +xmalloc.h myname.h rad64.h salt.h getdef.h encrypt.h putpwent.h mbsebbs_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a mball_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a @@ -45,7 +45,7 @@ mbtoberep_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../ mbuser_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a install-exec-local: - @if [ "$(shell whoami)" != "root" ] ; then \ + @if [ "`id -un`" != "root" ] ; then \ echo; echo " Must be root to install!"; echo; exit 3; \ fi $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 6711 mbsebbs $(bindir) @@ -55,7 +55,7 @@ install-exec-local: $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbfbgen $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbstat $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbtoberep $(bindir) - $(INSTALL) -s -g root -o root -m 6711 mbuser $(bindir) - $(INSTALL) -s -g root -o root -m 6711 mbuseradd $(bindir) - $(INSTALL) -s -g root -o root -m 6711 mbpasswd $(bindir) + $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuser $(bindir) + $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuseradd $(bindir) + $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbpasswd $(bindir) diff --git a/mbsebbs/Makefile.in b/mbsebbs/Makefile.in index 5536c14f..b0f0f435 100644 --- a/mbsebbs/Makefile.in +++ b/mbsebbs/Makefile.in @@ -59,6 +59,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : AWK = @AWK@ CC = @CC@ +CHOWN = @CHOWN@ COMPRESS = @COMPRESS@ GROUP = @GROUP@ GZIP = @GZIP@ @@ -70,7 +71,6 @@ OWNER = @OWNER@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ VERSION = @VERSION@ -YACC = @YACC@ SUBDIRS = . noinst_PROGRAMS = mbsebbs mball mblang mbchat mbfbgen mbstat mbtoberep mbuser mbuseradd mbpasswd @@ -94,7 +94,7 @@ mbuser_SOURCES = mbuser.c mbuser.h mbuseradd_SOURCES = mbuseradd.c mbuseradd.h -mbpasswd_SOURCES = mbpasswd.c commonio.c pwio.c shadowio.c sgetpwent.c xmalloc.c myname.c rad64.c salt.c getdef.c encrypt.c mbpasswd.h commonio.h pwio.h shadowio.h sgetpwent.h xmalloc.h myname.h rad64.h salt.h getdef.h encrypt.h +mbpasswd_SOURCES = mbpasswd.c commonio.c pwio.c shadowio.c sgetpwent.c xmalloc.c myname.c rad64.c salt.c getdef.c encrypt.c putpwent.c mbpasswd.h commonio.h pwio.h shadowio.h sgetpwent.h xmalloc.h myname.h rad64.h salt.h getdef.h encrypt.h putpwent.h mbsebbs_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmbinet.a @@ -157,7 +157,7 @@ mbuseradd_LDADD = $(LDADD) mbuseradd_DEPENDENCIES = mbuseradd_LDFLAGS = mbpasswd_OBJECTS = mbpasswd.o commonio.o pwio.o shadowio.o sgetpwent.o \ -xmalloc.o myname.o rad64.o salt.o getdef.o encrypt.o +xmalloc.o myname.o rad64.o salt.o getdef.o encrypt.o putpwent.o mbpasswd_LDADD = $(LDADD) mbpasswd_DEPENDENCIES = mbpasswd_LDFLAGS = @@ -172,6 +172,19 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best +DEP_FILES = .deps/bank.P .deps/bbslist.P .deps/bye.P .deps/change.P \ +.deps/chat.P .deps/commonio.P .deps/email.P .deps/encrypt.P \ +.deps/exitinfo.P .deps/file.P .deps/filesub.P .deps/fsedit.P \ +.deps/funcs.P .deps/funcs4.P .deps/getdef.P .deps/language.P \ +.deps/lineedit.P .deps/mail.P .deps/mball.P .deps/mbchat.P \ +.deps/mbfbgen.P .deps/mblang.P .deps/mbpasswd.P .deps/mbsebbs.P \ +.deps/mbstat.P .deps/mbtoberep.P .deps/mbuser.P .deps/mbuseradd.P \ +.deps/menu.P .deps/misc.P .deps/msgutil.P .deps/myname.P \ +.deps/newuser.P .deps/nextuser.P .deps/offline.P .deps/oneline.P \ +.deps/page.P .deps/pinfo.P .deps/pop3.P .deps/putpwent.P \ +.deps/pwcheck.P .deps/pwio.P .deps/rad64.P .deps/safe.P .deps/salt.P \ +.deps/sgetpwent.P .deps/shadowio.P .deps/timecheck.P .deps/timeout.P \ +.deps/user.P .deps/xmalloc.P SOURCES = $(mbsebbs_SOURCES) $(mball_SOURCES) $(mblang_SOURCES) $(mbchat_SOURCES) $(mbfbgen_SOURCES) $(mbstat_SOURCES) $(mbtoberep_SOURCES) $(mbuser_SOURCES) $(mbuseradd_SOURCES) $(mbpasswd_SOURCES) OBJECTS = $(mbsebbs_OBJECTS) $(mball_OBJECTS) $(mblang_OBJECTS) $(mbchat_OBJECTS) $(mbfbgen_OBJECTS) $(mbstat_OBJECTS) $(mbtoberep_OBJECTS) $(mbuser_OBJECTS) $(mbuseradd_OBJECTS) $(mbpasswd_OBJECTS) @@ -179,9 +192,9 @@ all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .o .s $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps mbsebbs/Makefile + cd $(top_srcdir) && $(AUTOMAKE) --gnu mbsebbs/Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status @@ -195,9 +208,6 @@ distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: -.c.o: - $(COMPILE) -c $< - .s.o: $(COMPILE) -c $< @@ -348,6 +358,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = mbsebbs distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mbsebbs/Makefile @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ @@ -368,174 +383,38 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done -bank.o: bank.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h \ - ../lib/common.h bank.h funcs4.h language.h funcs.h timeout.h \ - timecheck.h exitinfo.h -bbslist.o: bbslist.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/clcomm.h ../lib/common.h bbslist.h \ - funcs.h funcs4.h language.h -bye.o: bye.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h \ - ../lib/common.h funcs.h language.h bye.h -change.o: change.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h change.h \ - funcs.h funcs4.h language.h misc.h pwcheck.h timeout.h \ - exitinfo.h bye.h -chat.o: chat.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h chat.h funcs.h funcs4.h language.h misc.h \ - exitinfo.h -commonio.o: commonio.c ../config.h commonio.h -email.o: email.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/msgtext.h ../lib/msg.h ../lib/common.h \ - ../lib/clcomm.h ../lib/mbinet.h exitinfo.h language.h mail.h \ - timeout.h msgutil.h funcs4.h email.h -encrypt.o: encrypt.c ../config.h encrypt.h -exitinfo.o: exitinfo.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h funcs.h \ - funcs4.h language.h oneline.h misc.h bye.h timeout.h \ - timecheck.h exitinfo.h -file.o: file.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h filesub.h file.h funcs.h funcs4.h language.h \ - misc.h timeout.h exitinfo.h change.h -filesub.o: filesub.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h filesub.h \ - funcs.h language.h funcs4.h misc.h timeout.h exitinfo.h \ - change.h -fsedit.o: fsedit.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/ansi.h ../lib/common.h ../lib/clcomm.h \ - mail.h funcs4.h language.h timeout.h pinfo.h fsedit.h -funcs.o: funcs.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/msgtext.h ../lib/msg.h \ - ../lib/clcomm.h funcs.h language.h funcs4.h oneline.h misc.h \ - bye.h timeout.h timecheck.h exitinfo.h mail.h email.h -funcs4.o: funcs4.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/clcomm.h ../lib/common.h ../lib/msg.h \ - funcs4.h misc.h timeout.h language.h -getdef.o: getdef.c ../config.h getdef.h -language.o: language.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h funcs4.h \ - language.h -lineedit.o: lineedit.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h mail.h \ - funcs4.h language.h timeout.h lineedit.h -mail.o: mail.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/msgtext.h ../lib/clcomm.h ../lib/msg.h mail.h funcs.h \ - funcs4.h language.h misc.h timeout.h oneline.h exitinfo.h \ - lineedit.h fsedit.h filesub.h msgutil.h pop3.h email.h -mball.o: mball.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/mbse.h \ - ../lib/records.h ../lib/common.h ../lib/dbcfg.h ../lib/clcomm.h \ - mball.h -mbchat.o: mbchat.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/common.h \ - ../lib/clcomm.h -mbfbgen.o: mbfbgen.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h -mblang.o: mblang.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h -mbpasswd.o: mbpasswd.c ../config.h encrypt.h rad64.h myname.h xmalloc.h \ - pwio.h shadowio.h mbpasswd.h -mbsebbs.o: mbsebbs.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h \ - mbsebbs.h user.h funcs.h funcs4.h language.h menu.h misc.h \ - bye.h timeout.h -mbstat.o: mbstat.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbstat.h -mbtoberep.o: mbtoberep.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h -mbuser.o: mbuser.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/records.h \ - ../lib/common.h ../lib/clcomm.h ../lib/dbcfg.h mbuser.h -mbuseradd.o: mbuseradd.c ../config.h mbuseradd.h -menu.o: menu.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h oneline.h mail.h bbslist.h change.h bank.h \ - chat.h file.h funcs.h funcs4.h misc.h nextuser.h safe.h \ - timeout.h menu.h page.h pinfo.h bye.h timecheck.h exitinfo.h \ - language.h offline.h email.h -misc.o: misc.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h \ - ../lib/common.h funcs.h funcs4.h language.h misc.h timeout.h \ - exitinfo.h -msgutil.o: msgutil.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h \ - ../lib/msgtext.h ../lib/msg.h oneline.h msgutil.h -myname.o: myname.c ../config.h -newuser.o: newuser.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/clcomm.h ../lib/common.h funcs4.h \ - pwcheck.h newuser.h language.h timeout.h change.h bye.h -nextuser.o: nextuser.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/ansi.h ../lib/clcomm.h ../lib/common.h \ - nextuser.h funcs.h funcs4.h language.h timeout.h -offline.o: offline.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/structs.h ../lib/mbse.h \ - ../lib/records.h ../lib/bluewave.h ../lib/common.h \ - ../lib/clcomm.h ../lib/msgtext.h ../lib/msg.h mail.h funcs.h \ - funcs4.h language.h file.h filesub.h exitinfo.h timeout.h \ - msgutil.h pop3.h offline.h -oneline.o: oneline.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h oneline.h \ - funcs.h funcs4.h language.h -page.o: page.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h funcs.h funcs4.h chat.h page.h timeout.h mail.h \ - language.h -pinfo.o: pinfo.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h funcs4.h -pop3.o: pop3.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h ../lib/mbinet.h ../lib/msgtext.h ../lib/msg.h \ - msgutil.h pop3.h -pwcheck.o: pwcheck.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h pwcheck.h \ - funcs4.h timeout.h -pwio.o: pwio.c ../config.h sgetpwent.h commonio.h pwio.h -rad64.o: rad64.c ../config.h rad64.h -safe.o: safe.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/clcomm.h \ - ../lib/common.h exitinfo.h funcs.h funcs4.h misc.h safe.h \ - timeout.h language.h -salt.o: salt.c ../config.h rad64.h getdef.h -sgetpwent.o: sgetpwent.c ../config.h sgetpwent.h -shadowio.o: shadowio.c ../config.h commonio.h shadowio.h -timecheck.o: timecheck.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/clcomm.h ../lib/common.h timecheck.h \ - funcs.h funcs4.h misc.h bye.h exitinfo.h language.h -timeout.o: timeout.c ../lib/libs.h ../lib/../config.h \ - ../lib/../lib/memwatch.h ../lib/mbse.h ../lib/structs.h \ - ../lib/records.h ../lib/common.h ../lib/clcomm.h ../lib/msg.h \ - timeout.h funcs.h funcs4.h bye.h filesub.h language.h -user.o: user.c ../lib/libs.h ../lib/../config.h ../lib/../lib/memwatch.h \ - ../lib/mbse.h ../lib/structs.h ../lib/records.h ../lib/common.h \ - ../lib/clcomm.h timeout.h user.h pwcheck.h funcs.h funcs4.h \ - misc.h bye.h file.h mail.h change.h menu.h exitinfo.h \ - language.h offline.h statetbl.h email.h newuser.h -xmalloc.o: xmalloc.c ../config.h xmalloc.h +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp info-am: info: info-recursive dvi-am: @@ -573,23 +452,24 @@ distclean-generic: maintainer-clean-generic: mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ - mostlyclean-tags mostlyclean-generic + mostlyclean-tags mostlyclean-depend mostlyclean-generic mostlyclean: mostlyclean-recursive -clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ - mostlyclean-am +clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ - distclean-generic clean-am + distclean-depend distclean-generic clean-am distclean: distclean-recursive maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-generic distclean-am + maintainer-clean-depend maintainer-clean-generic \ + distclean-am @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." @@ -604,17 +484,18 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck \ -install-exec-local install-exec-am install-exec install-data-am \ -install-data install-am install uninstall-am uninstall all-redirect \ -all-am all installdirs-am installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +distclean-tags clean-tags maintainer-clean-tags distdir \ +mostlyclean-depend distclean-depend clean-depend \ +maintainer-clean-depend info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-local install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean install-exec-local: - @if [ "$(shell whoami)" != "root" ] ; then \ + @if [ "`id -un`" != "root" ] ; then \ echo; echo " Must be root to install!"; echo; exit 3; \ fi $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 6711 mbsebbs $(bindir) @@ -624,9 +505,9 @@ install-exec-local: $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbfbgen $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbstat $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbtoberep $(bindir) - $(INSTALL) -s -g root -o root -m 6711 mbuser $(bindir) - $(INSTALL) -s -g root -o root -m 6711 mbuseradd $(bindir) - $(INSTALL) -s -g root -o root -m 6711 mbpasswd $(bindir) + $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuser $(bindir) + $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuseradd $(bindir) + $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbpasswd $(bindir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/mbsebbs/commonio.c b/mbsebbs/commonio.c index 3c3fa706..51b54faf 100644 --- a/mbsebbs/commonio.c +++ b/mbsebbs/commonio.c @@ -2,7 +2,7 @@ * * File ..................: mbuseradd/commonio.c * Purpose ...............: MBSE BBS Shadow Password Suite - * Last modification date : 07-Feb-2001 + * Last modification date : 09-Aug-2001 * Original Source .......: Shadow Password Suite * Original Copyrioght ...: Julianne Frances Haugh and others. * @@ -50,16 +50,19 @@ #include "commonio.h" /* local function prototypes */ -static int check_link_count (const char *); -static int do_lock_file (const char *, const char *); -static FILE *fopen_set_perms (const char *, const char *, const struct stat *); -static int create_backup (const char *, FILE *); -static void free_linked_list (struct commonio_db *); -static void add_one_entry (struct commonio_db *, struct commonio_entry *); -static int name_is_nis (const char *); -static int write_all (const struct commonio_db *); -static struct commonio_entry *find_entry_by_name (struct commonio_db *, const char *); +static int check_link_count (const char *); +static int do_lock_file (const char *, const char *); +static FILE *fopen_set_perms (const char *, const char *, const struct stat *); +static int create_backup (const char *, FILE *); +static void free_linked_list (struct commonio_db *); +static void add_one_entry (struct commonio_db *, struct commonio_entry *); +static int name_is_nis (const char *); +static int write_all (const struct commonio_db *); +static struct commonio_entry *find_entry_by_name (struct commonio_db *, const char *); +#ifdef HAVE_LCKPWDF +static int lock_count = 0; +#endif static int check_link_count(const char *file) { @@ -142,8 +145,8 @@ static int do_lock_file(const char *file, const char *lock) static FILE *fopen_set_perms(const char *name, const char *mode, const struct stat *sb) { - FILE *fp; - int mask; + FILE *fp; + mode_t mask; mask = umask(0777); fp = fopen(name, mode); @@ -151,14 +154,6 @@ static FILE *fopen_set_perms(const char *name, const char *mode, const struct st if (!fp) return NULL; -#ifdef HAVE_FCHMOD - if (fchmod(fileno(fp), sb->st_mode & 0777)) - goto fail; -#else - if (chmod(name, sb->st_mode & 0777)) - goto fail; -#endif - #ifdef HAVE_FCHOWN if (fchown(fileno(fp), sb->st_uid, sb->st_gid)) goto fail; @@ -166,6 +161,14 @@ static FILE *fopen_set_perms(const char *name, const char *mode, const struct st if (chown(name, sb->st_mode)) goto fail; #endif + +#ifdef HAVE_FCHMOD + if (fchmod(fileno(fp), sb->st_mode & 0664)) + goto fail; +#else + if (chmod(name, sb->st_mode & 0664)) + goto fail; +#endif return fp; fail: @@ -181,7 +184,8 @@ static int create_backup(const char *backup, FILE *fp) struct stat sb; struct utimbuf ub; FILE *bkfp; - int c, mask; + int c; + mode_t mask; if (fstat(fileno(fp), &sb)) return -1; @@ -249,66 +253,71 @@ int commonio_present(const struct commonio_db *db) -int commonio_lock(struct commonio_db *db) +int commonio_lock_nowait(struct commonio_db *db) { - char file[1024]; - char lock[1024]; + char file[1024]; + char lock[1024]; - if (db->locked) - return 1; + if (db->locked) + return 1; - snprintf(file, sizeof file, "%s.%ld", db->filename, (long) getpid()); - snprintf(lock, sizeof lock, "%s.lock", db->filename); - if (do_lock_file(file, lock)) { - db->locked = 1; - return 1; - } - return 0; + snprintf(file, sizeof file, "%s.%ld", db->filename, (long) getpid()); + snprintf(lock, sizeof lock, "%s.lock", db->filename); + if (do_lock_file(file, lock)) { + db->locked = 1; + return 1; + } + return 0; } - -int commonio_lock_first(struct commonio_db *db) +int commonio_lock(struct commonio_db *db) { + int i; + #ifdef HAVE_LCKPWDF - /* - * When locking several files, *_lock_first() is called - * for the first one, and *_lock() for the others. - * If lckpwdf() is available, call it here (it may block - * for up to 15 seconds), and if it succeeds, call - * *_lock() once (no retries, it should always succeed). - */ - - if (lckpwdf() == -1) - return 0; /* failure */ - - if (!commonio_lock(db)) { - ulckpwdf(); - return 0; /* failure */ - } - - return 1; /* success */ -#else - int i; - - /* - * No lckpwdf() - do it the old way. - */ + /* + * only if the system libc has a real lckpwdf() - the one from + * lockpw.c calls us and would cause infinite recursion! + */ + if (db->use_lckpwdf) { + /* + * Call lckpwdf() on the first lock. + * If it succeeds, call *_lock() only once + * (no retries, it should always succeed). + */ + if (lock_count == 0) { + if (lckpwdf() == -1) + return 0; /* failure */ + } + if (!commonio_lock_nowait(db)) { + ulckpwdf(); + return 0; /* failure */ + } + lock_count++; + return 1; /* success */ + } +#endif + /* + * lckpwdf() not used - do it the old way. + */ #ifndef LOCK_TRIES #define LOCK_TRIES 15 #endif - for (i = 1; i < LOCK_TRIES; i++) { - if (commonio_lock(db)) - return 1; /* success */ - sleep(1); - } - - /* - * Retry the last time... - */ - return commonio_lock(db); -#endif /* !HAVE_LCKPWDF */ +#ifndef LOCK_SLEEP +#define LOCK_SLEEP 1 +#endif + for (i = 0; i < LOCK_TRIES; i++) { + if (i > 0) + sleep(LOCK_SLEEP); /* delay between retries */ + if (commonio_lock_nowait(db)) + return 1; /* success */ + /* no unnecessary retries on "permission denied" errors */ + if (geteuid() != 0) + return 0; + } + return 0; /* failure */ } @@ -322,13 +331,24 @@ int commonio_unlock(struct commonio_db *db) if (!commonio_close(db)) return 0; } - if (db->locked) { - db->locked = 0; - snprintf(lock, sizeof lock, "%s.lock", db->filename); - unlink(lock); - return 1; - } - return 0; + if (db->locked) { + /* + * Unlock in reverse order: remove the lock file, + * then call ulckpwdf() (if used) on last unlock. + */ + db->locked = 0; + snprintf(lock, sizeof lock, "%s.lock", db->filename); + unlink(lock); +#ifdef HAVE_LCKPWDF + if (db->use_lckpwdf && lock_count > 0) { + lock_count--; + if (lock_count == 0) + ulckpwdf(); + } +#endif + return 1; + } + return 0; } @@ -508,6 +528,7 @@ int commonio_close(struct commonio_db *db) goto success; } + memset(&sb, 0, sizeof sb); if (db->fp) { if (fstat(fileno(db->fp), &sb)) { fclose(db->fp); diff --git a/mbsebbs/commonio.h b/mbsebbs/commonio.h index 14b98f50..f25a1769 100644 --- a/mbsebbs/commonio.h +++ b/mbsebbs/commonio.h @@ -8,9 +8,9 @@ */ struct commonio_entry { char *line; - int changed; void *entry; /* struct passwd, struct spwd, ... */ struct commonio_entry *prev, *next; + int changed:1; }; @@ -85,7 +85,11 @@ struct commonio_db { /* * Various flags. */ - int changed, isopen, locked, readonly; + int changed:1; + int isopen:1; + int locked:1; + int readonly:1; + int use_lckpwdf:1; }; @@ -93,7 +97,7 @@ struct commonio_db { int commonio_setname (struct commonio_db *, const char *); int commonio_present (const struct commonio_db *); int commonio_lock (struct commonio_db *); -int commonio_lock_first (struct commonio_db *); +int commonio_lock_nowait (struct commonio_db *); int commonio_open (struct commonio_db *, int); const void *commonio_locate (struct commonio_db *, const char *); int commonio_update (struct commonio_db *, const void *); diff --git a/mbsebbs/encrypt.c b/mbsebbs/encrypt.c index f4d4069c..670e2c6d 100644 --- a/mbsebbs/encrypt.c +++ b/mbsebbs/encrypt.c @@ -2,7 +2,7 @@ * * File ..................: mbuseradd/encrypt.c * Purpose ...............: MBSE BBS Shadow Password Suite - * Last modification date : 13-May-2001 + * Last modification date : 09-Aug-2001 * Original Source .......: Shadow Password Suite * Original Copyrioght ...: Julianne Frances Haugh and others. * @@ -63,6 +63,7 @@ #include "../config.h" #include #include +#include #ifdef _XOPEN_CRYPT #include #endif @@ -113,6 +114,10 @@ char *pw_encrypt(const char *clear, const char *salt) for (count = 0;count < 10;count++) { cp = crypt (clear, salt); + if (!cp) { + perror("crypt"); + exit(1); + } if (strlen(cp) != 13) return cp; strcat (cipher, cp + 2); @@ -125,6 +130,15 @@ char *pw_encrypt(const char *clear, const char *salt) } #else cp = crypt (clear, salt); + if (!cp) { + /* + * Single Unix Spec: crypt() may return a null pointer, + * and set errno to indicate an error. The caller doesn't + * expect us to return NULL, so... + */ + perror("crypt"); + exit(1); + } if (strlen(cp) != 13) return cp; /* nonstandard crypt() in libc, better bail out */ strcpy (cipher, cp); diff --git a/mbsebbs/file.c b/mbsebbs/file.c index dab8d70d..789c2470 100644 --- a/mbsebbs/file.c +++ b/mbsebbs/file.c @@ -2,7 +2,7 @@ * * File ..................: bbs/file.c * Purpose ...............: All the file functions. - * Last modification date : 28-Jun-2001 + * Last modification date : 10-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -473,7 +473,7 @@ void File_RawDir(char *OpData) printf("%-20s", dp->d_name); colour(13,0); - printf("%-12ld", statfile.st_size); + printf("%-12ld", (long)(statfile.st_size)); colour(10,0); printf("%-10s\n", StrDateDMY(statfile.st_mtime)); @@ -1354,7 +1354,7 @@ void List_Home() printf("%-20s", dp->d_name); colour(13,0); - printf("%-12ld", statfile.st_size); + printf("%-12ld", (long)(statfile.st_size)); colour(10,0); printf("%s ", StrDateDMY(statfile.st_mtime)); @@ -2098,7 +2098,7 @@ void EditTaglist() Fg--; colour(Fg, 0); - printf(" %8ld", Tag.Size); + printf(" %8ld", (long)(Tag.Size)); Fg--; colour(Fg, 0); diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index 48af87f3..9268c05a 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -2,7 +2,7 @@ * * File ..................: bbs/filesub.c * Purpose ...............: All the file sub functions. - * Last modification date : 28-Jun-2001 + * Last modification date : 09-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -427,9 +427,9 @@ int ShowOneFile() colour(CFG.FilesizeF, CFG.FilesizeB); if(strlen(file.Name) < 25) - printf("%10lu ", file.Size); + printf("%10lu ", (long)(file.Size)); else - printf("%25lu ", file.Size); + printf("%25lu ", (long)(file.Size)); colour(CFG.FiledateF, CFG.FiledateB); printf("%-10s ", StrDateDMY(file.UploadDate)); @@ -813,7 +813,7 @@ int ImportFile(char *fn, int Area, int fileid, time_t iTime, off_t Size) x = atoi(token); Size *= i / x; /* You have */ /* extra download KBytes. */ - printf("%s %ld %s\n", (char *) Language(249), Size / 1024, (char *) Language(250)); + printf("%s %ld %s\n", (char *) Language(249), (long)(Size / 1024), (char *) Language(250)); exitinfo.DownloadKToday += (Size / 1024); Syslog('b', "DownloadKToday %d", exitinfo.DownloadKToday); @@ -891,7 +891,7 @@ int Addfile(char *File, int AreaNum, int fileid) memset(&file, 0, sizeof(file)); strcpy(file.Name, File); - sprintf(temp1,"%ld",statfile.st_size); + sprintf(temp1,"%ld",(long)(statfile.st_size)); file.Size = atoi(temp1); file.FileDate = statfile.st_mtime; strcpy(file.Uploader, exitinfo.sUserName); @@ -998,7 +998,7 @@ int Addfile(char *File, int AreaNum, int fileid) fprintf(pPrivate, "****************************************************"); fprintf(pPrivate, "\nUser : %s", file.Uploader); fprintf(pPrivate, "\nFile : %s", file.Name); - fprintf(pPrivate, "\nSize : %lu", file.Size); + fprintf(pPrivate, "\nSize : %lu", (long)(file.Size)); fprintf(pPrivate, "\nUpload Date : %s\n\n", StrDateDMY(file.UploadDate)); for(i = 0; i < iDesc - 1; i++) diff --git a/mbsebbs/funcs4.c b/mbsebbs/funcs4.c index ee2e7945..43d259f5 100644 --- a/mbsebbs/funcs4.c +++ b/mbsebbs/funcs4.c @@ -2,7 +2,7 @@ * * File ..................: bbs/funcs4.c * Purpose ...............: Misc functions, also for some utils. - * Last modification date : 28-Jun-2001 + * Last modification date : 08-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -834,14 +834,10 @@ int Check4UnixLogin(char *UsersName) struct passwd *pw; while ((pw = getpwent())) { - #ifdef linux - if(strcmp(pw->pw_gecos, UsersName) == 0) { - #else - if(strcmp(pw->pw_comment, UsersName) == 0) { - #endif - UID = pw->pw_uid; - break; - } + if(strcmp(pw->pw_gecos, UsersName) == 0) { + UID = pw->pw_uid; + break; + } } return UID; diff --git a/mbsebbs/getdef.c b/mbsebbs/getdef.c index 6940c34a..54d47e68 100644 --- a/mbsebbs/getdef.c +++ b/mbsebbs/getdef.c @@ -2,7 +2,7 @@ * * File ..................: mbuseradd/getdef.c * Purpose ...............: MBSE BBS Shadow Password Suite - * Last modification date : 27-Jun-2001 + * Last modification date : 09-Aug-2001 * Original Source .......: Shadow Password Suite * Original Copyrioght ...: Julianne Frances Haugh and others. * @@ -78,30 +78,37 @@ struct itemdef { char *value; /* value given, or NULL if no value */ }; + + /* - * This list *must* be sorted by the "name" member. + * This list *must* be sorted by the "name" member. + * It doesn't hurt that there are extra entries here + * that are not known by the system this is running + * on. Missing entries here gives a nasty message to + * new bbs users. */ #define NUMDEFS (sizeof(def_table)/sizeof(def_table[0])) static struct itemdef def_table[] = { { "CHFN_AUTH", NULL }, { "CHFN_RESTRICT", NULL }, + { "CLOSE_SESSIONS", NULL }, { "CONSOLE", NULL }, { "CONSOLE_GROUPS", NULL }, -#ifdef HAVE_LIBCRACK { "CRACKLIB_DICTPATH", NULL }, -#endif { "CREATE_HOME", NULL }, { "DEFAULT_HOME", NULL }, { "DIALUPS_CHECK_ENAB", NULL }, { "ENVIRON_FILE", NULL }, { "ENV_HZ", NULL }, { "ENV_PATH" , NULL }, + { "ENV_ROOTPATH", NULL }, { "ENV_SUPATH", NULL }, { "ENV_TZ", NULL }, { "ERASECHAR", NULL }, { "FAILLOG_ENAB", NULL }, { "FAIL_DELAY", NULL }, + { "FAKE_SHELL", NULL }, { "FTMP_FILE", NULL }, { "GID_MAX", NULL }, { "GID_MIN", NULL }, @@ -121,6 +128,7 @@ static struct itemdef def_table[] = { { "MOTD_FILE", NULL }, { "NOLOGINS_FILE", NULL }, { "NOLOGIN_STR", NULL }, + { "NO_PASSWORD_CONSOLE", NULL }, { "OBSCURE_CHECKS_ENAB", NULL }, { "PASS_ALWAYS_WARN", NULL }, { "PASS_CHANGE_TRIES", NULL }, diff --git a/mbsebbs/mball.c b/mbsebbs/mball.c index a9af5290..e6bebe86 100644 --- a/mbsebbs/mball.c +++ b/mbsebbs/mball.c @@ -2,7 +2,7 @@ * * File ..................: mbsebbs/mball.c * Purpose ...............: Creates allfiles listings - * Last modification date : 28-Jun-2001 + * Last modification date : 09-Aug-2001 * ***************************************************************************** * Copyright (C) 1997-2001 @@ -564,7 +564,7 @@ void MakeIndex() if (strlen(file.Desc[z])) { if (z == 0) fprintf(fp, "%-12s %7luK %s ", file.Name, - file.Size / 1024, + (long)(file.Size / 1024), StrDateDMY(file.UploadDate)); else fprintf(fp, " "); @@ -604,7 +604,8 @@ void MakeIndex() area.Path+strlen(CFG.ftp_base), file.Name, file.Name); } fprintf(fa, "

%s
", StrDateDMY(file.FileDate)); - fprintf(fa, "
%lu Kb.
", file.Size / 1024); + fprintf(fa, "
%lu Kb.
", + (long)(file.Size / 1024)); fprintf(fa, "
%8ld
", file.TimesDL + file.TimesFTP + file.TimesReq); fprintf(fa, "
");
@@ -856,7 +857,7 @@ void Masterlist()
 						if((!file.Deleted) && (!file.Missing)) {
 							New = (((t_start - file.UploadDate) / 84400) <= CFG.newdays);
 							sprintf(temp, "%-12s%10lu K %s [%04ld] Uploader: %s",
-								file.Name, file.Size / 1024, StrDateDMY(file.UploadDate), 
+								file.Name, (long)(file.Size / 1024), StrDateDMY(file.UploadDate), 
 								file.TimesDL + file.TimesFTP + file.TimesReq, 
 								strlen(file.Uploader)?file.Uploader:"");
 							fprintf(fp, "%s\r\n", temp);
diff --git a/mbsebbs/mbpasswd.c b/mbsebbs/mbpasswd.c
index f2e995ff..e1db99a4 100644
--- a/mbsebbs/mbpasswd.c
+++ b/mbsebbs/mbpasswd.c
@@ -2,7 +2,7 @@
  *
  * File ..................: mbpasswd.c
  * Purpose ...............: setuid root version of passwd
- * Last modification date : 27-Jun-2001
+ * Last modification date : 10-Aug-2001
  * Shadow Suite (c) ......: Julianne Frances Haugh
  *
  *****************************************************************************
@@ -32,10 +32,13 @@
 
 #include "../config.h"
 #include 
+#include 
+#include 
+#ifdef HAVE_SYS_RESOURCE_H
 #include 
+#endif
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -43,9 +46,15 @@
 #include 
 #include 
 #include 
+#include 
 #if defined(SHADOW_PASSWORD)
 #include 
 #endif
+#ifdef HAVE_USERSEC_H
+#include 
+#include 
+#include 
+#endif
 
 #include "encrypt.h"
 #include "rad64.h"
@@ -107,12 +116,19 @@ static int  force;	/* Force update of locked passwords */
 
 
 
+#ifndef __FreeBSD__
 static void fail_exit(int status)
 {
-	pw_unlock();
-#ifdef SHADOWPWD
-	spw_unlock();
+//	gr_unlock();
+#ifdef SHADOWGRP
+	if (is_shadow_grp)
+		sgr_unlock();
 #endif
+#ifdef SHADOWPWD
+	if (is_shadow_pwd)
+		spw_unlock();
+#endif
+	pw_unlock();
 	exit(status);
 }
 
@@ -121,7 +137,7 @@ static void fail_exit(int status)
 static void oom(void)
 {
 	fprintf(stderr, "mbpasswd: out of memory\n");
-	fail_exit(3);
+	fail_exit(E_FAILURE);
 }
 
 
@@ -130,8 +146,7 @@ static void oom(void)
  * insert_crypt_passwd - add an "old-style" password to authentication string
  * result now malloced to avoid overflow, just in case.  --marekm
  */
-static char *
-insert_crypt_passwd(const char *string, char *passwd)
+static char *insert_crypt_passwd(const char *string, char *passwd)
 {
 #ifdef AUTH_METHODS
         if (string && *string) {
@@ -158,9 +173,10 @@ insert_crypt_passwd(const char *string, char *passwd)
 #endif
         return xstrdup(passwd);
 }
+#endif /* FreeBSD */
 
 
-
+#ifndef __FreeBSD__
 static char *update_crypt_pw(char *cp)
 {
 	if (do_update_pwd)
@@ -168,6 +184,7 @@ static char *update_crypt_pw(char *cp)
 
 	return cp;
 }
+#endif
 
 
 
@@ -178,6 +195,7 @@ static char *update_crypt_pw(char *cp)
  */
 void pwd_init(void)
 {
+#ifdef HAVE_SYS_RESOURCE_H
 	struct rlimit rlim;
 
 #ifdef RLIMIT_CORE
@@ -206,9 +224,14 @@ void pwd_init(void)
 #ifdef RLIMIT_STACK
 	setrlimit(RLIMIT_STACK, &rlim);
 #endif
+#else /* !HAVE_SYS_RESOURCE_H */
+	set_filesize_limit(30000);
+	/* don't know how to set the other limits... */
+#endif /* !HAVE_SYS_RESOURCE_H */
+
 	signal(SIGALRM, SIG_IGN);
-	signal(SIGHUP, SIG_IGN);
-	signal(SIGINT, SIG_IGN);
+	signal(SIGHUP,  SIG_IGN);
+	signal(SIGINT,  SIG_IGN);
 	signal(SIGPIPE, SIG_IGN);
 	signal(SIGQUIT, SIG_IGN);
 	signal(SIGTERM, SIG_IGN);
@@ -238,6 +261,12 @@ int isexpired(const struct passwd *pw)
 {
 #endif
         long    now;
+#ifdef  HAVE_USERSEC_H
+        int     minage = 0;
+        int     maxage = 10000;
+        int     curage = 0;
+        struct  userpw  *pu;
+#endif
 
         now = time ((time_t *) 0) / SCALE;
 
@@ -267,24 +296,57 @@ int isexpired(const struct passwd *pw)
         if (sp->sp_lstchg > 0 && sp->sp_max >= 0 && sp->sp_inact >= 0 &&
                         now >= sp->sp_lstchg + sp->sp_max + sp->sp_inact)
                 return 2;
+#endif
+#ifdef  HAVE_USERSEC_H  /*{*/
+        /*
+         * The aging information lives someplace else.  Get it from the
+         * login.cfg file
+         */
+
+        if (getconfattr (SC_SYS_PASSWD, SC_MINAGE, &minage, SEC_INT))
+                minage = -1;
+
+        if (getconfattr (SC_SYS_PASSWD, SC_MAXAGE, &maxage, SEC_INT))
+                maxage = -1;
+
+        pu = getuserpw (pw->pw_name);
+        curage = (time (0) - pu->upw_lastupdate) / (7*86400L);
+
+        if (maxage != -1 && curage > maxage)
+                return 1;
+#else   /*} !HAVE_USERSEC_H */
 
         /*
          * The last and max fields must be present for an account
          * to have an expired password.  A maximum of >10000 days
          * is considered to be infinite.
          */
+
+#ifdef  SHADOWPWD
         if (sp->sp_lstchg == -1 ||
                         sp->sp_max == -1 || sp->sp_max >= (10000L*DAY/SCALE))
                 return 0;
+#endif
+#ifdef  ATT_AGE
+        if (pw->pw_age[0] == '\0' || pw->pw_age[0] == '/')
+                return 0;
+#endif
 
         /*
          * Calculate today's day and the day on which the password
          * is going to expire.  If that date has already passed,
          * the password has expired.
          */
+
+#ifdef  SHADOWPWD
         if (now >= sp->sp_lstchg + sp->sp_max)
                 return 1;
 #endif
+#ifdef  ATT_AGE
+        if (a64l (pw->pw_age + 2) + c64i (pw->pw_age[1]) < now / 7)
+                return 1;
+#endif
+#endif  /*} HAVE_USERSEC_H */
         return 0;
 }
 
@@ -305,6 +367,9 @@ static void check_password(const struct passwd *pw)
 #endif
 	time_t now, last, ok;
 	int exp_status;
+#ifdef HAVE_USERSEC_H
+	struct userpw *pu;
+#endif
 
 #ifdef SHADOW_PASSWORD
 	exp_status = isexpired(pw, sp);
@@ -332,7 +397,7 @@ static void check_password(const struct passwd *pw)
 		fprintf (stderr, "The password for %s cannot be changed.\n", sp->sp_namp);
 		syslog(LOG_WARNING, "password locked for %s", sp->sp_namp);
 		closelog();
-		exit (1);
+		exit (E_NOPERM);
 	}
 
 	/*
@@ -346,16 +411,34 @@ static void check_password(const struct passwd *pw)
 		fprintf (stderr, "The password for %s cannot be changed.\n", pw->pw_name);
 		syslog(LOG_WARNING, "password locked for %s", pw->pw_name);
 		closelog();
-		exit (1);
+		exit (E_NOPERM);
 	}
-	last = 0;
-	ok = 0;
+#ifdef ATT_AGE
+        /*
+         * Can always be changed if there is no age info
+         */
+
+        if (! pw->pw_age[0])
+                return;
+
+        last = a64l (pw->pw_age + 2) * WEEK;
+        ok = last + c64i (pw->pw_age[1]) * WEEK;
+#else   /* !ATT_AGE */
+#ifdef HAVE_USERSEC_H
+        pu = getuserpw(pw->pw_name);
+        last = pu ? pu->upw_lastupdate : 0L;
+        ok = last + (minage > 0 ? minage * WEEK : 0);
+#else
+        last = 0;
+        ok = 0;
+#endif
+#endif /* !ATT_AGE */
 #endif /* !SHADOW_PASSWORD */
 	if (now < ok) {
 		fprintf(stderr, "Sorry, the password for %s cannot be changed yet.\n", pw->pw_name);
 		syslog(LOG_WARNING, "now < minimum age for `%s'", pw->pw_name);
 		closelog();
-		exit (1);
+		exit (E_NOPERM);
 	}
 }
 
@@ -381,12 +464,34 @@ struct spwd *pwd_to_spwd(const struct passwd *pw)
         sp.sp_namp = pw->pw_name;
         sp.sp_pwdp = pw->pw_passwd;
 
+#ifdef ATT_AGE
         /*
-         * Defaults used if there is no pw_age information.
+         * AT&T-style password aging maps the sp_min, sp_max, and
+         * sp_lstchg information from the pw_age field, which appears
+         * after the encrypted password.
          */
-        sp.sp_min = 0;
-        sp.sp_max = (10000L * DAY) / SCALE;
-        sp.sp_lstchg = time((time_t *) 0) / SCALE;
+        if (pw->pw_age[0]) {
+                sp.sp_max = (c64i(pw->pw_age[0]) * WEEK) / SCALE;
+
+                if (pw->pw_age[1])
+                        sp.sp_min = (c64i(pw->pw_age[1]) * WEEK) / SCALE;
+                else
+                        sp.sp_min = (10000L * DAY) / SCALE;
+
+                if (pw->pw_age[1] && pw->pw_age[2])
+                        sp.sp_lstchg = (a64l(pw->pw_age + 2) * WEEK) / SCALE;
+                else
+                        sp.sp_lstchg = time((time_t *) 0) / SCALE;
+        } else
+#endif
+	{
+        	/*
+        	 * Defaults used if there is no pw_age information.
+        	 */
+        	sp.sp_min = 0;
+        	sp.sp_max = (10000L * DAY) / SCALE;
+        	sp.sp_lstchg = time((time_t *) 0) / SCALE;
+	}
 
         /*
          * These fields have no corresponding information in the password
@@ -421,7 +526,7 @@ static int new_password(const struct passwd *pw, char *newpasswd)
 	 * Encrypt the password, then wipe the cleartext password.
 	 */
 	cp = pw_encrypt(pass, crypt_make_salt());
-	bzero(pass, sizeof pass);
+	memset(&pass, 0, sizeof(pass));
 
 #ifdef HAVE_LIBCRACK_HIST
 	HistUpdate(pw->pw_name, crypt_passwd);
@@ -431,11 +536,17 @@ static int new_password(const struct passwd *pw, char *newpasswd)
 }
 
 
+#ifndef __FreeBSD__
 
 static void update_noshadow(int shadow_locked)
 {
-	const struct passwd *pw;
-	struct passwd *npw;
+	const struct passwd	*pw;
+	struct passwd		*npw;
+#ifdef ATT_AGE
+        char			age[5];
+        long			week = time((time_t *) 0) / WEEK;
+        char			*cp;
+#endif
 
 	/*
 	 * call this with shadow_locked != 0 to avoid calling lckpwdf()
@@ -444,38 +555,112 @@ static void update_noshadow(int shadow_locked)
 	 * and call lckpwdf() only before the first lock, and ulckpwdf()
 	 * after the last unlock.
 	 */
-	if (!(shadow_locked ? pw_lock() : pw_lock_first())) {
-	fprintf(stderr, "Cannot lock the password file; try again later.\n");
+	if (!pw_lock()) {
+		fprintf(stderr, "Cannot lock the password file; try again later.\n");
 		syslog(LOG_WARNING, "can't lock password file");
-		exit(5);
+		exit(E_PWDBUSY);
 	}
 	if (!pw_open(O_RDWR)) {
 		fprintf(stderr, "Cannot open the password file.\n");
 		syslog(LOG_ERR, "can't open password file");
-		fail_exit(3);
+		fail_exit(E_MISSING);
 	}
 	pw = pw_locate(name);
 	if (!pw) {
 		fprintf(stderr, "mbpasswd: user %s not found in /etc/passwd\n", name);
-		fail_exit(1);
+		fail_exit(E_NOPERM);
 	}
 	npw = __pw_dup(pw);
 	if (!npw)
 		oom();
 	npw->pw_passwd = update_crypt_pw(npw->pw_passwd);
+#ifdef ATT_AGE
+        memset(age, 0, sizeof(age));
+        STRFCPY(age, npw->pw_age);
+
+        /*
+         * Just changing the password - update the last change date
+         * if there is one, otherwise the age just disappears.
+         */
+        if (do_update_age) {
+                if (strlen(age) > 2) {
+                        cp = l64a(week);
+                        age[2] = cp[0];
+                        age[3] = cp[1];
+                } else {
+                        age[0] = '\0';
+                }
+        }
+
+        if (xflg) {
+                if (age_max > 0)
+                        age[0] = i64c((age_max + 6) / 7);
+                else
+                        age[0] = '.';
+
+                if (age[1] == '\0')
+                        age[1] = '.';
+        }
+        if (nflg) {
+                if (age[0] == '\0')
+                        age[0] = 'z';
+
+                if (age_min > 0)
+                        age[1] = i64c((age_min + 6) / 7);
+                else
+                        age[1] = '.';
+        }
+        /*
+         * The last change date is added by -n or -x if it's
+         * not already there.
+         */
+        if ((nflg || xflg) && strlen(age) <= 2) {
+                cp = l64a(week);
+                age[2] = cp[0];
+                age[3] = cp[1];
+        }
+
+        /*
+         * Force password change - if last change date is
+         * present, it will be set to (today - max - 1 week).
+         * Otherwise, just set min = max = 0 (will disappear
+         * when password is changed).
+         */
+        if (eflg) {
+                if (strlen(age) > 2) {
+                        cp = l64a(week - c64i(age[0]) - 1);
+                        age[2] = cp[0];
+                        age[3] = cp[1];
+                } else {
+                        strcpy(age, "..");
+                }
+        }
+
+        npw->pw_age = age;
+#endif
+
 	if (!pw_update(npw)) {
 		fprintf(stderr, "Error updating the password entry.\n");
 		syslog(LOG_ERR, "error updating password entry");
-		fail_exit(3);
+		fail_exit(E_FAILURE);
 	}
+#ifdef NDBM
+        if (pw_dbm_present() && !pw_dbm_update(npw)) {
+                fprintf(stderr, _("Error updating the DBM password entry.\n"));
+                SYSLOG((LOG_ERR, DBMERROR2));
+                fail_exit(E_FAILURE);
+        }
+        endpwent();
+#endif
 	if (!pw_close()) {
 		fprintf(stderr, "Cannot commit password file changes.\n");
 		syslog(LOG_ERR, "can't rewrite password file");
-		fail_exit(3);
+		fail_exit(E_FAILURE);
 	}
         pw_unlock();
 }
 
+#endif /* Not __FreeBSD__ */
 
 
 #ifdef SHADOW_PASSWORD
@@ -484,28 +669,23 @@ static void update_shadow(void)
         const struct spwd *sp;
         struct spwd *nsp;
 
-        if (!spw_lock_first()) {
+        if (!spw_lock()) {
                 fprintf(stderr, "Cannot lock the password file; try again later.\n");
                 syslog(LOG_WARNING, "can't lock password file");
-                exit(5);
+                exit(E_PWDBUSY);
         }
         if (!spw_open(O_RDWR)) {
                 fprintf(stderr, "Cannot open the password file.\n");
                 syslog(LOG_ERR, "can't open password file");
-                fail_exit(3);
+                fail_exit(E_FAILURE);
         }
         sp = spw_locate(name);
         if (!sp) {
-#if 0
-                fprintf(stderr, "%s: user %s not found in /etc/shadow\n",
-                        Prog, name);
-                fail_exit(1);
-#else
                 /* Try to update the password in /etc/passwd instead.  */
-                spw_unlock();
+                spw_close();
                 update_noshadow(1);
+		spw_unlock();
                 return;
-#endif
         }
         nsp = __spw_dup(sp);
         if (!nsp)
@@ -517,12 +697,20 @@ static void update_shadow(void)
         if (!spw_update(nsp)) {
                 fprintf(stderr, "Error updating the password entry.\n");
                 syslog(LOG_ERR, "error updating password entry");
-                fail_exit(3);
+                fail_exit(E_FAILURE);
         }
+#ifdef NDBM
+        if (sp_dbm_present() && !sp_dbm_update(nsp)) {
+                fprintf(stderr, _("Error updating the DBM password entry.\n"));
+                SYSLOG((LOG_ERR, DBMERROR2));
+                fail_exit(E_FAILURE);
+        }
+        endspent();
+#endif
         if (!spw_close()) {
                 fprintf(stderr, "Cannot commit password file changes.\n");
                 syslog(LOG_ERR, "can't rewrite password file");
-                fail_exit(3);
+                fail_exit(E_FAILURE);
         }
         spw_unlock();
 }
@@ -541,7 +729,11 @@ int main(int argc, char *argv[])
 #ifdef SHADOW_PASSWORD
 	const struct spwd	*sp;
 #endif
-	char		*cp;
+	char			*cp;
+#ifdef __FreeBSD__
+	char			temp[81];
+	char			cmd[256];
+#endif
 
 	/*
 	 * Get my username
@@ -560,11 +752,11 @@ int main(int argc, char *argv[])
 	gr = getgrgid(pw->pw_gid);
 	if (!gr) {
 		fprintf(stderr, "mbpasswd: Cannot determine group name.\n");
-		exit(1);
+		exit(E_NOPERM);
 	}
 	if (strcmp(gr->gr_name, (char *)"bbs")) {
 		fprintf(stderr, "mbpasswd: You are not a member of group \"bbs\".\n");
-		exit(1);
+		exit(E_NOPERM);
 	}
 
 //	NOOT dit programma moet kontroleren of het is aangeroepen door mbsebbs.
@@ -577,7 +769,7 @@ int main(int argc, char *argv[])
 		printf("mbpasswd [-opt] [username] [newpassword]\n");
 		printf("options are:  -n   normal password change\n");
 		printf("              -f   forced password change\n");
-		exit(1);
+		exit(E_FAILURE);
 	}
 
 	if (strncmp(argv[1], "-f", 2) == 0)
@@ -590,17 +782,17 @@ int main(int argc, char *argv[])
 	 */
 	if (strlen(argv[2]) > 16) {
 		fprintf(stderr, "mbpasswd: Username too long\n");
-		exit(1);
+		exit(E_FAILURE);
 	}
 	if (strlen(argv[3]) > 16) {
 		fprintf(stderr, "mbpasswd: Password too long\n");
-		exit(1);
+		exit(E_FAILURE);
 	}
 
 	name = strdup(argv[2]);
 	if ((pw = getpwnam(name)) == NULL) {
 		fprintf(stderr, "mbpasswd: Unknown user %s\n", name);
-		exit(1);
+		exit(E_FAILURE);
 	}
 
 	openlog("mbpasswd", LOG_PID|LOG_CONS|LOG_NOWAIT, LOG_AUTH);
@@ -627,8 +819,9 @@ int main(int argc, char *argv[])
 
 	if (new_password(pw, argv[3])) {
 		fprintf(stderr, "The password for %s is unchanged.\n", name);
+		syslog(LOG_ERR, "The password for %s is unchanged", name);
 		closelog();
-		exit(1);
+		exit(E_FAILURE);
 	}
 	do_update_pwd = 1;
 	do_update_age = 1;
@@ -645,19 +838,57 @@ int main(int argc, char *argv[])
 		fprintf(stderr, "Cannot change ID to root.\n");
 		syslog(LOG_ERR, "can't setuid(0)");
 		closelog();
-		exit(1);
+		exit(E_FAILURE);
 	}
 
+#ifndef __FreeBSD__
+
+#ifdef  HAVE_USERSEC_H
+        update_userpw(pw->pw_passwd);
+#else  /* !HAVE_USERSEC_H */
+
 #ifdef SHADOW_PASSWORD
 	if (spw_file_present())
 		update_shadow();
 	else
 #endif
 		update_noshadow(0);
+#endif /* !HAVE_USERSEC_H */
+
+#else /* __FreeBSD__ */
+
+	/*
+	 *  FreeBSD has no interface (that I know of) to change the users password,
+	 *  but they do have a utility that does it. We will use that.
+	 */
+	if ((access("/usr/bin/chpass", X_OK)) == 0)
+		strcpy(temp, "/usr/bin/chpass");
+	else if ((access("/usr/sbin/chpass", X_OK)) == 0)
+		strcpy(temp, "/usr/sbin/chpass");
+	else if ((access("/bin/chpass", X_OK)) == 0)
+		strcpy(temp, "/bin/chpass");
+	else if ((access("/sbin/chpass", X_OK)) == 0)
+		strcpy(temp, "/sbin/chpass");
+	else {
+		fprintf(stderr, "mbpasswd: Can't find chpass\n");
+		syslog(LOG_INFO, "Can't find chpass");
+		closelog();
+		exit(E_FAILURE);
+	}
+	sprintf(cmd, "%s -p \"%s\" %s", temp, crypt_passwd, name);
+
+	if (system(cmd) != 0) {
+		perror("mbpasswd: failed to change password\n");
+		syslog(LOG_INFO, "password change for `%s' failed", name);
+		closelog();
+		exit(E_FAILURE);
+	}
+
+#endif /* __FreeBSD__ */
 
 	syslog(LOG_INFO, "password for `%s' changed by user `%s'", name, myname);
 	closelog();
-	exit(0);
+	exit(E_SUCCESS);
 }
 
 
diff --git a/mbsebbs/mbpasswd.h b/mbsebbs/mbpasswd.h
index e76aebeb..dabf3a13 100644
--- a/mbsebbs/mbpasswd.h
+++ b/mbsebbs/mbpasswd.h
@@ -6,21 +6,35 @@
 #define STRFCPY(A,B) \
         (strncpy((A), (B), sizeof(A) - 1), (A)[sizeof(A) - 1] = '\0')
 
+/*
+ * exit status values
+ */
+
+#define E_SUCCESS       0       /* success */
+#define E_NOPERM        1       /* permission denied */
+#define E_USAGE         2       /* invalid combination of options */
+#define E_FAILURE       3       /* unexpected failure, nothing done */
+#define E_MISSING       4       /* unexpected failure, passwd file missing */
+#define E_PWDBUSY       5       /* passwd file busy, try again later */
+#define E_BAD_ARG       6       /* invalid argument to option */
+
+
 
 /*
  * Function prototypes
  */
 struct passwd	*get_my_pwent(void);
 static int      new_password (const struct passwd *, char *);
-static void	fail_exit(int);
-static void	oom(void);
 void		pwd_init(void);
 char            *crypt_make_salt(void);
 char            *pw_encrypt(const char *, const char *);
 int             i64c(int);
 char            *l64a(long);
+#ifndef __FreeBSD__
+static void	fail_exit(int);
+static void	oom(void);
 static void	update_noshadow(int);
-
+#endif
 #ifdef SHADOW_PASSWORD
 struct spwd     *pwd_to_spwd(const struct passwd *);
 static void	update_shadow(void);
diff --git a/mbsebbs/mbsebbs.c b/mbsebbs/mbsebbs.c
index b56a2c39..9f00e61d 100644
--- a/mbsebbs/mbsebbs.c
+++ b/mbsebbs/mbsebbs.c
@@ -102,6 +102,13 @@ int main(int argc, char **argv)
 #endif
 		exit(1);
 	}
+//        if (seteuid(pw->pw_uid) == -1) {
+//                perror("Can't seteuid() to \"mbse\" user");
+//#ifdef MEMWATCH
+//                mwTerm();
+//#endif
+//                exit(1);
+//        }
 
 	/* 
 	 * Set local time and statistic indexes.
@@ -158,7 +165,7 @@ int main(int argc, char **argv)
 		sprintf(pTTY, "%s", tty);
 	}
 
-	umask(007);
+	umask(000);
 
 	/* 
 	 * Trap signals
diff --git a/mbsebbs/mbtoberep.c b/mbsebbs/mbtoberep.c
index c7f6a279..bc6e86e4 100644
--- a/mbsebbs/mbtoberep.c
+++ b/mbsebbs/mbtoberep.c
@@ -2,7 +2,7 @@
  *
  * File ..................: mbtoberep/mbtoberep.c
  * Purpose ...............: Show contents of toberep.data
- * Last modification date : 28-Jun-2001
+ * Last modification date : 09-Aug-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
 		printf("Comment       %s\n", rep.Comment);
 		printf("Group         %s\n", rep.Group);
 		printf("File name     %s\n", rep.Name);
-		printf("FIle size     %lu\n", rep.Size);
+		printf("FIle size     %lu\n", (long)(rep.Size));
 		printf("File size Kb  %lu\n", rep.SizeKb);
 		printf("File date     %s", ctime(&rep.Fdate));
 		printf("File CRC      %s\n", rep.Crc);
diff --git a/mbsebbs/mbuser.c b/mbsebbs/mbuser.c
index 46db78b1..9a7e562e 100644
--- a/mbsebbs/mbuser.c
+++ b/mbsebbs/mbuser.c
@@ -2,7 +2,7 @@
  *
  * File ..................: mbuser/mbuser.c
  * Purpose ...............: User Pack Util
- * Last modification date : 01-Jul-2001
+ * Last modification date : 12-Aug-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -305,8 +305,13 @@ void UserPack(int days, int level, int pack)
 						WriteError("Cannot setuid(root) or setgid(root)");
 						WriteError("Cannot delete unix account %s", usr.Name);
 					} else {
+#ifndef __FreeBSD__
 						rc = execute((char *)"/usr/sbin/userdel ", usr.Name, NULL,
 							(char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null");
+#else
+						rc = execute((char *)"/usr/sbin/pw userdel ", usr.Name, NULL,
+							(char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null");
+#endif
 						if (chdir(CFG.bbs_usersdir) == 0)
 							rc = execute((char *)"/bin/rm -Rf ", usr.Name, NULL,
 								(char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null");
diff --git a/mbsebbs/mbuseradd.c b/mbsebbs/mbuseradd.c
index 74d36c83..ec6d23ed 100644
--- a/mbsebbs/mbuseradd.c
+++ b/mbsebbs/mbuseradd.c
@@ -2,7 +2,7 @@
  *
  * File ..................: mbuseradd.c
  * Purpose ...............: setuid root version of useradd
- * Last modification date : 28-Jun-2001
+ * Last modification date : 25-Aug-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -41,8 +41,7 @@
 #include 
 #include 
 #include 
-
-#include 
+#include 
 
 #include "mbuseradd.h"
 
@@ -71,7 +70,7 @@ int execute(char *cmd, char *file, char *in, char *out, char *err)
 			if (open(in, O_RDONLY) != 0) {
 				perror("");
 				fprintf(stderr, "mbuseradd: Reopen of stdin to %s failed\n", in);
-				exit(-1);
+				_exit(-1);
 			}
 		}
 		if (out) {
@@ -79,7 +78,7 @@ int execute(char *cmd, char *file, char *in, char *out, char *err)
 			if (open(out, O_WRONLY | O_APPEND | O_CREAT,0600) != 1) {
 				perror("");
 				fprintf(stderr, "mbuseradd: Reopen of stdout to %s failed\n", out);
-				exit(-1);
+				_exit(-1);
 			}
 		}
 		if (err) {
@@ -87,12 +86,12 @@ int execute(char *cmd, char *file, char *in, char *out, char *err)
 			if (open(err, O_WRONLY | O_APPEND | O_CREAT,0600) != 2) {
 				perror("");
 				fprintf(stderr, "mbuseradd: Reopen of stderr to %s failed\n", err);
-				exit(-1);
+				_exit(-1);
 			}
 		}
 		rc = execv(vector[0],vector);
 		fprintf(stderr, "mbuseradd: Exec \"%s\" returned %d\n", vector[0], rc);
-		exit(-1);
+		_exit(-1);
 	}
 
 	do {
@@ -135,19 +134,13 @@ int main(int argc, char *argv[])
 	char		*PassEnt, *temp, *shell;
 	int		i;
 	struct passwd	*pwent, *pwuser;
-	FILE		*fp;
-
-	if (setuid(0) == -1 || setgid(1) == -1) {
-		perror("");
-		fprintf(stderr, "mbuseradd: Unable to setuid(root) or setgid(root)\n");
-		fprintf(stderr, "Make sure that this program is set to -rwsr-sr-x\n");
-		fprintf(stderr, "Owner must be root and group root\n");
-		exit(1);
-	}
 
 	if (argc != 5)
 		Help();
 
+	/*
+	 *  First simple check for argument overflow
+	 */
 	for (i = 1; i < 5; i++) {
 		if (strlen(argv[i]) > 80) {
 			fprintf(stderr, "mbuseradd: Argument %d is too long\n", i);
@@ -159,10 +152,20 @@ int main(int argc, char *argv[])
 	temp    = calloc(PATH_MAX, sizeof(char));
 	shell   = calloc(PATH_MAX, sizeof(char));
 
+        if (setuid(0) == -1 || setgid(1) == -1) {
+                perror("");
+                fprintf(stderr, "mbuseradd: Unable to setuid(root) or setgid(root)\n");
+                fprintf(stderr, "Make sure that this program is set to -rwsr-sr-x\n");
+                fprintf(stderr, "Owner must be root and group root\n");
+                exit(1);
+        }
+	umask(0000);
+
 	/*
 	 * Build command to add user entry to the /etc/passwd and /etc/shadow
 	 * files. We use the systems own useradd program.
 	 */
+#ifdef __linux__
 	if ((access("/usr/bin/useradd", R_OK)) == 0)
 		strcpy(temp, "/usr/bin/useradd");
 	else if ((access("/bin/useradd", R_OK)) == 0)
@@ -175,11 +178,30 @@ int main(int argc, char *argv[])
 		fprintf(stderr, "mbuseradd: Can't find useradd\n");
 		exit(1);
 	}
+#elif __FreeBSD__
+	if ((access("/usr/sbin/pw", X_OK)) == 0)
+		strcpy(temp, "/usr/sbin/pw");
+	else if ((access("/sbin/pw", X_OK)) == 0)
+		strcpy(temp, "/sbin/pw");
+	else {
+		fprintf(stderr, "mbuseradd: Can't find pw\n");
+		exit(1);
+	}
+#else
+	fprintf(stderr, "mbuseradd: Don't know how to add a user on this OS\n");
+	exit(1);
+#endif
 
 	sprintf(shell, "%s/bin/mbsebbs", getenv("MBSE_ROOT"));
 
+#ifdef __linux__
 	sprintf(PassEnt, "%s -c \"%s\" -d %s/%s -g %s -s %s %s",
 		temp, argv[3], argv[4], argv[2], argv[1], shell, argv[2]);
+#endif
+#ifdef __FreeBSD__
+	sprintf(PassEnt, "%s useradd %s -c \"%s\" -d %s/%s -g %s -s %s",
+		temp, argv[2], argv[3], argv[4], argv[2], argv[1], shell);
+#endif
 	fflush(stdout);
 	fflush(stdin);
 
diff --git a/mbsebbs/pwio.c b/mbsebbs/pwio.c
index bd8cd640..e004710f 100644
--- a/mbsebbs/pwio.c
+++ b/mbsebbs/pwio.c
@@ -2,12 +2,12 @@
  *
  * File ..................: mbuseradd/pwio.c
  * Purpose ...............: MBSE BBS Shadow Password Suite
- * Last modification date : 18-Sep-2000
+ * Last modification date : 09-Aug-2001
  * Original Source .......: Shadow Password Suite
  * Original Copyrioght ...: Julianne Frances Haugh and others.
  *
  *****************************************************************************
- * Copyright (C) 1997-2000
+ * Copyright (C) 1997-2001
  *   
  * Michiel Broek		FIDO:		2:280/2802
  * Beekmansbos 10
@@ -43,6 +43,9 @@
 #include 
 #include "sgetpwent.h"
 #include "commonio.h"
+#ifndef	HAVE_PUTPWENT
+#include "putpwent.h"
+#endif
 #include "pwio.h"
 
 
@@ -143,16 +146,17 @@ static struct commonio_ops passwd_ops = {
 
 
 static struct commonio_db passwd_db = {
-	"/etc/passwd",
-	&passwd_ops,
-	NULL,
-	NULL,
-	NULL,
-	NULL,
-	0,
-	0,
-	0,
-	0
+        PASSWD_FILE,    /* filename */
+        &passwd_ops,    /* ops */
+        NULL,           /* fp */
+        NULL,           /* head */
+        NULL,           /* tail */
+        NULL,           /* cursor */
+        0,              /* changed */
+        0,              /* isopen */
+        0,              /* locked */
+        0,              /* readonly */
+        1               /* use_lckpwdf */
 };
 
 
@@ -171,13 +175,6 @@ int pw_lock(void)
 
 
 
-int pw_lock_first(void)
-{
-	return commonio_lock_first(&passwd_db);
-}
-
-
-
 int pw_open(int mode)
 {
 	return commonio_open(&passwd_db, mode);
diff --git a/mbsebbs/pwio.h b/mbsebbs/pwio.h
index f21b263b..aeea9031 100644
--- a/mbsebbs/pwio.h
+++ b/mbsebbs/pwio.h
@@ -1,6 +1,14 @@
 #ifndef	_PWIO_H
 #define	_PWIO_H
 
+#ifndef PASSWD_FILE
+#define PASSWD_FILE "/etc/passwd"
+#endif
+
+#ifndef GROUP_FILE
+#define GROUP_FILE "/etc/group"
+#endif
+
 struct passwd *__pw_dup (const struct passwd *);
 void __pw_set_changed (void);
 int pw_close (void);
diff --git a/mbsebbs/shadowio.c b/mbsebbs/shadowio.c
index 84ecd3d7..3da0426b 100644
--- a/mbsebbs/shadowio.c
+++ b/mbsebbs/shadowio.c
@@ -2,12 +2,12 @@
  *
  * File ..................: mbuseradd/shadowio.c
  * Purpose ...............: MBSE BBS Shadow Password Suite
- * Last modification date : 13-Aug-2000
+ * Last modification date : 09-Aug-2001
  * Original Source .......: Shadow Password Suite
  * Original Copyrioght ...: Julianne Frances Haugh and others.
  *
  *****************************************************************************
- * Copyright (C) 1997-2000
+ * Copyright (C) 1997-2001
  *   
  * Michiel Broek		FIDO:		2:280/2802
  * Beekmansbos 10
@@ -117,16 +117,17 @@ static struct commonio_ops shadow_ops = {
 
 
 static struct commonio_db shadow_db = {
-	SHADOW_FILE,
-	&shadow_ops,
-	NULL,
-	NULL,
-	NULL,
-	NULL,
-	0,
-	0,
-	0,
-	0
+        SHADOW_FILE,    /* filename */
+        &shadow_ops,    /* ops */
+        NULL,           /* fp */
+        NULL,           /* head */
+        NULL,           /* tail */
+        NULL,           /* cursor */
+        0,              /* changed */
+        0,              /* isopen */
+        0,              /* locked */
+        0,              /* readonly */
+        1               /* use_lckpwdf */
 };
 
 
@@ -152,13 +153,6 @@ int spw_lock(void)
 
 
 
-int spw_lock_first(void)
-{
-	return commonio_lock_first(&shadow_db);
-}
-
-
-
 int spw_open(int mode)
 {
 	return commonio_open(&shadow_db, mode);
diff --git a/mbsebbs/shadowio.h b/mbsebbs/shadowio.h
index 2bb725f7..776daef1 100644
--- a/mbsebbs/shadowio.h
+++ b/mbsebbs/shadowio.h
@@ -5,6 +5,13 @@
 #ifndef SHADOW_FILE
 #define SHADOW_FILE "/etc/shadow"
 #endif
+
+#ifdef SHADOWGRP
+#ifndef SGROUP_FILE
+#define SGROUP_FILE "/etc/gshadow"
+#endif
+#endif
+
 #endif
 
 
@@ -14,7 +21,6 @@ int spw_close (void);
 int spw_file_present (void);
 const struct spwd *spw_locate (const char *);
 int spw_lock (void);
-int spw_lock_first (void);
 int spw_name (const char *);
 const struct spwd *spw_next (void);
 int spw_open (int);
diff --git a/mbsebbs/user.c b/mbsebbs/user.c
index d8964131..db507d9c 100644
--- a/mbsebbs/user.c
+++ b/mbsebbs/user.c
@@ -4,7 +4,7 @@
  * Purpose ...............: Main user login procedure.  Checks for limits, 
  *                          new ratio's cats all the welcome screens, and 
  *                          does a lot of checking in general.
- * Last modification date : 28-Jun-2001
+ * Last modification date : 08-Aug-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -615,11 +615,7 @@ void user()
 	} else {
 		Syslog('+', "Unixmode login: %s", sUnixName);
 		if ((pw = getpwnam(sUnixName)))
-		#ifdef linux
 			strcpy(sGetName, pw->pw_gecos);
-		#else
-			strcpy(sGetName, pw->pw_comment);
-		#endif
 
 		/*
 		 * If there are more fields in the passwd gecos field
diff --git a/mbtask/Makefile.am b/mbtask/Makefile.am
index c81fd24e..163c8db0 100644
--- a/mbtask/Makefile.am
+++ b/mbtask/Makefile.am
@@ -11,13 +11,13 @@ taskcomm.c taskcomm.h taskstat.c taskstat.h taskdisk.c taskdisk.h \
 taskregs.c taskregs.h taskinfo.c taskinfo.h outstat.c outstat.h \
 scanout.c scanout.h nodelist.c nodelist.h callstat.c callstat.h libs.h
 
-LDADD = ../lib/libmemwatch.a
+#  LDADD = ../lib/libmemwatch.a
 
 install-exec-local:
-	@if [ "$(shell whoami)" != "root" ] ; then \
+	@if [ "`id -un`" != "root" ] ; then \
 		echo; echo " Must be root to install!"; echo; exit 3; \
 	fi
-	$(INSTALL) -s -o root -g root -m 6711 mbtask $(bindir)
+	$(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbtask $(bindir)
 	@if [ -f $(sysconfdir)/mbsed.conf ]; then \
 		rm $(sysconfdir)/mbsed.conf ; \
 	fi
diff --git a/mbtask/Makefile.in b/mbtask/Makefile.in
index af3981fa..bb6b94d1 100644
--- a/mbtask/Makefile.in
+++ b/mbtask/Makefile.in
@@ -59,6 +59,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 AWK = @AWK@
 CC = @CC@
+CHOWN = @CHOWN@
 COMPRESS = @COMPRESS@
 GROUP = @GROUP@
 GZIP = @GZIP@
@@ -70,7 +71,6 @@ OWNER = @OWNER@
 PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
 VERSION = @VERSION@
-YACC = @YACC@
 
 SUBDIRS = .
 
@@ -80,8 +80,6 @@ noinst_PROGRAMS = mbtask
 
 mbtask_SOURCES = mbtask.c mbtask.h signame.c signame.h taskutil.c taskutil.h taskcomm.c taskcomm.h taskstat.c taskstat.h taskdisk.c taskdisk.h taskregs.c taskregs.h taskinfo.c taskinfo.h outstat.c outstat.h scanout.c scanout.h nodelist.c nodelist.h callstat.c callstat.h libs.h
 
-
-LDADD = ../lib/libmemwatch.a
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
@@ -96,7 +94,7 @@ mbtask_OBJECTS =  mbtask.o signame.o taskutil.o taskcomm.o taskstat.o \
 taskdisk.o taskregs.o taskinfo.o outstat.o scanout.o nodelist.o \
 callstat.o
 mbtask_LDADD = $(LDADD)
-mbtask_DEPENDENCIES =  ../lib/libmemwatch.a
+mbtask_DEPENDENCIES = 
 mbtask_LDFLAGS = 
 CFLAGS = @CFLAGS@
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -109,6 +107,10 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
 TAR = tar
 GZIP_ENV = --best
+DEP_FILES =  .deps/callstat.P .deps/mbtask.P .deps/nodelist.P \
+.deps/outstat.P .deps/scanout.P .deps/signame.P .deps/taskcomm.P \
+.deps/taskdisk.P .deps/taskinfo.P .deps/taskregs.P .deps/taskstat.P \
+.deps/taskutil.P
 SOURCES = $(mbtask_SOURCES)
 OBJECTS = $(mbtask_OBJECTS)
 
@@ -116,9 +118,9 @@ all: all-redirect
 .SUFFIXES:
 .SUFFIXES: .S .c .o .s
 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps mbtask/Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu mbtask/Makefile
 
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -132,9 +134,6 @@ distclean-noinstPROGRAMS:
 
 maintainer-clean-noinstPROGRAMS:
 
-.c.o:
-	$(COMPILE) -c $<
-
 .s.o:
 	$(COMPILE) -c $<
 
@@ -249,6 +248,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 subdir = mbtask
 
 distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu mbtask/Makefile
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
@@ -269,32 +273,38 @@ distdir: $(DISTFILES)
 	      || exit 1; \
 	  fi; \
 	done
-callstat.o: callstat.c libs.h ../config.h ../lib/memwatch.h \
-	../lib/structs.h taskutil.h callstat.h
-mbtask.o: mbtask.c libs.h ../config.h ../lib/memwatch.h ../lib/structs.h \
-	signame.h taskstat.h taskutil.h taskregs.h taskcomm.h outstat.h \
-	nodelist.h mbtask.h
-nodelist.o: nodelist.c libs.h ../config.h ../lib/memwatch.h \
-	../lib/structs.h taskutil.h nodelist.h
-outstat.o: outstat.c libs.h ../config.h ../lib/memwatch.h \
-	../lib/structs.h taskutil.h scanout.h nodelist.h callstat.h \
-	outstat.h
-scanout.o: scanout.c libs.h ../config.h ../lib/memwatch.h \
-	../lib/structs.h taskutil.h scanout.h
-signame.o: signame.c signame.h
-taskcomm.o: taskcomm.c libs.h ../config.h ../lib/memwatch.h taskstat.h \
-	taskregs.h taskdisk.h taskinfo.h taskutil.h taskcomm.h
-taskdisk.o: taskdisk.c libs.h ../config.h ../lib/memwatch.h taskdisk.h \
-	taskutil.h
-taskinfo.o: taskinfo.c libs.h ../config.h ../lib/memwatch.h \
-	../lib/structs.h taskinfo.h
-taskregs.o: taskregs.c libs.h ../config.h ../lib/memwatch.h taskstat.h \
-	taskregs.h taskutil.h
-taskstat.o: taskstat.c libs.h ../config.h ../lib/memwatch.h \
-	../lib/structs.h taskstat.h outstat.h taskutil.h
-taskutil.o: taskutil.c libs.h ../config.h ../lib/memwatch.h \
-	../lib/structs.h signame.h scanout.h taskutil.h
 
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
 info-am:
 info: info-recursive
 dvi-am:
@@ -332,23 +342,24 @@ distclean-generic:
 
 maintainer-clean-generic:
 mostlyclean-am:  mostlyclean-noinstPROGRAMS mostlyclean-compile \
-		mostlyclean-tags mostlyclean-generic
+		mostlyclean-tags mostlyclean-depend mostlyclean-generic
 
 mostlyclean: mostlyclean-recursive
 
-clean-am:  clean-noinstPROGRAMS clean-compile clean-tags clean-generic \
-		mostlyclean-am
+clean-am:  clean-noinstPROGRAMS clean-compile clean-tags clean-depend \
+		clean-generic mostlyclean-am
 
 clean: clean-recursive
 
 distclean-am:  distclean-noinstPROGRAMS distclean-compile distclean-tags \
-		distclean-generic clean-am
+		distclean-depend distclean-generic clean-am
 
 distclean: distclean-recursive
 
 maintainer-clean-am:  maintainer-clean-noinstPROGRAMS \
 		maintainer-clean-compile maintainer-clean-tags \
-		maintainer-clean-generic distclean-am
+		maintainer-clean-depend maintainer-clean-generic \
+		distclean-am
 	@echo "This command is intended for maintainers to use;"
 	@echo "it deletes files that may require special tools to rebuild."
 
@@ -363,20 +374,23 @@ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
 all-recursive check-recursive installcheck-recursive info-recursive \
 dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
 maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck \
-install-exec-local install-exec-am install-exec install-data-am \
-install-data install-am install uninstall-am uninstall all-redirect \
-all-am all installdirs-am installdirs mostlyclean-generic \
-distclean-generic clean-generic maintainer-clean-generic clean \
-mostlyclean distclean maintainer-clean
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-local install-exec-am \
+install-exec install-data-am install-data install-am install \
+uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
+#  LDADD = ../lib/libmemwatch.a
+
 install-exec-local:
-	@if [ "$(shell whoami)" != "root" ] ; then \
+	@if [ "`id -un`" != "root" ] ; then \
 		echo; echo " Must be root to install!"; echo; exit 3; \
 	fi
-	$(INSTALL) -s -o root -g root -m 6711 mbtask $(bindir)
+	$(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbtask $(bindir)
 	@if [ -f $(sysconfdir)/mbsed.conf ]; then \
 		rm $(sysconfdir)/mbsed.conf ; \
 	fi
diff --git a/mbtask/libs.h b/mbtask/libs.h
index d7698ea9..012f9ca9 100644
--- a/mbtask/libs.h
+++ b/mbtask/libs.h
@@ -2,7 +2,7 @@
  *
  * File ..................: libs.h
  * Purpose ...............: Libraries include list
- * Last modification date : 05-jul-2001
+ * Last modification date : 11-Aug-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -60,16 +60,22 @@
 #include 
 #include 
 #include 
+#ifdef  HAVE_SYS_VFS_H
 #include 
-#include 
+#endif
+#include 
+#include 
+#include 
 #include 
 
 #include 
 #include 
+#ifdef __FreeBSD__
+#include 
+#endif
 #include 
 #include 
 
-#include "../lib/memwatch.h"
 
 
 /*
@@ -94,11 +100,15 @@ struct icmp_filter {
 
 
 /* Ancillary data object manipulation macros.  */
+/*
 #  if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
 #   define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
 #  else
 #   define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
 #  endif
+*/
+
+/*
 #  define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
 #  define CMSG_FIRSTHDR(mhdr) \
   ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)                 \
@@ -118,20 +128,21 @@ _EXTERN_INLINE struct cmsghdr *
 __cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
 {
   if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
-    /* The kernel header does this so there may be a reason.  */
+*/    /* The kernel header does this so there may be a reason.  */ /*
     return 0;
-
+*/
+/*
   __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
                                + CMSG_ALIGN (__cmsg->cmsg_len));
   if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
                                          + __mhdr->msg_controllen)
       || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
           >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
-    /* No more entries.  */
+*/    /* No more entries.  */  /*
     return 0;
   return __cmsg;
 }
-#  endif        /* Use `extern inline'.  */
+#  endif    */    /* Use `extern inline'.  */
 # endif
 
 
diff --git a/mbtask/mbtask.c b/mbtask/mbtask.c
index ae0e13d4..bc8fc89a 100644
--- a/mbtask/mbtask.c
+++ b/mbtask/mbtask.c
@@ -2,7 +2,7 @@
  *
  * File ..................: mbtask/mbtask.c
  * Purpose ...............: MBSE BBS Task Manager
- * Last modification date : 09-Jul-2001
+ * Last modification date : 13-Aug-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -126,10 +126,12 @@ void load_maincfg(void)
 #ifdef __USE_GNU
                 sprintf(CFG.sysdomain, "%s.%s", un.nodename, un.domainname); 
 #else
+#ifdef __linux__
                 sprintf(CFG.sysdomain, "%s.%s", un.nodename, un.__domainname);
 #endif
-                sprintf(CFG.comment, "MBSE Linux BBS development");
-                sprintf(CFG.origin, "MBSE Linux BBS. Made in the Netherlands");
+#endif
+                sprintf(CFG.comment, "MBSE BBS development");
+                sprintf(CFG.origin, "MBSE BBS. Made in the Netherlands");
                 sprintf(CFG.location, "Earth");
 
                 /*
@@ -391,9 +393,6 @@ void load_maincfg(void)
                 if ((fp = fopen(cfgfn, "a+")) == NULL) {
 			perror("");
                         fprintf(stderr, "Can't create %s\n", cfgfn);
-#ifdef MEMWATCH
-        		mwTerm();
-#endif
                         exit(2);
                 }
                 fwrite(&CFG, sizeof(CFG), 1, fp);
@@ -491,33 +490,21 @@ pid_t launch(char *cmd, char *opts, char *name, int tasktype)
 		close(0);
 		if (open("/dev/null", O_RDONLY) != 0) {
 			tasklog('?', "$Launch: \"%s\": reopen of stdin to /dev/null failed", buf);
-#ifdef MEMWATCH
-        		mwTerm();
-#endif
 			_exit(-1);
 		}
 		close(1);
 		if (open("/dev/null", O_WRONLY | O_APPEND | O_CREAT,0600) != 1) {
 			tasklog('?', "$Launch: \"%s\": reopen of stdout to /dev/null failed", buf);
-#ifdef MEMWATCH
-        		mwTerm();
-#endif
 			_exit(-1);
 		}
 		close(2);
 		if (open("/dev/null", O_WRONLY | O_APPEND | O_CREAT,0600) != 2) {
 			tasklog('?', "$Launch: \"%s\": reopen of stderr to /dev/null failed", buf);
-#ifdef MEMWATCH
-        		mwTerm();
-#endif
 			_exit(-1);
 		}
 		errno = 0;
 		rc = execv(vector[0],vector);
 		tasklog('?', "$Launch: execv \"%s\" failed, returned %d", cmd, rc);
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
 		_exit(-1);
 	default:
 		/* grandchild's daddy's process */
@@ -697,9 +684,6 @@ void die(int onsig)
 		unlink(spath);
 	}
 	tasklog(' ', "MBTASK finished");
-#ifdef MEMWATCH
-        mwTerm();
-#endif
 	exit(onsig);
 }
 
@@ -774,6 +758,37 @@ void ulocktask(void)
 }
 
 
+/* different names, same thing... be careful, as these are macros... */
+#ifdef __FreeBSD__
+# define icmphdr   icmp
+# define iphdr     ip
+# define ip_saddr  ip_src.s_addr
+# define ip_daddr  ip_dst.s_addr
+#else
+# define ip_saddr  saddr
+# define ip_daddr  daddr
+# define ip_hl     ihl
+# define ip_p      protocol
+#endif
+
+
+#ifdef __linux__
+# define icmp_type  type
+# define icmp_code  code
+# define icmp_cksum checksum
+# define icmp_id    un.echo.id
+# define icmp_seq   un.echo.sequence
+#endif
+
+#ifdef __FreeBSD__
+# define ICMP_DEST_UNREACH   ICMP_UNREACH
+# define ICMP_TIME_EXCEEDED ICMP_TIMXCEED    
+#endif
+
+#define ICMP_BASEHDR_LEN  8
+#define ICMP4_ECHO_LEN    ICMP_BASEHDR_LEN
+
+
 
 /*
  * Takes a packet as send out and a recieved ICMP packet and looks whether the ICMP packet is 
@@ -794,14 +809,14 @@ static int icmp4_errcmp(char *packet, int plen, struct in_addr *to, char *errmsg
 	if (elen < sizeof(struct iphdr))
                 return 0;
 	memcpy(&iph, errmsg, sizeof(iph));
-	if (iph.protocol != IPPROTO_ICMP || elen < iph.ihl * 4 + ICMP_BASEHDR_LEN + sizeof(eiph))
+	if (iph.ip_p != IPPROTO_ICMP || elen < iph.ip_hl * 4 + ICMP_BASEHDR_LEN + sizeof(eiph))
 		return 0;
-	memcpy(&icmph, errmsg + iph.ihl * 4, ICMP_BASEHDR_LEN);
-	memcpy(&eiph, errmsg + iph.ihl * 4 + ICMP_BASEHDR_LEN, sizeof(eiph));
-	if (elen < iph.ihl * 4 + ICMP_BASEHDR_LEN + eiph.ihl * 4 + 8)
+	memcpy(&icmph, errmsg + iph.ip_hl * 4, ICMP_BASEHDR_LEN);
+	memcpy(&eiph, errmsg + iph.ip_hl * 4 + ICMP_BASEHDR_LEN, sizeof(eiph));
+	if (elen < iph.ip_hl * 4 + ICMP_BASEHDR_LEN + eiph.ip_hl * 4 + 8)
 		return 0;
-	data = errmsg + iph.ihl * 4 + ICMP_BASEHDR_LEN + eiph.ihl * 4;
-	return icmph.type == errtype && memcmp(&to->s_addr, &eiph.daddr, sizeof(to->s_addr)) == 0 && 
+	data = errmsg + iph.ip_hl * 4 + ICMP_BASEHDR_LEN + eiph.ip_hl * 4;
+	return icmph.icmp_type == errtype && memcmp(&to->s_addr, &eiph.ip_daddr, sizeof(to->s_addr)) == 0 && 
 		memcmp(data, packet, plen < 8 ?plen:8) == 0;
 }
 
@@ -825,14 +840,28 @@ int ping_send(struct in_addr addr)
 {
 	int			len;
 	int			isock;
+#ifdef __linux__
 	struct icmp_filter	f;
+#else
+	struct protoent		*pe;
+	int			SOL_IP;
+#endif
 	unsigned long		sum;
 	unsigned short		*ptr;
 
+#ifndef __linux__
+        if (!(pe = getprotobyname("ip"))) {
+                tasklog('?', "icmp ping: getprotobyname() failed: %s", strerror(errno));
+                return -1;
+        }
+        SOL_IP = pe->p_proto;
+#endif
+
 	isock = ping_isocket;
 	p_sequence = 1;
 	id = (unsigned short)get_rand16(); /* randomize a ping id */
 
+#ifdef __linux__
 	/* Fancy ICMP filering -- only on Linux (as far is I know) */
         
 	/* In fact, there should be macros for treating icmp_filter, but I haven't found them in Linux 2.2.15.
@@ -845,12 +874,13 @@ int ping_send(struct in_addr addr)
 			tasklog('?', "$icmp ping: setsockopt() failed %d", isock);
 		return -1;
 	}
+#endif
 
-	icmpd.type     = ICMP_ECHO;
-	icmpd.code     = 0;
-	icmpd.checksum = 0;
-	icmpd.un.echo.id = htons((short)id);
-	icmpd.un.echo.sequence = htons(p_sequence);
+	icmpd.icmp_type  = ICMP_ECHO;
+	icmpd.icmp_code  = 0;
+	icmpd.icmp_cksum = 0;
+	icmpd.icmp_id    = htons((short)id);
+	icmpd.icmp_seq   = htons(p_sequence);
 
        	/* Checksumming - Algorithm taken from nmap. Thanks... */
 
@@ -862,14 +892,14 @@ int ping_send(struct in_addr addr)
 	}
 	sum = (sum >> 16) + (sum & 0xffff);
 	sum += (sum >> 16);
-	icmpd.checksum = ~sum;
+	icmpd.icmp_cksum = ~sum;
 
 	memset(&to, 0, sizeof(to));
 	to.sin_family = AF_INET;
 	to.sin_port   = 0;
 	to.sin_addr   = addr;
 	SET_SOCKA_LEN4(to);
-	if (sendto(isock, &icmpd, ICMP_BASEHDR_LEN, 0, (struct sockaddr *)&to, sizeof(to)) == -1) {
+	if (sendto(isock, &icmpd, ICMP4_ECHO_LEN, 0, (struct sockaddr *)&to, sizeof(to)) == -1) {
 		if (icmp_errs < ICMP_MAX_ERRS)
 			tasklog('?', "$icmp ping: sendto()");
 		return -2;
@@ -908,18 +938,18 @@ int ping_receive(struct in_addr addr)
 		if ((len = recvfrom(isock, &buf, sizeof(buf), 0,(struct sockaddr *)&ffrom, &sl)) != -1) {
 			if (len > sizeof(struct iphdr)) {
 				memcpy(&iph, buf, sizeof(iph));
-				if (len - iph.ihl * 4 >= ICMP_BASEHDR_LEN) {
-					memcpy(&icmpp, ((unsigned long int *)buf)+iph.ihl, sizeof(icmpp));
-					if (iph.saddr == addr.s_addr && 
-					    icmpp.type == ICMP_ECHOREPLY &&
-					    ntohs(icmpp.un.echo.id) == id && 
-					    ntohs(icmpp.un.echo.sequence) <= p_sequence) {
+				if (len - iph.ip_hl * 4 >= ICMP_BASEHDR_LEN) {
+					memcpy(&icmpp, ((unsigned long int *)buf)+iph.ip_hl, sizeof(icmpp));
+					if (iph.ip_saddr == addr.s_addr && 
+					    icmpp.icmp_type == ICMP_ECHOREPLY &&
+					    ntohs(icmpp.icmp_id) == id && 
+					    ntohs(icmpp.icmp_seq) <= p_sequence) {
 						return 0;
 					} else {
 						/* No regular echo reply. Maybe an error? */
-						if (icmp4_errcmp((char *)&icmpd, ICMP_BASEHDR_LEN, 
+						if (icmp4_errcmp((char *)&icmpd, ICMP4_ECHO_LEN, 
 						    &to.sin_addr, buf, len, ICMP_DEST_UNREACH) ||
-						    icmp4_errcmp((char *)&icmpd, ICMP_BASEHDR_LEN, 
+						    icmp4_errcmp((char *)&icmpd, ICMP4_ECHO_LEN, 
 						    &to.sin_addr, buf, len, ICMP_TIME_EXCEEDED)) {
 							return -4;
 						}
@@ -935,6 +965,21 @@ int ping_receive(struct in_addr addr)
 
 
 
+/*
+ *  External Semafore Checks
+ */
+void test_sema(char *);
+void test_sema(char *sema)
+{
+	if (IsSema(sema)) {
+		RemoveSema(sema);
+		tasklog('s', "Semafore %s detected", sema);
+		sem_set(sema, TRUE);
+	}
+}
+
+
+
 /*
  *  Check semafore's, system status flags etc. This is called
  *  each second to test for condition changes.
@@ -969,12 +1014,13 @@ void check_sema(void)
 	get_zmh();
 
 	/*
-	 *  Newnews semafore can also be set in the semafore directory.
+	 *  Semafore's that still can be detected, usefull for
+	 *  external programs that create them.
 	 */
-	if (IsSema((char *)"newnews")) {
-		RemoveSema((char *)"newnews");
-		s_newnews = TRUE;
-	}
+	test_sema((char *)"newnews");
+	test_sema((char *)"mailout");
+	test_sema((char *)"mailin");
+	test_sema((char *)"scanout");
 }
 
 
@@ -1227,8 +1273,6 @@ void scheduler(void)
 
 				if (inet_aton(pingaddress, &paddr)) {
 					rc = ping_send(paddr);
-					if (internet)
-						tasklog('p', "ping send %s id=%d rc=%d", pingaddress, id, rc);
 					if (rc) {
 						if (icmp_errs++ < ICMP_MAX_ERRS)
 							tasklog('?', "ping send %s rc=%d", pingaddress, rc);
@@ -1279,8 +1323,6 @@ void scheduler(void)
                                                 if (!rc) {
                                                         pingstate = P_OK;
                                                         pingresult[pingnr] = TRUE;
-							if (internet)
-								tasklog('p', "ping recv %s id=%d rc=%d", pingaddress, id, rc);
                                                 } else {
 							if (rc != -6)
 								tasklog('p', "ping recv %s id=%d rc=%d", pingaddress, id, rc);
@@ -1306,9 +1348,6 @@ int main(int argc, char **argv)
         pid_t           frk;
         FILE            *fp;
 
-#ifdef MEMWATCH
-        mwInit();
-#endif 
        /*
          * Print copyright notices and setup logging.
          */
@@ -1332,9 +1371,6 @@ int main(int argc, char **argv)
 	if ((ping_isocket = socket(PF_INET, SOCK_RAW, IPPROTO_ICMP)) == -1) {
 		perror("");
 		printf("socket init failed, is mbtask not installed setuid root?\n");
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
 		exit(1);
 	}
 
@@ -1348,27 +1384,18 @@ int main(int argc, char **argv)
 		perror("");
 		printf("can't setuid to mbse\n");
 		close(ping_isocket);
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
 		exit(1);
 	}
 	if (setgid(pw->pw_gid)) {
 		perror("");
 		printf("can't setgid to bbs\n");
 		close(ping_isocket);
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
 		exit(1);
 	}
 
 	umask(007);
         if (locktask(pw->pw_dir)) {
 		close(ping_isocket);
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
                 exit(1);
         }
 
@@ -1385,6 +1412,13 @@ int main(int argc, char **argv)
 	memset(®info, 0, sizeof(reginfo));
 	sprintf(spath, "%s/tmp/mbtask", getenv("MBSE_ROOT"));
 
+	/*
+	 * Now that init is complete and this program is locked, it is
+	 * safe to remove a stale socket if it is there after a crash.
+	 */
+        if (!file_exist(spath, R_OK))
+                unlink(spath);
+
         /*
          * Server initialization is complete. Now we can fork the 
          * daemon and return to the user. We need to do a setpgrp
@@ -1394,8 +1428,8 @@ int main(int argc, char **argv)
          * if the child were to open a terminal, it would become
          * associated with that terminal as its control terminal.
          */
-	if ((pgrp = setpgrp()) == -1) {
-		tasklog('?', "$setpgrp failed");
+	if ((pgrp = setpgid(0, 0)) == -1) {
+		tasklog('?', "$setpgid failed");
 		die(0);
 	}
 
@@ -1424,9 +1458,6 @@ int main(int argc, char **argv)
                         fclose(fp);
                 }
                 tasklog('+', "Starting daemon with pid %d", frk);
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
                 exit(0);
         }
 
diff --git a/mbtask/taskstat.c b/mbtask/taskstat.c
index e9df9e2d..126ad708 100644
--- a/mbtask/taskstat.c
+++ b/mbtask/taskstat.c
@@ -2,7 +2,7 @@
  *
  * File ..................: mbtask/taskstat.c
  * Purpose ...............: Keep track of server status 
- * Last modification date : 09-Jul-2001
+ * Last modification date : 30-Jul-2001
  *
  *****************************************************************************
  * Copyright (C) 1997-2001
@@ -115,9 +115,6 @@ void status_init()
 	cnt = read(stat_fd, &status, sizeof(status_r));
 	if (cnt != sizeof(status_r)) {
 		printf("Error reading status file\n");
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
 		exit(1);
 	}
 	status.startups++;
@@ -128,9 +125,6 @@ void status_init()
 	cnt = write(stat_fd, &status, sizeof(status_r));
 	if (cnt != sizeof(status_r)) {
 		tasklog('?', "$Error rewrite status file\n");
-#ifdef MEMWATCH
-        	mwTerm();
-#endif
 		exit(1);
 	}
 	close(stat_fd);
diff --git a/script/Makefile.am b/script/Makefile.am
index 1be3c7f6..2314f811 100644
--- a/script/Makefile.am
+++ b/script/Makefile.am
@@ -3,7 +3,7 @@
 SUBDIRS = .
 
 install-exec-local:
-	@if [ "$(shell whoami)" != "root" ] ; then \
+	@if [ "`id -un`" != "root" ] ; then \
 		echo; echo " Must be root to install!"; echo; exit 3; \
 	fi
 	@if [ ! -x $(sysconfdir)/maint ]; then \
@@ -22,8 +22,8 @@ install-exec-local:
 		$(INSTALL) -o @OWNER@ -g @GROUP@  -m 0711 monthly     $(sysconfdir) ; \
 		echo "$(INSTALL) -o @OWNER@ -g @GROUP@  -m 0711 monthly     $(sysconfdir)" ; \
 	fi
-	@./installinit
+	@bash ./installinit.sh
 
-EXTRA_DIST = README maint midnight weekly monthly installinit rc rc.shutdown mbse.start mbse.stop
+EXTRA_DIST = README maint midnight weekly monthly installinit.sh rc rc.shutdown mbse.start mbse.stop
 
 
diff --git a/script/Makefile.in b/script/Makefile.in
index 1d668e34..c1c66b8d 100644
--- a/script/Makefile.in
+++ b/script/Makefile.in
@@ -59,6 +59,7 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 AWK = @AWK@
 CC = @CC@
+CHOWN = @CHOWN@
 COMPRESS = @COMPRESS@
 GROUP = @GROUP@
 GZIP = @GZIP@
@@ -70,11 +71,10 @@ OWNER = @OWNER@
 PACKAGE = @PACKAGE@
 RANLIB = @RANLIB@
 VERSION = @VERSION@
-YACC = @YACC@
 
 SUBDIRS = .
 
-EXTRA_DIST = README maint midnight weekly monthly installinit rc rc.shutdown mbse.start mbse.stop
+EXTRA_DIST = README maint midnight weekly monthly installinit.sh rc rc.shutdown mbse.start mbse.stop
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
@@ -88,9 +88,9 @@ GZIP_ENV = --best
 all: all-redirect
 .SUFFIXES:
 $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
-	cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps script/Makefile
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu script/Makefile
 
-Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
 	cd $(top_builddir) \
 	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
 
@@ -189,6 +189,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
 subdir = script
 
 distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu script/Makefile
 	@for file in $(DISTFILES); do \
 	  d=$(srcdir); \
 	  if test -d $$d/$$file; then \
@@ -280,7 +285,7 @@ mostlyclean distclean maintainer-clean
 
 
 install-exec-local:
-	@if [ "$(shell whoami)" != "root" ] ; then \
+	@if [ "`id -un`" != "root" ] ; then \
 		echo; echo " Must be root to install!"; echo; exit 3; \
 	fi
 	@if [ ! -x $(sysconfdir)/maint ]; then \
@@ -299,7 +304,7 @@ install-exec-local:
 		$(INSTALL) -o @OWNER@ -g @GROUP@  -m 0711 monthly     $(sysconfdir) ; \
 		echo "$(INSTALL) -o @OWNER@ -g @GROUP@  -m 0711 monthly     $(sysconfdir)" ; \
 	fi
-	@./installinit
+	@bash ./installinit.sh
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/script/mbse.start b/script/mbse.start
index 0c2f01bd..cd494b6c 100644
--- a/script/mbse.start
+++ b/script/mbse.start
@@ -1,9 +1,9 @@
 #
 # ~/bin/mbse.start
 # BBS Startup script, should be run as BBS owner.
-# Note: This is only used on Slackware systems until 7.0.0
+# Note: This is only used on Slackware systems until 7.0.0 and FreeBSD
 #
-# 27-May-2001 MB.
+# 13-Aug-2001 MB.
 
 if [ "$MBSE_ROOT" = "" ]; then
    export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'`
diff --git a/script/mbse.stop b/script/mbse.stop
index 67f03a82..3ad85cff 100644
--- a/script/mbse.stop
+++ b/script/mbse.stop
@@ -1,9 +1,9 @@
 #
 # ~/bin/mbse.start
 # BBS Shutdown script, should be run as BBS owner.
-# Note: this is only used on Slackware systems.
+# Note: this is only used on Slackware and FreeBSD systems.
 #
-# 27-May-2001 MB.
+# 13-Aug-2001 MB.
 
 export PATH="/sbin:/usr/sbin:/bin:/usr/bin:$MBSE_ROOT/bin:"
 
diff --git a/script/rc b/script/rc
index 22bf17af..73610f4d 100644
--- a/script/rc
+++ b/script/rc
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# $MBSE_ROOT/etc/rc:  BBS Startup script for Slackware.
+# $MBSE_ROOT/etc/rc:  BBS Startup script for Slackware and FreeBSD
 #
-# 08-Jul-1999
+# 13-Aug-2001
 
 # Remove stale tempfiles from cron.
 rm -f /tmp/cron.mbse.*
diff --git a/script/rc.shutdown b/script/rc.shutdown
index 77dbe0c7..237e8cfd 100644
--- a/script/rc.shutdown
+++ b/script/rc.shutdown
@@ -1,8 +1,8 @@
 #!/bin/sh
 #
-# /mnt/prod/mbse/etc/rc.shutdown:  BBS Shutdown script for Slackware
+# /opt/mbse/etc/rc.shutdown:  BBS Shutdown script for Slackware and FreeBSD
 #
-# 08-Jul-1998
+# 13-Aug-2001
 
 if [ "$MBSE_ROOT" = "" ]; then 
    export MBSE_ROOT=`cat /etc/passwd | grep mbse: | awk -F ':' '{ print $6}'`