Upgrade CVS to 0.33.18 current

This commit is contained in:
Michiel Broek 2001-08-25 19:53:11 +00:00
parent 2ff822f657
commit e90745a139
111 changed files with 3126 additions and 3121 deletions

View File

@ -20,7 +20,7 @@ Jan van de Werken
Sean Rima Sean Rima
Juergen Heisel Juergen Heisel
Jim Hansen Jim Hansen
Ken Bowley kbowley@users.sourceforge.net, 1:114/485@fidonet Ken Bowley
Redy Rodriguez 2:283/613.6 Redy Rodriguez 2:283/613.6
Johannes Lundberg 2:206/149@fidonet, <jojo@chaosdev.org> Johannes Lundberg 2:206/149@fidonet, <jojo@chaosdev.org>
Vincent Danen Vincent Danen

View File

@ -4060,3 +4060,86 @@ v0.33.17 21-May-2001
Replaced the internet menu and txtfiles with versions that work Replaced the internet menu and txtfiles with versions that work
with the current menu structure. 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 <nexthop> (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.

View File

@ -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 MBSE BBS is a full Fidonet capable ANSI bbs
package including a mailer (ifcico clone), package including a mailer, tosser, ticfile
tosser, ticfile processor, filefind and other processor, filefind and other utilities.
utilities.
The bbs supports full configurable ANSI The bbs supports full configurable ANSI
menus, multiple languages, IEMSI, standard menus, multiple languages, IEMSI, standard
file transfer protocols, native Linux doors file transfer protocols, native Linux doors,
and BlueWave and QWK offline readers. DOS doors using dosemu and BlueWave and QWK
offline readers.
The mailer supports FTS-0001, YooHoo/2U2, The mailer supports FTS-0001, YooHoo/2U2,
EMSI protocols over modem, TCP/IP IFC and EMSI protocols over modem, TCP/IP IFC and
Binkd protocol. Zedzap, Zmodem, Telink and Binkp protocols. Zedzap, Zmodem, Telink and
Hydra file transfer protocols. Full FTN mail Hydra file transfer protocols. Full FTN mail
support, including automatic routing for hub support, including automatic routing for hub
and host systems. and host systems.
Internal mail format is JAM (c) messagebase. Internal mail format is JAM (c) messagebase.
Full tic file support, including extended 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 Originating sites 2:280/2802@fidonet and
http://mbse.sourceforge.net/ http://mbse.sourceforge.net/
Copyright by Michiel Broek. Copyright by Michiel Broek.

View File

@ -9,22 +9,88 @@ SUBDIRS = @SUBDIRS@
install-exec-local: install-exec-local:
@./checkbasic @./checkbasic
@if [ "$(shell whoami)" != "root" ] ; then \ @if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \ echo; echo " Must be root to install!"; echo; exit 3; \
fi fi
$(mkinstalldirs) $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} @if [ ! -d $(prefix)/bin ] ; then \
$(mkinstalldirs) $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} $(mkinstalldirs) $(prefix)/bin ; \
$(mkinstalldirs) $(prefix)/{english,english/txtfiles,english/menus,english/macro} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/bin ; \
$(mkinstalldirs) $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} fi
$(mkinstalldirs) $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} @if [ ! -d $(prefix)/etc ] ; then \
chown @OWNER@.@GROUP@ $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} $(mkinstalldirs) $(prefix)/etc ; \
chown @OWNER@.@GROUP@ $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} $(mkinstalldirs) $(prefix)/etc/maptabs ; \
chown @OWNER@.@GROUP@ $(prefix)/{english,english/txtfiles,english/menus,english/macro} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc ; \
chown @OWNER@.@GROUP@ $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc/maptabs ; \
chown @OWNER@.@GROUP@ $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} fi
chmod 777 $(prefix)/{sema,tmp} @if [ ! -d $(prefix)/doc ] ; then \
$(mkinstalldirs) /var/spool/mbse $(mkinstalldirs) $(prefix)/doc ; \
$(mkinstalldirs) /var/spool/mbse/{nodelist,unknown,inbound,outbound,badtic,ticqueue,ftp,mail} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/doc ; \
chown -R @OWNER@.@GROUP@ /var/spool/mbse fi
chmod -R 755 /var/spool/mbse @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

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
AUTOMAKE_OPTIONS = foreign dist-zip no-installinfo no-installman 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 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 all: all-redirect
.SUFFIXES: .SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -272,6 +272,11 @@ distdir: $(DISTFILES)
-rm -rf $(distdir) -rm -rf $(distdir)
mkdir $(distdir) mkdir $(distdir)
-chmod 777 $(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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
@ -371,24 +376,90 @@ maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-exec-local: install-exec-local:
@./checkbasic @./checkbasic
@if [ "$(shell whoami)" != "root" ] ; then \ @if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \ echo; echo " Must be root to install!"; echo; exit 3; \
fi fi
$(mkinstalldirs) $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} @if [ ! -d $(prefix)/bin ] ; then \
$(mkinstalldirs) $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} $(mkinstalldirs) $(prefix)/bin ; \
$(mkinstalldirs) $(prefix)/{english,english/txtfiles,english/menus,english/macro} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/bin ; \
$(mkinstalldirs) $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} fi
$(mkinstalldirs) $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} @if [ ! -d $(prefix)/etc ] ; then \
chown @OWNER@.@GROUP@ $(prefix)/{bin,etc,etc/maptabs,doc,fdb,home,log,magic,sema,var,tmp} $(mkinstalldirs) $(prefix)/etc ; \
chown @OWNER@.@GROUP@ $(prefix)/{dutch,dutch/txtfiles,dutch/menus,dutch/macro} $(mkinstalldirs) $(prefix)/etc/maptabs ; \
chown @OWNER@.@GROUP@ $(prefix)/{english,english/txtfiles,english/menus,english/macro} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc ; \
chown @OWNER@.@GROUP@ $(prefix)/{italian,italian/txtfiles,italian/menus,italian/macro} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/etc/maptabs ; \
chown @OWNER@.@GROUP@ $(prefix)/{spanish,spanish/txtfiles,spanish/menus,spanish/macro} fi
chmod 777 $(prefix)/{sema,tmp} @if [ ! -d $(prefix)/doc ] ; then \
$(mkinstalldirs) /var/spool/mbse $(mkinstalldirs) $(prefix)/doc ; \
$(mkinstalldirs) /var/spool/mbse/{nodelist,unknown,inbound,outbound,badtic,ticqueue,ftp,mail} ${CHOWN} @OWNER@.@GROUP@ $(prefix)/doc ; \
chown -R @OWNER@.@GROUP@ /var/spool/mbse fi
chmod -R 755 /var/spool/mbse @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. # 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. # Otherwise a system limit (for SysV at least) may be exceeded.

25
README
View File

@ -1,25 +1,16 @@
MBSE BBS Packages. MBSE BBS Packages.
This needs changes.
Distribution naming scheme: Distribution naming scheme:
mbd0_30a.tgz mbsebbs-0.33.18.tar.gz
^^^^ ^^^ | | | |
||| || | | | +-------- minor patchlevel
||| |+---- Alpha, Beta, Gamma or none for stable version. | | +----------- minor version
||| +----- Minor version number (2 digits). | +------------- major version
||+-------- Major version number. +------------------- package name
|+--------- Package type, see next section.
+---------- Always mb (2 alpha characters).
Package types: For fidonet distribution, the tar archive and FILE_ID.DIZ are
zipped together in a file like mbb03318.zip
b - The complete MBSE BBS package, including mailer and utilities.
i - Internet <> Fidonet gateway software.
p - Pointlist processing software.
Note that for distribution via Fidonet Technology networks the naming scheme
is restricted to dos 8.3 conventions, while longer names would be nicer.

196
SETUP.sh
View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/bash
# #
# Basic setup script for MBSE BBS # 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. # Customisation section, change the next variables to your need.
# However, all docs refer to the setup below. # However, all docs refer to the setup below.
@ -13,6 +13,7 @@ MHOME=/opt/mbse
PATH=/bin:/sbin:/usr/bin:/usr/sbin: PATH=/bin:/sbin:/usr/bin:/usr/sbin:
DISTNAME= DISTNAME=
DISTVERS= DISTVERS=
OSTYPE=`uname -s`
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
@ -42,48 +43,73 @@ read junk
log "+" "MBSE BBS $0 started by `whoami`" log "+" "MBSE BBS $0 started by `whoami`"
log "+" "Current directory is `pwd`" 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. # First do various tests to see which Linux distribution this is.
# #
if [ -f /etc/slackware-version ]; then if [ "$OSTYPE" = "Linux" ]; then
# Slackware 7.0 and later PW=
DISTNAME="Slackware" if [ -f /etc/slackware-version ]; then
DISTVERS=`cat /etc/slackware-version` # Slackware 7.0 and later
else DISTNAME="Slackware"
if [ -f /etc/debian_version ]; then DISTVERS=`cat /etc/slackware-version`
# Debian, at least since version 2.2 DISTVERS=${DISTVERS:0:3}
DISTNAME="Debian"
DISTVERS=`cat /etc/debian_version`
else else
if [ -f /etc/SuSE-release ]; then if [ -f /etc/debian_version ]; then
DISTNAME="SuSE" # Debian, at least since version 2.2
DISTVERS=`cat /etc/SuSE-release | grep VERSION | awk '{ print $3 }'` DISTNAME="Debian"
else DISTVERS=`cat /etc/debian_version`
if [ -f /etc/redhat-release ]; then else
DISTNAME="RedHat" if [ -f /etc/SuSE-release ]; then
DISTVERS=`cat /etc/redhat-release | awk '{ print $5 }'` DISTNAME="SuSE"
DISTVERS=`cat /etc/SuSE-release | grep VERSION | awk '{ print $3 }'`
else else
if [ -f /etc/mandrake-release ]; then if [ -f /etc/redhat-release ]; then
DISTNAME="Mandrake" DISTNAME="RedHat"
# Format: Linux Mandrake release 8.0 (Cooker) for i586 DISTVERS=`cat /etc/redhat-release | awk '{ print $5 }'`
DISTVERS=`cat /etc/mandrake-release | awk '{ print $4 }'` else
else if [ -f /etc/mandrake-release ]; then
if [ -f /etc/rc.d/rc.0 ] && [ -f /etc/rc.d/rc.local ]; then DISTNAME="Mandrake"
# If Slackware wasn't detected yet it is version 4.0 or older. # Format: Linux Mandrake release 8.0 (Cooker) for i586
DISTNAME="Slackware" DISTVERS=`cat /etc/mandrake-release | awk '{ print $4 }'`
DISTVERS="Old"
else 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
fi fi
fi # Linux
if [ "$OSTYPE" = "FreeBSD" ]; then
DISTNAME="FreeBSD"
DISTVERS=`uname -r`
DISTVERS=${DISTVERS:0:3}
PW="pw "
fi fi
log "+" "Detected \"${DISTNAME}\" version \"${DISTVERS}\"" log "+" "Detected \"${OSTYPE}\" (${HOSTTYPE}) \"${DISTNAME}\" version \"${DISTVERS}\""
# Basic checks. # Basic checks.
if [ `whoami` != "root" ]; then if [ `whoami` != "root" ]; then
@ -129,19 +155,44 @@ if [ -f /etc/passwd.lock ]; then
fi fi
clear clear
if [ -d /opt ]; then if [ "$OSTYPE" = "Linux" ]; then
log "+" "Directory /opt already present" if [ -d /opt ]; then
else log "+" "Directory /opt already present"
mkdir /opt else
mkdir /opt
log "+" "[$?] Directory /opt created"
echo "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 fi
cat << EOF cat << EOF
Basic checks done. 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. Everything looks allright to start the installation now.
Next the script will install a new group 'bbs' and two new 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 read junk
clear clear
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
# The real work starts here # The real work starts here
@ -173,10 +223,15 @@ log "+" "Starting installation"
echo "Installing MBSE BBS for the first time..." echo "Installing MBSE BBS for the first time..."
echo "" echo ""
echo -n "Adding group 'bbs'" echo -n "Adding group 'bbs'"
groupadd bbs $PW groupadd bbs
log "+" "[$?] Added group bbs" log "+" "[$?] Added group bbs"
echo -n ", user 'mbse'" 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" log "+" "[$?] Added user mbse"
chmod 770 $MHOME chmod 770 $MHOME
log "+" "[$?] chmod 770 $MHOME" log "+" "[$?] chmod 770 $MHOME"
@ -207,34 +262,41 @@ echo "Now set the login password for user 'mbse'"
passwd mbse passwd mbse
log "+" "[$?] Password is set for user mbse" log "+" "[$?] Password is set for user mbse"
echo -n "Adding user 'bbs'" echo -n "Adding user 'bbs'"
mkdir $MHOME/home if [ ! -d $MHOME/home ]; then
log "+" "[$?] Created directory $MHOME/home" mkdir $MHOME/home
log "+" "[$?] Created directory $MHOME/home"
fi
chown mbse.bbs $MHOME/home chown mbse.bbs $MHOME/home
log "+" "[$?] chown mbse.bbs $MHOME/home log "+" "[$?] chown mbse.bbs $MHOME/home"
chmod 775 $MHOME/home chmod 775 $MHOME/home
log "+" "[$?] 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 if [ "$OSTYPE" = "Linux" ]; then
log "+" "[$?] Added user bbs" 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. # Some systems (RedHat and Mandrake) insist on creating a users homedir.
# These are full of garbage we don't need. Kill it first. # These are full of garbage we don't need. Kill it first.
if [ -d $MHOME/home/bbs ]; then if [ -d $MHOME/home/bbs ]; then
rm -Rf $MHOME/home/bbs rm -Rf $MHOME/home/bbs
log "+" "[$?] Removed $MHOME/home/bbs" log "+" "[$?] Removed $MHOME/home/bbs"
fi fi
mkdir $MHOME/home/bbs mkdir -m 0770 $MHOME/home/bbs
log "+" "[$?] mkdir $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 chown mbse.bbs $MHOME/home/bbs
log "+" "[$?] 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 ", removing password:"
echo -n "$$" >/etc/passwd.lock if [ "$OSTYPE" = "Linux" ]; then
if [ -f /etc/shadow ]; then echo -n "$$" >/etc/passwd.lock
log "+" "Shadow password system" if [ -f /etc/shadow ]; then
log "+" "Standard shadow password system"
# Not all systems are the same... # Not all systems are the same...
if [ "`grep bbs:\!\!: /etc/shadow`" != "" ]; then if [ "`grep bbs:\!\!: /etc/shadow`" != "" ]; then
sed /bbs:\!\!:/s/bbs:\!\!:/bbs::/ /etc/shadow >/etc/shadow.bbs 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)" log "+" "[$?] Default style owner of /etc/shadow (0600 root.root)"
fi fi
echo " File /etc/shadow.mbse is your backup of /etc/shadow" echo " File /etc/shadow.mbse is your backup of /etc/shadow"
else else
log "+" "Not a shadow password system" log "+" "Not a shadow password system"
if [ "`grep bbs:\!\!: /etc/passwd`" != "" ]; then if [ "`grep bbs:\!\!: /etc/passwd`" != "" ]; then
sed /bbs:\!\!:/s/bbs:\!\!:/bbs::/ /etc/passwd >/etc/passwd.bbs sed /bbs:\!\!:/s/bbs:\!\!:/bbs::/ /etc/passwd >/etc/passwd.bbs
@ -271,10 +333,19 @@ else
chmod 644 /etc/passwd chmod 644 /etc/passwd
log "+" "[$?] Changed owner of /etc/passwd" log "+" "[$?] Changed owner of /etc/passwd"
echo " File /etc/passwd.mbse is your backup 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 fi
rm /etc/passwd.lock
echo "" echo ""
if [ "`grep binkp /etc/services`" = "" ]; then if [ "`grep binkp /etc/services`" = "" ]; then
BINKD=TRUE BINKD=TRUE
else else
@ -358,8 +429,15 @@ cat << EOF
or /etc/shadow, the backup copies have the extension '.mbse'. or /etc/shadow, the backup copies have the extension '.mbse'.
Then issue (as root of course) the following commands: Then issue (as root of course) the following commands:
userdel bbs
userdel -r mbse
groupdel bbs
EOF 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

14
TODO
View File

@ -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 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. N: Deleting a line in the FS editor with the BS key gives a SEGFAULT.
mbfido: mbfido:
U: postnetmail doesn't set msgid and reply for storenet.
U: Code cleanup and make a structure in this program. Remove duplicate U: Code cleanup and make a structure in this program. Remove duplicate
or similar functions. 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 N: Remove memory leak during toss. (It's ok for less 5000 messages for
each run). each run).
@ -56,6 +60,14 @@ mbfido:
To: address in the message, the gate doesn't see that and uses the To: address in the message, the gate doesn't see that and uses the
name to "All". 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: mbcico:
L: Implement modem connect response translation for ISDN lines, i.e. L: Implement modem connect response translation for ISDN lines, i.e.
make the CAUSE responses human readable. see McMail for this make the CAUSE responses human readable. see McMail for this

View File

@ -12,10 +12,8 @@
#undef HAVE_MKSTEMP #undef HAVE_MKSTEMP
/* If you have gettimeofday function */ /* If you have gettimeofday function */
#undef HAVE_GETTIMEOFDAY
#undef HAVE_DECLARED_TIMEZONE #undef HAVE_DECLARED_TIMEZONE
#undef HAVE_TM_GMTOFF #undef HAVE_TM_GMTOFF
#undef HAVE_TM_ZONE
/* If you don't have pid_t */ /* If you don't have pid_t */
#undef DONT_HAVE_PID_T #undef DONT_HAVE_PID_T
@ -56,11 +54,6 @@
#undef AUTH_METHODS #undef AUTH_METHODS
#undef CKDEFS #undef CKDEFS
#undef DOUBLESIZE #undef DOUBLESIZE
#undef HAVE_A64L
#undef HAVE_FCHMOD
#undef HAVE_FCHOWN
#undef HAVE_FSYNC
#undef HAVE_LCKPWDF
#undef HAVE_LIBCRACK #undef HAVE_LIBCRACK
#undef HAVE_LIBCRACK_HIST #undef HAVE_LIBCRACK_HIST
#undef KEEP_NIS_AT_END #undef KEEP_NIS_AT_END

View File

@ -37,6 +37,9 @@
/* Define if you have the vprintf function. */ /* Define if you have the vprintf function. */
#undef HAVE_VPRINTF #undef HAVE_VPRINTF
/* Define to `int' if <sys/types.h> doesn't define. */
#undef mode_t
/* Define to `long' if <sys/types.h> doesn't define. */ /* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t #undef off_t
@ -52,6 +55,9 @@
/* Define to `unsigned' if <sys/types.h> doesn't define. */ /* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t #undef size_t
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
#undef STAT_MACROS_BROKEN
/* Define if you have the ANSI C header files. */ /* Define if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
@ -67,18 +73,9 @@
/* Define vfork as fork if vfork does not work. */ /* Define vfork as fork if vfork does not work. */
#undef vfork #undef vfork
/* Define if lex declares yytext as a char * by default, not a char[]. */
#undef YYTEXT_POINTER
/* Memory debugging */ /* Memory debugging */
#undef MEMWATCH #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 */ /* If you don't have pid_t */
#undef DONT_HAVE_PID_T #undef DONT_HAVE_PID_T
@ -102,6 +99,20 @@
#undef SHADOW_PASSWORD #undef SHADOW_PASSWORD
#undef SO_OOBINLINE #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. */ /* Define if you have the a64l function. */
#undef HAVE_A64L #undef HAVE_A64L
@ -114,6 +125,9 @@
/* Define if you have the fchown function. */ /* Define if you have the fchown function. */
#undef HAVE_FCHOWN #undef HAVE_FCHOWN
/* Define if you have the fdatasync function. */
#undef HAVE_FDATASYNC
/* Define if you have the fsync function. */ /* Define if you have the fsync function. */
#undef HAVE_FSYNC #undef HAVE_FSYNC
@ -144,6 +158,9 @@
/* Define if you have the putenv function. */ /* Define if you have the putenv function. */
#undef HAVE_PUTENV #undef HAVE_PUTENV
/* Define if you have the putpwent function. */
#undef HAVE_PUTPWENT
/* Define if you have the re_comp function. */ /* Define if you have the re_comp function. */
#undef HAVE_RE_COMP #undef HAVE_RE_COMP
@ -198,6 +215,9 @@
/* Define if you have the <fcntl.h> header file. */ /* Define if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H
/* Define if you have the <gshadow.h> header file. */
#undef HAVE_GSHADOW_H
/* Define if you have the <malloc.h> header file. */ /* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H #undef HAVE_MALLOC_H
@ -207,6 +227,12 @@
/* Define if you have the <netinet/in.h> header file. */ /* Define if you have the <netinet/in.h> header file. */
#undef HAVE_NETINET_IN_H #undef HAVE_NETINET_IN_H
/* Define if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
/* Define if you have the <shadow.h> header file. */
#undef HAVE_SHADOW_H
/* Define if you have the <sys/dir.h> header file. */ /* Define if you have the <sys/dir.h> header file. */
#undef HAVE_SYS_DIR_H #undef HAVE_SYS_DIR_H
@ -219,18 +245,33 @@
/* Define if you have the <sys/ndir.h> header file. */ /* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H #undef HAVE_SYS_NDIR_H
/* Define if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
/* Define if you have the <sys/time.h> header file. */ /* Define if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H #undef HAVE_SYS_TIME_H
/* Define if you have the <sys/vfs.h> header file. */
#undef HAVE_SYS_VFS_H
/* Define if you have the <syslog.h> header file. */ /* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H #undef HAVE_SYSLOG_H
/* Define if you have the <termio.h> header file. */ /* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIO_H #undef HAVE_TERMIOS_H
/* Define if you have the <ulimit.h> header file. */
#undef HAVE_ULIMIT_H
/* Define if you have the <unistd.h> header file. */ /* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define if you have the <usersec.h> header file. */
#undef HAVE_USERSEC_H
/* Define if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
/* Name of package */ /* Name of package */
#undef PACKAGE #undef PACKAGE

866
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,12 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
AC_INIT(lib/libs.h) AC_INIT(lib/libs.h)
AM_CONFIG_HEADER(config.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) AC_SUBST(SUBDIRS)
dnl General settings for MBSE BBS dnl General settings for MBSE BBS
MBSE_PACKAGE=mbsebbs MBSE_PACKAGE=mbsebbs
MBSE_VERSION=0.33.17 MBSE_VERSION=0.33.18
AC_SUBST(PACKAGE, $MBSE_PACKAGE) AC_SUBST(PACKAGE, $MBSE_PACKAGE)
AC_SUBST(VERSION, $MBSE_VERSION) AC_SUBST(VERSION, $MBSE_VERSION)
AM_INIT_AUTOMAKE($MBSE_PACKAGE, $MBSE_VERSION) AM_INIT_AUTOMAKE($MBSE_PACKAGE, $MBSE_VERSION)
@ -25,8 +25,7 @@ AC_CHECK_PROG(AWK, awk, awk)
AC_PROG_INSTALL AC_PROG_INSTALL
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_RANLIB AC_PROG_RANLIB
AC_PROG_YACC AC_PATH_PROG(CHOWN, chown, chown, /bin:/sbin:/usr/bin:/usr/sbin:)
AM_PROG_LEX
CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe" CFLAGS="$CFLAGS -Wall -Wshadow -Wwrite-strings -Wstrict-prototypes -pipe"
dnl Additional commandline switches dnl Additional commandline switches
@ -49,6 +48,23 @@ AC_DEFINE_UNQUOTED(RESTAMP_OLD_POSTINGS, 21)
AC_DEFINE(RESTAMP_FUTURE_POSTINGS) AC_DEFINE(RESTAMP_FUTURE_POSTINGS)
dnl Checks for libraries. 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 <pwd.h>],
[ 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 <pwd.h>],
[ 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) AC_CHECK_LIB(shadow,setspent,result=yes,result=no)
if test "$result" = "yes"; then if test "$result" = "yes"; then
LIBS="$LIBS -lshadow" LIBS="$LIBS -lshadow"
@ -70,6 +86,7 @@ else
fi fi
fi fi
fi fi
if test "$SHADOW_PASSWORD" = "1"; then if test "$SHADOW_PASSWORD" = "1"; then
if test "$ac_cv_func_fgetspent" != "yes"; then if test "$ac_cv_func_fgetspent" != "yes"; then
AC_CHECK_LIB(shadow,fgetspent,result=yes,result=no) AC_CHECK_LIB(shadow,fgetspent,result=yes,result=no)
@ -81,6 +98,7 @@ if test "$SHADOW_PASSWORD" = "1"; then
fi fi
AC_DEFINE(SHADOW_PASSWORD) AC_DEFINE(SHADOW_PASSWORD)
fi fi
AC_CHECK_LIB(crypt,crypt,result=yes,result=no) AC_CHECK_LIB(crypt,crypt,result=yes,result=no)
if test "$result" = "yes"; then if test "$result" = "yes"; then
LIBS="$LIBS -lcrypt" LIBS="$LIBS -lcrypt"
@ -91,7 +109,8 @@ dnl Checks for header files.
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_STDC AC_HEADER_STDC
AC_HEADER_SYS_WAIT 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 AC_STRUCT_TIMEZONE
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
@ -99,13 +118,15 @@ AC_C_CONST
AC_TYPE_UID_T AC_TYPE_UID_T
AC_TYPE_OFF_T AC_TYPE_OFF_T
AC_TYPE_PID_T AC_TYPE_PID_T
AC_TYPE_MODE_T
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_STRUCT_ST_BLKSIZE AC_STRUCT_ST_BLKSIZE
AC_HEADER_STAT
AC_HEADER_TIME AC_HEADER_TIME
AC_STRUCT_TM AC_STRUCT_TM
dnl Checks for library functions. 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_FUNC_FNMATCH
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
@ -143,7 +164,6 @@ AC_OUTPUT(
mbcico/Makefile mbcico/Makefile
mbfido/Makefile mbfido/Makefile
mbfido/paths.h mbfido/paths.h
mbftpd/Makefile
mbmon/Makefile mbmon/Makefile
mbsebbs/Makefile mbsebbs/Makefile
mbtask/Makefile mbtask/Makefile

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = . SUBDIRS = .
@ -88,9 +88,9 @@ GZIP_ENV = --best
all: all-redirect all: all-redirect
.SUFFIXES: .SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -189,6 +189,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = examples subdir = examples
distdir: $(DISTFILES) 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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \

View File

@ -3,11 +3,12 @@
SUBDIRS = . 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 \ flow.html postfix.html gwnews.html index.htm ups.html \
install.html intergate.html intro.html invoking.html \ install.html intergate.html intro.html invoking.html \
known_bugs.html mgetty.html routing.html nodelist.html \ known_bugs.html mgetty.html routing.html nodelist.html
ftsc/fsc-0039.html ftsc/fsc-0056.html ftsc/fsc-0087.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/fsp-1003.html ftsc/fsp-1009.html ftsc/fts-0007.html \
ftsc/fsc-0046.html ftsc/fsc-0057.html ftsc/fsc-0091.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/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/fsc-0049.html ftsc/fsc-0062.html ftsc/fsc-0093.html \
ftsc/fsp-1006.html ftsc/fts-0004.html ftsc/index.htm \ ftsc/fsp-1006.html ftsc/fts-0004.html ftsc/index.htm \
ftsc/fsc-0050.html ftsc/fsc-0070.html ftsc/fsp-1001.html \ 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/fsc-0072.html ftsc/fsp-1002.html ftsc/fsp-1008.html \
ftsc/fts-0006.html ftsc/fsc-0035.html ftsc/fsp-1010.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/fsp-1011.html ftsc/ftscprod.html ftsc/fsc-0088.html \
ftsc/fts-4001.html \ ftsc/fts-4001.html ftsc/fts-5001.html
images/b_arrow.gif images/magic.gif images/nodes1.gif \
H_IMAGES = images/b_arrow.gif images/magic.gif images/nodes1.gif \
images/connec.gif images/mbsetup0.gif images/nodes2.gif \ images/connec.gif images/mbsetup0.gif images/nodes2.gif \
images/domains.gif images/mbsetup1.6.S.gif images/nodes3.gif \ images/domains.gif images/mbsetup1.6.S.gif images/nodes3.gif \
images/e_menu.gif images/mbsetup1.6.gif images/nodes4.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/hatch.gif images/nodelist4.gif images/tty3.gif \
images/language.gif images/nodelist5.gif images/uarrow.gif \ images/language.gif images/nodelist5.gif images/uarrow.gif \
images/larrow.gif images/nodes.gif images/users.gif \ images/larrow.gif images/nodes.gif images/users.gif \
images/mbse.jpg images/taskmgr.gif \ images/mbse.jpg images/taskmgr.gif
license/copying.html license/hydracom.html license/index.htm \
license/jam.html \ H_LICENSE = license/copying.html license/hydracom.html license/index.htm \
menus/control.html menus/index.htm menus/menu100.html \ license/jam.html
H_MENUS = menus/control.html menus/index.htm menus/menu100.html \
menus/menu300.html menus/menu500.html \ menus/menu300.html menus/menu500.html \
menus/menu0.html menus/menu200.html menus/menu400.html \ menus/menu0.html menus/menu200.html menus/menu400.html
misc/dropfile.html misc/fileid.html misc/index.htm \
H_MISC = misc/dropfile.html misc/fileid.html misc/index.htm \
misc/jam.html misc/semafore.html misc/filefind.html \ misc/jam.html misc/semafore.html misc/filefind.html \
misc/ftpserver.html misc/ipmailer.html misc/outbound.html \ misc/ftpserver.html misc/ipmailer.html misc/outbound.html \
misc/usleep.html \ misc/usleep.html
programs/import.html programs/mbchat.html \
H_PROGS = programs/import.html programs/mbchat.html \
programs/mbfido.html programs/mbmon.html \ programs/mbfido.html programs/mbmon.html \
programs/mbtoberep.html \ programs/mbtoberep.html \
programs/index.htm programs/mbcico.html \ programs/index.htm programs/mbcico.html \
@ -58,8 +64,9 @@ programs/mbsetup.html programs/mbuseradd.html \
programs/mball.html programs/mbfbgen.html \ programs/mball.html programs/mbfbgen.html \
programs/mblang.html programs/mbsebbs.html \ programs/mblang.html programs/mbsebbs.html \
programs/mbstat.html programs/mbpasswd.html \ programs/mbstat.html programs/mbpasswd.html \
programs/mbtask.html programs/mbmail.html \ programs/mbtask.html programs/mbmail.html
setup/archiver.html setup/index.htm setup/bbs.html \
H_SETUP = setup/archiver.html setup/index.htm setup/bbs.html \
setup/bbslist.html setup/language.html setup/oneliner.html \ setup/bbslist.html setup/language.html setup/oneliner.html \
setup/emareas.html setup/magic.html setup/mail.html \ setup/emareas.html setup/magic.html setup/mail.html \
setup/protocol.html setup/emgroup.html setup/safe.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/hatch.html setup/virscan.html setup/services.html \
setup/domains.html setup/taskmgr.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: install-exec-local:
rm -Rf $(prefix)/html
$(mkinstalldirs) $(prefix)/html
@echo "Installing html documentation in $(prefix)/html" @echo "Installing html documentation in $(prefix)/html"
@cp -Pr $(EXTRA_DIST) $(prefix)/html @rm -Rf $(prefix)/html
chown -R @OWNER@.@GROUP@ $(prefix)/html @$(mkinstalldirs) $(prefix)/html
chmod -R 0644 $(prefix)/html/*.htm* @$(mkinstalldirs) $(prefix)/html/ftsc
chmod -R 0644 $(prefix)/html/images/*.gif @$(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

View File

@ -61,6 +61,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -72,12 +73,34 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = . 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 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES = CONFIG_CLEAN_FILES =
@ -91,9 +114,9 @@ GZIP_ENV = --best
all: all-redirect all: all-redirect
.SUFFIXES: .SUFFIXES:
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -192,6 +215,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = html subdir = html
distdir: $(DISTFILES) 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 \ $(mkinstalldirs) $(distdir)/ftsc $(distdir)/images $(distdir)/license \
$(distdir)/menus $(distdir)/misc $(distdir)/programs \ $(distdir)/menus $(distdir)/misc $(distdir)/programs \
$(distdir)/setup $(distdir)/setup
@ -286,13 +314,32 @@ mostlyclean distclean maintainer-clean
install-exec-local: install-exec-local:
rm -Rf $(prefix)/html
$(mkinstalldirs) $(prefix)/html
@echo "Installing html documentation in $(prefix)/html" @echo "Installing html documentation in $(prefix)/html"
@cp -Pr $(EXTRA_DIST) $(prefix)/html @rm -Rf $(prefix)/html
chown -R @OWNER@.@GROUP@ $(prefix)/html @$(mkinstalldirs) $(prefix)/html
chmod -R 0644 $(prefix)/html/*.htm* @$(mkinstalldirs) $(prefix)/html/ftsc
chmod -R 0644 $(prefix)/html/images/*.gif @$(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. # 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. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -11,7 +11,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 27-May-2001</h5> <h5>Last update 07-Aug-2001</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<h1>MBSE BBS Basic Installation</h1> <h1>MBSE BBS Basic Installation</h1>
@ -27,13 +27,13 @@ environment. If you don't do this, things will fail.
MBSE BBS is default installed in <b>/opt/mbse</b>. The spoolfiles (in and MBSE BBS is default installed in <b>/opt/mbse</b>. The spoolfiles (in and
outbound, message bases) go into <b>/var/spool/mbse</b>. In the <b>/opt/mbse</b> outbound, message bases) go into <b>/var/spool/mbse</b>. In the <b>/opt/mbse</b>
path are several subdirectories, <b>bin</b> for the binaries, <b>etc</b> for the path are several subdirectories, <b>bin</b> for the binaries, <b>etc</b> for the
configuration and some scripts, <b>english</b> and <b>dutch</b> for the language configuration and some scripts, <b>english, spanish, italian</b> and <b>dutch</b> for the language
files and menus, <b>home</b> for the users homedirectories, <b>log</b> for the files and menus, <b>home</b> for the users homedirectories, <b>log</b> for the
logfiles, <b>magic</b> for the filerequest magicnames, <b>fdb</b> for the files logfiles, <b>magic</b> for the filerequest magicnames, <b>fdb</b> for the files
database, <b>var</b> for some statistic files and <b>tmp</b> as temp directory. database, <b>var</b> for some statistic files and <b>tmp</b> as temp directory.
<p> <p>
Don't use UMSDOS or SAMBA filesystems for the bbs, stick by the standard Linux 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 by FTP and WWW you must create the directory structure under the ftp user
behind the pub directory. Read <a href="misc/ftpserver.html">the behind the pub directory. Read <a href="misc/ftpserver.html">the
ftp server</a> doc for details. If you don't follow these guidlines, you ftp server</a> 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: To start the script type:
<pre> <pre>
cd mbsebbs-0.33.nn cd mbsebbs-0.33.nn
sh ./SETUP.sh bash ./SETUP.sh
</pre> </pre>
Yes, use <b>bash</b> 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: The script does the following:
<ol> <ol>
<li>Create the group <strong>bbs</strong> <li>Create the group <strong>bbs</strong>
@ -80,6 +82,7 @@ easy to guess of course. The script will then continue again:
<li>The user <strong>bbs</strong> is added. <li>The user <strong>bbs</strong> is added.
<li>The password will be removed from user <strong>bbs</strong> This action <li>The password will be removed from user <strong>bbs</strong> This action
will make changes in /etc/shadow (if you have that) otherwise in /etc/passwd. 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.
<li>If they don't exist in the file /etc/services the services fido, tfido <li>If they don't exist in the file /etc/services the services fido, tfido
and binkp will be added. and binkp will be added.
<li>If they don't exist in the file /etc/inetd.conf the internet protocols <li>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 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 the backups of the system files that are changed are in /etc with the
extension <strong>.mbse</strong> i.e: those were the original files. extension <strong>.mbse</strong> i.e: those were the original files.
If everythings is allright, then remove the directory /tmp/mbsebbs-0.33.nn:
<pre>
cd /tmp
rm -Rf mbsebbs-0.33.nn
</pre>
<p>&nbsp;<p> <p>&nbsp;<p>
<h3>Step 4: Install the basic packages.</h3> <h3>Step 4: Install the basic packages.</h3>
@ -103,9 +111,7 @@ archives:
<pre> <pre>
tar xfvz /path/to/mbsebbs-0.33.nn.tar.gz tar xfvz /path/to/mbsebbs-0.33.nn.tar.gz
</pre> </pre>
You now have the subdirectory with sources in the right place. Indeed, if you You now have the subdirectory with sources in the right place.
have a new installation, you also have unpacked the archive somewere else
to run the installation script. That one can be removed.
Next build the binaries and install them using the folowing commands: Next build the binaries and install them using the folowing commands:
<pre> <pre>
cd ~/mbsebbs-0.33.nn cd ~/mbsebbs-0.33.nn
@ -119,7 +125,7 @@ exit
The last part of the installation procedure shows you the location of the bbs 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 startup script that is added to your system. Because this is your first
time installation, example menus, textfiles and some databases are installed. 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. will not be installed again.
<p> <p>
Now you must start the <b>mbtask</b> daemon by hand by typing <b>/opt/mbse/bin/mbtask</b>. Now you must start the <b>mbtask</b> daemon by hand by typing <b>/opt/mbse/bin/mbtask</b>.

View File

@ -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. 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 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 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. create and maintain html pages for the file areas.
<P>&nbsp;<P> <P>&nbsp;<P>

View File

@ -11,7 +11,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 08-Jun-2001</h5> <h5>Last update 11-Aug-2001</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<h1>Fidonet Technical Standards</h1> <h1>Fidonet Technical Standards</h1>
@ -82,12 +82,14 @@ Michiel Broek.
<li>FTS-0002 Obsoleted by FTS-0005 <li>FTS-0002 Obsoleted by FTS-0005
<li>FTS-0003 Obsoleted by FTS-0006 <li>FTS-0003 Obsoleted by FTS-0006
<li><a href="fts-0004.html">FTS-0004 Echomail specification, B.Hartman</a> <li><a href="fts-0004.html">FTS-0004 Echomail specification, B.Hartman</a>
<li><a href="fts-0005.html">FTS-0005 The distribution nodelist, B.Baker, R.Moore, D.Nugent</a> <li>FTS-0005 Obsoleted by FTS-5000
<li><a href="fts-0006.html">FTS-0006 YOOHOO and YOOHOO/2U2, V.Perriello</a> <li><a href="fts-0006.html">FTS-0006 YOOHOO and YOOHOO/2U2, V.Perriello</a>
<li><a href="fts-0007.html">FTS-0007 SEAlink protocol extension, P.Becker</a> <li><a href="fts-0007.html">FTS-0007 SEAlink protocol extension, P.Becker</a>
<li><a href="fts-0008.html">FTS-0008 Bark file-request protocol extension, P.Becker</a> <li><a href="fts-0008.html">FTS-0008 Bark file-request protocol extension, P.Becker</a>
<li><a href="fts-0009.html">FTS-0009 Message identification and reply linkage, J.Nutt</a> <li><a href="fts-0009.html">FTS-0009 Message identification and reply linkage, J.Nutt</a>
<li><a href="fts-4001.html">FTS-4001 Addressing Control Paragraphs, Goran Eriksson</a> <li><a href="fts-4001.html">FTS-4001 Addressing Control Paragraphs, Goran Eriksson</a>
<li><a href="fts-5000.html">FTS-5000 The distribution nodelist, David Hallford</a>
<li><a href="fts-5001.html">FTS-5001 Nodelist flags and user flags, David Hallford</a>
</ul> </ul>
<HR> <HR>

View File

@ -12,10 +12,10 @@
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<center><img SRC="images/mbse.jpg" BORDER=0></center> <center><img SRC="images/mbse.jpg" BORDER=0></center>
<h1>MBSE BBS System Guide v0.33.17</h1> <h1>MBSE BBS System Guide v0.33.18</h1>
<HR> <HR>
<h5>Last update 07-Jul-2001</h5><BR><P> <h5>Last update 27-Jul-2001</h5><BR><P>
<h3><a NAME="top"></a>Introduction</h3> <h3><a NAME="top"></a>Introduction</h3>

View File

@ -56,7 +56,7 @@ name of that area and echomail received in that area will automatic be
posted to that newsgroup. The command <b>mbfido news</b> will check all posted to that newsgroup. The command <b>mbfido news</b> will check all
configured newsgroups for new newsarticles. If you set it up for the first configured newsgroups for new newsarticles. If you set it up for the first
time you need to run <strong>mbfido news -learn</strong> to fill the dupes time you need to run <strong>mbfido news -learn</strong> 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 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 command once after you have set this up. Later when you receive fresh articles
the command <strong>mbfido news</strong> will only gate new arrived articles. the command <strong>mbfido news</strong> will only gate new arrived articles.

View File

@ -11,7 +11,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 22-jul-2001</h5> <h5>Last update 27-jul-2001</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<H1>Semafore files with MBSE BBS.</H1> <H1>Semafore files with MBSE BBS.</H1>
@ -19,7 +19,7 @@
The directory $MBSE_ROOT/sema is the hardcoded semafore directory where all 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, 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. 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.
<PRE> <PRE>
zmh Purpose: to mark the state of Zone Mail Hour. 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. Checked by mbtask to start news processing.
Removed by mbtask as soon as it is detected. 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 mbtask.last Purpose: A timestamp created and touched by "mbtask" every
minute so you can check it is running. minute so you can check it is running.
</PRE> </PRE>

View File

@ -11,7 +11,7 @@
</HEAD> </HEAD>
<BODY> <BODY>
<BLOCKQUOTE> <BLOCKQUOTE>
<h5>Last update 21-Jun-2001</h5> <h5>Last update 25-Aug-2001</h5>
<P>&nbsp;<P> <P>&nbsp;<P>
<H1 ALIGN="CENTER">MBSE BBS - Internet Gateway - Postfix setup.</H1> <H1 ALIGN="CENTER">MBSE BBS - Internet Gateway - Postfix setup.</H1>
@ -97,7 +97,7 @@ uucp unix - n n - - pipe
ifmail unix - n n - 1 pipe ifmail unix - n n - 1 pipe
flags=F user=fido argv=/usr/local/bin/ifmail -r $nexthop ($recipient) flags=F user=fido argv=/usr/local/bin/ifmail -r $nexthop ($recipient)
mbmail unix - n n - 1 pipe 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 bsmtp unix - n n - - pipe
flags=F. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient flags=F. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
</pre> </pre>

View File

@ -119,7 +119,7 @@ the temporary file is removed.
<H3>Alias file.</H3> <H3>Alias file.</H3>
<P> <P>
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. aliases from there.
If "from" address of a message from FidoNet matches <b>right</b> side If "from" address of a message from FidoNet matches <b>right</b> side
of some entry in alias file, then the Reply-To: header is created 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. 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. 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 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.
<P> <P>
<code><strong>mbfido</strong> [command] -nodupe</code> <code><strong>mbfido</strong> [command] -nodupe</code>
Disable checking for duplicate's. Normally you should not use this switch. Disable checking for duplicate's. Normally you should not use this switch.

View File

@ -29,7 +29,7 @@ is present on all Linux systems. To use <b>passwd</b> to change the password of
another user is only allowed by <b>root</b>. The mbpasswd program overcomes this limitation. another user is only allowed by <b>root</b>. The mbpasswd program overcomes this limitation.
The wrapper <b>mbpasswd</b> is run from the bbs by user <b>mbse</b> when an ordinary The wrapper <b>mbpasswd</b> is run from the bbs by user <b>mbse</b> when an ordinary
user is logged in the bbs. The program is called when a new user logs in the bbs or 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 password in the bbs program. This is necessary for the user to be able to get
his email using the pop3 protocol.<P> his email using the pop3 protocol.<P>
You never need to run <strong>mbpasswd</strong> by hand, in fact it is protected so that only You never need to run <strong>mbpasswd</strong> by hand, in fact it is protected so that only

View File

@ -54,7 +54,7 @@ But before any program is started a number of things are checked:
<LI>The UPS semafore <b>upsalarm</b> will be checked. This means that the system is running on <LI>The UPS semafore <b>upsalarm</b> will be checked. This means that the system is running on
battery power and no new jobs are started. battery power and no new jobs are started.
<LI>The UPS semafore <b>upsdown</b> will be checked. This is the fatal one, if <LI>The UPS semafore <b>upsdown</b> will be checked. This is the fatal one, if
this one excists <b>mbtask</b> will try to stop all current running jobs. this one exists <b>mbtask</b> will try to stop all current running jobs.
If there are no jobs left running then <b>mbtask</b> will stop itself. If there are no jobs left running then <b>mbtask</b> will stop itself.
The upsdown semafore means that the system The upsdown semafore means that the system
will shutdown and power off, that's why it's fatal and there is no way back.<br> will shutdown and power off, that's why it's fatal and there is no way back.<br>
@ -86,7 +86,7 @@ The checks and actions are:
<tr><td>mailout</td><td>Fast</td><td>mbfido</td><td>Max. 1 mbfido task</td><td>mbfido scan web -quiet</td></tr> <tr><td>mailout</td><td>Fast</td><td>mbfido</td><td>Max. 1 mbfido task</td><td>mbfido scan web -quiet</td></tr>
<tr><td>mailin</td><td>Fast</td><td>mbfido</td><td>Max. 1 mbfido task</td><td>mbfido tic toss web -quiet</td></tr> <tr><td>mailin</td><td>Fast</td><td>mbfido</td><td>Max. 1 mbfido task</td><td>mbfido tic toss web -quiet</td></tr>
<tr><td>newnews</td><td>Fast</td><td>mbfido</td><td>Max. 1 mbfido task</td><td>mbfido news web -quiet</td></tr> <tr><td>newnews</td><td>Fast</td><td>mbfido</td><td>Max. 1 mbfido task</td><td>mbfido news web -quiet</td></tr>
<tr><td>mbindex</td><td>Fast</td><td>mbindex</td><td>No other tasks</td><td>mbindex -quiet and if excist: goldnode</td></tr> <tr><td>mbindex</td><td>Fast</td><td>mbindex</td><td>No other tasks</td><td>mbindex -quiet and if exist: goldnode</td></tr>
<tr><td>msglink</td><td>Fast</td><td>mbfido</td><td>No other tasks</td><td>mbmsg link -quiet</td></tr> <tr><td>msglink</td><td>Fast</td><td>mbfido</td><td>No other tasks</td><td>mbmsg link -quiet</td></tr>
<tr><td>reqindex</td><td>Fast</td><td>mbfile</td><td>No other tasks</td><td>mbfile index -quiet</td></tr> <tr><td>reqindex</td><td>Fast</td><td>mbfile</td><td>No other tasks</td><td>mbfile index -quiet</td></tr>
<tr><td>scanout</td><td>Slow</td><td>call</td><td>Only 1 call task</td><td>mbcico -r1</td></tr> <tr><td>scanout</td><td>Slow</td><td>call</td><td>Only 1 call task</td><td>mbcico -r1</td></tr>

View File

@ -29,7 +29,7 @@ and incoming netmail will be converted to email and send to <strong>listserv</st
at your host.<br> at your host.<br>
If you should want to run some votemanager on your system you can If you should want to run some votemanager on your system you can
do that by creating a service <b>votemgr</b> with the type set to <b>email</b>. do that by creating a service <b>votemgr</b> with the type set to <b>email</b>.
You also need to setup a valid unix user <b>votemgr</b> so that there will be an excisting You also need to setup a valid unix user <b>votemgr</b> so that there will be an existing
mailbox. Then with some external scripts you can process all received messages. mailbox. Then with some external scripts you can process all received messages.
<P>&nbsp;<P> <P>&nbsp;<P>

View File

@ -34,7 +34,7 @@ they are:
not logged out, they will be disconnected anyway. not logged out, they will be disconnected anyway.
</ol> </ol>
I know not all UPS software can do this but most UPS software is open source so you can change it to create 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. startup scripts will remove them before the bbs is started.
<P>&nbsp;<P> <P>&nbsp;<P>

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = . SUBDIRS = .
LIBS = LIBS =
@ -123,9 +123,9 @@ all: all-redirect
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .S .c .o .s .SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -139,9 +139,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
.s.o: .s.o:
$(COMPILE) -c $< $(COMPILE) -c $<
@ -252,6 +249,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = lang subdir = lang
distdir: $(DISTFILES) 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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = . SUBDIRS = .
@ -138,6 +138,20 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = tar
GZIP_ENV = --best 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) 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) 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:
.SUFFIXES: .S .c .o .s .SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -161,9 +175,6 @@ distclean-noinstLIBRARIES:
maintainer-clean-noinstLIBRARIES: maintainer-clean-noinstLIBRARIES:
.c.o:
$(COMPILE) -c $<
.s.o: .s.o:
$(COMPILE) -c $< $(COMPILE) -c $<
@ -304,6 +315,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = lib subdir = lib
distdir: $(DISTFILES) 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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
@ -324,101 +340,38 @@ distdir: $(DISTFILES)
|| exit 1; \ || exit 1; \
fi; \ fi; \
done 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-am:
info: info-recursive info: info-recursive
dvi-am: dvi-am:
@ -457,23 +410,25 @@ distclean-generic:
maintainer-clean-generic: maintainer-clean-generic:
-test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \
mostlyclean-tags mostlyclean-generic mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-generic \ clean-am: clean-noinstLIBRARIES clean-compile clean-tags clean-depend \
mostlyclean-am clean-generic mostlyclean-am
clean: clean-recursive clean: clean-recursive
distclean-am: distclean-noinstLIBRARIES distclean-compile \ distclean-am: distclean-noinstLIBRARIES distclean-compile \
distclean-tags distclean-generic clean-am distclean-tags distclean-depend distclean-generic \
clean-am
distclean: distclean-recursive distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ maintainer-clean-am: maintainer-clean-noinstLIBRARIES \
maintainer-clean-compile maintainer-clean-tags \ 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 "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild." @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 \ all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ distclean-tags clean-tags maintainer-clean-tags distdir \
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ mostlyclean-depend distclean-depend clean-depend \
install-exec install-data-am install-data install-am install \ maintainer-clean-depend info-am info dvi-am dvi check check-am \
uninstall-am uninstall all-redirect all-am all installdirs-am \ installcheck-am installcheck install-exec-am install-exec \
installdirs mostlyclean-generic distclean-generic clean-generic \ install-data-am install-data install-am install uninstall-am uninstall \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean 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.??? ftscprod.c: ftscprod.???

View File

@ -351,8 +351,8 @@ extern struct _pkey {
extern char SigName[32][16]; extern char SigName[32][16];
int ttyfd; /* Filedescriptor for raw mode */ int ttyfd; /* Filedescriptor for raw mode */
struct termio tbuf, tbufsav; /* Structure for raw mode */ struct termios tbufs, tbufsavs; /* Structure for raw mode */
@ -399,7 +399,7 @@ fidoaddr str2aka(char *addr);
* From falists.c * From falists.c
*/ */
void tidy_falist(fa_list **); 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 fill_path(fa_list **,char *);
void sort_list(fa_list **); void sort_list(fa_list **);
void uniq_list(fa_list **); void uniq_list(fa_list **);

View File

@ -2,7 +2,7 @@
* *
* File ..................: falists.c * File ..................: falists.c
* Purpose ...............: SEEN-BY and PATH lists * Purpose ...............: SEEN-BY and PATH lists
* Last modification date : 25-Mar-2001 * Last modification date : 31-Jul-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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; fa_list *tmp;
faddr *ta; 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 = (fa_list *)malloc(sizeof(fa_list));
tmp->next = *fap; tmp->next = *fap;
tmp->addr = ta; tmp->addr = ta;
tmp->force = force;
*fap = tmp; *fap = tmp;
} }
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: jammsg.c * File ..................: jammsg.c
* Purpose ...............: JAM message base functions * 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) int JAM_Lock(unsigned long ulTimeout)
{ {
// char *File;
// int fd = -1, Tries = 0;
int Tries = 0; int Tries = 0;
struct flock fl; struct flock fl;
@ -383,23 +381,6 @@ int JAM_Lock(unsigned long ulTimeout)
usleep(250000); usleep(250000);
Syslog('m', "JAM messagebase lock attempt %d", Tries); 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; return TRUE;
} }
@ -1301,15 +1282,6 @@ void JAM_UnLock(void)
if (fcntl(fdHdr, F_SETLK, &fl)) { if (fcntl(fdHdr, F_SETLK, &fl)) {
WriteError("$Can't unlock JAM message base"); 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);
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: libs.h * File ..................: libs.h
* Purpose ...............: Libraries include list * Purpose ...............: Libraries include list
* Last modification date : 23-May-2001 * Last modification date : 05-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -55,7 +55,7 @@
#include <errno.h> #include <errno.h>
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <unistd.h> #include <unistd.h>
#include <termio.h> #include <termios.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <dirent.h> #include <dirent.h>
@ -63,9 +63,13 @@
#include <stdarg.h> #include <stdarg.h>
#include <pwd.h> #include <pwd.h>
#include <netdb.h> #include <netdb.h>
#ifdef SHADOW_PASSWORD
#include <shadow.h> #include <shadow.h>
#endif
#include <sys/ioctl.h> #include <sys/ioctl.h>
#ifdef HAVE_SYS_VFS_H
#include <sys/vfs.h> #include <sys/vfs.h>
#endif
#include <sys/param.h> #include <sys/param.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/utsname.h> #include <sys/utsname.h>

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfile * File ..................: mbfile
* Purpose ...............: Basic File I/O * Purpose ...............: Basic File I/O
* Last modification date : 05-Jul-2001 * Last modification date : 12-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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) int diskfree(int needed)
{ {
#ifdef __linux__
char *mtab, *dev, *fs, *type; char *mtab, *dev, *fs, *type;
FILE *fp; FILE *fp;
struct statfs sfs; struct statfs sfs;
int RetVal = TRUE; int RetVal = TRUE;
unsigned long temp; unsigned long temp;
#endif
#ifdef __linux__
if (! needed) if (! needed)
return TRUE; return TRUE;
@ -283,7 +291,8 @@ int diskfree(int needed)
*/ */
if (strncmp((char *)"/dev/fd", dev, 7) && strncmp((char *)"/boot", fs, 5) && if (strncmp((char *)"/dev/fd", dev, 7) && strncmp((char *)"/boot", fs, 5) &&
(!strncmp((char *)"ext2", type, 4) || !strncmp((char *)"reiserfs", type, 8) || (!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) { if (statfs(fs, &sfs) == 0) {
temp = (unsigned long)(sfs.f_bsize / 512L); temp = (unsigned long)(sfs.f_bsize / 512L);
if (((unsigned long)(sfs.f_bavail * temp) / 2048L) < needed) { if (((unsigned long)(sfs.f_bavail * temp) / 2048L) < needed) {
@ -299,6 +308,9 @@ int diskfree(int needed)
free(mtab); free(mtab);
return RetVal; return RetVal;
#else /* ifdef __linux__ */
return TRUE; /* Assume enough */
#endif
} }

View File

@ -1414,10 +1414,10 @@ int GetTimeInfo(TIMEINFO *Now)
#if defined(HAVE_GETTIMEOFDAY) #if defined(HAVE_GETTIMEOFDAY)
struct timeval tv; struct timeval tv;
#endif /* defined(HAVE_GETTIMEOFDAY) */ #endif /* defined(HAVE_GETTIMEOFDAY) */
#if !defined(HAVE_TM_GMTOFF) #if !defined(HAVE_TM_ZONE)
struct tm local; struct tm local;
struct tm gmt; struct tm gmt;
#endif /* !defined(HAVE_TM_GMTOFF) */ #endif /* !defined(HAVE_TM_ZONE) */
/* Get the basic time. */ /* Get the basic time. */
#if defined(HAVE_GETTIMEOFDAY) #if defined(HAVE_GETTIMEOFDAY)
@ -1436,7 +1436,7 @@ int GetTimeInfo(TIMEINFO *Now)
if ((tm = localtime(&Now->time)) == NULL) if ((tm = localtime(&Now->time)) == NULL)
return -1; return -1;
secondsUntilNextHour = 60 * (60 - tm->tm_min) - tm->tm_sec; 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. */ /* To get the timezone, compare localtime with GMT. */
local = *tm; local = *tm;
if ((tm = gmtime(&Now->time)) == NULL) if ((tm = gmtime(&Now->time)) == NULL)
@ -1458,7 +1458,7 @@ int GetTimeInfo(TIMEINFO *Now)
LastTzone += gmt.tm_min - local.tm_min; LastTzone += gmt.tm_min - local.tm_min;
#else #else
LastTzone = (0 - tm->tm_gmtoff) / 60; LastTzone = (0 - tm->tm_gmtoff) / 60;
#endif /* defined(HAVE_TM_GMTOFF) */ #endif /* defined(HAVE_TM_ZONE) */
NextHour = Now->time + secondsUntilNextHour; NextHour = Now->time + secondsUntilNextHour;
} }
Now->tzone = LastTzone; Now->tzone = LastTzone;
@ -1739,7 +1739,7 @@ time_t parsedate(char *p, TIMEINFO *now)
yyYear = tm->tm_year + 1900; yyYear = tm->tm_year + 1900;
yyMonth = tm->tm_mon + 1; yyMonth = tm->tm_mon + 1;
yyDay = tm->tm_mday; yyDay = tm->tm_mday;
#ifdef HAVE_TM_GMTOFF #ifdef HAVE_TM_ZONE
yyTimezone = tm->tm_gmtoff/60; yyTimezone = tm->tm_gmtoff/60;
#else #else
yyTimezone = timezone/60; yyTimezone = timezone/60;

View File

@ -2,10 +2,10 @@
* *
* File ..................: rawio.c * File ..................: rawio.c
* Purpose ...............: Raw I/O routines. * 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 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -42,26 +42,39 @@ int rawset = FALSE;
*/ */
void Setraw() void Setraw()
{ {
if (ioctl(ttyfd, TCGETA, &tbuf) == -1) { int rc;
perror("TCGETA Failed");
exit(1); /* ERROR - could not set get tty ioctl */ // 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; tbufsavs = tbufs;
tbuf.c_iflag &= ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON ); tbufs.c_iflag &= ~(INLCR | ICRNL | ISTRIP | IXON ); /* IUCLC removed for FreeBSD */
/* /*
* Map CRNL modes strip control characters and flow control * Map CRNL modes strip control characters and flow control
*/ */
tbuf.c_oflag &= ~OPOST; /* Don't do ouput character translation */ tbufs.c_oflag &= ~OPOST; /* Don't do ouput character translation */
tbuf.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */ tbufs.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */
tbuf.c_cc[VMIN] = 1; /* Receive 1 character at a time */ tbufs.c_cc[VMIN] = 1; /* Receive 1 character at a time */
tbuf.c_cc[VTIME] = 0; /* No time limit per character */ tbufs.c_cc[VTIME] = 0; /* No time limit per character */
if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) { if ((rc = tcsetattr(ttyfd, TCSADRAIN, &tbufs))) {
perror("TCSETAF failed"); perror("");
exit(1); /* ERROR - could not set tty ioctl */ 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; rawset = TRUE;
} }
@ -72,13 +85,20 @@ void Setraw()
*/ */
void Unsetraw() void Unsetraw()
{ {
int rc;
/* /*
* Only unset the mode if it is set to raw mode * Only unset the mode if it is set to raw mode
*/ */
if (rawset == TRUE) { if (rawset == TRUE) {
if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) { // if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) {
perror("TCSETAF Normal Failed"); // perror("TCSETAF Normal Failed");
exit(1); /* ERROR - could not save original tty ioctl */ // 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; rawset = FALSE;
@ -114,14 +134,17 @@ unsigned char Getone()
*/ */
int Speed(void) int Speed(void)
{ {
int mspeed; // int mspeed;
struct termio ttyhold; // 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); // ioctl(0, TCGETA, &ttyhold);
mspeed = baud[ttyhold.c_cflag & 017]; // mspeed = baud[ttyhold.c_cflag & 017];
ioctl(0, TCSETAF, &ttyhold); // ioctl(0, TCSETAF, &ttyhold);
mspeed = cfgetospeed(&tbufs);
return(mspeed); return(mspeed);
} }

View File

@ -29,7 +29,6 @@ LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a \
../lib/libmsgbase.a ../lib/libdbase.a ../lib/libmsgbase.a ../lib/libdbase.a
install-exec-local: install-exec-local:
$(mkinstalldirs) $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbcico $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbcico $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbout $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbout $(bindir)

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
EXTRA_DIST = README EXTRA_DIST = README
SUBDIRS = . SUBDIRS = .
@ -121,6 +121,17 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = tar
GZIP_ENV = --best 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) SOURCES = $(mbcico_SOURCES) $(mbout_SOURCES)
OBJECTS = $(mbcico_OBJECTS) $(mbout_OBJECTS) OBJECTS = $(mbcico_OBJECTS) $(mbout_OBJECTS)
@ -128,9 +139,9 @@ all: all-redirect
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .S .c .o .s .SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -144,9 +155,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
.s.o: .s.o:
$(COMPILE) -c $< $(COMPILE) -c $<
@ -265,6 +273,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = mbcico subdir = mbcico
distdir: $(DISTFILES) 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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
@ -285,170 +298,38 @@ distdir: $(DISTFILES)
|| exit 1; \ || exit 1; \
fi; \ fi; \
done 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-am:
info: info-recursive info: info-recursive
dvi-am: dvi-am:
@ -486,23 +367,24 @@ distclean-generic:
maintainer-clean-generic: maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \
mostlyclean-am clean-generic mostlyclean-am
clean: clean-recursive clean: clean-recursive
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \
distclean-generic clean-am distclean-depend distclean-generic clean-am
distclean: distclean-recursive distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \ 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 "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild." @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 \ all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ distclean-tags clean-tags maintainer-clean-tags distdir \
dvi-am dvi check check-am installcheck-am installcheck \ mostlyclean-depend distclean-depend clean-depend \
install-exec-local install-exec-am install-exec install-data-am \ maintainer-clean-depend info-am info dvi-am dvi check check-am \
install-data install-am install uninstall-am uninstall all-redirect \ installcheck-am installcheck install-exec-local install-exec-am \
all-am all installdirs-am installdirs mostlyclean-generic \ install-exec install-data-am install-data install-am install \
distclean-generic clean-generic maintainer-clean-generic clean \ uninstall-am uninstall all-redirect all-am all installdirs-am \
mostlyclean distclean maintainer-clean installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-exec-local: install-exec-local:
$(mkinstalldirs) $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbcico $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbcico $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbout $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbout $(bindir)

View File

@ -2,7 +2,7 @@
* *
* File ....................: mbcico/binkp.c * File ....................: mbcico/binkp.c
* Purpose .................: Fidonet binkd protocol * Purpose .................: Fidonet binkd protocol
* Last modification date ..: 07-Jul-2001 * Last modification date ..: 07-Aug-2001
* Binkp protocol copyright : Dima Maloff. * Binkp protocol copyright : Dima Maloff.
* *
***************************************************************************** *****************************************************************************
@ -823,7 +823,8 @@ int binkp_batch(file_list *to_send)
char *rname, *lname; char *rname, *lname;
long rsize, roffs, lsize; long rsize, roffs, lsize;
time_t rtime, ltime; time_t rtime, ltime;
long rxbytes, written; off_t rxbytes;
long written;
binkp_list *bll = NULL, *tmp, *cursend = NULL; binkp_list *bll = NULL, *tmp, *cursend = NULL;
file_list *tsl; file_list *tsl;

View File

@ -2,10 +2,10 @@
* *
* File ..................: mbcico/callstat.c * File ..................: mbcico/callstat.c
* Purpose ...............: Fidonet mailer * 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 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -73,7 +73,7 @@ void putstatus(faddr *addr, int incr, int sts)
fwrite(cst, sizeof(callstat), 1, fp); fwrite(cst, sizeof(callstat), 1, fp);
fclose(fp); fclose(fp);
if (cst->tryno >= 30) if (cst->tryno >= 30)
WriteError("Node %s is marked undialble.", ascfnode(addr, 0x1f)); WriteError("Node %s is marked undialable.", ascfnode(addr, 0x1f));
} else { } else {
WriteError("$Cannot create status file for node %s", ascfnode(addr,0x1f)); WriteError("$Cannot create status file for node %s", ascfnode(addr,0x1f));
} }

View File

@ -2,10 +2,10 @@
* *
* File ..................: mbcico/filelist.c * File ..................: mbcico/filelist.c
* Purpose ...............: fidonet mailer * 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 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -463,7 +463,13 @@ void execute_disposition(file_list *fl)
WriteError("$Error writing '~' to .flo at %lu", (unsigned long)fl->floff); WriteError("$Error writing '~' to .flo at %lu", (unsigned long)fl->floff);
} }
fflush(fl->flofp); fflush(fl->flofp);
#ifdef HAVE_FDATASYNC
fdatasync(fileno(fl->flofp)); fdatasync(fileno(fl->flofp));
#else
#ifdef HAVE_FSYNC
fsync(fileno(fl->flofp));
#endif
#endif
} else } else
WriteError("$error seeking in .flo to %lu", (unsigned long)fl->floff); WriteError("$error seeking in .flo to %lu", (unsigned long)fl->floff);
} }

View File

@ -2,11 +2,11 @@
* *
* File ..................: mbcico/hydra.c * File ..................: mbcico/hydra.c
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* Last modification date : 30-Dec-2000 * Last modification date : 07-Aug-2001
* Remark ................: See below for more copyright details and credits. * Remark ................: See below for more copyright details and credits.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2000 * Copyright (C) 1997-2001
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -530,7 +530,8 @@ int hydra_batch(int role, file_list *to_send)
char *inbuf, *outbuf; char *inbuf, *outbuf;
int rxlen, txlen; /* length of receive/transmit buffer */ int rxlen, txlen; /* length of receive/transmit buffer */
long txwindow, rxwindow; /* window sizes */ long txwindow, rxwindow; /* window sizes */
long txpos, rxpos; /* file positions */ long txpos;
off_t rxpos; /* file positions */
long stxpos, srxpos; long stxpos, srxpos;
long longnum; long longnum;
int hdxlink = FALSE; int hdxlink = FALSE;
@ -865,7 +866,7 @@ int hydra_batch(int role, file_list *to_send)
if (to_send) { if (to_send) {
txlen = sprintf(txbuf, "%08lx%08lx%08lx%08lx%08lx", txlen = sprintf(txbuf, "%08lx%08lx%08lx%08lx%08lx",
mtime2sl(txstat.st_mtime+(txstat.st_mtime%2)), 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 * convert file name to DOS-format

View File

@ -2,10 +2,10 @@
* *
* File ..................: mbcico/openport.c * File ..................: mbcico/openport.c
* Purpose ...............: Fidonet mailer * 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 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -115,12 +115,6 @@ int openport(char *port, int speed)
fflush(stderr); fflush(stderr);
close(2); close(2);
} }
// if (setpgrp() < 0) {
// WriteError("$openport: setpgrp failed");
// ulock(pname);
// return 1;
// }
} }
tty_status = 0; tty_status = 0;
hanged_up = 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);
char *bstr(speed_t sp) char *bstr(speed_t sp)
{ {
#ifdef CBAUD
switch(sp & CBAUD) { switch(sp & CBAUD) {
#else
switch(sp) {
#endif
case 0: return (char *)"0"; case 0: return (char *)"0";
#if defined(B50) #if defined(B50)
case B50: return (char *)"50"; 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) int tty_raw(int speed)
{ {

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbcico/respfreq.c * File ..................: mbcico/respfreq.c
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* Last modification date : 07-Feb-2001 * Last modification date : 08-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -269,6 +269,7 @@ file_list *respfreq(char *nm, char *pw, char *dt)
Area = 0L; Area = 0L;
free(p); free(p);
Syslog('f', "Start search ...");
while (!no_more && (fread(&idx, sizeof(idx), 1, fi) == 1)) { while (!no_more && (fread(&idx, sizeof(idx), 1, fi) == 1)) {
if (re_exec(idx.Name) || re_exec(idx.LName)) { if (re_exec(idx.Name) || re_exec(idx.LName)) {
Syslog('f', "Index found %s area %d record %d", idx.LName, idx.AreaNum, idx.Record); Syslog('f', "Index found %s area %d record %d", idx.LName, idx.AreaNum, idx.Record);

View File

@ -2,10 +2,10 @@
* *
* File ..................: mbcico/tcpproto.c * File ..................: mbcico/tcpproto.c
* Purpose ...............: Fidonet mailer * 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 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -55,9 +55,10 @@ static FILE *in;
static char txbuf[2048]; static char txbuf[2048];
static char rxbuf[2048]; static char rxbuf[2048];
static int rx_type; 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 finsend(void);
static int receivefile(char *,time_t,off_t); static int receivefile(char *,time_t,off_t);
static int resync(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) { for (tmpf = lst; tmpf && (maxrc == 0); tmpf = tmpf->next) {
if (tmpf->remote) { if (tmpf->remote) {
rc = sendfile(tmpf->local,tmpf->remote); rc = sendtfile(tmpf->local,tmpf->remote);
rc = abs(rc); rc = abs(rc);
if (rc > maxrc) if (rc > maxrc)
maxrc=rc; maxrc=rc;
@ -158,7 +159,7 @@ next:
static int sendfile(char *ln, char *rn) static int sendtfile(char *ln, char *rn)
{ {
int rc=0; int rc=0;
struct stat st; struct stat st;

View File

@ -2,10 +2,10 @@
* *
* File ..................: mbcico/zmrecv.c * File ..................: mbcico/zmrecv.c
* Purpose ...............: Fidonet mailer * 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 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -514,7 +514,7 @@ int procheader(char *Name)
strcpy(ctt,date(Modtime)); strcpy(ctt,date(Modtime));
Syslog('+', "Zmodem: \"%s\" %ld bytes, %s mode %o", Name, Bytesleft, ctt, Filemode); 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); (void)time(&startime);
sbytes = rxbytes; sbytes = rxbytes;

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbcico/zmsend.c * File ..................: mbcico/zmsend.c
* Purpose ...............: Fidonet mailer * Purpose ...............: Fidonet mailer
* Last modification date : 07-Feb-2001 * Last modification date : 07-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -41,7 +41,7 @@
#include "filelist.h" #include "filelist.h"
static int initsend(void); static int initsend(void);
static int sendfile(char*,char*); static int sendzfile(char*,char*);
static int finsend(void); static int finsend(void);
static int getzrxinit(void); static int getzrxinit(void);
@ -102,7 +102,7 @@ int zmsndfiles(file_list *lst)
for (tmpf = lst; tmpf && (maxrc < 2); tmpf = tmpf->next) { for (tmpf = lst; tmpf && (maxrc < 2); tmpf = tmpf->next) {
if (tmpf->remote) { if (tmpf->remote) {
rc = sendfile(tmpf->local, tmpf->remote); rc = sendzfile(tmpf->local, tmpf->remote);
rc = abs(rc); rc = abs(rc);
if (rc > maxrc) if (rc > maxrc)
maxrc = rc; 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; int rc=0;
struct stat st; struct stat st;

View File

@ -4,29 +4,22 @@ SUBDIRS = .
EXTRA_DIST = maptabs.tgz paths.h.in README 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 \ 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 \ 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 \ addbbs.c magic.c fsort.c toberep.c ftn2rfc.c atoul.c ping.c \
cookie.c forward.c sendmail.c scan.c addpkt.c importnet.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 \ areamgr.c filemgr.c notify.c mgrutil.c rollover.c bwrite.c rfc2ftn.c \
rnews.c newspost.c aliasdb.c postemail.c postnetmail.c backalias.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 \ 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 \ 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 \ addbbs.h magic.h fsort.h toberep.h ftn2rfc.h atoul.h ping.h \
cookie.h forward.h sendmail.h scan.h addpkt.h importnet.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 \ areamgr.h filemgr.h notify.h mgrutil.h rollover.h bwrite.h rfc2ftn.h \
rnews.h newspost.h aliasdb.h postemail.h postnetmail.h backalias.h rnews.h newspost.h aliasdb.h postemail.h postnetmail.h postecho.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
mbseq_SOURCES = mbseq.c mbseq.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 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 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 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 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 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-exec-local:
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbfido $(bindir) $(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 mbseq $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbaff $(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 mbindex $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbdiff $(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 mbfile $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbmsg $(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 rm -f $(bindir)/mbnews
ln -s $(bindir)/mbfido $(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/*)

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,18 +71,14 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = . SUBDIRS = .
EXTRA_DIST = maptabs.tgz paths.h.in README 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 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
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
mbseq_SOURCES = mbseq.c mbseq.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 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 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 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 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 mbindex_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
@ -116,21 +112,16 @@ CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@ LDFLAGS = @LDFLAGS@
LIBS = @LIBS@ LIBS = @LIBS@
mbfido_OBJECTS = flock.o tosspkt.o mbfido.o hatch.o maketags.o \ 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 \ tracker.o makestat.o scannews.o lhash.o pack.o ulock.o tic.o ptic.o \
ulock.o tic.o ptic.o utic.o mover.o hash.o mkftnhdr.o addbbs.o magic.o \ utic.o mover.o hash.o mkftnhdr.o addbbs.o magic.o fsort.o toberep.o \
fsort.o toberep.o mkrfcmsg.o atoul.o ping.o cookie.o forward.o \ ftn2rfc.o atoul.o ping.o cookie.o forward.o sendmail.o scan.o addpkt.o \
sendmail.o scan.o addpkt.o importnet.o areamgr.o filemgr.o notify.o \ storenet.o storeecho.o areamgr.o filemgr.o notify.o mgrutil.o \
mgrutil.o rollover.o bwrite.o rnews.o newspost.o aliasdb.o postemail.o \ rollover.o bwrite.o rfc2ftn.o rnews.o newspost.o aliasdb.o postemail.o \
postnetmail.o backalias.o postnetmail.o postecho.o backalias.o
mbfido_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \ mbfido_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \
../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a \ ../lib/libcommon.a ../lib/libmsgbase.a ../lib/libdbase.a \
../lib/libmbinet.a ../lib/libmbinet.a
mbfido_LDFLAGS = 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_OBJECTS = mbseq.o
mbseq_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \ mbseq_DEPENDENCIES = ../lib/libmemwatch.a ../lib/libclcomm.a \
../lib/libcommon.a ../lib/libdbase.a ../lib/libcommon.a ../lib/libdbase.a
@ -167,16 +158,31 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = tar
GZIP_ENV = --best GZIP_ENV = --best
SOURCES = $(mbfido_SOURCES) $(mbmail_SOURCES) $(mbseq_SOURCES) $(mbaff_SOURCES) $(mbindex_SOURCES) $(mbdiff_SOURCES) $(mbfile_SOURCES) $(mbmsg_SOURCES) DEP_FILES = .deps/addbbs.P .deps/addpkt.P .deps/aliasdb.P \
OBJECTS = $(mbfido_OBJECTS) $(mbmail_OBJECTS) $(mbseq_OBJECTS) $(mbaff_OBJECTS) $(mbindex_OBJECTS) $(mbdiff_OBJECTS) $(mbfile_OBJECTS) $(mbmsg_OBJECTS) .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 all: all-redirect
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .S .c .o .s .SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -192,9 +198,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
.s.o: .s.o:
$(COMPILE) -c $< $(COMPILE) -c $<
@ -215,10 +218,6 @@ mbfido: $(mbfido_OBJECTS) $(mbfido_DEPENDENCIES)
@rm -f mbfido @rm -f mbfido
$(LINK) $(mbfido_LDFLAGS) $(mbfido_OBJECTS) $(mbfido_LDADD) $(LIBS) $(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) mbseq: $(mbseq_OBJECTS) $(mbseq_DEPENDENCIES)
@rm -f mbseq @rm -f mbseq
$(LINK) $(mbseq_LDFLAGS) $(mbseq_OBJECTS) $(mbseq_LDADD) $(LIBS) $(LINK) $(mbseq_LDFLAGS) $(mbseq_OBJECTS) $(mbseq_LDADD) $(LIBS)
@ -337,6 +336,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = mbfido subdir = mbfido
distdir: $(DISTFILES) 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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
@ -357,232 +361,38 @@ distdir: $(DISTFILES)
|| exit 1; \ || exit 1; \
fi; \ fi; \
done 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-am:
info: info-recursive info: info-recursive
dvi-am: dvi-am:
@ -620,23 +430,24 @@ distclean-generic:
maintainer-clean-generic: maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \
mostlyclean-am clean-generic mostlyclean-am
clean: clean-recursive clean: clean-recursive
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \
distclean-generic clean-am distclean-depend distclean-generic clean-am
distclean: distclean-recursive distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \ 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 "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild." @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 \ all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ distclean-tags clean-tags maintainer-clean-tags distdir \
dvi-am dvi check check-am installcheck-am installcheck \ mostlyclean-depend distclean-depend clean-depend \
install-exec-local install-exec-am install-exec install-data-am \ maintainer-clean-depend info-am info dvi-am dvi check check-am \
install-data install-am install uninstall-am uninstall all-redirect \ installcheck-am installcheck install-exec-local install-exec-am \
all-am all installdirs-am installdirs mostlyclean-generic \ install-exec install-data-am install-data install-am install \
distclean-generic clean-generic maintainer-clean-generic clean \ uninstall-am uninstall all-redirect all-am all installdirs-am \
mostlyclean distclean maintainer-clean installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-exec-local: install-exec-local:
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 4751 mbfido $(bindir) $(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 mbseq $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbaff $(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 mbindex $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbdiff $(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 mbfile $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbmsg $(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 rm -f $(bindir)/mbnews
ln -s $(bindir)/mbfido $(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. # 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. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -13,4 +13,9 @@
| |--> mkrfcmsg --> postemail | |--> mkrfcmsg --> postemail
+---------------+ +---------------+
+---------------+
FTN | |--> Outbound
------->| postecho |--> MsgBase
| |--> mkrfcmsg --> spool --> newspost
+---------------+

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/addpkt.c * File ..................: mbfido/addpkt.c
* Purpose ...............: Add mail to .pkt * Purpose ...............: Add mail to .pkt
* Last modification date : 02-Jun-2001 * Last modification date : 31-Jul-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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) || if ((tname == NULL) || (strlen(tname) > 36) ||
(fname == NULL) || (strlen(fname) > 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; return 1;
}
buffer[0x00] = 2; buffer[0x00] = 2;
buffer[0x01] = 0; buffer[0x01] = 0;

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/areamgr.c * File ..................: mbfido/areamgr.c
* Purpose ...............: AreaMgr * Purpose ...............: AreaMgr
* Last modification date : 11-Mar-2001 * Last modification date : 31-Jul-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -67,8 +67,6 @@ extern int echo_imp; /* Echomail imported */
extern int echo_out; /* Echomail forwarded */ extern int echo_out; /* Echomail forwarded */
extern int echo_bad; /* Bad echomail */ extern int echo_bad; /* Bad echomail */
extern int echo_dupe; /* Dupe 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 areamgr = 0; /* Nr of AreaMgr messages */
int a_help = FALSE; int a_help = FALSE;
@ -81,14 +79,14 @@ unsigned long a_msgs = 0;
void A_Help(faddr *); void A_Help(faddr *, char *);
void A_Help(faddr *t) void A_Help(faddr *t, char *replyid)
{ {
FILE *fp; FILE *fp;
Syslog('+', "AreaMgr: Help"); 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, "Address all requests to '%s' (without quotes)\r", (char *)"Areamgr");
fprintf(fp, "Youre AreaMgr password goes on the subject line.\r\r"); 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 *, char *);
void A_Query(faddr *t) void A_Query(faddr *t, char *replyid)
{ {
FILE *qp, *gp, *mp; FILE *qp, *gp, *mp;
char *temp, *Group; char *temp, *Group;
@ -149,7 +147,7 @@ void A_Query(faddr *t)
Syslog('+', "AreaMgr: Query"); Syslog('+', "AreaMgr: Query");
f = bestaka_s(t); 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)); 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; FILE *qp, *gp, *mp;
char *temp, *Group; char *temp, *Group;
@ -258,7 +256,7 @@ void A_List(faddr *t, int Notify)
Syslog('+', "AreaMgr: List"); Syslog('+', "AreaMgr: List");
f = bestaka_s(t); 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); WriteMailGroups(qp, f);
temp = calloc(128, sizeof(char)); 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; FILE *qp, *gp, *mp;
char *temp, *Group; char *temp, *Group;
@ -377,7 +375,7 @@ void A_Flow(faddr *t, int Notify)
Syslog('+', "AreaMgr: Flow report"); Syslog('+', "AreaMgr: Flow report");
f = bestaka_s(t); 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)); temp = calloc(128, sizeof(char));
@ -464,8 +462,8 @@ void A_Flow(faddr *t, int Notify)
void A_Status(faddr *); void A_Status(faddr *, char *);
void A_Status(faddr *t) void A_Status(faddr *t, char *replyid)
{ {
FILE *fp; FILE *fp;
int i; int i;
@ -476,7 +474,7 @@ void A_Status(faddr *t)
else else
i = Miy - 1; 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"); 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 *, char *);
void A_Unlinked(faddr *t) void A_Unlinked(faddr *t, char *replyid)
{ {
FILE *qp, *gp, *mp; FILE *qp, *gp, *mp;
char *temp, *Group; char *temp, *Group;
@ -517,7 +515,7 @@ void A_Unlinked(faddr *t)
Syslog('+', "AreaMgr: Unlinked"); Syslog('+', "AreaMgr: Unlinked");
f = bestaka_s(t); 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); WriteMailGroups(qp, f);
temp = calloc(128, sizeof(char)); 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; int i, rc = 0, spaces;
char *Buf; 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. * create a response netmail about what we did.
*/ */
if (ftell(tmp)) { 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, " Dear %s\r\r", nodes.Sysop);
fprintf(np, "Here is the result of your AreaMgr request:\r\r"); 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); fclose(tmp);
if (a_stat) if (a_stat)
A_Status(f); A_Status(f, replyid);
if (a_query) if (a_query)
A_Query(f); A_Query(f, replyid);
if (a_list) if (a_list)
A_List(f, FALSE); A_List(f, replyid, FALSE);
if (a_flow) if (a_flow)
A_Flow(f, FALSE); A_Flow(f, replyid, FALSE);
if (a_unlnk) if (a_unlnk)
A_Unlinked(f); A_Unlinked(f, replyid);
if (a_help) if (a_help)
A_Help(f); A_Help(f, replyid);
return rc; return rc;
} }

View File

@ -2,10 +2,10 @@
#define _AREAMGR_H #define _AREAMGR_H
void A_Status(faddr *); void A_Status(faddr *, char *);
void A_List(faddr *, int); void A_List(faddr *, char *, int);
void A_Flow(faddr *, int); void A_Flow(faddr *, char *, int);
int AreaMgr(faddr *, faddr *, time_t, int, FILE *); int AreaMgr(faddr *, faddr *, char *, char *, time_t, int, FILE *);
#endif #endif

View File

@ -2,10 +2,10 @@
* *
* File ..................: mbaff/filefind.c * File ..................: mbaff/filefind.c
* Purpose ...............: Announce new files and FileFind * 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 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -192,7 +192,7 @@ int StartReply(ff_list *ffl)
* Start message text including kludges * Start message text including kludges
*/ */
Msg_Id(scanmgr.Aka); Msg_Id(scanmgr.Aka);
sprintf(temp, "\001REPLYID: %s", ffl->msgid); sprintf(temp, "\001REPLY: %s", ffl->msgid);
MsgText_Add2(temp); MsgText_Add2(temp);
Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp)); Msg.ReplyCRC = upd_crc32(temp, crc, strlen(temp));
Msg_Pid(); Msg_Pid();
@ -408,7 +408,8 @@ void ScanFiles(ff_list *tmp)
if (!strcmp(rft->filename, file.Name)) if (!strcmp(rft->filename, file.Name))
break; break;
fclose(pFile); 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); MsgText_Add2(temp);
/* /*

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/filemgr.c * File ..................: mbfido/filemgr.c
* Purpose ...............: FileMgr * Purpose ...............: FileMgr
* Last modification date : 11-Mar-2001 * Last modification date : 31-Jul-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -66,8 +66,6 @@ extern int echo_imp; /* Echomail imported */
extern int echo_out; /* Echomail forwarded */ extern int echo_out; /* Echomail forwarded */
extern int echo_bad; /* Bad fileecho */ extern int echo_bad; /* Bad fileecho */
extern int echo_dupe; /* Dupe 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 filemgr = 0; /* Nr of FileMgr messages */
int f_help = FALSE; int f_help = FALSE;
@ -78,14 +76,14 @@ int f_unlnk = FALSE;
void F_Help(faddr *); void F_Help(faddr *, char *);
void F_Help(faddr *t) void F_Help(faddr *t, char *replyid)
{ {
FILE *fp; FILE *fp;
Syslog('+', "FileMgr: Help"); 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, "Address all requests to '%s' (without quotes)\r", (char *)"Filemgr");
fprintf(fp, "Youre FileMgr password goes on the subject line.\r\r"); 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 *, char *);
void F_Query(faddr *t) void F_Query(faddr *t, char *replyid)
{ {
FILE *qp, *gp, *fp; FILE *qp, *gp, *fp;
char *temp, *Group; char *temp, *Group;
@ -147,7 +145,7 @@ void F_Query(faddr *t)
Syslog('+', "FileMgr: Query"); Syslog('+', "FileMgr: Query");
f = bestaka_s(t); 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)); 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; FILE *qp, *gp, *fp;
char *temp, *Group; char *temp, *Group;
@ -252,7 +250,7 @@ void F_List(faddr *t, int Notify)
Syslog('+', "FileMgr: List"); Syslog('+', "FileMgr: List");
f = bestaka_s(t); 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); WriteFileGroups(qp, f);
temp = calloc(128, sizeof(char)); temp = calloc(128, sizeof(char));
@ -340,8 +338,8 @@ void F_List(faddr *t, int Notify)
void F_Status(faddr *); void F_Status(faddr *, char *);
void F_Status(faddr *t) void F_Status(faddr *t, char *replyid)
{ {
FILE *fp; FILE *fp;
int i; int i;
@ -352,7 +350,7 @@ void F_Status(faddr *t)
else else
i = Miy - 1; 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"); 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 *, char *);
void F_Unlinked(faddr *t) void F_Unlinked(faddr *t, char *replyid)
{ {
FILE *qp, *gp, *fp; FILE *qp, *gp, *fp;
char *temp, *Group; char *temp, *Group;
@ -402,7 +400,7 @@ void F_Unlinked(faddr *t)
Syslog('+', "FileMgr: Unlinked"); Syslog('+', "FileMgr: Unlinked");
f = bestaka_s(t); 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)); 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; int i, rc = 0, spaces;
char *Buf; char *Buf;
@ -930,7 +928,7 @@ int FileMgr(faddr *f, faddr *t, time_t mdate, int flags, FILE *fp)
} }
if (ftell(tmp)) { 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, " Dear %s\r\r", nodes.Sysop);
fprintf(np, "Here is the result of your FileMgr request:\r\r"); 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); fclose(tmp);
if (f_stat) if (f_stat)
F_Status(f); F_Status(f, replyid);
if (f_query) if (f_query)
F_Query(f); F_Query(f, replyid);
if (f_list) if (f_list)
F_List(f, FALSE); F_List(f, replyid, FALSE);
if (f_unlnk) if (f_unlnk)
F_Unlinked(f); F_Unlinked(f, replyid);
if (f_help) if (f_help)
F_Help(f); F_Help(f, replyid);
return rc; return rc;
} }

View File

@ -2,9 +2,9 @@
#define _FILEMGR_H #define _FILEMGR_H
void F_Status(faddr *); void F_Status(faddr *, char *);
void F_List(faddr *, int); void F_List(faddr *, char *, int);
int FileMgr(faddr *, faddr *, time_t, int, FILE *); int FileMgr(faddr *, faddr *, char *, char *, time_t, int, FILE *);
#endif #endif

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/forward.c * File ..................: mbfido/forward.c
* Purpose ...............: File forward to a node * Purpose ...............: File forward to a node
* Last modification date : 11-Mar-2001 * Last modification date : 10-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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, "File : %s\r", TIC.TicIn.OrgName);
fprintf(net, "Description : %s\r", TIC.TicIn.Desc); fprintf(net, "Description : %s\r", TIC.TicIn.Desc);
fprintf(net, "Area : %s %s\r", TIC.TicIn.Area, TIC.TicIn.AreaDesc); 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, "CRC : %s\r", TIC.TicIn.Crc);
fprintf(net, "Origin : %s\r", TIC.TicIn.Origin); fprintf(net, "Origin : %s\r", TIC.TicIn.Origin);
if (strlen(TIC.TicIn.Magic)) if (strlen(TIC.TicIn.Magic))

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/mbfido.c * File ..................: mbfido/mbfido.c
* Purpose ...............: Process Fidonet style mail and files. * Purpose ...............: Process Fidonet style mail and files.
* Last modification date : 10-Jul-2001 * Last modification date : 14-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -61,6 +61,7 @@
#include "newspost.h" #include "newspost.h"
#include "rnews.h" #include "rnews.h"
#include "backalias.h" #include "backalias.h"
#include "rfc2ftn.h"
#define UNPACK_FACTOR 300 #define UNPACK_FACTOR 300
@ -77,6 +78,7 @@ int do_stat = FALSE; /* Create statistic HTML pages */
int do_test = FALSE; /* Test routing */ int do_test = FALSE; /* Test routing */
int do_news = FALSE; /* Process NNTP news */ int do_news = FALSE; /* Process NNTP news */
int do_uucp = FALSE; /* Process UUCP newsbatch */ int do_uucp = FALSE; /* Process UUCP newsbatch */
int do_mail = FALSE; /* Process MTA email message */
int do_unsec = FALSE; /* Unsecure tossing */ int do_unsec = FALSE; /* Unsecure tossing */
int do_learn = FALSE; /* News articles learnmode */ int do_learn = FALSE; /* News articles learnmode */
int check_crc = TRUE; /* Check .tic crc values */ int check_crc = TRUE; /* Check .tic crc values */
@ -115,6 +117,7 @@ void Help(void)
colour(9, 0); colour(9, 0);
printf(" Commands are:\n\n"); printf(" Commands are:\n\n");
colour(3, 0); colour(3, 0);
printf(" m mail <recipient> ... MTA Mail mode\n");
printf(" ne news Scan for new news\n"); printf(" ne news Scan for new news\n");
printf(" no notify <nodes> Send notify messages\n"); printf(" no notify <nodes> Send notify messages\n");
printf(" r roll Rollover statistic counters\n"); printf(" r roll Rollover statistic counters\n");
@ -246,9 +249,13 @@ void die(int onsig)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int i, Loop; int i, Loop;
char *p, *cmd, Options[81]; char *p, *cmd, *temp, Options[81];
struct passwd *pw; struct passwd *pw;
struct tm *t; struct tm *t;
fa_list **envrecip, *envrecip_start = NULL;
faddr *taddr;
int envrecip_count = 0;
FILE *ofp;
#ifdef MEMWATCH #ifdef MEMWATCH
mwInit(); mwInit();
@ -256,9 +263,11 @@ int main(int argc, char **argv)
/* /*
* The next trick is to supply a fake environment variable * 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. * this will setup the variable so InitConfig() will work.
* The /etc/passwd must point to the correct homedirectory. * 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) { if (getenv("MBSE_ROOT") == NULL) {
pw = getpwuid(getuid()); pw = getpwuid(getuid());
@ -310,7 +319,11 @@ int main(int argc, char **argv)
p++; p++;
else else
p = argv[0]; 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_quiet = TRUE;
do_uucp = TRUE; do_uucp = TRUE;
cmd = xstrcpy((char *)"Cmd: mbnews"); cmd = xstrcpy((char *)"Cmd: mbnews");
@ -320,9 +333,10 @@ int main(int argc, char **argv)
cmd = xstrcpy((char *)"Cmd: mbfido"); cmd = xstrcpy((char *)"Cmd: mbfido");
} }
envrecip = &envrecip_start;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
cmd = xstrcat(cmd, (char *)" "); cmd = xstrcat(cmd, (char *)" ");
cmd = xstrcat(cmd, tl(argv[i])); cmd = xstrcat(cmd, argv[i]);
if (strncmp(tl(argv[i]), "ne", 2) == 0) if (strncmp(tl(argv[i]), "ne", 2) == 0)
do_news = TRUE; do_news = TRUE;
@ -338,36 +352,52 @@ int main(int argc, char **argv)
} }
if (strncmp(tl(argv[i]), "r", 1) == 0) if (strncmp(tl(argv[i]), "r", 1) == 0)
do_roll = TRUE; do_roll = TRUE;
if (strncmp(tl(argv[i]), "s", 1) == 0) else if (strncmp(tl(argv[i]), "s", 1) == 0)
do_scan = TRUE; do_scan = TRUE;
if (strncmp(tl(argv[i]), "ta", 2) == 0) else if (strncmp(tl(argv[i]), "ta", 2) == 0)
do_tags = TRUE; do_tags = TRUE;
if (strncmp(tl(argv[i]), "ti", 2) == 0) else if (strncmp(tl(argv[i]), "ti", 2) == 0)
do_tic = TRUE; do_tic = TRUE;
if (strncmp(tl(argv[i]), "te", 2) == 0) else if (strncmp(tl(argv[i]), "te", 2) == 0)
do_test = TRUE; do_test = TRUE;
if (strncmp(tl(argv[i]), "to", 2) == 0) else if (strncmp(tl(argv[i]), "to", 2) == 0)
do_toss = TRUE; do_toss = TRUE;
if (strncmp(tl(argv[i]), "u", 1) == 0) else if (strncmp(tl(argv[i]), "u", 1) == 0)
do_uucp = TRUE; 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; do_stat = TRUE;
if (strncmp(tl(argv[i]), "-a", 2) == 0) else if (strncmp(tl(argv[i]), "-a", 2) == 0)
autocrea = TRUE; autocrea = TRUE;
if (strncmp(tl(argv[i]), "-f", 2) == 0) else if (strncmp(tl(argv[i]), "-f", 2) == 0)
do_full = TRUE; do_full = TRUE;
if (strncmp(tl(argv[i]), "-l", 2) == 0) else if (strncmp(tl(argv[i]), "-l", 2) == 0)
do_learn = TRUE; do_learn = TRUE;
if (strncmp(tl(argv[i]), "-noc", 4) == 0) else if (strncmp(tl(argv[i]), "-noc", 4) == 0)
check_crc = FALSE; check_crc = FALSE;
if (strncmp(tl(argv[i]), "-nod", 4) == 0) else if (strncmp(tl(argv[i]), "-nod", 4) == 0)
check_dupe = FALSE; check_dupe = FALSE;
if (strncmp(tl(argv[i]), "-q", 2) == 0) else if (strncmp(tl(argv[i]), "-q", 2) == 0)
do_quiet = TRUE; do_quiet = TRUE;
if (strncmp(tl(argv[i]), "-unp", 4) == 0) else if (strncmp(tl(argv[i]), "-unp", 4) == 0)
do_unprot = TRUE; do_unprot = TRUE;
if (strncmp(tl(argv[i]), "-uns", 4) == 0) else if (strncmp(tl(argv[i]), "-uns", 4) == 0)
do_unsec = TRUE; 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(); ProgName();
@ -384,10 +414,11 @@ int main(int argc, char **argv)
die(101); die(101);
if (lockunpack()) if (lockunpack())
die(0); die(101);
if (initnl()) if (initnl())
die(101); die(101);
Rollover(); if (!do_mail && !do_uucp)
Rollover();
if (!do_quiet) if (!do_quiet)
printf("\n"); printf("\n");
@ -396,10 +427,36 @@ int main(int argc, char **argv)
*/ */
cmd = calloc(PATH_MAX, sizeof(char)); cmd = calloc(PATH_MAX, sizeof(char));
sprintf(cmd, "%s/etc/aliases", getenv("MBSE_ROOT")); 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); readalias(cmd);
free(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 (do_notify)
if (Notify(Options)) if (Notify(Options))
packmail(); packmail();
@ -410,8 +467,6 @@ int main(int argc, char **argv)
* Hatch new files and process .tic files * Hatch new files and process .tic files
* until nothing left to do. * until nothing left to do.
*/ */
if (!diskfree(CFG.freespace))
die(101);
Loop = TRUE; Loop = TRUE;
do { do {
Hatch(); Hatch();
@ -446,7 +501,7 @@ int main(int argc, char **argv)
if (do_stat) if (do_stat)
MakeStat(); MakeStat();
if (do_uucp) if (do_uucp)
NewsUUCP(FALSE); NewsUUCP();
die(0); die(0);
return 0; return 0;
} }
@ -625,8 +680,7 @@ int TossPkts(void)
} }
free(inbound); free(inbound);
if (diskfree(CFG.freespace)) packmail();
packmail();
return maxrc; return maxrc;
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbindex.c * File ..................: mbindex.c
* Purpose ...............: Nodelist Compiler * Purpose ...............: Nodelist Compiler
* Last modification date : 25-May-2001 * Last modification date : 08-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -628,20 +628,22 @@ int compile(char *nlname, unsigned short zo, unsigned short ne, unsigned short n
*q++ = '\0'; *q++ = '\0';
} }
if ((strlen(p) == 3) && (!strcmp(p, "300"))) { if ((strlen(p) == 3) && (!strcmp(p, "300"))) {
if ((strstr(q, (char *)"X75")) || if (q != NULL) {
(strstr(q, (char *)"V110L")) || if ((strstr(q, (char *)"X75")) ||
(strstr(q, (char *)"V110H")) || (strstr(q, (char *)"V110L")) ||
(strstr(q, (char *)"V120L")) || (strstr(q, (char *)"V110H")) ||
(strstr(q, (char *)"V120H")) || (strstr(q, (char *)"V120L")) ||
(strstr(q, (char *)"ISDN"))) (strstr(q, (char *)"V120H")) ||
ndx.pflag |= NL_ISDN; (strstr(q, (char *)"ISDN")))
if ((strstr(q, (char *)"IFC")) || ndx.pflag |= NL_ISDN;
(strstr(q, (char *)"IBN")) || if ((strstr(q, (char *)"IFC")) ||
(strstr(q, (char *)"ITN")) || (strstr(q, (char *)"IBN")) ||
(strstr(q, (char *)"IVM")) || (strstr(q, (char *)"ITN")) ||
(strstr(q, (char *)"IFT")) || (strstr(q, (char *)"IVM")) ||
(strstr(q, (char *)"IP"))) (strstr(q, (char *)"IFT")) ||
ndx.pflag |= NL_TCPIP; (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)", Syslog('S',"put: %u:%u/%u.%u reg %u upl %u/%u typ %u flg %02X as (%u,%lu)",

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbmail/message.c * File ..................: mbmail/message.c
* Purpose ...............: MBSE BBS Mail Gate * Purpose ...............: MBSE BBS Mail Gate
* Last modification date : 02-May-2001 * Last modification date : 27-Jul-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -54,7 +54,7 @@
#include "mkftnhdr.h" #include "mkftnhdr.h"
#include "tracker.h" #include "tracker.h"
#include "viadate.h" #include "viadate.h"
#include "importnet.h" #include "storenet.h"
#define MAXHDRSIZE 2048 #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) { if (TrackMail(Dest, &Route) == R_LOCAL) {
/* /*
* Mail for our local system. Instead of adding the message to a .pkt create * 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; postlocal = TRUE;
pkt = tmpfile(); 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); fmsg->to->name = xstrcpy(CFG.sysop_name);
} }
if (SearchUser(fmsg->to->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); 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; return 2;
} else { } else {
WriteError("Unknown bbs user"); WriteError("Unknown bbs user");

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbmail/mkftnhdr.c * File ..................: mbmail/mkftnhdr.c
* Purpose ...............: MBSE BBS Mail Gate * Purpose ...............: MBSE BBS Mail Gate
* Last modification date : 25-Mar-2001 * Last modification date : 14-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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 *freename = NULL, *rfcfrom = NULL, *p, *q, *l, *r;
char *fbuf = NULL; 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)); p = xstrcpy(hdr((char *)"X-Fidonet-Comment-To",msg));
if (p == NULL) if (p == NULL)
p = xstrcpy(hdr((char *)"X-Apparently-To",msg)); p = xstrcpy(hdr((char *)"X-Apparently-To",msg));
if (p == NULL)
p = xstrcpy(hdr((char *)"To", msg)); /* 14-Aug-2001 MB */
if (p) { if (p) {
Syslog('N', "getting `to' address from: \"%s\"",p); Syslog('n', "getting `to' address from: \"%s\"",p);
if ((tmsg->to = parsefaddr(p)) == NULL) if ((tmsg->to = parsefaddr(p)) == NULL)
tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0"); tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0");
if ((l = strrchr(p,'<')) && (r = strchr(p,'>')) && (l < r)) { 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); tmsg->to->name=xstrcpy(l);
} }
free(p); free(p);
} else /*
tmsg->to = parsefaddr((char *)"All@p0.f0.n0.z0"); * It will become echomail, the destination FTN address must
Syslog('n', "TO: %s",ascinode(tmsg->to,0x7f)); * 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)); p = fbuf = xstrcpy(hdr((char *)"Reply-To", msg));
if (fbuf == NULL) 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"); 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. if (newsmode)
The msgs.Aka next is not valid. */ bestaka = bestaka_s(fido2faddr(msgs.Aka));
if ((tmsg->from == NULL) && ((bestaka = bestaka_s(fido2faddr(msgs.Aka))))) { else
bestaka = bestaka_s(tmsg->to);
if ((tmsg->from == NULL) && (bestaka)) {
if (CFG.dontregate) { if (CFG.dontregate) {
p = xstrcpy(hdr((char *)"X-FTN-Sender",msg)); p = xstrcpy(hdr((char *)"X-FTN-Sender",msg));
if (p == NULL) { 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", 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); 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)) while (isspace(*p))
p++; p++;
tmsg->origin = xstrcpy(hdrconv(p, incode, outcode)); tmsg->origin = xstrcpy(hdrconv(p, incode, outcode));

View File

@ -3,7 +3,7 @@
int ftnmsgid(char *,char **,unsigned long *,char *); int ftnmsgid(char *,char **,unsigned long *,char *);
ftnmsg *mkftnhdr(rfcmsg *, int, int, int); ftnmsg *mkftnhdr(rfcmsg *, int, int, int, faddr *);
#endif #endif

View File

@ -140,12 +140,12 @@ int Notify(char *Options)
} }
if (i == 0) { if (i == 0) {
F_Status(fido2faddr(nodes.Aka[i])); F_Status(fido2faddr(nodes.Aka[i]), NULL);
A_Status(fido2faddr(nodes.Aka[i])); A_Status(fido2faddr(nodes.Aka[i]), NULL);
} }
F_List(fido2faddr(nodes.Aka[i]), TRUE); F_List(fido2faddr(nodes.Aka[i]), NULL, TRUE);
A_List(fido2faddr(nodes.Aka[i]), TRUE); A_List(fido2faddr(nodes.Aka[i]), NULL, TRUE);
A_Flow(fido2faddr(nodes.Aka[i]), TRUE); A_Flow(fido2faddr(nodes.Aka[i]), NULL, TRUE);
notify++; notify++;
} }
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: tosser/pack.c * File ..................: tosser/pack.c
* Purpose ...............: Pack mail * Purpose ...............: Pack mail
* Last modification date : 11-Mar-2001 * Last modification date : 05-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -370,6 +370,9 @@ void packmail()
struct dirent *de; struct dirent *de;
DIR *dp; DIR *dp;
if (!diskfree(CFG.freespace))
return;
IsDoing("Packing mail"); IsDoing("Packing mail");
if (!do_quiet) { if (!do_quiet) {
colour(9, 0); colour(9, 0);

View File

@ -62,7 +62,6 @@ extern int do_quiet;
extern int net_in; /* Netmails received */ extern int net_in; /* Netmails received */
extern int net_out; /* Netmails forwarded */ extern int net_out; /* Netmails forwarded */
extern int net_bad; /* Bad netmails (tracking errors */ extern int net_bad; /* Bad netmails (tracking errors */
extern char *subj; /* Message subject */
extern char *msgid; /* Original message id */ extern char *msgid; /* Original message id */

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/postnetmail.c * File ..................: mbfido/postnetmail.c
* Purpose ...............: Post Netmail message from temp file * Purpose ...............: Post Netmail message from temp file
* Last modification date : 21-Jun-2001 * Last modification date : 03-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -40,8 +40,8 @@
#include "../lib/clcomm.h" #include "../lib/clcomm.h"
#include "tracker.h" #include "tracker.h"
#include "addpkt.h" #include "addpkt.h"
#include "importnet.h" #include "storenet.h"
#include "mkrfcmsg.h" #include "ftn2rfc.h"
#include "areamgr.h" #include "areamgr.h"
#include "filemgr.h" #include "filemgr.h"
#include "ping.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. * Post netmail message for temp file. The tempfile is an FTN style message.
* *
* 0 - All seems well. * 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) int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t mdate, int flags, int DoPing)
{ {
char *p, *reply = NULL; char *p, *msgid = NULL, *reply = NULL;
char name[36], *buf; char name[36], *buf, *l, *r, *q;
char System[36], ext[4]; char System[36], ext[4];
int result = 1, email = FALSE; int result = 1, email = FALSE, fmpt = 0, topt = 0;
faddr *ta, *ra; faddr *ta, *ra;
fidoaddr na, route, Orig; fidoaddr na, route, Orig;
FILE *sfp, *net; 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)); Syslog('m', "Post netmail subj: %s", MBSE_SS(subject));
net_in++; 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)); memset(&na, 0, sizeof(na));
na.zone = t->zone; na.zone = t->zone;
na.net = t->net; na.net = t->net;
@ -108,12 +227,10 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
if (email) { if (email) {
/* /*
* Send this netmail via mkrfcmsg -> postemail. * Send this netmail via ftn2rfc -> postemail.
*/ */
if (reply)
free(reply);
most_debug = TRUE; 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; most_debug = FALSE;
return result; 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) { while (fread(&servrec, servhdr.recsize, 1, sfp) == 1) {
if ((strncasecmp(servrec.Service, name, strlen(servrec.Service)) == 0) && servrec.Active) { if ((strncasecmp(servrec.Service, name, strlen(servrec.Service)) == 0) && servrec.Active) {
switch (servrec.Action) { switch (servrec.Action) {
case AREAMGR: result = AreaMgr(f, t, mdate, flags, fp); case AREAMGR: result = AreaMgr(f, t, msgid, subject, mdate, flags, fp);
break; break;
case FILEMGR: result = FileMgr(f, t, mdate, flags, fp); case FILEMGR: result = FileMgr(f, t, msgid, subject, mdate, flags, fp);
break; break;
case EMAIL: most_debug = TRUE; 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; most_debug = FALSE;
break; break;
} }
Syslog('m', "Handled service %s, rc=%d", servrec.Service, result); Syslog('m', "Handled service %s, rc=%d", servrec.Service, result);
if (reply)
free(reply);
fclose(sfp); fclose(sfp);
return result; return result;
} }
@ -174,9 +289,7 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
* Import if one fits. * Import if one fits.
*/ */
if (SearchUser(name)) { if (SearchUser(name)) {
if (reply) return storenet(f, t, mdate, flags, subject, msgid, reply, fp);
free(reply);
return importnet(f, t, mdate, flags, fp);
} }
Syslog('+', " \"%s\" is not a known BBS user", name); 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); Syslog('+', " Readdress from %s to %s", name, CFG.sysop_name);
sprintf(name, "%s", CFG.sysop_name); sprintf(name, "%s", CFG.sysop_name);
if (SearchUser(name)) { if (SearchUser(name)) {
return importnet(f, t, mdate, flags, fp); return storenet(f, t, mdate, flags, subject, msgid, reply, fp);
} else { } else {
WriteError("Readdress import failed"); WriteError("Readdress import failed, sysop doesn't exist. CHECK YOUR SETUP");
return 0; return 0;
} }
break; break;
@ -291,8 +404,6 @@ int postnetmail(FILE *fp, faddr *f, faddr *t, char *orig, char *subject, time_t
fclose(net); fclose(net);
free(buf); free(buf);
net_out++; net_out++;
if (reply)
free(reply);
Syslog('m', "Forward done."); Syslog('m', "Forward done.");
return 0; 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"); WriteError("No ROUTE for this netmail");
net_bad++; net_bad++;
if (reply) return storenet(f, t, mdate, flags, subject, msgid, reply, fp);
free(reply);
return importnet(f, t, mdate, flags, fp);
break; break;
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/ptic.c * File ..................: mbfido/ptic.c
* Purpose ...............: Process 1 .tic file * Purpose ...............: Process 1 .tic file
* Last modification date : 08-Jul-2001 * Last modification date : 31-Jul-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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) && 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))) { !((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); 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) && 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))) { (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); 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);
} }
} }
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/rnews.c * File ..................: mbfido/rnews.c
* Purpose ...............: rnews function * Purpose ...............: rnews function
* Last modification date : 19-Jul-2001 * Last modification date : 14-Aug-2001
* Remarks ...............: Most of these functions are borrowed from inn. * Remarks ...............: Most of these functions are borrowed from inn.
* *
***************************************************************************** *****************************************************************************
@ -42,7 +42,7 @@
#include "../lib/msg.h" #include "../lib/msg.h"
#include "../lib/msgtext.h" #include "../lib/msgtext.h"
#include "pack.h" #include "pack.h"
#include "scannews.h" #include "rfc2ftn.h"
#include "mbfido.h" #include "mbfido.h"
#include "paths.h" #include "paths.h"
#include "rnews.h" #include "rnews.h"
@ -88,6 +88,8 @@ static HEADER RequiredHeaders[] = {
#define ISWHITE(c) ((c) == ' ' || (c) == '\t') #define ISWHITE(c) ((c) == ' ' || (c) == '\t')
#define caseEQn(a, b, n) (strncasecmp((a), (b), (size_t)(n)) == 0) #define caseEQn(a, b, n) (strncasecmp((a), (b), (size_t)(n)) == 0)
/* /*
* External variables * External variables
*/ */
@ -95,6 +97,7 @@ extern int do_quiet;
extern int most_debug; extern int most_debug;
extern int news_in; extern int news_in;
extern int news_dupe; extern int news_dupe;
extern int check_dupe;
void ProcessOne(FILE *); void ProcessOne(FILE *);
@ -109,9 +112,11 @@ const char *HeaderFindMem(const char *Article, const int ArtLen, const char *Hea
const char *p; const char *p;
for (p = Article; ; ) { 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 * delete that line -- meet the RFC!) then compare the rest
* of the word. */ * of the word.
*/
if (HeaderLen + 1 < Article + ArtLen - p && p[HeaderLen] == ':' if (HeaderLen + 1 < Article + ArtLen - p && p[HeaderLen] == ':'
&& ISWHITE(p[HeaderLen + 1]) && caseEQn(p, Header, (size_t)HeaderLen)) { && ISWHITE(p[HeaderLen + 1]) && caseEQn(p, Header, (size_t)HeaderLen)) {
p += HeaderLen + 2; p += HeaderLen + 2;
@ -274,7 +279,6 @@ static int Process(char *article)
char *id = NULL; char *id = NULL;
FILE *fp; FILE *fp;
Syslog('n', "Process article");
/* /*
* Empty 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; int fd = STDIN, i, rc;
@ -550,19 +554,11 @@ void NewsUUCP(int unspool)
printf("Process UUCP Newsbatch\n"); printf("Process UUCP Newsbatch\n");
} }
if (unspool) { most_debug = TRUE;
// Unspool(); rc = UnpackOne(&fd, &i);
} else { most_debug = FALSE;
// if (!UnpackOne(&fd, &i)) WaitForChildren(i);
// Spool(fd); Syslog('+', "End of UUCP batch, rc=%d", rc);
most_debug = TRUE;
rc = UnpackOne(&fd, &i);
most_debug = FALSE;
Syslog('+', "Batch result=%d", rc);
WaitForChildren(i);
}
Syslog('+', "End of UUCP batch");
packmail(); packmail();
if (!do_quiet) if (!do_quiet)
@ -601,7 +597,7 @@ void ProcessOne(FILE *fp)
groups[nrofgroups] = xstrcpy(group); groups[nrofgroups] = xstrcpy(group);
nrofgroups++; nrofgroups++;
} else { } 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) { } else if (mbuf == NULL) {
WriteError("No valid Message-ID found"); WriteError("No valid Message-ID found");
} else { } else {
news_in++;
IsDoing("Article %d", (news_in + 1)); IsDoing("Article %d", (news_in + 1));
for (i = 0; i < nrofgroups; i++) { for (i = 0; i < nrofgroups; i++) {
Syslog('n', "Process %s", groups[i]); Syslog('n', "Process %s", groups[i]);
p = xstrcpy(mbuf); p = xstrcpy(mbuf);
p = xstrcat(p, groups[i]); p = xstrcat(p, groups[i]);
crc = str_crc32(p); crc = str_crc32(p);
if (CheckDupe(crc, D_NEWS, CFG.nntpdupes)) { if (check_dupe && CheckDupe(crc, D_NEWS, CFG.nntpdupes)) {
news_dupe++; news_dupe++;
news_in++;
Syslog('+', "Duplicate article \"%s\" in group %s", mbuf, groups[i]); Syslog('+', "Duplicate article \"%s\" in group %s", mbuf, groups[i]);
} else { } else {
if (SearchMsgsNews(groups[i])) { if (SearchMsgsNews(groups[i])) {
do_article(fp); rfc2ftn(fp, NULL);
} }
} }
free(groups[i]); free(groups[i]);

View File

@ -13,7 +13,7 @@
#define SMBUF 256 #define SMBUF 256
void NewsUUCP(int); void NewsUUCP(void);
#endif #endif

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/scan.h * File ..................: mbfido/scan.h
* Purpose ...............: Scan for outgoing mail. * Purpose ...............: Scan for outgoing mail.
* Last modification date : 01-Jul-2001 * Last modification date : 13-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -41,7 +41,7 @@
#include "addpkt.h" #include "addpkt.h"
#include "pack.h" #include "pack.h"
#include "tracker.h" #include "tracker.h"
#include "mkrfcmsg.h" #include "ftn2rfc.h"
#include "postemail.h" #include "postemail.h"
#include "scan.h" #include "scan.h"
@ -52,8 +52,6 @@ extern int net_bad;
extern int echo_in; extern int echo_in;
extern int email_out; extern int email_out;
extern int echo_out; extern int echo_out;
extern int email_imp;
extern int email_bad;
extern int most_debug; extern int most_debug;
int scanned; int scanned;
@ -252,7 +250,7 @@ void ScanFull()
*/ */
if ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS)) { if ((msgs.Type == ECHOMAIL) || (msgs.Type == NEWS)) {
echo_in++; echo_in++;
fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE); fill_list(&sbl, aka2str(msgs.Aka), NULL);
for (i = 0; i < 40; i++) { for (i = 0; i < 40; i++) {
if (CFG.akavalid[i] && if (CFG.akavalid[i] &&
(msgs.Aka.zone == CFG.aka[i].zone) && (msgs.Aka.zone == CFG.aka[i].zone) &&
@ -260,14 +258,14 @@ void ScanFull()
(msgs.Aka.node == CFG.aka[i].node))) { (msgs.Aka.node == CFG.aka[i].node))) {
sprintf(sbe, "%u/%u", CFG.aka[i].net, sprintf(sbe, "%u/%u", CFG.aka[i].net,
CFG.aka[i].node); CFG.aka[i].node);
fill_list(&sbl, sbe, NULL, FALSE); fill_list(&sbl, sbe, NULL);
} }
} }
fseek(pAreas, sysstart, SEEK_SET); fseek(pAreas, sysstart, SEEK_SET);
for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) { for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) {
fread(&Link, sizeof(sysconnect), 1, pAreas); fread(&Link, sizeof(sysconnect), 1, pAreas);
if ((Link.aka.zone) && (Link.sendto) && (!Link.pause)) { 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); uniq_list(&sbl);
@ -404,7 +402,7 @@ void ScanOne(char *path, unsigned long MsgNum)
*/ */
if (msgs.Type == ECHOMAIL || msgs.Type == NEWS) { if (msgs.Type == ECHOMAIL || msgs.Type == NEWS) {
echo_in++; echo_in++;
fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE); fill_list(&sbl, aka2str(msgs.Aka), NULL);
for (i = 0; i < 40; i++) { for (i = 0; i < 40; i++) {
if (CFG.akavalid[i] && if (CFG.akavalid[i] &&
(msgs.Aka.zone == CFG.aka[i].zone) && (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))) { (msgs.Aka.node == CFG.aka[i].node))) {
sprintf(sbe, "%u/%u", CFG.aka[i].net, sprintf(sbe, "%u/%u", CFG.aka[i].net,
CFG.aka[i].node); CFG.aka[i].node);
fill_list(&sbl, sbe, NULL, FALSE); fill_list(&sbl, sbe, NULL);
} }
} }
fseek(pAreas, sysstart, SEEK_SET); fseek(pAreas, sysstart, SEEK_SET);
for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) { for (i = 0; i < (msgshdr.syssize / sizeof(sysconnect)); i++) {
fread(&Link, sizeof(sysconnect), 1, pAreas); fread(&Link, sizeof(sysconnect), 1, pAreas);
if ((Link.aka.zone) && (Link.sendto) && (!Link.pause)) { 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); uniq_list(&sbl);
@ -530,8 +528,8 @@ int RescanOne(faddr *L, char *marea, unsigned long Num)
while (MsgNum<=Total){ while (MsgNum<=Total){
if (Msg_ReadHeader(MsgNum)) { if (Msg_ReadHeader(MsgNum)) {
if (Msg_Lock(15L)) { if (Msg_Lock(15L)) {
fill_list(&sbl, aka2str(msgs.Aka), NULL, FALSE); fill_list(&sbl, aka2str(msgs.Aka), NULL);
fill_list(&sbl, aka2str(Link.aka), NULL, FALSE); fill_list(&sbl, aka2str(Link.aka), NULL);
sort_list(&sbl); sort_list(&sbl);
ExportEcho(Link, MsgNum, &sbl); ExportEcho(Link, MsgNum, &sbl);
tidy_falist(&sbl); tidy_falist(&sbl);
@ -753,7 +751,7 @@ void ExportNews(unsigned long MsgNum, fa_list **sbl)
rewind(qp); rewind(qp);
most_debug = TRUE; 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; most_debug = FALSE;
tidy_faddr(from); tidy_faddr(from);
fclose(qp); 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, 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"); (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. * 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, "Content-Transfer-Encoding: 8bit\n");
fprintf(fp, "X-Mailreader: MBSE BBS %s\r\n", VERSION); 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 (Msg_Read(MsgNum, 78)) {
if ((p = (char *)MsgText_First()) != NULL) { if ((p = (char *)MsgText_First()) != NULL) {
do { do {
@ -947,25 +973,6 @@ void ExportNet(unsigned long MsgNum, int UUCPgate)
return; 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) if (msgs.Aka.point && !is_fmpt)
fprintf(qp, "\001FMPT %d\r", msgs.Aka.point); fprintf(qp, "\001FMPT %d\r", msgs.Aka.point);
if (Dest.point && !is_topt) if (Dest.point && !is_topt)
@ -1077,9 +1084,9 @@ void ExportEmail(unsigned long MsgNum)
} }
rewind(qp); rewind(qp);
most_debug = TRUE; 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; most_debug = FALSE;
Syslog('m', "mkrfcmsg rc=%d", retval); Syslog('m', "ftn2rfc rc=%d", retval);
email_out++; email_out++;
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/scannews.c * File ..................: mbfido/scannews.c
* Purpose ...............: Scan for new News * Purpose ...............: Scan for new News
* Last modification date : 01-Jul-2001 * Last modification date : 04-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -42,9 +42,10 @@
#include "../lib/msgtext.h" #include "../lib/msgtext.h"
#include "mkftnhdr.h" #include "mkftnhdr.h"
#include "hash.h" #include "hash.h"
#include "echoout.h"
#include "rollover.h" #include "rollover.h"
#include "pack.h" #include "pack.h"
#include "storeecho.h"
#include "rfc2ftn.h"
#include "scannews.h" #include "scannews.h"
@ -58,16 +59,6 @@
*/ */
POverview xoverview = NULL; POverview xoverview = NULL;
int marker = 0; 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 int echo_in;
extern char *replyaddr; 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 fill_artlist(List **, char *, long, int);
void Marker(void); void Marker(void);
int get_article(char *, char *); int get_article(char *, char *);
int needputrfc(rfcmsg *);
void tidy_artlist(List **fdp) 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) void Marker(void)
{ {
if (do_quiet) if (do_quiet)
@ -397,776 +342,13 @@ int get_article(char *msgid, char *ftntag)
news_in++; news_in++;
IsDoing("Article %d", (news_in)); IsDoing("Article %d", (news_in));
retval = do_article(fp); retval = rfc2ftn(fp, NULL);
fclose(fp); fclose(fp);
return retval; 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) int get_xover(char *grpname, long startnr, long endnr, List **art)
{ {
char cmd[81], *ptr, *ptr2, *resp, *p; 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;
}

View File

@ -32,7 +32,6 @@ enum { RETVAL_ERROR = -1, RETVAL_OK = 0, RETVAL_NOARTICLES, RETVAL_UNEXPECTEDANS
void ScanNews(void); void ScanNews(void);
int do_article(FILE *);
#endif #endif

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbfido/tic.c * File ..................: mbfido/tic.c
* Purpose ...............: Process .tic files * Purpose ...............: Process .tic files
* Last modification date : 08-Jul-2001 * Last modification date : 31-Jul-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -311,7 +311,7 @@ int LoadTic(char *inb, char *tfn)
} }
if (strncasecmp(Temp, "seenby ", 7) == 0) { if (strncasecmp(Temp, "seenby ", 7) == 0) {
fill_list(&sbl, Temp+7, NULL, FALSE); fill_list(&sbl, Temp+7, NULL);
Kwd = TRUE; Kwd = TRUE;
} }

View File

@ -2,7 +2,7 @@
* *
* File ..................: tosser/tosspkt.c * File ..................: tosser/tosspkt.c
* Purpose ...............: Toss a single *.pkt file * Purpose ...............: Toss a single *.pkt file
* Last modification date : 03-Jun-2001 * Last modification date : 03-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -34,9 +34,18 @@
#include "../lib/records.h" #include "../lib/records.h"
#include "../lib/common.h" #include "../lib/common.h"
#include "../lib/clcomm.h" #include "../lib/clcomm.h"
#include "../lib/msg.h"
#include "../lib/msgtext.h"
#include "../lib/dbcfg.h"
#include "../lib/dbnode.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 "tosspkt.h"
#include "postnetmail.h"
#include "postecho.h"
#include "rollover.h"
@ -44,6 +53,11 @@
* External declarations * External declarations
*/ */
extern int do_quiet; 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_imp = 0; /* Email imported */
int email_out = 0; /* Email forwarded */ int email_out = 0; /* Email forwarded */
int email_bad = 0; /* Bad email */ 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; 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) char *aread(char *s, int count, FILE *fp)
{ {
int i,c,next; 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. * Toss one packet.
* *
@ -198,11 +431,8 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
time_t mdate = 0L; time_t mdate = 0L;
FILE *fp; FILE *fp;
unsigned char buffer[0x0e]; unsigned char buffer[0x0e];
off_t orig_off; char *subj = NULL;
subj = NULL;
toname = NULL;
fromname = NULL;
result = fread(&buffer, 1, sizeof(buffer), pkt); result = fread(&buffer, 1, sizeof(buffer), pkt);
if (result == 0) { if (result == 0) {
Syslog('m', "Zero bytes message, assume end of pkt"); 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) if (strlen(buf) > 36)
Syslog('!', "to name too long (%d) \"%s\"", strlen(buf), printable(buf, 0)); Syslog('!', "to name too long (%d) \"%s\"", strlen(buf), printable(buf, 0));
t.name = xstrcpy(buf); t.name = xstrcpy(buf);
toname = xstrcpy(buf);
if (aread(buf, sizeof(buf)-1, pkt)) { if (aread(buf, sizeof(buf)-1, pkt)) {
if (*(p=t.name+strlen(t.name)-1) == '\n') if (*(p=t.name+strlen(t.name)-1) == '\n')
*p = '\0'; *p = '\0';
@ -272,7 +501,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
if (strlen(buf) > 36) if (strlen(buf) > 36)
Syslog('!', "from name too long (%d) \"%s\"", strlen(buf), printable(buf, 0)); Syslog('!', "from name too long (%d) \"%s\"", strlen(buf), printable(buf, 0));
f.name = xstrcpy(buf); f.name = xstrcpy(buf);
fromname = xstrcpy(buf);
if (aread(buf, sizeof(buf)-1, pkt)) { if (aread(buf, sizeof(buf)-1, pkt)) {
if (*(p=f.name+strlen(f.name)-1) == '\n') if (*(p=f.name+strlen(f.name)-1) == '\n')
*p = '\0'; *p = '\0';
@ -307,7 +535,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
WriteError("$unable to open temporary file"); WriteError("$unable to open temporary file");
return 4; return 4;
} }
orig_off = 0L;
/* /*
* Read the text from the .pkt file * 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. * Extract info from Origin line if found.
*/ */
if (!strncmp(buf," * Origin:",10)) { if (!strncmp(buf," * Origin:",10)) {
orig_off = ftell(fp);
p=buf+10; p=buf+10;
while (*p == ' ') p++; while (*p == ' ') p++;
if ((l=strrchr(p,'(')) && (r=strrchr(p,')')) && (l < r)) { 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) if (rc)
rc+=10; rc+=10;
if (rc > maxrc) if (rc > maxrc)
@ -370,14 +596,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
free(t.domain); free(t.domain);
t.domain=NULL; t.domain=NULL;
if (fromname)
free(fromname);
fromname = NULL;
if (toname)
free(toname);
toname = NULL;
if (subj) if (subj)
free(subj); free(subj);
subj = NULL; subj = NULL;
@ -386,10 +604,6 @@ int getmessage(FILE *pkt, faddr *p_from, faddr *p_to)
free(orig); free(orig);
orig = NULL; orig = NULL;
if (msgid)
free(msgid);
msgid = NULL;
if (feof(pkt) || ferror(pkt)) { if (feof(pkt) || ferror(pkt)) {
WriteError("Unexpected end of packet"); WriteError("Unexpected end of packet");
return 5; return 5;

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = . SUBDIRS = .
noinst_PROGRAMS = mbmon noinst_PROGRAMS = mbmon
@ -101,6 +101,7 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = tar
GZIP_ENV = --best GZIP_ENV = --best
DEP_FILES = .deps/common.P .deps/mbmon.P .deps/mutil.P
SOURCES = $(mbmon_SOURCES) SOURCES = $(mbmon_SOURCES)
OBJECTS = $(mbmon_OBJECTS) OBJECTS = $(mbmon_OBJECTS)
@ -108,9 +109,9 @@ all: all-redirect
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .S .c .o .s .SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -124,9 +125,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
.s.o: .s.o:
$(COMPILE) -c $< $(COMPILE) -c $<
@ -241,6 +239,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = mbmon subdir = mbmon
distdir: $(DISTFILES) 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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
@ -261,13 +264,38 @@ distdir: $(DISTFILES)
|| exit 1; \ || exit 1; \
fi; \ fi; \
done 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-am:
info: info-recursive info: info-recursive
dvi-am: dvi-am:
@ -305,23 +333,24 @@ distclean-generic:
maintainer-clean-generic: maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \
mostlyclean-am clean-generic mostlyclean-am
clean: clean-recursive clean: clean-recursive
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \
distclean-generic clean-am distclean-depend distclean-generic clean-am
distclean: distclean-recursive distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \ 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 "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild." @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 \ all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ distclean-tags clean-tags maintainer-clean-tags distdir \
dvi-am dvi check check-am installcheck-am installcheck \ mostlyclean-depend distclean-depend clean-depend \
install-exec-local install-exec-am install-exec install-data-am \ maintainer-clean-depend info-am info dvi-am dvi check check-am \
install-data install-am install uninstall-am uninstall all-redirect \ installcheck-am installcheck install-exec-local install-exec-am \
all-am all installdirs-am installdirs mostlyclean-generic \ install-exec install-data-am install-data install-am install \
distclean-generic clean-generic maintainer-clean-generic clean \ uninstall-am uninstall all-redirect all-am all installdirs-am \
mostlyclean distclean maintainer-clean installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-exec-local: install-exec-local:

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbmon/common.c * File ..................: mbmon/common.c
* Purpose ...............: Common utilities * Purpose ...............: Common utilities
* Last modification date : 25-May-2001 * Last modification date : 10-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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 */ int lcnt = 0; /* Same message counter */
static char *pbuff = NULL; static char *pbuff = NULL;
static int sock = -1; /* TCP/IP socket */ 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 clntaddr; /* Client socket address */
struct sockaddr_un servaddr; /* Server socket address */ struct sockaddr_un servaddr; /* Server socket address */
@ -453,26 +455,40 @@ int rawset = FALSE;
*/ */
void Setraw() void Setraw()
{ {
if (ioctl(ttyfd, TCGETA, &tbuf) == -1) { int rc;
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; // if (ioctl(ttyfd, TCGETA, &tbuf) == -1) {
tbuf.c_iflag &= ~(INLCR | ICRNL | IUCLC | ISTRIP | IXON ); // 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 * Map CRNL modes strip control characters and flow control
*/ */
tbuf.c_oflag &= ~OPOST; /* Don't do ouput character translation */ tbufs.c_oflag &= ~OPOST; /* Don't do ouput character translation */
tbuf.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */ tbufs.c_lflag &= ~(ICANON | ECHO); /* No canonical input and no echo */
tbuf.c_cc[VMIN] = 1; /* Receive 1 character at a time */ tbufs.c_cc[VMIN] = 1; /* Receive 1 character at a time */
tbuf.c_cc[VTIME] = 0; /* No time limit per character */ tbufs.c_cc[VTIME] = 0; /* No time limit per character */
if (ioctl(ttyfd, TCSETAF, &tbuf) == -1) { if ((rc = tcsetattr(ttyfd, TCSADRAIN, &tbufs))) {
perror("TCSETAF failed"); perror("");
exit(1); /* ERROR - could not set tty ioctl */ 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; rawset = TRUE;
} }
@ -483,13 +499,20 @@ void Setraw()
*/ */
void Unsetraw() void Unsetraw()
{ {
int rc;
/* /*
* Only unset the mode if it is set to raw mode * Only unset the mode if it is set to raw mode
*/ */
if (rawset == TRUE) { if (rawset == TRUE) {
if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) { // if (ioctl(ttyfd, TCSETAF, &tbufsav) == -1) {
perror("TCSETAF Normal Failed"); // perror("TCSETAF Normal Failed");
exit(1); /* ERROR - could not save original tty ioctl */ // 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; rawset = FALSE;

View File

@ -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 InitClient(char *);
void ExitClient(int); void ExitClient(int);
void SockS(const char *, ...); void SockS(const char *, ...);

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbmon/mbmon.c * File ..................: mbmon/mbmon.c
* Purpose ...............: Monitor Program * Purpose ...............: Monitor Program
* Last modification date : 29-Jun-2001 * Last modification date : 11-Aug-2001
* Todo ..................: Trace logfiles * Todo ..................: Trace logfiles
* Chat with user via server * Chat with user via server
* *
@ -366,7 +366,13 @@ void soft_info(void)
{ {
clr_index(); clr_index();
set_color(YELLOW, BLACK); 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); set_color(WHITE, BLACK);
center_addstr( 9, (char *)"(c) Michiel Broek"); center_addstr( 9, (char *)"(c) Michiel Broek");
set_color(YELLOW, BLACK); set_color(YELLOW, BLACK);

View File

@ -2,7 +2,7 @@
* *
* File ..................: mutil.c * File ..................: mutil.c
* Purpose ...............: Utilities * Purpose ...............: Utilities
* Last modification date : 25-May-2001 * Last modification date : 07-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -33,6 +33,8 @@
#include "common.h" #include "common.h"
#include "mutil.h" #include "mutil.h"
extern int ttyfd;
unsigned char readkey(int y, int x, int fg, int bg) unsigned char readkey(int y, int x, int fg, int bg)
{ {

View File

@ -31,9 +31,9 @@ mbuser_SOURCES = mbuser.c mbuser.h
mbuseradd_SOURCES = mbuseradd.c mbuseradd.h mbuseradd_SOURCES = mbuseradd.c mbuseradd.h
mbpasswd_SOURCES = mbpasswd.c commonio.c pwio.c shadowio.c sgetpwent.c \ 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 \ 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 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 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 mbuser_LDADD = ../lib/libmemwatch.a ../lib/libclcomm.a ../lib/libcommon.a ../lib/libdbase.a
install-exec-local: install-exec-local:
@if [ "$(shell whoami)" != "root" ] ; then \ @if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \ echo; echo " Must be root to install!"; echo; exit 3; \
fi fi
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 6711 mbsebbs $(bindir) $(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 mbfbgen $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbstat $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbstat $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbtoberep $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbtoberep $(bindir)
$(INSTALL) -s -g root -o root -m 6711 mbuser $(bindir) $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuser $(bindir)
$(INSTALL) -s -g root -o root -m 6711 mbuseradd $(bindir) $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuseradd $(bindir)
$(INSTALL) -s -g root -o root -m 6711 mbpasswd $(bindir) $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbpasswd $(bindir)

View File

@ -59,6 +59,7 @@ PRE_UNINSTALL = :
POST_UNINSTALL = : POST_UNINSTALL = :
AWK = @AWK@ AWK = @AWK@
CC = @CC@ CC = @CC@
CHOWN = @CHOWN@
COMPRESS = @COMPRESS@ COMPRESS = @COMPRESS@
GROUP = @GROUP@ GROUP = @GROUP@
GZIP = @GZIP@ GZIP = @GZIP@
@ -70,7 +71,6 @@ OWNER = @OWNER@
PACKAGE = @PACKAGE@ PACKAGE = @PACKAGE@
RANLIB = @RANLIB@ RANLIB = @RANLIB@
VERSION = @VERSION@ VERSION = @VERSION@
YACC = @YACC@
SUBDIRS = . SUBDIRS = .
noinst_PROGRAMS = mbsebbs mball mblang mbchat mbfbgen mbstat mbtoberep mbuser mbuseradd mbpasswd 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 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 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_DEPENDENCIES =
mbuseradd_LDFLAGS = mbuseradd_LDFLAGS =
mbpasswd_OBJECTS = mbpasswd.o commonio.o pwio.o shadowio.o sgetpwent.o \ 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_LDADD = $(LDADD)
mbpasswd_DEPENDENCIES = mbpasswd_DEPENDENCIES =
mbpasswd_LDFLAGS = mbpasswd_LDFLAGS =
@ -172,6 +172,19 @@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar TAR = tar
GZIP_ENV = --best 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) 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) 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:
.SUFFIXES: .S .c .o .s .SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(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) \ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
@ -195,9 +208,6 @@ distclean-noinstPROGRAMS:
maintainer-clean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
.s.o: .s.o:
$(COMPILE) -c $< $(COMPILE) -c $<
@ -348,6 +358,11 @@ distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = mbsebbs subdir = mbsebbs
distdir: $(DISTFILES) 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 \ @for file in $(DISTFILES); do \
d=$(srcdir); \ d=$(srcdir); \
if test -d $$d/$$file; then \ if test -d $$d/$$file; then \
@ -368,174 +383,38 @@ distdir: $(DISTFILES)
|| exit 1; \ || exit 1; \
fi; \ fi; \
done 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-am:
info: info-recursive info: info-recursive
dvi-am: dvi-am:
@ -573,23 +452,24 @@ distclean-generic:
maintainer-clean-generic: maintainer-clean-generic:
mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-am: mostlyclean-noinstPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive mostlyclean: mostlyclean-recursive
clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-generic \ clean-am: clean-noinstPROGRAMS clean-compile clean-tags clean-depend \
mostlyclean-am clean-generic mostlyclean-am
clean: clean-recursive clean: clean-recursive
distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \ distclean-am: distclean-noinstPROGRAMS distclean-compile distclean-tags \
distclean-generic clean-am distclean-depend distclean-generic clean-am
distclean: distclean-recursive distclean: distclean-recursive
maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ maintainer-clean-am: maintainer-clean-noinstPROGRAMS \
maintainer-clean-compile maintainer-clean-tags \ 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 "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild." @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 \ all-recursive check-recursive installcheck-recursive info-recursive \
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ distclean-tags clean-tags maintainer-clean-tags distdir \
dvi-am dvi check check-am installcheck-am installcheck \ mostlyclean-depend distclean-depend clean-depend \
install-exec-local install-exec-am install-exec install-data-am \ maintainer-clean-depend info-am info dvi-am dvi check check-am \
install-data install-am install uninstall-am uninstall all-redirect \ installcheck-am installcheck install-exec-local install-exec-am \
all-am all installdirs-am installdirs mostlyclean-generic \ install-exec install-data-am install-data install-am install \
distclean-generic clean-generic maintainer-clean-generic clean \ uninstall-am uninstall all-redirect all-am all installdirs-am \
mostlyclean distclean maintainer-clean installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-exec-local: install-exec-local:
@if [ "$(shell whoami)" != "root" ] ; then \ @if [ "`id -un`" != "root" ] ; then \
echo; echo " Must be root to install!"; echo; exit 3; \ echo; echo " Must be root to install!"; echo; exit 3; \
fi fi
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 6711 mbsebbs $(bindir) $(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 mbfbgen $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbstat $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbstat $(bindir)
$(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbtoberep $(bindir) $(INSTALL) -s -o @OWNER@ -g @GROUP@ -m 0711 mbtoberep $(bindir)
$(INSTALL) -s -g root -o root -m 6711 mbuser $(bindir) $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuser $(bindir)
$(INSTALL) -s -g root -o root -m 6711 mbuseradd $(bindir) $(INSTALL) -s -o `id -un` -g `id -gn` -m 6711 mbuseradd $(bindir)
$(INSTALL) -s -g root -o root -m 6711 mbpasswd $(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. # 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. # Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbuseradd/commonio.c * File ..................: mbuseradd/commonio.c
* Purpose ...............: MBSE BBS Shadow Password Suite * Purpose ...............: MBSE BBS Shadow Password Suite
* Last modification date : 07-Feb-2001 * Last modification date : 09-Aug-2001
* Original Source .......: Shadow Password Suite * Original Source .......: Shadow Password Suite
* Original Copyrioght ...: Julianne Frances Haugh and others. * Original Copyrioght ...: Julianne Frances Haugh and others.
* *
@ -50,16 +50,19 @@
#include "commonio.h" #include "commonio.h"
/* local function prototypes */ /* local function prototypes */
static int check_link_count (const char *); static int check_link_count (const char *);
static int do_lock_file (const char *, const char *); static int do_lock_file (const char *, const char *);
static FILE *fopen_set_perms (const char *, const char *, const struct stat *); static FILE *fopen_set_perms (const char *, const char *, const struct stat *);
static int create_backup (const char *, FILE *); static int create_backup (const char *, FILE *);
static void free_linked_list (struct commonio_db *); static void free_linked_list (struct commonio_db *);
static void add_one_entry (struct commonio_db *, struct commonio_entry *); static void add_one_entry (struct commonio_db *, struct commonio_entry *);
static int name_is_nis (const char *); static int name_is_nis (const char *);
static int write_all (const struct commonio_db *); static int write_all (const struct commonio_db *);
static struct commonio_entry *find_entry_by_name (struct commonio_db *, const char *); 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) 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) static FILE *fopen_set_perms(const char *name, const char *mode, const struct stat *sb)
{ {
FILE *fp; FILE *fp;
int mask; mode_t mask;
mask = umask(0777); mask = umask(0777);
fp = fopen(name, mode); fp = fopen(name, mode);
@ -151,14 +154,6 @@ static FILE *fopen_set_perms(const char *name, const char *mode, const struct st
if (!fp) if (!fp)
return NULL; 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 #ifdef HAVE_FCHOWN
if (fchown(fileno(fp), sb->st_uid, sb->st_gid)) if (fchown(fileno(fp), sb->st_uid, sb->st_gid))
goto fail; 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)) if (chown(name, sb->st_mode))
goto fail; goto fail;
#endif #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; return fp;
fail: fail:
@ -181,7 +184,8 @@ static int create_backup(const char *backup, FILE *fp)
struct stat sb; struct stat sb;
struct utimbuf ub; struct utimbuf ub;
FILE *bkfp; FILE *bkfp;
int c, mask; int c;
mode_t mask;
if (fstat(fileno(fp), &sb)) if (fstat(fileno(fp), &sb))
return -1; 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 file[1024];
char lock[1024]; char lock[1024];
if (db->locked) if (db->locked)
return 1; return 1;
snprintf(file, sizeof file, "%s.%ld", db->filename, (long) getpid()); snprintf(file, sizeof file, "%s.%ld", db->filename, (long) getpid());
snprintf(lock, sizeof lock, "%s.lock", db->filename); snprintf(lock, sizeof lock, "%s.lock", db->filename);
if (do_lock_file(file, lock)) { if (do_lock_file(file, lock)) {
db->locked = 1; db->locked = 1;
return 1; return 1;
} }
return 0; return 0;
} }
int commonio_lock(struct commonio_db *db)
int commonio_lock_first(struct commonio_db *db)
{ {
int i;
#ifdef HAVE_LCKPWDF #ifdef HAVE_LCKPWDF
/* /*
* When locking several files, *_lock_first() is called * only if the system libc has a real lckpwdf() - the one from
* for the first one, and *_lock() for the others. * lockpw.c calls us and would cause infinite recursion!
* If lckpwdf() is available, call it here (it may block */
* for up to 15 seconds), and if it succeeds, call if (db->use_lckpwdf) {
* *_lock() once (no retries, it should always succeed). /*
*/ * Call lckpwdf() on the first lock.
* If it succeeds, call *_lock() only once
if (lckpwdf() == -1) * (no retries, it should always succeed).
return 0; /* failure */ */
if (lock_count == 0) {
if (!commonio_lock(db)) { if (lckpwdf() == -1)
ulckpwdf(); return 0; /* failure */
return 0; /* failure */ }
} if (!commonio_lock_nowait(db)) {
ulckpwdf();
return 1; /* success */ return 0; /* failure */
#else }
int i; lock_count++;
return 1; /* success */
/* }
* No lckpwdf() - do it the old way. #endif
*/ /*
* lckpwdf() not used - do it the old way.
*/
#ifndef LOCK_TRIES #ifndef LOCK_TRIES
#define LOCK_TRIES 15 #define LOCK_TRIES 15
#endif #endif
for (i = 1; i < LOCK_TRIES; i++) {
if (commonio_lock(db))
return 1; /* success */
sleep(1); #ifndef LOCK_SLEEP
} #define LOCK_SLEEP 1
#endif
/* for (i = 0; i < LOCK_TRIES; i++) {
* Retry the last time... if (i > 0)
*/ sleep(LOCK_SLEEP); /* delay between retries */
return commonio_lock(db); if (commonio_lock_nowait(db))
#endif /* !HAVE_LCKPWDF */ 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)) if (!commonio_close(db))
return 0; return 0;
} }
if (db->locked) { if (db->locked) {
db->locked = 0; /*
snprintf(lock, sizeof lock, "%s.lock", db->filename); * Unlock in reverse order: remove the lock file,
unlink(lock); * then call ulckpwdf() (if used) on last unlock.
return 1; */
} db->locked = 0;
return 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; goto success;
} }
memset(&sb, 0, sizeof sb);
if (db->fp) { if (db->fp) {
if (fstat(fileno(db->fp), &sb)) { if (fstat(fileno(db->fp), &sb)) {
fclose(db->fp); fclose(db->fp);

View File

@ -8,9 +8,9 @@
*/ */
struct commonio_entry { struct commonio_entry {
char *line; char *line;
int changed;
void *entry; /* struct passwd, struct spwd, ... */ void *entry; /* struct passwd, struct spwd, ... */
struct commonio_entry *prev, *next; struct commonio_entry *prev, *next;
int changed:1;
}; };
@ -85,7 +85,11 @@ struct commonio_db {
/* /*
* Various flags. * 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_setname (struct commonio_db *, const char *);
int commonio_present (const struct commonio_db *); int commonio_present (const struct commonio_db *);
int commonio_lock (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); int commonio_open (struct commonio_db *, int);
const void *commonio_locate (struct commonio_db *, const char *); const void *commonio_locate (struct commonio_db *, const char *);
int commonio_update (struct commonio_db *, const void *); int commonio_update (struct commonio_db *, const void *);

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbuseradd/encrypt.c * File ..................: mbuseradd/encrypt.c
* Purpose ...............: MBSE BBS Shadow Password Suite * Purpose ...............: MBSE BBS Shadow Password Suite
* Last modification date : 13-May-2001 * Last modification date : 09-Aug-2001
* Original Source .......: Shadow Password Suite * Original Source .......: Shadow Password Suite
* Original Copyrioght ...: Julianne Frances Haugh and others. * Original Copyrioght ...: Julianne Frances Haugh and others.
* *
@ -63,6 +63,7 @@
#include "../config.h" #include "../config.h"
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <stdio.h>
#ifdef _XOPEN_CRYPT #ifdef _XOPEN_CRYPT
#include <crypt.h> #include <crypt.h>
#endif #endif
@ -113,6 +114,10 @@ char *pw_encrypt(const char *clear, const char *salt)
for (count = 0;count < 10;count++) { for (count = 0;count < 10;count++) {
cp = crypt (clear, salt); cp = crypt (clear, salt);
if (!cp) {
perror("crypt");
exit(1);
}
if (strlen(cp) != 13) if (strlen(cp) != 13)
return cp; return cp;
strcat (cipher, cp + 2); strcat (cipher, cp + 2);
@ -125,6 +130,15 @@ char *pw_encrypt(const char *clear, const char *salt)
} }
#else #else
cp = crypt (clear, salt); 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) if (strlen(cp) != 13)
return cp; /* nonstandard crypt() in libc, better bail out */ return cp; /* nonstandard crypt() in libc, better bail out */
strcpy (cipher, cp); strcpy (cipher, cp);

View File

@ -2,7 +2,7 @@
* *
* File ..................: bbs/file.c * File ..................: bbs/file.c
* Purpose ...............: All the file functions. * Purpose ...............: All the file functions.
* Last modification date : 28-Jun-2001 * Last modification date : 10-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -473,7 +473,7 @@ void File_RawDir(char *OpData)
printf("%-20s", dp->d_name); printf("%-20s", dp->d_name);
colour(13,0); colour(13,0);
printf("%-12ld", statfile.st_size); printf("%-12ld", (long)(statfile.st_size));
colour(10,0); colour(10,0);
printf("%-10s\n", StrDateDMY(statfile.st_mtime)); printf("%-10s\n", StrDateDMY(statfile.st_mtime));
@ -1354,7 +1354,7 @@ void List_Home()
printf("%-20s", dp->d_name); printf("%-20s", dp->d_name);
colour(13,0); colour(13,0);
printf("%-12ld", statfile.st_size); printf("%-12ld", (long)(statfile.st_size));
colour(10,0); colour(10,0);
printf("%s ", StrDateDMY(statfile.st_mtime)); printf("%s ", StrDateDMY(statfile.st_mtime));
@ -2098,7 +2098,7 @@ void EditTaglist()
Fg--; Fg--;
colour(Fg, 0); colour(Fg, 0);
printf(" %8ld", Tag.Size); printf(" %8ld", (long)(Tag.Size));
Fg--; Fg--;
colour(Fg, 0); colour(Fg, 0);

View File

@ -2,7 +2,7 @@
* *
* File ..................: bbs/filesub.c * File ..................: bbs/filesub.c
* Purpose ...............: All the file sub functions. * Purpose ...............: All the file sub functions.
* Last modification date : 28-Jun-2001 * Last modification date : 09-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -427,9 +427,9 @@ int ShowOneFile()
colour(CFG.FilesizeF, CFG.FilesizeB); colour(CFG.FilesizeF, CFG.FilesizeB);
if(strlen(file.Name) < 25) if(strlen(file.Name) < 25)
printf("%10lu ", file.Size); printf("%10lu ", (long)(file.Size));
else else
printf("%25lu ", file.Size); printf("%25lu ", (long)(file.Size));
colour(CFG.FiledateF, CFG.FiledateB); colour(CFG.FiledateF, CFG.FiledateB);
printf("%-10s ", StrDateDMY(file.UploadDate)); 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); x = atoi(token);
Size *= i / x; Size *= i / x;
/* You have */ /* extra download KBytes. */ /* 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); exitinfo.DownloadKToday += (Size / 1024);
Syslog('b', "DownloadKToday %d", exitinfo.DownloadKToday); Syslog('b', "DownloadKToday %d", exitinfo.DownloadKToday);
@ -891,7 +891,7 @@ int Addfile(char *File, int AreaNum, int fileid)
memset(&file, 0, sizeof(file)); memset(&file, 0, sizeof(file));
strcpy(file.Name, File); strcpy(file.Name, File);
sprintf(temp1,"%ld",statfile.st_size); sprintf(temp1,"%ld",(long)(statfile.st_size));
file.Size = atoi(temp1); file.Size = atoi(temp1);
file.FileDate = statfile.st_mtime; file.FileDate = statfile.st_mtime;
strcpy(file.Uploader, exitinfo.sUserName); strcpy(file.Uploader, exitinfo.sUserName);
@ -998,7 +998,7 @@ int Addfile(char *File, int AreaNum, int fileid)
fprintf(pPrivate, "****************************************************"); fprintf(pPrivate, "****************************************************");
fprintf(pPrivate, "\nUser : %s", file.Uploader); fprintf(pPrivate, "\nUser : %s", file.Uploader);
fprintf(pPrivate, "\nFile : %s", file.Name); 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)); fprintf(pPrivate, "\nUpload Date : %s\n\n", StrDateDMY(file.UploadDate));
for(i = 0; i < iDesc - 1; i++) for(i = 0; i < iDesc - 1; i++)

View File

@ -2,7 +2,7 @@
* *
* File ..................: bbs/funcs4.c * File ..................: bbs/funcs4.c
* Purpose ...............: Misc functions, also for some utils. * Purpose ...............: Misc functions, also for some utils.
* Last modification date : 28-Jun-2001 * Last modification date : 08-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -834,14 +834,10 @@ int Check4UnixLogin(char *UsersName)
struct passwd *pw; struct passwd *pw;
while ((pw = getpwent())) { while ((pw = getpwent())) {
#ifdef linux if(strcmp(pw->pw_gecos, UsersName) == 0) {
if(strcmp(pw->pw_gecos, UsersName) == 0) { UID = pw->pw_uid;
#else break;
if(strcmp(pw->pw_comment, UsersName) == 0) { }
#endif
UID = pw->pw_uid;
break;
}
} }
return UID; return UID;

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbuseradd/getdef.c * File ..................: mbuseradd/getdef.c
* Purpose ...............: MBSE BBS Shadow Password Suite * Purpose ...............: MBSE BBS Shadow Password Suite
* Last modification date : 27-Jun-2001 * Last modification date : 09-Aug-2001
* Original Source .......: Shadow Password Suite * Original Source .......: Shadow Password Suite
* Original Copyrioght ...: Julianne Frances Haugh and others. * Original Copyrioght ...: Julianne Frances Haugh and others.
* *
@ -78,30 +78,37 @@ struct itemdef {
char *value; /* value given, or NULL if no value */ 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])) #define NUMDEFS (sizeof(def_table)/sizeof(def_table[0]))
static struct itemdef def_table[] = { static struct itemdef def_table[] = {
{ "CHFN_AUTH", NULL }, { "CHFN_AUTH", NULL },
{ "CHFN_RESTRICT", NULL }, { "CHFN_RESTRICT", NULL },
{ "CLOSE_SESSIONS", NULL },
{ "CONSOLE", NULL }, { "CONSOLE", NULL },
{ "CONSOLE_GROUPS", NULL }, { "CONSOLE_GROUPS", NULL },
#ifdef HAVE_LIBCRACK
{ "CRACKLIB_DICTPATH", NULL }, { "CRACKLIB_DICTPATH", NULL },
#endif
{ "CREATE_HOME", NULL }, { "CREATE_HOME", NULL },
{ "DEFAULT_HOME", NULL }, { "DEFAULT_HOME", NULL },
{ "DIALUPS_CHECK_ENAB", NULL }, { "DIALUPS_CHECK_ENAB", NULL },
{ "ENVIRON_FILE", NULL }, { "ENVIRON_FILE", NULL },
{ "ENV_HZ", NULL }, { "ENV_HZ", NULL },
{ "ENV_PATH" , NULL }, { "ENV_PATH" , NULL },
{ "ENV_ROOTPATH", NULL },
{ "ENV_SUPATH", NULL }, { "ENV_SUPATH", NULL },
{ "ENV_TZ", NULL }, { "ENV_TZ", NULL },
{ "ERASECHAR", NULL }, { "ERASECHAR", NULL },
{ "FAILLOG_ENAB", NULL }, { "FAILLOG_ENAB", NULL },
{ "FAIL_DELAY", NULL }, { "FAIL_DELAY", NULL },
{ "FAKE_SHELL", NULL },
{ "FTMP_FILE", NULL }, { "FTMP_FILE", NULL },
{ "GID_MAX", NULL }, { "GID_MAX", NULL },
{ "GID_MIN", NULL }, { "GID_MIN", NULL },
@ -121,6 +128,7 @@ static struct itemdef def_table[] = {
{ "MOTD_FILE", NULL }, { "MOTD_FILE", NULL },
{ "NOLOGINS_FILE", NULL }, { "NOLOGINS_FILE", NULL },
{ "NOLOGIN_STR", NULL }, { "NOLOGIN_STR", NULL },
{ "NO_PASSWORD_CONSOLE", NULL },
{ "OBSCURE_CHECKS_ENAB", NULL }, { "OBSCURE_CHECKS_ENAB", NULL },
{ "PASS_ALWAYS_WARN", NULL }, { "PASS_ALWAYS_WARN", NULL },
{ "PASS_CHANGE_TRIES", NULL }, { "PASS_CHANGE_TRIES", NULL },

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbsebbs/mball.c * File ..................: mbsebbs/mball.c
* Purpose ...............: Creates allfiles listings * Purpose ...............: Creates allfiles listings
* Last modification date : 28-Jun-2001 * Last modification date : 09-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -564,7 +564,7 @@ void MakeIndex()
if (strlen(file.Desc[z])) { if (strlen(file.Desc[z])) {
if (z == 0) if (z == 0)
fprintf(fp, "%-12s %7luK %s ", file.Name, fprintf(fp, "%-12s %7luK %s ", file.Name,
file.Size / 1024, (long)(file.Size / 1024),
StrDateDMY(file.UploadDate)); StrDateDMY(file.UploadDate));
else else
fprintf(fp, " "); fprintf(fp, " ");
@ -604,7 +604,8 @@ void MakeIndex()
area.Path+strlen(CFG.ftp_base), file.Name, file.Name); area.Path+strlen(CFG.ftp_base), file.Name, file.Name);
} }
fprintf(fa, "<TD><PRE>%s</PRE></TD>", StrDateDMY(file.FileDate)); fprintf(fa, "<TD><PRE>%s</PRE></TD>", StrDateDMY(file.FileDate));
fprintf(fa, "<TD align=right><PRE>%lu Kb.</PRE></TD>", file.Size / 1024); fprintf(fa, "<TD align=right><PRE>%lu Kb.</PRE></TD>",
(long)(file.Size / 1024));
fprintf(fa, "<TD><PRE>%8ld</PRE></TD>", fprintf(fa, "<TD><PRE>%8ld</PRE></TD>",
file.TimesDL + file.TimesFTP + file.TimesReq); file.TimesDL + file.TimesFTP + file.TimesReq);
fprintf(fa, "<TD><PRE>"); fprintf(fa, "<TD><PRE>");
@ -856,7 +857,7 @@ void Masterlist()
if((!file.Deleted) && (!file.Missing)) { if((!file.Deleted) && (!file.Missing)) {
New = (((t_start - file.UploadDate) / 84400) <= CFG.newdays); New = (((t_start - file.UploadDate) / 84400) <= CFG.newdays);
sprintf(temp, "%-12s%10lu K %s [%04ld] Uploader: %s", 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, file.TimesDL + file.TimesFTP + file.TimesReq,
strlen(file.Uploader)?file.Uploader:""); strlen(file.Uploader)?file.Uploader:"");
fprintf(fp, "%s\r\n", temp); fprintf(fp, "%s\r\n", temp);

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbpasswd.c * File ..................: mbpasswd.c
* Purpose ...............: setuid root version of passwd * Purpose ...............: setuid root version of passwd
* Last modification date : 27-Jun-2001 * Last modification date : 10-Aug-2001
* Shadow Suite (c) ......: Julianne Frances Haugh * Shadow Suite (c) ......: Julianne Frances Haugh
* *
***************************************************************************** *****************************************************************************
@ -32,10 +32,13 @@
#include "../config.h" #include "../config.h"
#include <stdio.h> #include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h> #include <sys/resource.h>
#endif
#include <grp.h> #include <grp.h>
#include <pwd.h> #include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <syslog.h> #include <syslog.h>
#include <string.h> #include <string.h>
@ -43,9 +46,15 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <time.h> #include <time.h>
#include <stdlib.h>
#if defined(SHADOW_PASSWORD) #if defined(SHADOW_PASSWORD)
#include <shadow.h> #include <shadow.h>
#endif #endif
#ifdef HAVE_USERSEC_H
#include <userpw.h>
#include <usersec.h>
#include <userconf.h>
#endif
#include "encrypt.h" #include "encrypt.h"
#include "rad64.h" #include "rad64.h"
@ -107,12 +116,19 @@ static int force; /* Force update of locked passwords */
#ifndef __FreeBSD__
static void fail_exit(int status) static void fail_exit(int status)
{ {
pw_unlock(); // gr_unlock();
#ifdef SHADOWPWD #ifdef SHADOWGRP
spw_unlock(); if (is_shadow_grp)
sgr_unlock();
#endif #endif
#ifdef SHADOWPWD
if (is_shadow_pwd)
spw_unlock();
#endif
pw_unlock();
exit(status); exit(status);
} }
@ -121,7 +137,7 @@ static void fail_exit(int status)
static void oom(void) static void oom(void)
{ {
fprintf(stderr, "mbpasswd: out of memory\n"); 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 * insert_crypt_passwd - add an "old-style" password to authentication string
* result now malloced to avoid overflow, just in case. --marekm * result now malloced to avoid overflow, just in case. --marekm
*/ */
static char * static char *insert_crypt_passwd(const char *string, char *passwd)
insert_crypt_passwd(const char *string, char *passwd)
{ {
#ifdef AUTH_METHODS #ifdef AUTH_METHODS
if (string && *string) { if (string && *string) {
@ -158,9 +173,10 @@ insert_crypt_passwd(const char *string, char *passwd)
#endif #endif
return xstrdup(passwd); return xstrdup(passwd);
} }
#endif /* FreeBSD */
#ifndef __FreeBSD__
static char *update_crypt_pw(char *cp) static char *update_crypt_pw(char *cp)
{ {
if (do_update_pwd) if (do_update_pwd)
@ -168,6 +184,7 @@ static char *update_crypt_pw(char *cp)
return cp; return cp;
} }
#endif
@ -178,6 +195,7 @@ static char *update_crypt_pw(char *cp)
*/ */
void pwd_init(void) void pwd_init(void)
{ {
#ifdef HAVE_SYS_RESOURCE_H
struct rlimit rlim; struct rlimit rlim;
#ifdef RLIMIT_CORE #ifdef RLIMIT_CORE
@ -206,9 +224,14 @@ void pwd_init(void)
#ifdef RLIMIT_STACK #ifdef RLIMIT_STACK
setrlimit(RLIMIT_STACK, &rlim); setrlimit(RLIMIT_STACK, &rlim);
#endif #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(SIGALRM, SIG_IGN);
signal(SIGHUP, SIG_IGN); signal(SIGHUP, SIG_IGN);
signal(SIGINT, SIG_IGN); signal(SIGINT, SIG_IGN);
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
signal(SIGQUIT, SIG_IGN); signal(SIGQUIT, SIG_IGN);
signal(SIGTERM, SIG_IGN); signal(SIGTERM, SIG_IGN);
@ -238,6 +261,12 @@ int isexpired(const struct passwd *pw)
{ {
#endif #endif
long now; 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; 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 && if (sp->sp_lstchg > 0 && sp->sp_max >= 0 && sp->sp_inact >= 0 &&
now >= sp->sp_lstchg + sp->sp_max + sp->sp_inact) now >= sp->sp_lstchg + sp->sp_max + sp->sp_inact)
return 2; 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 * The last and max fields must be present for an account
* to have an expired password. A maximum of >10000 days * to have an expired password. A maximum of >10000 days
* is considered to be infinite. * is considered to be infinite.
*/ */
#ifdef SHADOWPWD
if (sp->sp_lstchg == -1 || if (sp->sp_lstchg == -1 ||
sp->sp_max == -1 || sp->sp_max >= (10000L*DAY/SCALE)) sp->sp_max == -1 || sp->sp_max >= (10000L*DAY/SCALE))
return 0; 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 * Calculate today's day and the day on which the password
* is going to expire. If that date has already passed, * is going to expire. If that date has already passed,
* the password has expired. * the password has expired.
*/ */
#ifdef SHADOWPWD
if (now >= sp->sp_lstchg + sp->sp_max) if (now >= sp->sp_lstchg + sp->sp_max)
return 1; return 1;
#endif #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; return 0;
} }
@ -305,6 +367,9 @@ static void check_password(const struct passwd *pw)
#endif #endif
time_t now, last, ok; time_t now, last, ok;
int exp_status; int exp_status;
#ifdef HAVE_USERSEC_H
struct userpw *pu;
#endif
#ifdef SHADOW_PASSWORD #ifdef SHADOW_PASSWORD
exp_status = isexpired(pw, sp); 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); fprintf (stderr, "The password for %s cannot be changed.\n", sp->sp_namp);
syslog(LOG_WARNING, "password locked for %s", sp->sp_namp); syslog(LOG_WARNING, "password locked for %s", sp->sp_namp);
closelog(); 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); fprintf (stderr, "The password for %s cannot be changed.\n", pw->pw_name);
syslog(LOG_WARNING, "password locked for %s", pw->pw_name); syslog(LOG_WARNING, "password locked for %s", pw->pw_name);
closelog(); closelog();
exit (1); exit (E_NOPERM);
} }
last = 0; #ifdef ATT_AGE
ok = 0; /*
* 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 */ #endif /* !SHADOW_PASSWORD */
if (now < ok) { if (now < ok) {
fprintf(stderr, "Sorry, the password for %s cannot be changed yet.\n", pw->pw_name); 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); syslog(LOG_WARNING, "now < minimum age for `%s'", pw->pw_name);
closelog(); 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_namp = pw->pw_name;
sp.sp_pwdp = pw->pw_passwd; 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; if (pw->pw_age[0]) {
sp.sp_max = (10000L * DAY) / SCALE; sp.sp_max = (c64i(pw->pw_age[0]) * WEEK) / SCALE;
sp.sp_lstchg = time((time_t *) 0) / 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 * 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. * Encrypt the password, then wipe the cleartext password.
*/ */
cp = pw_encrypt(pass, crypt_make_salt()); cp = pw_encrypt(pass, crypt_make_salt());
bzero(pass, sizeof pass); memset(&pass, 0, sizeof(pass));
#ifdef HAVE_LIBCRACK_HIST #ifdef HAVE_LIBCRACK_HIST
HistUpdate(pw->pw_name, crypt_passwd); 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) static void update_noshadow(int shadow_locked)
{ {
const struct passwd *pw; const struct passwd *pw;
struct passwd *npw; 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() * 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() * and call lckpwdf() only before the first lock, and ulckpwdf()
* after the last unlock. * after the last unlock.
*/ */
if (!(shadow_locked ? pw_lock() : pw_lock_first())) { if (!pw_lock()) {
fprintf(stderr, "Cannot lock the password file; try again later.\n"); fprintf(stderr, "Cannot lock the password file; try again later.\n");
syslog(LOG_WARNING, "can't lock password file"); syslog(LOG_WARNING, "can't lock password file");
exit(5); exit(E_PWDBUSY);
} }
if (!pw_open(O_RDWR)) { if (!pw_open(O_RDWR)) {
fprintf(stderr, "Cannot open the password file.\n"); fprintf(stderr, "Cannot open the password file.\n");
syslog(LOG_ERR, "can't open password file"); syslog(LOG_ERR, "can't open password file");
fail_exit(3); fail_exit(E_MISSING);
} }
pw = pw_locate(name); pw = pw_locate(name);
if (!pw) { if (!pw) {
fprintf(stderr, "mbpasswd: user %s not found in /etc/passwd\n", name); fprintf(stderr, "mbpasswd: user %s not found in /etc/passwd\n", name);
fail_exit(1); fail_exit(E_NOPERM);
} }
npw = __pw_dup(pw); npw = __pw_dup(pw);
if (!npw) if (!npw)
oom(); oom();
npw->pw_passwd = update_crypt_pw(npw->pw_passwd); 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)) { if (!pw_update(npw)) {
fprintf(stderr, "Error updating the password entry.\n"); fprintf(stderr, "Error updating the password entry.\n");
syslog(LOG_ERR, "error updating password entry"); 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()) { if (!pw_close()) {
fprintf(stderr, "Cannot commit password file changes.\n"); fprintf(stderr, "Cannot commit password file changes.\n");
syslog(LOG_ERR, "can't rewrite password file"); syslog(LOG_ERR, "can't rewrite password file");
fail_exit(3); fail_exit(E_FAILURE);
} }
pw_unlock(); pw_unlock();
} }
#endif /* Not __FreeBSD__ */
#ifdef SHADOW_PASSWORD #ifdef SHADOW_PASSWORD
@ -484,28 +669,23 @@ static void update_shadow(void)
const struct spwd *sp; const struct spwd *sp;
struct spwd *nsp; struct spwd *nsp;
if (!spw_lock_first()) { if (!spw_lock()) {
fprintf(stderr, "Cannot lock the password file; try again later.\n"); fprintf(stderr, "Cannot lock the password file; try again later.\n");
syslog(LOG_WARNING, "can't lock password file"); syslog(LOG_WARNING, "can't lock password file");
exit(5); exit(E_PWDBUSY);
} }
if (!spw_open(O_RDWR)) { if (!spw_open(O_RDWR)) {
fprintf(stderr, "Cannot open the password file.\n"); fprintf(stderr, "Cannot open the password file.\n");
syslog(LOG_ERR, "can't open password file"); syslog(LOG_ERR, "can't open password file");
fail_exit(3); fail_exit(E_FAILURE);
} }
sp = spw_locate(name); sp = spw_locate(name);
if (!sp) { 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. */ /* Try to update the password in /etc/passwd instead. */
spw_unlock(); spw_close();
update_noshadow(1); update_noshadow(1);
spw_unlock();
return; return;
#endif
} }
nsp = __spw_dup(sp); nsp = __spw_dup(sp);
if (!nsp) if (!nsp)
@ -517,12 +697,20 @@ static void update_shadow(void)
if (!spw_update(nsp)) { if (!spw_update(nsp)) {
fprintf(stderr, "Error updating the password entry.\n"); fprintf(stderr, "Error updating the password entry.\n");
syslog(LOG_ERR, "error updating password entry"); 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()) { if (!spw_close()) {
fprintf(stderr, "Cannot commit password file changes.\n"); fprintf(stderr, "Cannot commit password file changes.\n");
syslog(LOG_ERR, "can't rewrite password file"); syslog(LOG_ERR, "can't rewrite password file");
fail_exit(3); fail_exit(E_FAILURE);
} }
spw_unlock(); spw_unlock();
} }
@ -541,7 +729,11 @@ int main(int argc, char *argv[])
#ifdef SHADOW_PASSWORD #ifdef SHADOW_PASSWORD
const struct spwd *sp; const struct spwd *sp;
#endif #endif
char *cp; char *cp;
#ifdef __FreeBSD__
char temp[81];
char cmd[256];
#endif
/* /*
* Get my username * Get my username
@ -560,11 +752,11 @@ int main(int argc, char *argv[])
gr = getgrgid(pw->pw_gid); gr = getgrgid(pw->pw_gid);
if (!gr) { if (!gr) {
fprintf(stderr, "mbpasswd: Cannot determine group name.\n"); fprintf(stderr, "mbpasswd: Cannot determine group name.\n");
exit(1); exit(E_NOPERM);
} }
if (strcmp(gr->gr_name, (char *)"bbs")) { if (strcmp(gr->gr_name, (char *)"bbs")) {
fprintf(stderr, "mbpasswd: You are not a member of group \"bbs\".\n"); 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. // 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("mbpasswd [-opt] [username] [newpassword]\n");
printf("options are: -n normal password change\n"); printf("options are: -n normal password change\n");
printf(" -f forced password change\n"); printf(" -f forced password change\n");
exit(1); exit(E_FAILURE);
} }
if (strncmp(argv[1], "-f", 2) == 0) if (strncmp(argv[1], "-f", 2) == 0)
@ -590,17 +782,17 @@ int main(int argc, char *argv[])
*/ */
if (strlen(argv[2]) > 16) { if (strlen(argv[2]) > 16) {
fprintf(stderr, "mbpasswd: Username too long\n"); fprintf(stderr, "mbpasswd: Username too long\n");
exit(1); exit(E_FAILURE);
} }
if (strlen(argv[3]) > 16) { if (strlen(argv[3]) > 16) {
fprintf(stderr, "mbpasswd: Password too long\n"); fprintf(stderr, "mbpasswd: Password too long\n");
exit(1); exit(E_FAILURE);
} }
name = strdup(argv[2]); name = strdup(argv[2]);
if ((pw = getpwnam(name)) == NULL) { if ((pw = getpwnam(name)) == NULL) {
fprintf(stderr, "mbpasswd: Unknown user %s\n", name); fprintf(stderr, "mbpasswd: Unknown user %s\n", name);
exit(1); exit(E_FAILURE);
} }
openlog("mbpasswd", LOG_PID|LOG_CONS|LOG_NOWAIT, LOG_AUTH); 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])) { if (new_password(pw, argv[3])) {
fprintf(stderr, "The password for %s is unchanged.\n", name); fprintf(stderr, "The password for %s is unchanged.\n", name);
syslog(LOG_ERR, "The password for %s is unchanged", name);
closelog(); closelog();
exit(1); exit(E_FAILURE);
} }
do_update_pwd = 1; do_update_pwd = 1;
do_update_age = 1; do_update_age = 1;
@ -645,19 +838,57 @@ int main(int argc, char *argv[])
fprintf(stderr, "Cannot change ID to root.\n"); fprintf(stderr, "Cannot change ID to root.\n");
syslog(LOG_ERR, "can't setuid(0)"); syslog(LOG_ERR, "can't setuid(0)");
closelog(); closelog();
exit(1); exit(E_FAILURE);
} }
#ifndef __FreeBSD__
#ifdef HAVE_USERSEC_H
update_userpw(pw->pw_passwd);
#else /* !HAVE_USERSEC_H */
#ifdef SHADOW_PASSWORD #ifdef SHADOW_PASSWORD
if (spw_file_present()) if (spw_file_present())
update_shadow(); update_shadow();
else else
#endif #endif
update_noshadow(0); 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); syslog(LOG_INFO, "password for `%s' changed by user `%s'", name, myname);
closelog(); closelog();
exit(0); exit(E_SUCCESS);
} }

View File

@ -6,21 +6,35 @@
#define STRFCPY(A,B) \ #define STRFCPY(A,B) \
(strncpy((A), (B), sizeof(A) - 1), (A)[sizeof(A) - 1] = '\0') (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 * Function prototypes
*/ */
struct passwd *get_my_pwent(void); struct passwd *get_my_pwent(void);
static int new_password (const struct passwd *, char *); static int new_password (const struct passwd *, char *);
static void fail_exit(int);
static void oom(void);
void pwd_init(void); void pwd_init(void);
char *crypt_make_salt(void); char *crypt_make_salt(void);
char *pw_encrypt(const char *, const char *); char *pw_encrypt(const char *, const char *);
int i64c(int); int i64c(int);
char *l64a(long); char *l64a(long);
#ifndef __FreeBSD__
static void fail_exit(int);
static void oom(void);
static void update_noshadow(int); static void update_noshadow(int);
#endif
#ifdef SHADOW_PASSWORD #ifdef SHADOW_PASSWORD
struct spwd *pwd_to_spwd(const struct passwd *); struct spwd *pwd_to_spwd(const struct passwd *);
static void update_shadow(void); static void update_shadow(void);

View File

@ -102,6 +102,13 @@ int main(int argc, char **argv)
#endif #endif
exit(1); 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. * Set local time and statistic indexes.
@ -158,7 +165,7 @@ int main(int argc, char **argv)
sprintf(pTTY, "%s", tty); sprintf(pTTY, "%s", tty);
} }
umask(007); umask(000);
/* /*
* Trap signals * Trap signals

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbtoberep/mbtoberep.c * File ..................: mbtoberep/mbtoberep.c
* Purpose ...............: Show contents of toberep.data * Purpose ...............: Show contents of toberep.data
* Last modification date : 28-Jun-2001 * Last modification date : 09-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -69,7 +69,7 @@ int main(int argc, char **argv)
printf("Comment %s\n", rep.Comment); printf("Comment %s\n", rep.Comment);
printf("Group %s\n", rep.Group); printf("Group %s\n", rep.Group);
printf("File name %s\n", rep.Name); 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 size Kb %lu\n", rep.SizeKb);
printf("File date %s", ctime(&rep.Fdate)); printf("File date %s", ctime(&rep.Fdate));
printf("File CRC %s\n", rep.Crc); printf("File CRC %s\n", rep.Crc);

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbuser/mbuser.c * File ..................: mbuser/mbuser.c
* Purpose ...............: User Pack Util * Purpose ...............: User Pack Util
* Last modification date : 01-Jul-2001 * Last modification date : 12-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-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 setuid(root) or setgid(root)");
WriteError("Cannot delete unix account %s", usr.Name); WriteError("Cannot delete unix account %s", usr.Name);
} else { } else {
#ifndef __FreeBSD__
rc = execute((char *)"/usr/sbin/userdel ", usr.Name, NULL, rc = execute((char *)"/usr/sbin/userdel ", usr.Name, NULL,
(char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/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) if (chdir(CFG.bbs_usersdir) == 0)
rc = execute((char *)"/bin/rm -Rf ", usr.Name, NULL, rc = execute((char *)"/bin/rm -Rf ", usr.Name, NULL,
(char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null"); (char *)"/dev/null",(char *)"/dev/null",(char *)"/dev/null");

View File

@ -2,7 +2,7 @@
* *
* File ..................: mbuseradd.c * File ..................: mbuseradd.c
* Purpose ...............: setuid root version of useradd * Purpose ...............: setuid root version of useradd
* Last modification date : 28-Jun-2001 * Last modification date : 25-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -41,8 +41,7 @@
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/param.h>
#include <linux/limits.h>
#include "mbuseradd.h" #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) { if (open(in, O_RDONLY) != 0) {
perror(""); perror("");
fprintf(stderr, "mbuseradd: Reopen of stdin to %s failed\n", in); fprintf(stderr, "mbuseradd: Reopen of stdin to %s failed\n", in);
exit(-1); _exit(-1);
} }
} }
if (out) { 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) { if (open(out, O_WRONLY | O_APPEND | O_CREAT,0600) != 1) {
perror(""); perror("");
fprintf(stderr, "mbuseradd: Reopen of stdout to %s failed\n", out); fprintf(stderr, "mbuseradd: Reopen of stdout to %s failed\n", out);
exit(-1); _exit(-1);
} }
} }
if (err) { 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) { if (open(err, O_WRONLY | O_APPEND | O_CREAT,0600) != 2) {
perror(""); perror("");
fprintf(stderr, "mbuseradd: Reopen of stderr to %s failed\n", err); fprintf(stderr, "mbuseradd: Reopen of stderr to %s failed\n", err);
exit(-1); _exit(-1);
} }
} }
rc = execv(vector[0],vector); rc = execv(vector[0],vector);
fprintf(stderr, "mbuseradd: Exec \"%s\" returned %d\n", vector[0], rc); fprintf(stderr, "mbuseradd: Exec \"%s\" returned %d\n", vector[0], rc);
exit(-1); _exit(-1);
} }
do { do {
@ -135,19 +134,13 @@ int main(int argc, char *argv[])
char *PassEnt, *temp, *shell; char *PassEnt, *temp, *shell;
int i; int i;
struct passwd *pwent, *pwuser; 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) if (argc != 5)
Help(); Help();
/*
* First simple check for argument overflow
*/
for (i = 1; i < 5; i++) { for (i = 1; i < 5; i++) {
if (strlen(argv[i]) > 80) { if (strlen(argv[i]) > 80) {
fprintf(stderr, "mbuseradd: Argument %d is too long\n", i); 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)); temp = calloc(PATH_MAX, sizeof(char));
shell = 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 * Build command to add user entry to the /etc/passwd and /etc/shadow
* files. We use the systems own useradd program. * files. We use the systems own useradd program.
*/ */
#ifdef __linux__
if ((access("/usr/bin/useradd", R_OK)) == 0) if ((access("/usr/bin/useradd", R_OK)) == 0)
strcpy(temp, "/usr/bin/useradd"); strcpy(temp, "/usr/bin/useradd");
else if ((access("/bin/useradd", R_OK)) == 0) 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"); fprintf(stderr, "mbuseradd: Can't find useradd\n");
exit(1); 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")); sprintf(shell, "%s/bin/mbsebbs", getenv("MBSE_ROOT"));
#ifdef __linux__
sprintf(PassEnt, "%s -c \"%s\" -d %s/%s -g %s -s %s %s", 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]); 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(stdout);
fflush(stdin); fflush(stdin);

View File

@ -2,12 +2,12 @@
* *
* File ..................: mbuseradd/pwio.c * File ..................: mbuseradd/pwio.c
* Purpose ...............: MBSE BBS Shadow Password Suite * Purpose ...............: MBSE BBS Shadow Password Suite
* Last modification date : 18-Sep-2000 * Last modification date : 09-Aug-2001
* Original Source .......: Shadow Password Suite * Original Source .......: Shadow Password Suite
* Original Copyrioght ...: Julianne Frances Haugh and others. * Original Copyrioght ...: Julianne Frances Haugh and others.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2000 * Copyright (C) 1997-2001
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -43,6 +43,9 @@
#include <string.h> #include <string.h>
#include "sgetpwent.h" #include "sgetpwent.h"
#include "commonio.h" #include "commonio.h"
#ifndef HAVE_PUTPWENT
#include "putpwent.h"
#endif
#include "pwio.h" #include "pwio.h"
@ -143,16 +146,17 @@ static struct commonio_ops passwd_ops = {
static struct commonio_db passwd_db = { static struct commonio_db passwd_db = {
"/etc/passwd", PASSWD_FILE, /* filename */
&passwd_ops, &passwd_ops, /* ops */
NULL, NULL, /* fp */
NULL, NULL, /* head */
NULL, NULL, /* tail */
NULL, NULL, /* cursor */
0, 0, /* changed */
0, 0, /* isopen */
0, 0, /* locked */
0 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) int pw_open(int mode)
{ {
return commonio_open(&passwd_db, mode); return commonio_open(&passwd_db, mode);

View File

@ -1,6 +1,14 @@
#ifndef _PWIO_H #ifndef _PWIO_H
#define _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 *); struct passwd *__pw_dup (const struct passwd *);
void __pw_set_changed (void); void __pw_set_changed (void);
int pw_close (void); int pw_close (void);

View File

@ -2,12 +2,12 @@
* *
* File ..................: mbuseradd/shadowio.c * File ..................: mbuseradd/shadowio.c
* Purpose ...............: MBSE BBS Shadow Password Suite * Purpose ...............: MBSE BBS Shadow Password Suite
* Last modification date : 13-Aug-2000 * Last modification date : 09-Aug-2001
* Original Source .......: Shadow Password Suite * Original Source .......: Shadow Password Suite
* Original Copyrioght ...: Julianne Frances Haugh and others. * Original Copyrioght ...: Julianne Frances Haugh and others.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2000 * Copyright (C) 1997-2001
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -117,16 +117,17 @@ static struct commonio_ops shadow_ops = {
static struct commonio_db shadow_db = { static struct commonio_db shadow_db = {
SHADOW_FILE, SHADOW_FILE, /* filename */
&shadow_ops, &shadow_ops, /* ops */
NULL, NULL, /* fp */
NULL, NULL, /* head */
NULL, NULL, /* tail */
NULL, NULL, /* cursor */
0, 0, /* changed */
0, 0, /* isopen */
0, 0, /* locked */
0 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) int spw_open(int mode)
{ {
return commonio_open(&shadow_db, mode); return commonio_open(&shadow_db, mode);

View File

@ -5,6 +5,13 @@
#ifndef SHADOW_FILE #ifndef SHADOW_FILE
#define SHADOW_FILE "/etc/shadow" #define SHADOW_FILE "/etc/shadow"
#endif #endif
#ifdef SHADOWGRP
#ifndef SGROUP_FILE
#define SGROUP_FILE "/etc/gshadow"
#endif
#endif
#endif #endif
@ -14,7 +21,6 @@ int spw_close (void);
int spw_file_present (void); int spw_file_present (void);
const struct spwd *spw_locate (const char *); const struct spwd *spw_locate (const char *);
int spw_lock (void); int spw_lock (void);
int spw_lock_first (void);
int spw_name (const char *); int spw_name (const char *);
const struct spwd *spw_next (void); const struct spwd *spw_next (void);
int spw_open (int); int spw_open (int);

View File

@ -4,7 +4,7 @@
* Purpose ...............: Main user login procedure. Checks for limits, * Purpose ...............: Main user login procedure. Checks for limits,
* new ratio's cats all the welcome screens, and * new ratio's cats all the welcome screens, and
* does a lot of checking in general. * does a lot of checking in general.
* Last modification date : 28-Jun-2001 * Last modification date : 08-Aug-2001
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2001 * Copyright (C) 1997-2001
@ -615,11 +615,7 @@ void user()
} else { } else {
Syslog('+', "Unixmode login: %s", sUnixName); Syslog('+', "Unixmode login: %s", sUnixName);
if ((pw = getpwnam(sUnixName))) if ((pw = getpwnam(sUnixName)))
#ifdef linux
strcpy(sGetName, pw->pw_gecos); strcpy(sGetName, pw->pw_gecos);
#else
strcpy(sGetName, pw->pw_comment);
#endif
/* /*
* If there are more fields in the passwd gecos field * If there are more fields in the passwd gecos field

Some files were not shown because too many files have changed in this diff Show More