Compare commits
118 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 901072385e | |||
| 926124dffc | |||
| 5eb6ddc45b | |||
| 144eacc0d6 | |||
| 1eacadd453 | |||
| e94fcfc054 | |||
| 6bcd460e15 | |||
| 0999c65b1a | |||
| 72f46f357d | |||
| 162a22f0a4 | |||
| 81b326ca45 | |||
| 7903fd08af | |||
| a2479e18f0 | |||
| 4c796b042c | |||
| 64cfc794dc | |||
| c5dc00c084 | |||
| 22fa90589b | |||
| ccd0e13c05 | |||
| 3a9ee4727a | |||
| ff329a7602 | |||
| 5a036bb150 | |||
| 245f11724d | |||
| 4d14e01c68 | |||
| df0c511487 | |||
| f8dd598312 | |||
| c695876504 | |||
| 0db3aee60f | |||
| f4d89f2fb2 | |||
| 9ac18a21a6 | |||
| 537daec883 | |||
| ee9c78d129 | |||
| 14d2f2992d | |||
| 78aac4f18c | |||
| df5a915287 | |||
| b95128f87a | |||
| 6d042318d5 | |||
| cf7208408c | |||
| aae6656a4a | |||
| 4297b51dca | |||
| b9e68f295e | |||
| c665ce0aaf | |||
| 2807cd61ff | |||
| 330da47169 | |||
| 1d696c0ba0 | |||
| 5a49ebdfe5 | |||
| 42246c136f | |||
| d8d953b0b3 | |||
| c91ca40037 | |||
| 81bbffb312 | |||
| 46dc91c446 | |||
| be3fcc0b5e | |||
| 416c79b637 | |||
| 6612f8fc89 | |||
| 2b63aa8cd7 | |||
| b14e52133d | |||
| 07edf66b72 | |||
| 8261016c7e | |||
| 4d48c2abe9 | |||
| 7f7e420b13 | |||
| 52b3b230b9 | |||
| 416795159f | |||
| 04f62c7725 | |||
| ddf8f3f9e0 | |||
| 6245ad3e10 | |||
| e3a1f7e52e | |||
| e94fffb110 | |||
| a7cda5b70f | |||
| 0d4a4945fe | |||
| c658e03af5 | |||
| 57e5e00ca3 | |||
| 1f7d70b755 | |||
| 3c60f8de01 | |||
| c47397c800 | |||
| 224115fffe | |||
| 875ea3505f | |||
| d581b113c8 | |||
| a296d43987 | |||
| aa32dac10e | |||
| 6a1a0a6838 | |||
| 83ce06579c | |||
| 8339af8eac | |||
| 2477709da4 | |||
| 136eca95f1 | |||
| 030322225f | |||
| 92bd4cae56 | |||
| 1837ebd57c | |||
| 2eb30b7644 | |||
| 7733d5d663 | |||
| 6a2320d922 | |||
| 5f10b52c77 | |||
| 55fc94a95b | |||
| 1667d8a800 | |||
| 5eced105c8 | |||
| 7486b9c141 | |||
| 2fbe1d3e54 | |||
| fa8e081584 | |||
| 981d4f00b3 | |||
| 26ecb8b64c | |||
| 526338f720 | |||
| 06f48fe1c1 | |||
| 4767b57ec9 | |||
| 8892e3f740 | |||
| 21eeae69cc | |||
| 9799f977b9 | |||
| 727f7cfdf3 | |||
| 36747d9071 | |||
| 9fa59cacca | |||
| b66dd2156c | |||
| 80275d30d3 | |||
| a62ae3afca | |||
| a9f98cdee9 | |||
| 10d30223d1 | |||
| c5fc6e9245 | |||
| 29000cfdd7 | |||
| de6ef3936b | |||
| 8db2ee4260 | |||
| 25081b1bae | |||
| deaa8140f5 |
0
.gitea/.gitkeep
Normal file
0
.gitea/.gitkeep
Normal file
66
.gitea/workflows/alt.yaml
Normal file
66
.gitea/workflows/alt.yaml
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
name: Altlinux build
|
||||||
|
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }} 🚀
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- workflow_dispatch
|
||||||
|
if: ${{ github.ref }} == 'refs/head/master'
|
||||||
|
jobs:
|
||||||
|
build-alt:
|
||||||
|
## runs-on: alt-latest
|
||||||
|
container:
|
||||||
|
image: prj.zxalexis.ru/zx/alt-rpmbuild
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checking environment
|
||||||
|
continue-on-error: true
|
||||||
|
run: printenv
|
||||||
|
- name: Installing prerequisites - update apt
|
||||||
|
run: apt-get update
|
||||||
|
## - name: Installing prerequisites - install nodejs for actions & git
|
||||||
|
## run: apt-get install -y git nodejs su
|
||||||
|
## - name: Installing build environment
|
||||||
|
## continue-on-error: true
|
||||||
|
## run: |
|
||||||
|
## apt-get install -y gcc rpm-build rpmlint make python gear hasher fakeroot patch rpmdevtools
|
||||||
|
- name: Installing needed software
|
||||||
|
run: apt-get install -y bison tcl
|
||||||
|
- name: Adding build user
|
||||||
|
run: useradd -d /builder -g users -m builder
|
||||||
|
- name: Fetching sources
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Getting version info
|
||||||
|
run: |
|
||||||
|
echo "BFORCE_VER=$(cat ${{ env.GITHUB_WORKSPACE }}/source/.version)" >> $GITHUB_ENV
|
||||||
|
- name: Compressing source to tar.gz archive
|
||||||
|
run: |
|
||||||
|
tar -cvzf ../bforce-${{ env.BFORCE_VER }}.tar.gz -C ${{ env.GITHUB_WORKSPACE }}/.. bforce
|
||||||
|
cp -v ${{ env.GITHUB_WORKSPACE }}/rpm/bforce.spec /builder/
|
||||||
|
chown builder /builder/bforce.spec
|
||||||
|
echo '-------------------------------------------------------'
|
||||||
|
pwd
|
||||||
|
ls /builder
|
||||||
|
sed -i 's/^# %setup/%setup/' /builder/bforce.spec
|
||||||
|
- name: Building buildtree
|
||||||
|
run: |
|
||||||
|
su - builder -c "cd /builder && mkdir -pv rpmbuild/{RPMS,SRPMS,SOURCES,BUILD,SPECS}"
|
||||||
|
ls /builder -l
|
||||||
|
mkdir -pv /builder/rpmbuild/SOURCES
|
||||||
|
mv ${{ env.GITHUB_WORKSPACE }}/../bforce-${{ env.BFORCE_VER }}.tar.gz /builder/rpmbuild/SOURCES/
|
||||||
|
chown -R builder /builder/*
|
||||||
|
- name: Building binary and source RPM
|
||||||
|
run: |
|
||||||
|
su - builder -c 'rpmbuild -bb /builder/bforce.spec --define "_topdir /builder/rpmbuild"'
|
||||||
|
- name: Constructing artifact name and version
|
||||||
|
run: |
|
||||||
|
echo "BFORCE_VERLONG=$(cat ${{ env.GITHUB_WORKSPACE }}/source/.version)-$(date +%Y%m%d)" >> $GITHUB_ENV
|
||||||
|
- name: Retrieving artifact files
|
||||||
|
run: mkdir bforce && cp /builder/rpmbuild/RPMS/x86_64/bforce-*.rpm bforce
|
||||||
|
- name: Try to upload artifacts bin
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: bforce-${{ env.BFORCE_VERLONG }}-Alt
|
||||||
|
path: /builder/rpmbuild/RPMS/x86_64
|
||||||
|
- name: Echo OK
|
||||||
|
run: echo "All OK"
|
||||||
79
.gitea/workflows/arch.yaml
Normal file
79
.gitea/workflows/arch.yaml
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
name: Archlinux build
|
||||||
|
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }} 🚀
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- workflow_dispatch
|
||||||
|
if: ${{ github.ref }} == 'refs/head/master'
|
||||||
|
jobs:
|
||||||
|
build-arch:
|
||||||
|
runs-on: arch-latest
|
||||||
|
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checking environment
|
||||||
|
continue-on-error: true
|
||||||
|
run: printenv
|
||||||
|
- name: Installing prerequisites - update pacman
|
||||||
|
run: pacman -Sy
|
||||||
|
- name: Installing prerequisites - install nodejs for actions & git
|
||||||
|
run: pacman --disable-sandbox --noconfirm -v -S git nodejs
|
||||||
|
- name: Adding user builder
|
||||||
|
continue-on-error: true
|
||||||
|
run: useradd -d /builder -g users -m builder
|
||||||
|
- name: Downloading PKGBUILD
|
||||||
|
run: |
|
||||||
|
su - builder -c "curl -O http://zxprj:3001/zx/bforce/raw/branch/master/archlinux/bforce.install"
|
||||||
|
su - builder -c "curl -o PKGBUILD http://zxprj:3001/zx/bforce/raw/branch/master/archlinux/PKGBUILD.ci"
|
||||||
|
- name: Building archlinux package
|
||||||
|
run: |
|
||||||
|
su -w GITHUB_SHA,GITHUB_REF_NAME,GITHUB_REF_TYPE - builder -c makepkg
|
||||||
|
su - builder -c "ls -la"
|
||||||
|
- name: Constructing artifact name and version
|
||||||
|
run: |
|
||||||
|
echo "BFORCE_VER=$(cat /builder/src/bforce/source/.version)-$(date +%Y%m%d)" >> $GITHUB_ENV
|
||||||
|
- name: Retrieving artifact files
|
||||||
|
run: mkdir bforce && cp /builder/bforce-*.pkg.tar.zst bforce
|
||||||
|
- name: Try to upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: bforce-${{ env.BFORCE_VER }}-Arch
|
||||||
|
path: bforce
|
||||||
|
make-test:
|
||||||
|
runs-on: arch-latest
|
||||||
|
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checking environment
|
||||||
|
continue-on-error: true
|
||||||
|
run: printenv
|
||||||
|
- name: Installing prerequisites - update pacman
|
||||||
|
run: pacman -Sy
|
||||||
|
- name: Installing prerequisites - install nodejs for actions & git
|
||||||
|
run: pacman --disable-sandbox --noconfirm -v -S git nodejs socat
|
||||||
|
- name: Downloading source tree
|
||||||
|
continue-on-error: false
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Constructing artifact name and version
|
||||||
|
run: |
|
||||||
|
echo "BFORCE_VER=$(cat ${{ github.workspace }}/source/.version)-$(date +%Y%m%d)" >> $GITHUB_ENV
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: bforce-${{ env.BFORCE_VER }}-Arch
|
||||||
|
- name: Display structure of downloaded files
|
||||||
|
run: ls -R
|
||||||
|
- name: Installing archlinux package
|
||||||
|
run: |
|
||||||
|
ls -la
|
||||||
|
pacman --noconfirm -v -U bforce-*.pkg.tar.zst
|
||||||
|
cd ${{ github.workspace }}/tests
|
||||||
|
echo '-----------------------------------------'
|
||||||
|
ls -la
|
||||||
|
- name: Testing package in clean environment
|
||||||
|
run: |
|
||||||
|
cd ${{ github.workspace }}/tests
|
||||||
|
echo '------------>>> TESTING <<<--------------'
|
||||||
|
BFBIN=/usr/bin/bforce ./mktests.sh
|
||||||
52
.gitea/workflows/debpkg.yaml
Normal file
52
.gitea/workflows/debpkg.yaml
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
name: Debian build
|
||||||
|
run-name: Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }} 🚀
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- workflow_dispatch
|
||||||
|
jobs:
|
||||||
|
build-ubuntu:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
branches:
|
||||||
|
- 'master'
|
||||||
|
- 'zx'
|
||||||
|
steps:
|
||||||
|
- name: Checking environment
|
||||||
|
continue-on-error: true
|
||||||
|
run: printenv
|
||||||
|
- name: Installing build-essentials
|
||||||
|
continue-on-error: false
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y build-essential fakeroot devscripts debhelper pkg-config --no-install-recommends
|
||||||
|
- name: Installing dependencies
|
||||||
|
continue-on-error: false
|
||||||
|
run: |
|
||||||
|
echo '---- bison ----'
|
||||||
|
apt install -y bison
|
||||||
|
echo '---- tcl ------'
|
||||||
|
apt install -y tcl
|
||||||
|
- name: Cloning source
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Getting version info
|
||||||
|
run: |
|
||||||
|
echo "BFORCE_VER=$(cat ${{ env.GITHUB_WORKSPACE }}/source/.version)-$(date +%Y%m%d)" >> $GITHUB_ENV
|
||||||
|
- name: Building package
|
||||||
|
continue-on-error: false
|
||||||
|
run: |
|
||||||
|
pwd
|
||||||
|
echo '---------------------'
|
||||||
|
cd ${GITHUB_WORKSPACE}/debian
|
||||||
|
ls -l
|
||||||
|
debuild -us -uc -b
|
||||||
|
echo '---build complete---'
|
||||||
|
ls -l ${{ env.GITHUB_WORKSPACE }}/../
|
||||||
|
- name: Collecting artifacts
|
||||||
|
run: |
|
||||||
|
mkdir -pv ${{ env.GITHUB_WORKSPACE }}/artifacts
|
||||||
|
mv -v ${{ env.GITHUB_WORKSPACE }}/../*.deb ${{ env.GITHUB_WORKSPACE }}/artifacts/
|
||||||
|
- name: Try to upload artifacts
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: bforce-${{ env.BFORCE_VER }}-Ubuntu
|
||||||
|
path: ${{ env.GITHUB_WORKSPACE }}/artifacts/bforce*.deb
|
||||||
|
- run: echo "This job's over"
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,6 +7,3 @@ source/config.log
|
|||||||
source/config.status
|
source/config.status
|
||||||
source/include/config.h
|
source/include/config.h
|
||||||
bforce.geany
|
bforce.geany
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
29
CHANGES
29
CHANGES
@ -273,3 +273,32 @@ Alexey Khromov (zx@zxalexis.ru)
|
|||||||
|
|
||||||
0.26
|
0.26
|
||||||
+ Fixed incorrect binkp protocol realization in unprotected sessions.
|
+ Fixed incorrect binkp protocol realization in unprotected sessions.
|
||||||
|
+ Fixed binkp override appliance in incoming handshake
|
||||||
|
|
||||||
|
0.26.1
|
||||||
|
+ Fixed binkp stuck on overrides in config
|
||||||
|
+ ReDebianized
|
||||||
|
+ Added CI automation: builds for Archlinux and Ubuntu
|
||||||
|
|
||||||
|
0.26.2
|
||||||
|
+ Added tests with socat and integrate it with CI
|
||||||
|
+ Fixed some minor lint errors by PVS-Studio
|
||||||
|
+ Fixed RPM spec-file to make builds for AltLinux
|
||||||
|
+ Added fail2ban filter to contrib
|
||||||
|
+ Fixed node/point-lists indexing and parsing for points listed
|
||||||
|
|
||||||
|
0.27
|
||||||
|
+ Fixed warnings from PVS-Studio analyser
|
||||||
|
+ Fixed getaddrinfo switching through available ip-addresses
|
||||||
|
+ Reduced SYN-SENT timeout to 3 secs to avoid blocking on hosts with services down
|
||||||
|
+ nlookup - new option -o to show configured overrides and hidden lines
|
||||||
|
+ nlookup - new option -t to show calltable
|
||||||
|
+ Added support for multiply INA: addresses of a node
|
||||||
|
+ Added automatic rolling of all available adresses on callout
|
||||||
|
+ Added automatic rolling of all available hidden phone numbers on callout
|
||||||
|
+ Full rework of overrides in config:
|
||||||
|
* override (not hidden) changes phone,ipaddr and flags (old behaviour - add flags)
|
||||||
|
* hidden flags temporary rolls instead of original
|
||||||
|
* INA in hidden flags sets remote address, protoflags change protocols
|
||||||
|
* ipaddr in hidden flags overwrites original and has max priority
|
||||||
|
* phone in hidden lines do not affect ip callout in case without flags
|
||||||
|
|||||||
53
FAQ
53
FAQ
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
BinkleyForce FAQ.
|
BinkleyForce FAQ.
|
||||||
|
|
||||||
v. 1.15 от 26 марта 2002.
|
27 апреля 2025
|
||||||
|
|
||||||
Q: А как для многолинейки сделать разные строки инициализации?
|
Q: А как для многолинейки сделать разные строки инициализации?
|
||||||
A: /DR/
|
A: /DR/
|
||||||
@ -103,17 +103,55 @@ A: /AB/
|
|||||||
Hу что-нибудь вроде:
|
Hу что-нибудь вроде:
|
||||||
override 2:5020/??? phone none ipaddr f???.n5020.z2.fidonet.net
|
override 2:5020/??? phone none ipaddr f???.n5020.z2.fidonet.net
|
||||||
Еще можно добавить флаги: BINKP - дл BinkP или IFC - для EMSI/..
|
Еще можно добавить флаги: BINKP - дл BinkP или IFC - для EMSI/..
|
||||||
|
A: /AK/
|
||||||
|
Формат override-строки такой:
|
||||||
|
override <фидоадрес> [hidden] [Phone <тлф>] [Ipaddr <dns|ip>] [Flags <флаги>]
|
||||||
|
ip-адрес/днс-имя сервера можно подменить как через Ipaddr, так и через
|
||||||
|
флаги, поставив INA:адрес
|
||||||
|
|
||||||
|
Пример override:
|
||||||
|
1) [флаги нодлиста: CM,IBN,INA:coolbbs.spb.ru,INA:cool2.spb.ru,BEER:lager]
|
||||||
|
override 2:5030/xxx hidden Flags IFC,INA:reservbbs.dyndns.org \
|
||||||
|
hidden Ipaddr 188.34.34.22 \
|
||||||
|
hidden Ipaddr 234.43.44.23 Flags IFC,CM
|
||||||
|
|
||||||
|
Порядок дозвона (до первого успешного установления сессии):
|
||||||
|
1. coolbbs.spb.ru:binkp
|
||||||
|
2. reservbbs.dyndns.org:ifcico
|
||||||
|
3. 188.34.34.22:binkp
|
||||||
|
4. 234.43.44.23:ifcico
|
||||||
|
5. cool2.spb.ru:binkp
|
||||||
|
|
||||||
|
2) [флаги нодлиста: CM,IBN,IFC,INA:coolbbs3.spb.ru,BEER:porter]
|
||||||
|
override 2:5030/xxx Phone None Flags IFC,INA:rybak3.dyndns.org \
|
||||||
|
hidden Ipaddr 188.34.35.22
|
||||||
|
|
||||||
|
Порядок дозвона (до первого успешного установления сессии):
|
||||||
|
1. rybak3.dyndns.org:ifcico
|
||||||
|
3. 188.34.35.22:ifcico
|
||||||
|
override без опции hidden заменяет нодлистовые поля!
|
||||||
|
|
||||||
|
Проверить настроенные override-s и порядок дозвона можно с помощью
|
||||||
|
программы nlookup: опция -o показывает override, опция -t - порядок
|
||||||
|
дозвона (IP+PSTN)
|
||||||
|
|
||||||
Q: Демон забивает на указание ip...и звонит по нодлистовому телефону. Вот как
|
Q: Демон забивает на указание ip...и звонит по нодлистовому телефону. Вот как
|
||||||
это пофиксить?
|
это пофиксить?
|
||||||
A: /AB/
|
A: /AB/
|
||||||
Это бага така. Для этого и прописываетс "phone none".
|
Это бага така. Для этого и прописываетс "phone none".
|
||||||
|
A: /AK/
|
||||||
|
Приоритеты c версии 0.26.x за ip-дозвоном, демон для ip-узлов не
|
||||||
|
производит дозвон, для PSTN-only - не ищет ip-адрес. При ручном дозвоне
|
||||||
|
используются все способы соединения из нодлиста, сначала IP, потом модем
|
||||||
|
|
||||||
Q: Я не понял, почему aftersession запускается, когда еще есть bsy?! Весь
|
Q: Я не понял, почему aftersession запускается, когда еще есть bsy?! Весь
|
||||||
нужный эффект теряется (bforce 0.22.3).
|
нужный эффект теряется (bforce 0.22.3).
|
||||||
A: /AB/
|
A: /AB/
|
||||||
Почему теряется? Он же в отдельной сессии запускаться может и бфорсу не
|
Почему теряется? Он же в отдельной сессии запускаться может и бфорсу не
|
||||||
обязательно ждать его завершения.
|
обязательно ждать его завершения.
|
||||||
|
A: /AK/
|
||||||
|
aftersession запускается, когда уже есть принятый пакет в inbound.
|
||||||
|
процесс получает значения переменных окружения от демона
|
||||||
|
|
||||||
Q: subst'ы было бы неплохо расширить т.к. очень не хватает AT~S91=7~DP :-(
|
Q: subst'ы было бы неплохо расширить т.к. очень не хватает AT~S91=7~DP :-(
|
||||||
A: /SNP/
|
A: /SNP/
|
||||||
@ -124,7 +162,7 @@ Q:
|
|||||||
A: /SNP/
|
A: /SNP/
|
||||||
inbound_directory (Protected) /var/spool/fido/inb-protected
|
inbound_directory (Protected) /var/spool/fido/inb-protected
|
||||||
inbound_directory /var/spool/fido/inb
|
inbound_directory /var/spool/fido/inb
|
||||||
Прим.: начина с 0.22.3 пример конфига имеет аналогичный порядок.
|
Прим.: начиная с 0.22.3 пример конфига имеет аналогичный порядок.
|
||||||
|
|
||||||
Q: Статистику после сессии собрать так и не смог. Пишет: "can't get modem
|
Q: Статистику после сессии собрать так и не смог. Пишет: "can't get modem
|
||||||
statistic: Modem not response". Модем IDC-2814BXL/VR+.
|
statistic: Modem not response". Модем IDC-2814BXL/VR+.
|
||||||
@ -142,7 +180,7 @@ A: /AB/
|
|||||||
fido stream tcp nowait root /usr/bin/bforce bforce -i auto
|
fido stream tcp nowait root /usr/bin/bforce bforce -i auto
|
||||||
|
|
||||||
Q: А как бы сделать так, чтобы можно было прописать другую директорию для
|
Q: А как бы сделать так, чтобы можно было прописать другую директорию для
|
||||||
локов? У мен, например, они в /var/spool/lock лежат...
|
локов? У меня, например, они в /var/spool/lock лежат...
|
||||||
A: /AB/
|
A: /AB/
|
||||||
Либо поправить autoconf (configure.in), либо ручками в config.h прописать.
|
Либо поправить autoconf (configure.in), либо ручками в config.h прописать.
|
||||||
/EK/
|
/EK/
|
||||||
@ -161,6 +199,8 @@ A: /AB/
|
|||||||
Q: Пример конфига 'override 2:5029/9 Phone Unpublished' не работает :-(
|
Q: Пример конфига 'override 2:5029/9 Phone Unpublished' не работает :-(
|
||||||
A: /VS/
|
A: /VS/
|
||||||
override 2:5029/9 Phone None
|
override 2:5029/9 Phone None
|
||||||
|
A: /AK/
|
||||||
|
Уже работает
|
||||||
|
|
||||||
Q: У меня прописано несколько hidden'ов, но bforce упорно звонит только по
|
Q: У меня прописано несколько hidden'ов, но bforce упорно звонит только по
|
||||||
одному из них.
|
одному из них.
|
||||||
@ -169,6 +209,8 @@ A: /PVC/
|
|||||||
UUE. Также доступен для фреков на 2:5020/2091 как
|
UUE. Также доступен для фреков на 2:5020/2091 как
|
||||||
bforce-0.22.4-0.22.4pl2.diff.bz2. Время для фреков c 1:00 до 5:20, c
|
bforce-0.22.4-0.22.4pl2.diff.bz2. Время для фреков c 1:00 до 5:20, c
|
||||||
7:40-9:00.
|
7:40-9:00.
|
||||||
|
A: /AK/
|
||||||
|
Исправлено в 0.27
|
||||||
|
|
||||||
Q: Подскажите, пожалyйста, как запpетить непаpольные соединения.
|
Q: Подскажите, пожалyйста, как запpетить непаpольные соединения.
|
||||||
A: /AB/
|
A: /AB/
|
||||||
@ -210,6 +252,9 @@ A: /AS/
|
|||||||
| /var/src/cvs/bforce/ > grep -r 'BFCONFIG' ./
|
| /var/src/cvs/bforce/ > grep -r 'BFCONFIG' ./
|
||||||
| ./source/bforce/conf_read.c: const char *name = getenv("BFCONFIG");
|
| ./source/bforce/conf_read.c: const char *name = getenv("BFCONFIG");
|
||||||
`----
|
`----
|
||||||
|
A: /AK/
|
||||||
|
Опция -с <config> для всех программ комплекта
|
||||||
|
|
||||||
===
|
===
|
||||||
|
|
||||||
Thanx to:
|
Thanx to:
|
||||||
|
|||||||
35
INSTALL
35
INSTALL
@ -1,4 +1,35 @@
|
|||||||
Basic Installation
|
Prerequisites
|
||||||
|
====================
|
||||||
|
|
||||||
|
C compiler (GCC in linux and clang in BSD will work well)
|
||||||
|
make
|
||||||
|
yacc or it's GNU's recreation named bison
|
||||||
|
Tcl optional for a couple of scripts
|
||||||
|
|
||||||
|
Installing with packages
|
||||||
|
=
|
||||||
|
|
||||||
|
Debian-based systesms (Debian, *buntu, Mint, Astra)
|
||||||
|
====================
|
||||||
|
|
||||||
|
Install build system for packaging:
|
||||||
|
|
||||||
|
apt install build-essential fakeroot devscripts debhelper pkg-config
|
||||||
|
apt install bison tcl
|
||||||
|
|
||||||
|
Use debuild to make deb-s:
|
||||||
|
|
||||||
|
cd <SRCDIR>/debian
|
||||||
|
debuild -us -uc -b
|
||||||
|
|
||||||
|
RPM-based systems (RHEL, CentOS, Altlinux, SimplyLinux, RedOS)
|
||||||
|
=====================
|
||||||
|
|
||||||
|
mkdir -p ./rpmbuild/{RPMS,BUILD}
|
||||||
|
rpmbuild -bb <SRCDIR>/rpm/bforce.spec --define "_topdir $( pwd )/rpmbuild" --define "_builddir <SRCDIR>/source"
|
||||||
|
|
||||||
|
|
||||||
|
Manual Installation
|
||||||
==================
|
==================
|
||||||
|
|
||||||
These are generic installation instructions.
|
These are generic installation instructions.
|
||||||
@ -46,7 +77,7 @@ The simplest way to compile this package is:
|
|||||||
|
|
||||||
Compilers and Options
|
Compilers and Options
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
Some systems require unusual options for compilation or linking that
|
Some systems require unusual options for compilation or linking that
|
||||||
the `configure' script does not know about. You can give `configure'
|
the `configure' script does not know about. You can give `configure'
|
||||||
initial values for variables by setting them in the environment. Using
|
initial values for variables by setting them in the environment. Using
|
||||||
|
|||||||
77
INSTALL.ru
77
INSTALL.ru
@ -3,21 +3,42 @@
|
|||||||
|
|
||||||
В данном документе приняты следующие обозначения:
|
В данном документе приняты следующие обозначения:
|
||||||
|
|
||||||
<SRCDIR> - путь, куда вы распаковали тарболл с исходными
|
<SRCDIR> - путь, куда вы распаковали тарболл с исходными текстами
|
||||||
текстами bforce 0.xx (далее bforce)
|
bforce 0.xx (далее bforce)
|
||||||
Тарболл - файл с расширением tar.gz, или tar.bz2
|
Тарболл - файл с расширением tar.gz, или tar.bz2
|
||||||
|
|
||||||
|
|
||||||
Требования к системе
|
Требования к системе
|
||||||
====================
|
====================
|
||||||
|
|
||||||
Для компиляции bforce вам потребуется компилятор (для
|
Для компиляции bforce вам потребуется компилятор с языка С,
|
||||||
gnu/bsd-систем gcc), так же GNU make (make для линукс,
|
так же GNU make (make для линукс, gmake для bsd) и yacc (в linux -
|
||||||
gmake для bsd).
|
bison). Опционально - tcl
|
||||||
|
|
||||||
Обратитесь к документации по вашей системе того, что бы
|
Создание пакета
|
||||||
узнать как установить вышеперечисленное программное обеспечение.
|
=
|
||||||
|
|
||||||
|
Debian-based системы (Debian, *buntu, Mint, Astra)
|
||||||
|
====================
|
||||||
|
|
||||||
|
Установка программ и набора скриптов для сборки пакетов:
|
||||||
|
|
||||||
|
apt install build-essential fakeroot devscripts debhelper pkg-config
|
||||||
|
apt install bison tcl
|
||||||
|
|
||||||
|
Для создания пакета из скачанных исходников достаточно воспользоваться
|
||||||
|
командой debuild:
|
||||||
|
|
||||||
|
cd <SRCDIR>/debian
|
||||||
|
debuild -us -uc -b
|
||||||
|
|
||||||
|
RPM-based системы (RHEL, CentOS, Altlinux, SimplyLinux, RedOS)
|
||||||
|
=====================
|
||||||
|
|
||||||
|
mkdir -p ./rpmbuild/{RPMS,BUILD}
|
||||||
|
rpmbuild -bb <SRCDIR>/rpm/bforce.spec --define "_topdir $( pwd )/rpmbuild" --define "_builddir <SRCDIR>/source"
|
||||||
|
|
||||||
|
Установка вручную
|
||||||
|
=
|
||||||
|
|
||||||
Процесс компиляции
|
Процесс компиляции
|
||||||
==================
|
==================
|
||||||
@ -160,29 +181,29 @@ ifc 60179/tcp # fidonet EMSI over TCP
|
|||||||
======================
|
======================
|
||||||
|
|
||||||
Дополнительные утилиты для bforce находятся в <SRCDIR>/contrib:
|
Дополнительные утилиты для bforce находятся в <SRCDIR>/contrib:
|
||||||
bflan - bforce log analyzer
|
bflan - bforce log analyzer
|
||||||
callout.sh - скрипт для отзвонки на аплинков
|
callout.sh - скрипт для отзвонки на аплинков
|
||||||
outman - скрипт outman
|
outman - скрипт outman
|
||||||
timesync.tcl - скрипт для синхорнизации времени с узлами ftn.
|
timesync.tcl - скрипт для синхорнизации времени с узлами ftn.
|
||||||
init.d/bforce - init-скрипт для RedHat
|
init.d/bforce - init-скрипт для RedHat
|
||||||
bfha - bforce history analyzer (bfha)
|
bfha - bforce history analyzer (bfha)
|
||||||
bfha/README - bfha README
|
bfha/README - bfha README
|
||||||
bfha/bfha.pl - собственно, bfha
|
bfha/bfha.pl - собственно, bfha
|
||||||
legacy-part.conf - файл для донастройки прав на /run/lock в systemd
|
legacy-part.conf - файл для донастройки прав на /run/lock в systemd
|
||||||
u-srif - продвинутый freq-процессор
|
u-srif - продвинутый freq-процессор
|
||||||
u-srif/u-srif-index.py \ с поддержой отчетов,
|
u-srif/u-srif-index.py \ с поддержой отчетов,
|
||||||
u-srif/u-srif-lookup.py \ ограничений,
|
u-srif/u-srif-lookup.py \ ограничений,
|
||||||
u-srif/u-srif.py \ индексации файловой базы,
|
u-srif/u-srif.py \ индексации файловой базы,
|
||||||
u-srif/conf \ что значительно ускоряет
|
u-srif/conf \ что значительно ускоряет
|
||||||
u-srif/conf/report.footer \ работу.
|
u-srif/conf/report.footer \ работу.
|
||||||
u-srif/conf/report.header \ Написан на python.
|
u-srif/conf/report.header \ Написан на python.
|
||||||
u-srif/conf/u-srif.aliases \ --------------------
|
u-srif/conf/u-srif.aliases \ --------------------
|
||||||
u-srif/conf/u-srif.conf \ -------------------
|
u-srif/conf/u-srif.conf \ -------------------
|
||||||
u-srif/conf/u-srif.dirs \ ------------------
|
u-srif/conf/u-srif.dirs \ ------------------
|
||||||
u-srif/lib / ------------------
|
u-srif/lib / ------------------
|
||||||
u-srif/lib/uconfig.py / -------------------
|
u-srif/lib/uconfig.py / -------------------
|
||||||
u-srif/lib/udbase.py / --------------------
|
u-srif/lib/udbase.py / --------------------
|
||||||
u-srif/lib/ufido.py / ---------------------
|
u-srif/lib/ufido.py / ---------------------
|
||||||
u-srif/lib/unodestat.py / ----------------------
|
u-srif/lib/unodestat.py / ----------------------
|
||||||
u-srif/lib/utmpl.py / -----------------------
|
u-srif/lib/utmpl.py / -----------------------
|
||||||
u-srif/lib/uutil.py / ------------------------
|
u-srif/lib/uutil.py / ------------------------
|
||||||
|
|||||||
19
README.md
19
README.md
@ -1,3 +1,7 @@
|
|||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
BinkleyForce FTN mailer
|
BinkleyForce FTN mailer
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
@ -28,9 +32,12 @@ any later version. See the COPYING file for further information.
|
|||||||
|
|
||||||
Known Bugs
|
Known Bugs
|
||||||
----------
|
----------
|
||||||
- BinkleyForce has no support (yet) for multiple INA: addresses
|
|
||||||
- Can not rotate hidden lines
|
~~BinkleyForce has no support (yet) for multiple INA: addresses~~
|
||||||
- Can not rotate supported IP protocols in case of failure
|
~~Can not rotate hidden lines~~
|
||||||
|
~~Can not rotate supported IP protocols in case of failure~~
|
||||||
|
|
||||||
|
- Can not (yet) apply flags to hidden phone lines.
|
||||||
|
|
||||||
Bug Reports
|
Bug Reports
|
||||||
-----------
|
-----------
|
||||||
@ -43,6 +50,10 @@ New Versions
|
|||||||
|
|
||||||
https://prj.zxalexis.ru/gitea/zx/bforce
|
https://prj.zxalexis.ru/gitea/zx/bforce
|
||||||
|
|
||||||
|
SAST Tools
|
||||||
|
----------
|
||||||
|
[PVS-Studio](https://pvs-studio.com/pvs-studio/?utm_source=website&utm_medium=github&utm_campaign=open_source) - static analyzer for C, C++, C#, and Java code.
|
||||||
|
|
||||||
Older Sources
|
Older Sources
|
||||||
-------------
|
-------------
|
||||||
https://github.com/zotrix/binkleyforce/
|
https://github.com/zotrix/binkleyforce/
|
||||||
@ -56,4 +67,4 @@ Copyright <br>
|
|||||||
> (c) 2007-2008 Sergey Babitch<br>
|
> (c) 2007-2008 Sergey Babitch<br>
|
||||||
> (c) 2011-2014 Sergey Dorofeev<br>
|
> (c) 2011-2014 Sergey Dorofeev<br>
|
||||||
> (c) 2014 Alexander Skovpen<br>
|
> (c) 2014 Alexander Skovpen<br>
|
||||||
> (c) 2024 Alexey Khromov<br>
|
> (c) 2024-2025 Alexey Khromov<br>
|
||||||
|
|||||||
@ -33,6 +33,7 @@ package() {
|
|||||||
mkdir -p ${pkgdir}/usr/bin
|
mkdir -p ${pkgdir}/usr/bin
|
||||||
mkdir -p ${pkgdir}/usr/local/bin
|
mkdir -p ${pkgdir}/usr/local/bin
|
||||||
mkdir -p ${pkgdir}/usr/share/doc/bforce
|
mkdir -p ${pkgdir}/usr/share/doc/bforce
|
||||||
|
mkdir -p ${pkgdir}/usr/share/man/man1
|
||||||
mkdir -p ${pkgdir}/var/log/bforce
|
mkdir -p ${pkgdir}/var/log/bforce
|
||||||
mkdir -p ${pkgdir}/var/spool/bforce
|
mkdir -p ${pkgdir}/var/spool/bforce
|
||||||
mkdir -p ${pkgdir}/var/spool/bforce/bt/in
|
mkdir -p ${pkgdir}/var/spool/bforce/bt/in
|
||||||
@ -44,6 +45,7 @@ package() {
|
|||||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfindex ${pkgdir}/usr/bin/bfindex
|
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfindex ${pkgdir}/usr/bin/bfindex
|
||||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfstat ${pkgdir}/usr/bin/bfstat
|
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfstat ${pkgdir}/usr/bin/bfstat
|
||||||
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/nlookup ${pkgdir}/usr/bin/nlookup
|
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/nlookup ${pkgdir}/usr/bin/nlookup
|
||||||
|
/usr/bin/install -c ${srcdir}/${pkgname}/man/*.1 ${pkgdir}/usr/share/man/man1/
|
||||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.conf ${pkgdir}/etc/bforce.conf.sample
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.conf ${pkgdir}/etc/bforce.conf.sample
|
||||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.subst ${pkgdir}/etc/bforce.subst.sample
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.subst ${pkgdir}/etc/bforce.subst.sample
|
||||||
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.passwd ${pkgdir}/etc/bforce.passwd.sample
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.passwd ${pkgdir}/etc/bforce.passwd.sample
|
||||||
|
|||||||
64
archlinux/PKGBUILD.ci
Normal file
64
archlinux/PKGBUILD.ci
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
pkgname=bforce
|
||||||
|
pkgver=r235.a1c93b8
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="binkleyforce FTN mailer"
|
||||||
|
arch=('i686' 'x86_64' 'aarch64')
|
||||||
|
url="https://prj.zxalexis.ru/gitea/zx/bforce/"
|
||||||
|
license=('GPL2')
|
||||||
|
source=(
|
||||||
|
"${pkgname}::git+https://prj.zxalexis.ru/gitea/zx/bforce.git"
|
||||||
|
)
|
||||||
|
makedepends=('git' 'gcc' 'make' 'glibc')
|
||||||
|
provides=('bforce')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd "${srcdir}/${pkgname}/source"
|
||||||
|
./configure --prefix=/ --disable-syslog --with-owner=fido --with-group=uucp
|
||||||
|
make
|
||||||
|
}
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd "${pkgname}"
|
||||||
|
git checkout "${GITHUB_SHA}"
|
||||||
|
printf "$( pwd )\n"
|
||||||
|
}
|
||||||
|
|
||||||
|
pkgver() {
|
||||||
|
cd "$pkgname"
|
||||||
|
if [ "${GITHUB_REF_TYPE}" = "tags" ]; then
|
||||||
|
printf "v%s" "${GITHUB_REF_NAME}"
|
||||||
|
else
|
||||||
|
printf "r%s.%s.%s" "$(git rev-list --count ${GITHUB_SHA})" "$(git rev-parse --short ${GITHUB_SHA})" "${GITHUB_REF_NAME}"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd ${pkgdir}
|
||||||
|
mkdir -p ${pkgdir}/etc
|
||||||
|
mkdir -p ${pkgdir}/usr/bin
|
||||||
|
mkdir -p ${pkgdir}/usr/local/bin
|
||||||
|
mkdir -p ${pkgdir}/usr/share/doc/bforce
|
||||||
|
mkdir -p ${pkgdir}/usr/share/man/man1
|
||||||
|
mkdir -p ${pkgdir}/var/log/bforce
|
||||||
|
mkdir -p ${pkgdir}/var/spool/bforce
|
||||||
|
mkdir -p ${pkgdir}/var/spool/bforce/bt/in
|
||||||
|
mkdir -p ${pkgdir}/var/spool/bforce/bt/pin
|
||||||
|
mkdir -p ${pkgdir}/var/spool/bforce/bt/out
|
||||||
|
mkdir -p ${pkgdir}/var/spool/bforce/ndl
|
||||||
|
mkdir -p ${pkgdir}/var/spool/bforce/bforce
|
||||||
|
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bforce ${pkgdir}/usr/bin/bforce
|
||||||
|
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfindex ${pkgdir}/usr/bin/bfindex
|
||||||
|
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/bfstat ${pkgdir}/usr/bin/bfstat
|
||||||
|
/usr/bin/install -c ${srcdir}/${pkgname}/source/bin/nlookup ${pkgdir}/usr/bin/nlookup
|
||||||
|
/usr/bin/install -c ${srcdir}/${pkgname}/man/*.1 ${pkgdir}/usr/share/man/man1/
|
||||||
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.conf ${pkgdir}/etc/bforce.conf.sample
|
||||||
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.subst ${pkgdir}/etc/bforce.subst.sample
|
||||||
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/bforce.passwd ${pkgdir}/etc/bforce.passwd.sample
|
||||||
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/freq.aliases ${pkgdir}/etc/freq.aliases.sample
|
||||||
|
/usr/bin/install -c -m 644 ${srcdir}/${pkgname}/examples/freq.dirs ${pkgdir}/etc/freq.dirs.sample
|
||||||
|
/usr/bin/install -c ${srcdir}/${pkgname}/contrib/outman ${pkgdir}/usr/local/bin/outman
|
||||||
|
echo "Please, edit /usr/local/bin/outman"
|
||||||
|
cp ${srcdir}/${pkgname}/docs/* ${pkgdir}/usr/share/doc/bforce/
|
||||||
|
}
|
||||||
|
|
||||||
|
sha256sums=('SKIP')
|
||||||
25
contrib/fail2ban/filter.d/bforce.conf
Normal file
25
contrib/fail2ban/filter.d/bforce.conf
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Fail2Ban filter for bforce bf-log.tcpip log file
|
||||||
|
# Detecting unauthorized access
|
||||||
|
# Typically logged in /var/log/bforce/bf-debug
|
||||||
|
|
||||||
|
# Apr 10 17:34:20 [944134] TCP/IP connect from 72.138.46.4 on port 5590
|
||||||
|
# Apr 10 17:34:21 [944134] Session ended up, rc=21, inetd=1
|
||||||
|
# Apr 10 17:34:21 [944134] session rc = 21 ("Cannot handshake with remote")
|
||||||
|
# Apr 10 17:34:21 [944135] Answering TCPIP call...
|
||||||
|
# Apr 10 17:34:21 [944135] TCP/IP connect from 72.138.46.4 on port 7714
|
||||||
|
# Apr 10 17:34:21 [944135] Session ended up, rc=21, inetd=1
|
||||||
|
# Apr 10 17:34:21 [944135] session rc = 21 ("Cannot handshake with remote")
|
||||||
|
|
||||||
|
[INCLUDES]
|
||||||
|
|
||||||
|
# Read common prefixes. If any customizations available -- read them from
|
||||||
|
# common.local
|
||||||
|
before = common.conf
|
||||||
|
|
||||||
|
[Init]
|
||||||
|
maxlines = 5
|
||||||
|
|
||||||
|
[Definition]
|
||||||
|
prefregex = \[<F-MLFID>\d+</F-MLFID>\] TCP/IP connect from <HOST> on port \d+$
|
||||||
|
failregex = session rc \= 21
|
||||||
|
ignoreregex =
|
||||||
8
contrib/fail2ban/jail.d/bforce_jail.conf
Normal file
8
contrib/fail2ban/jail.d/bforce_jail.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[bforce]
|
||||||
|
enabled = true
|
||||||
|
port = 24554,60179
|
||||||
|
filter = bforce
|
||||||
|
logpath = /opt/fidonms/logs/bf-log.tcpip
|
||||||
|
maxretry = 5
|
||||||
|
findtime = 60
|
||||||
|
bantime = 600
|
||||||
@ -6,7 +6,7 @@ Type=forking
|
|||||||
PIDFile=/tmp/bforce.pid
|
PIDFile=/tmp/bforce.pid
|
||||||
User=fido
|
User=fido
|
||||||
Group=fido
|
Group=fido
|
||||||
ExecStart=/usr/bin/bforce -d -C /opt/fidonms/etc/bforce.conf
|
ExecStart=/usr/bin/bforce -d -C /etc/bforce/bforce.conf
|
||||||
ExecStop=/usr/bin/bforce -q
|
ExecStop=/usr/bin/bforce -q
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
|||||||
@ -9,5 +9,5 @@ service binkp
|
|||||||
wait = no
|
wait = no
|
||||||
user = fido
|
user = fido
|
||||||
server = /usr/bin/bforce
|
server = /usr/bin/bforce
|
||||||
server_args = -C /opt/fidonms/etc/bforce.conf -i binkp
|
server_args = -C /etc/bforce/bforce.conf -i binkp
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,5 +9,5 @@ service ifc
|
|||||||
wait = no
|
wait = no
|
||||||
user = fido
|
user = fido
|
||||||
server = /usr/bin/bforce
|
server = /usr/bin/bforce
|
||||||
server_args = -C /opt/fidonms/etc/bforce.conf -i auto
|
server_args = -C /etc/bforce/bforce.conf -i auto
|
||||||
}
|
}
|
||||||
|
|||||||
263
debian/Makefile.in
vendored
263
debian/Makefile.in
vendored
@ -1,263 +0,0 @@
|
|||||||
# Makefile.in generated by automake 1.8.3 from Makefile.am.
|
|
||||||
# @configure_input@
|
|
||||||
|
|
||||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
|
||||||
# 2003, 2004 Free Software Foundation, Inc.
|
|
||||||
# This Makefile.in is free software; the Free Software Foundation
|
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
|
||||||
# with or without modifications, as long as this notice is preserved.
|
|
||||||
|
|
||||||
# This program is distributed in the hope that it will be useful,
|
|
||||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
|
||||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
|
||||||
# PARTICULAR PURPOSE.
|
|
||||||
|
|
||||||
@SET_MAKE@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
top_srcdir = @top_srcdir@
|
|
||||||
VPATH = @srcdir@
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE@
|
|
||||||
pkglibdir = $(libdir)/@PACKAGE@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE@
|
|
||||||
top_builddir = ..
|
|
||||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
install_sh_DATA = $(install_sh) -c -m 644
|
|
||||||
install_sh_PROGRAM = $(install_sh) -c
|
|
||||||
install_sh_SCRIPT = $(install_sh) -c
|
|
||||||
INSTALL_HEADER = $(INSTALL_DATA)
|
|
||||||
transform = $(program_transform_name)
|
|
||||||
NORMAL_INSTALL = :
|
|
||||||
PRE_INSTALL = :
|
|
||||||
POST_INSTALL = :
|
|
||||||
NORMAL_UNINSTALL = :
|
|
||||||
PRE_UNINSTALL = :
|
|
||||||
POST_UNINSTALL = :
|
|
||||||
build_triplet = @build@
|
|
||||||
host_triplet = @host@
|
|
||||||
target_triplet = @target@
|
|
||||||
subdir = ../debian
|
|
||||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
|
||||||
am__aclocal_m4_deps = $(top_srcdir)/configure.in
|
|
||||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES)
|
|
||||||
mkinstalldirs = $(mkdir_p)
|
|
||||||
CONFIG_HEADER = $(top_builddir)/include/config.h
|
|
||||||
CONFIG_CLEAN_FILES =
|
|
||||||
SOURCES =
|
|
||||||
DIST_SOURCES =
|
|
||||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
|
||||||
CC = @CC@
|
|
||||||
CFLAGS = @CFLAGS@
|
|
||||||
CPP = @CPP@
|
|
||||||
CPPFLAGS = @CPPFLAGS@
|
|
||||||
DEFS = @DEFS@
|
|
||||||
ECHO_C = @ECHO_C@
|
|
||||||
ECHO_N = @ECHO_N@
|
|
||||||
ECHO_T = @ECHO_T@
|
|
||||||
EGREP = @EGREP@
|
|
||||||
EXEEXT = @EXEEXT@
|
|
||||||
GROUP = @GROUP@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
LDFLAGS = @LDFLAGS@
|
|
||||||
LIBOBJS = @LIBOBJS@
|
|
||||||
LIBS = @LIBS@
|
|
||||||
LTLIBOBJS = @LTLIBOBJS@
|
|
||||||
OBJEXT = @OBJEXT@
|
|
||||||
OWNER = @OWNER@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
YACC = @YACC@
|
|
||||||
ac_ct_CC = @ac_ct_CC@
|
|
||||||
bindir = @bindir@
|
|
||||||
build = @build@
|
|
||||||
build_alias = @build_alias@
|
|
||||||
build_cpu = @build_cpu@
|
|
||||||
build_os = @build_os@
|
|
||||||
build_vendor = @build_vendor@
|
|
||||||
datadir = @datadir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
host = @host@
|
|
||||||
host_alias = @host_alias@
|
|
||||||
host_cpu = @host_cpu@
|
|
||||||
host_os = @host_os@
|
|
||||||
host_vendor = @host_vendor@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
libdir = @libdir@
|
|
||||||
libexecdir = @libexecdir@
|
|
||||||
localstatedir = @localstatedir@
|
|
||||||
mandir = @mandir@
|
|
||||||
oldincludedir = @oldincludedir@
|
|
||||||
prefix = @prefix@
|
|
||||||
program_transform_name = @program_transform_name@
|
|
||||||
sbindir = @sbindir@
|
|
||||||
sharedstatedir = @sharedstatedir@
|
|
||||||
sysconfdir = @sysconfdir@
|
|
||||||
target = @target@
|
|
||||||
target_alias = @target_alias@
|
|
||||||
target_cpu = @target_cpu@
|
|
||||||
target_os = @target_os@
|
|
||||||
target_vendor = @target_vendor@
|
|
||||||
|
|
||||||
# $Id$
|
|
||||||
EXTRA_DIST = copyright changelog rules conffiles \
|
|
||||||
control dirs init.d
|
|
||||||
|
|
||||||
all: all-am
|
|
||||||
|
|
||||||
.SUFFIXES:
|
|
||||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
|
||||||
@for dep in $?; do \
|
|
||||||
case '$(am__configure_deps)' in \
|
|
||||||
*$$dep*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
|
||||||
&& exit 0; \
|
|
||||||
exit 1;; \
|
|
||||||
esac; \
|
|
||||||
done; \
|
|
||||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ../debian/Makefile'; \
|
|
||||||
cd $(top_srcdir) && \
|
|
||||||
$(AUTOMAKE) --gnu ../debian/Makefile
|
|
||||||
.PRECIOUS: Makefile
|
|
||||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|
||||||
@case '$?' in \
|
|
||||||
*config.status*) \
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
|
||||||
*) \
|
|
||||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
|
||||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
|
||||||
esac;
|
|
||||||
|
|
||||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
|
|
||||||
$(top_srcdir)/configure: $(am__configure_deps)
|
|
||||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
|
||||||
uninstall-info-am:
|
|
||||||
tags: TAGS
|
|
||||||
TAGS:
|
|
||||||
|
|
||||||
ctags: CTAGS
|
|
||||||
CTAGS:
|
|
||||||
|
|
||||||
|
|
||||||
distdir: $(DISTFILES)
|
|
||||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
|
||||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
|
||||||
list='$(DISTFILES)'; for file in $$list; do \
|
|
||||||
case $$file in \
|
|
||||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
|
||||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
|
||||||
esac; \
|
|
||||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
|
||||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
|
||||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
|
||||||
dir="/$$dir"; \
|
|
||||||
$(mkdir_p) "$(distdir)$$dir"; \
|
|
||||||
else \
|
|
||||||
dir=''; \
|
|
||||||
fi; \
|
|
||||||
if test -d $$d/$$file; then \
|
|
||||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
|
||||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
|
||||||
fi; \
|
|
||||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
|
||||||
else \
|
|
||||||
test -f $(distdir)/$$file \
|
|
||||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
|
||||||
|| exit 1; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
check-am: all-am
|
|
||||||
check: check-am
|
|
||||||
all-am: Makefile
|
|
||||||
installdirs:
|
|
||||||
install: install-am
|
|
||||||
install-exec: install-exec-am
|
|
||||||
install-data: install-data-am
|
|
||||||
uninstall: uninstall-am
|
|
||||||
|
|
||||||
install-am: all-am
|
|
||||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
|
||||||
|
|
||||||
installcheck: installcheck-am
|
|
||||||
install-strip:
|
|
||||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
|
||||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
|
||||||
`test -z '$(STRIP)' || \
|
|
||||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
|
||||||
mostlyclean-generic:
|
|
||||||
|
|
||||||
clean-generic:
|
|
||||||
|
|
||||||
distclean-generic:
|
|
||||||
-rm -f $(CONFIG_CLEAN_FILES)
|
|
||||||
|
|
||||||
maintainer-clean-generic:
|
|
||||||
@echo "This command is intended for maintainers to use"
|
|
||||||
@echo "it deletes files that may require special tools to rebuild."
|
|
||||||
clean: clean-am
|
|
||||||
|
|
||||||
clean-am: clean-generic mostlyclean-am
|
|
||||||
|
|
||||||
distclean: distclean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
distclean-am: clean-am distclean-generic
|
|
||||||
|
|
||||||
dvi: dvi-am
|
|
||||||
|
|
||||||
dvi-am:
|
|
||||||
|
|
||||||
html: html-am
|
|
||||||
|
|
||||||
info: info-am
|
|
||||||
|
|
||||||
info-am:
|
|
||||||
|
|
||||||
install-data-am:
|
|
||||||
|
|
||||||
install-exec-am:
|
|
||||||
|
|
||||||
install-info: install-info-am
|
|
||||||
|
|
||||||
install-man:
|
|
||||||
|
|
||||||
installcheck-am:
|
|
||||||
|
|
||||||
maintainer-clean: maintainer-clean-am
|
|
||||||
-rm -f Makefile
|
|
||||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
|
||||||
|
|
||||||
mostlyclean: mostlyclean-am
|
|
||||||
|
|
||||||
mostlyclean-am: mostlyclean-generic
|
|
||||||
|
|
||||||
pdf: pdf-am
|
|
||||||
|
|
||||||
pdf-am:
|
|
||||||
|
|
||||||
ps: ps-am
|
|
||||||
|
|
||||||
ps-am:
|
|
||||||
|
|
||||||
uninstall-am: uninstall-info-am
|
|
||||||
|
|
||||||
.PHONY: all all-am check check-am clean clean-generic distclean \
|
|
||||||
distclean-generic distdir dvi dvi-am html html-am info info-am \
|
|
||||||
install install-am install-data install-data-am install-exec \
|
|
||||||
install-exec-am install-info install-info-am install-man \
|
|
||||||
install-strip installcheck installcheck-am installdirs \
|
|
||||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
|
||||||
mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \
|
|
||||||
uninstall-info-am
|
|
||||||
|
|
||||||
# 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.
|
|
||||||
.NOEXPORT:
|
|
||||||
6
debian/README.Debian
vendored
6
debian/README.Debian
vendored
@ -1,6 +0,0 @@
|
|||||||
bforce for Debian
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
See CHANGES.ugenk
|
|
||||||
|
|
||||||
-- Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>, Thu Feb 10 23:54:48 2005
|
|
||||||
33
debian/changelog
vendored
33
debian/changelog
vendored
@ -1,3 +1,36 @@
|
|||||||
|
bforce (0.27) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Fixed warnings from PVS-Studio analyser
|
||||||
|
* Fixed getaddrinfo switching through available ip-addresses
|
||||||
|
* Reduced SYN-SENT timeout to 3 secs to avoid blocking on hosts with services down
|
||||||
|
* nlookup - new option -o to show configured overrides and hidden lines
|
||||||
|
* nlookup - new option -t to show calltable
|
||||||
|
* Added support for multiply INA: addresses of a node
|
||||||
|
* Added automatic rolling of all available adresses on callout
|
||||||
|
* Added automatic rolling of all available hidden phone numbers on callout
|
||||||
|
* Full rework of overrides in config
|
||||||
|
|
||||||
|
-- Alexey Khromov <zx@zxalexis.ru> Sat, 26 Apr 2025 21:19:54 +0300
|
||||||
|
|
||||||
|
bforce (0.26.2) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Added tests to CI actions
|
||||||
|
* Fixed nodelist indexing for points handling
|
||||||
|
|
||||||
|
-- Alexey Khromov <zx@zxalexis.ru> Sat, 19 Apr 2025 07:43:54 +0300
|
||||||
|
|
||||||
|
bforce (0.26.1) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Fixed for ubuntu/debian builds and CI actions
|
||||||
|
|
||||||
|
-- Alexey Khromov <zx@zxalexis.ru> Sun, 13 Apr 2025 20:06:54 +0300
|
||||||
|
|
||||||
|
bforce (0.26) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Fixed for IPv6 and build on amd64 and aarch64 platforms
|
||||||
|
|
||||||
|
-- Alexey Khromov <zx@zxalexis.ru> Sun, 13 Apr 2025 12:53:54 +0000
|
||||||
|
|
||||||
bforce (0.22.9-3) unstable; urgency=low
|
bforce (0.22.9-3) unstable; urgency=low
|
||||||
|
|
||||||
* fixes in init.d script
|
* fixes in init.d script
|
||||||
|
|||||||
2
debian/compat
vendored
2
debian/compat
vendored
@ -1 +1 @@
|
|||||||
4
|
3
|
||||||
|
|||||||
6
debian/conffiles
vendored
6
debian/conffiles
vendored
@ -1,6 +0,0 @@
|
|||||||
/etc/bforce/bforce.conf
|
|
||||||
/etc/bforce/bforce.subst
|
|
||||||
/etc/bforce/bforce.passwd
|
|
||||||
/etc/bforce/freq.dirs
|
|
||||||
/etc/bforce/freq.aliases
|
|
||||||
|
|
||||||
4
debian/control
vendored
4
debian/control
vendored
@ -1,13 +1,13 @@
|
|||||||
Source: bforce
|
Source: bforce
|
||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Evgeniy Kozhuhovskiy <e.kozhuhovskiy@gmail.com>
|
Maintainer: Alexey Khromov <zx@zxalexis.ru>
|
||||||
Build-Depends: debhelper (>> 3.0.0), bison (>> 1.0.0)
|
Build-Depends: debhelper (>> 3.0.0), bison (>> 1.0.0)
|
||||||
Standards-Version: 3.5.10
|
Standards-Version: 3.5.10
|
||||||
|
|
||||||
Package: bforce
|
Package: bforce
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}
|
Depends: ${shlibs:Depends}, tclsh:any
|
||||||
Description: Binkey Force FTN mailer
|
Description: Binkey Force FTN mailer
|
||||||
FTN mailer is a program that transmit files (netmail and echomail)
|
FTN mailer is a program that transmit files (netmail and echomail)
|
||||||
between your FTN node and other.
|
between your FTN node and other.
|
||||||
|
|||||||
1
debian/dirs
vendored
1
debian/dirs
vendored
@ -1,5 +1,6 @@
|
|||||||
usr/bin
|
usr/bin
|
||||||
usr/lib/bforce
|
usr/lib/bforce
|
||||||
|
usr/lib/systemd/system
|
||||||
etc/bforce
|
etc/bforce
|
||||||
etc/default
|
etc/default
|
||||||
etc/default/bforce
|
etc/default/bforce
|
||||||
|
|||||||
10
debian/docs
vendored
10
debian/docs
vendored
@ -1,9 +1,5 @@
|
|||||||
README
|
README.md
|
||||||
README.kst
|
|
||||||
README.ugenk
|
|
||||||
TODO
|
TODO
|
||||||
CHANGES
|
|
||||||
CHANGES.kst
|
|
||||||
CHANGES.ugenk
|
|
||||||
INSTALL
|
INSTALL
|
||||||
INSTALL.ru
|
INSTALL.ru
|
||||||
|
SYSLOG
|
||||||
|
|||||||
18
debian/postinst
vendored
18
debian/postinst
vendored
@ -26,15 +26,15 @@ set -e
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
|
|
||||||
if ! grep -s news /etc/group >/dev/null 2>&1; then
|
# if ! grep -s news /etc/group >/dev/null 2>&1; then
|
||||||
addgroup --system news
|
# addgroup --system news
|
||||||
fi
|
# fi
|
||||||
|
#
|
||||||
if ! id uucp >/dev/null 2>&1; then
|
# if ! id uucp >/dev/null 2>&1; then
|
||||||
adduser --system --disabled-password uucp
|
# adduser --system --disabled-password uucp
|
||||||
chsh -s /bin/sh uucp
|
# chsh -s /bin/sh uucp
|
||||||
adduser uucp dialout
|
# adduser uucp dialout
|
||||||
fi
|
# fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
abort-upgrade|abort-remove|abort-deconfigure)
|
abort-upgrade|abort-remove|abort-deconfigure)
|
||||||
|
|||||||
13
debian/rules
vendored
13
debian/rules
vendored
@ -6,8 +6,7 @@
|
|||||||
#export DH_VERBOSE=1
|
#export DH_VERBOSE=1
|
||||||
|
|
||||||
# This is the debhelper compatibility version to use.
|
# This is the debhelper compatibility version to use.
|
||||||
export DH_COMPAT=3
|
export DH_COMPAT=11
|
||||||
|
|
||||||
|
|
||||||
PACKAGE = bforce
|
PACKAGE = bforce
|
||||||
|
|
||||||
@ -49,7 +48,7 @@ clean:
|
|||||||
rm -f build-stamp configure-stamp
|
rm -f build-stamp configure-stamp
|
||||||
|
|
||||||
# Add here commands to clean up after the build process.
|
# Add here commands to clean up after the build process.
|
||||||
-$(MAKE) -C source clean
|
# -$(MAKE) -C source clean
|
||||||
dh_clean
|
dh_clean
|
||||||
rm -f source/config.cache source/include/config.h source/config.log\
|
rm -f source/config.cache source/include/config.h source/config.log\
|
||||||
source/config.status source/Makefile
|
source/config.status source/Makefile
|
||||||
@ -57,7 +56,7 @@ clean:
|
|||||||
install: build
|
install: build
|
||||||
dh_testdir
|
dh_testdir
|
||||||
dh_testroot
|
dh_testroot
|
||||||
dh_clean -k
|
dh_prep
|
||||||
dh_installdirs
|
dh_installdirs
|
||||||
|
|
||||||
# Add here commands to install the package into debian/bforce.
|
# Add here commands to install the package into debian/bforce.
|
||||||
@ -74,7 +73,7 @@ install: build
|
|||||||
/usr/bin/install -c -m 600 -o $(USER) -g $(GROUP) examples/bforce.passwd $(CURDIR)/debian/bforce/etc/bforce/bforce.passwd
|
/usr/bin/install -c -m 600 -o $(USER) -g $(GROUP) examples/bforce.passwd $(CURDIR)/debian/bforce/etc/bforce/bforce.passwd
|
||||||
/usr/bin/install -c -m 644 -o $(USER) -g $(GROUP) examples/freq.aliases $(CURDIR)/debian/bforce/etc/bforce/freq.aliases
|
/usr/bin/install -c -m 644 -o $(USER) -g $(GROUP) examples/freq.aliases $(CURDIR)/debian/bforce/etc/bforce/freq.aliases
|
||||||
/usr/bin/install -c -m 644 -o $(USER) -g $(GROUP) examples/freq.dirs $(CURDIR)/debian/bforce/etc/bforce/freq.dirs
|
/usr/bin/install -c -m 644 -o $(USER) -g $(GROUP) examples/freq.dirs $(CURDIR)/debian/bforce/etc/bforce/freq.dirs
|
||||||
|
/usr/bin/install -c -m 660 contrib/systemd/bforce.service $(CURDIR)/debian/bforce/usr/lib/systemd/system/bforce.service
|
||||||
/usr/bin/install $(CURDIR)/debian/bfha.def $(CURDIR)/debian/bforce/etc/default/bforce/bfha
|
/usr/bin/install $(CURDIR)/debian/bfha.def $(CURDIR)/debian/bforce/etc/default/bforce/bfha
|
||||||
/usr/bin/install $(CURDIR)/contrib/bfha/bfha-debian.pl $(CURDIR)/debian/bforce/usr/lib/bforce/bfha.pl
|
/usr/bin/install $(CURDIR)/contrib/bfha/bfha-debian.pl $(CURDIR)/debian/bforce/usr/lib/bforce/bfha.pl
|
||||||
|
|
||||||
@ -92,8 +91,8 @@ binary-arch: build install
|
|||||||
# dh_installlogrotate
|
# dh_installlogrotate
|
||||||
dh_installinit
|
dh_installinit
|
||||||
# dh_installcron
|
# dh_installcron
|
||||||
dh_installman $(CURDIR)/debian/bfindex.1 $(CURDIR)/debian/bforce.1 \
|
dh_installman $(CURDIR)/man/bfindex.1 $(CURDIR)/man/bforce.1 \
|
||||||
$(CURDIR)/debian/bfstat.1 $(CURDIR)/debian/nlookup.1
|
$(CURDIR)/man/bfstat.1 $(CURDIR)/man/nlookup.1 $(CURDIR)/man/outman.1
|
||||||
# dh_installinfo
|
# dh_installinfo
|
||||||
dh_installchangelogs CHANGES
|
dh_installchangelogs CHANGES
|
||||||
dh_link
|
dh_link
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
.SH NAME
|
.SH NAME
|
||||||
bfindex \- nodelist compiler for bforce
|
bfindex \- nodelist compiler for bforce
|
||||||
.SH SYNOPSYS
|
.SH SYNOPSYS
|
||||||
\fBbfindex [-fh]\fR
|
\fBbfindex [-fh] [-C\fIconfig\fB]\fR
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBbfindex\fP is a nodelist compiler for BinkleyForce FTN mailer.
|
\fBbfindex\fP is a nodelist compiler for BinkleyForce FTN mailer.
|
||||||
@ -2,7 +2,7 @@
|
|||||||
.SH NAME
|
.SH NAME
|
||||||
bfstat \- binkley style outbound statistic
|
bfstat \- binkley style outbound statistic
|
||||||
.SH SYNOPSYS
|
.SH SYNOPSYS
|
||||||
\fBbfstat [-afhprst] [-n \fInumber\fB]\fR
|
\fBbfstat [-afhprst] [-n \fInumber\fB] [-C\fIconfig\fB]\fR
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBbfstat\fP help you to see your outbound statistic in human readable
|
\fBbfstat\fP help you to see your outbound statistic in human readable
|
||||||
form.
|
form.
|
||||||
@ -2,7 +2,7 @@
|
|||||||
.SH NAME
|
.SH NAME
|
||||||
Bnlookup \- Nodelist search tool for bforce
|
Bnlookup \- Nodelist search tool for bforce
|
||||||
.SH SYNOPSYS
|
.SH SYNOPSYS
|
||||||
\fBnlookup [-rh]\fR
|
\fBnlookup [-otrh] [-C\fIconfig\fB]\fR
|
||||||
|
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
\fBnlookup\fP is a nodelist search tool for BinkleyForce FTN mailer.
|
\fBnlookup\fP is a nodelist search tool for BinkleyForce FTN mailer.
|
||||||
@ -13,6 +13,12 @@ show nodelist string
|
|||||||
\fB\-m\fR
|
\fB\-m\fR
|
||||||
show sysops e-mail (see FSP-1004.001 - p2)
|
show sysops e-mail (see FSP-1004.001 - p2)
|
||||||
.P
|
.P
|
||||||
|
\fB\-t\fR
|
||||||
|
show calltable
|
||||||
|
.P
|
||||||
|
\fB\-o\fR
|
||||||
|
show overrides
|
||||||
|
.P
|
||||||
\fB-h\fR
|
\fB-h\fR
|
||||||
show help message
|
show help message
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
@ -1,54 +1,68 @@
|
|||||||
Summary: Bforce, Fidonet mailer
|
Summary: Bforce, Fidonet mailer
|
||||||
Name: bforce
|
Name: bforce
|
||||||
Version: 0.22.8
|
Version: 0.27
|
||||||
Release: ugenk4
|
Release: %{_vendor}1
|
||||||
Copyright: GPL
|
Copyright: GPL
|
||||||
Group: Fidonet/mailer
|
Group: Fidonet/mailer
|
||||||
Source0: bforce-%{version}.%{release}.tar.gz
|
Source0: bforce-%{version}.tar.gz
|
||||||
BuildRoot: %{_tmppath}/%{name}-root
|
BuildRoot: %{_tmppath}/%{name}-root
|
||||||
|
|
||||||
%description
|
%description
|
||||||
BFORCE is a FTN mailer. Supports PSTN and binkp sessions.
|
BFORCE is a FTN mailer. Supports PSTN and binkp sessions.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
#%setup -q -n %{name}-%{version}.%{release}
|
# uncomment this to build from tarball
|
||||||
cd source
|
# %setup -q -n %{name}
|
||||||
./configure --prefix=/usr --disable-log-passwd --sysconfdir=/etc/bforce --bindir=/usr/bin --with-owner=uucp --with-group=news
|
echo "------------ PREPARING RPM BUILD IN $(pwd) ------------"
|
||||||
|
export RPM_PACKAGE_VERSION=$(cat %{_builddir}/%{name}/source/.version)
|
||||||
|
cd %{_builddir}/%{name}/source
|
||||||
|
%{_builddir}/%{name}/source/configure --prefix=/usr --disable-log-passwd --sysconfdir=/etc/bforce --bindir=/usr/bin --with-owner=uucp --with-group=news CFLAGS='-g1'
|
||||||
|
|
||||||
%build
|
%build
|
||||||
cd source
|
echo "------------ BUILDING RPM IN $(pwd) ------------"
|
||||||
|
cd %{_builddir}/%{name}/source
|
||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
|
mkdir -p $RPM_BUILD_ROOT
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/bforce
|
mkdir -p $RPM_BUILD_ROOT/etc/bforce
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
mkdir -p $RPM_BUILD_ROOT/usr/bin
|
||||||
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/usr/share/man/man1
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system/
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/log/bforce
|
mkdir -p $RPM_BUILD_ROOT/var/log/bforce
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/bt/pin
|
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/bt/pin
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/bt/in
|
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/bt/in
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/ndl
|
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/ndl
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/bforce
|
mkdir -p $RPM_BUILD_ROOT/var/spool/fido/bforce
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/$RPM_DOC_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION
|
||||||
|
|
||||||
|
|
||||||
install -o uucp -g news source/bin/bforce $RPM_BUILD_ROOT/usr/bin/bforce
|
install %{_builddir}/%{name}/source/bin/bforce $RPM_BUILD_ROOT/usr/bin/bforce
|
||||||
install -o uucp -g news source/bin/bfindex $RPM_BUILD_ROOT/usr/bin/bfindex
|
install %{_builddir}/%{name}/source/bin/bfindex $RPM_BUILD_ROOT/usr/bin/bfindex
|
||||||
install -o uucp -g news source/bin/bfstat $RPM_BUILD_ROOT/usr/bin/bfstat
|
install %{_builddir}/%{name}/source/bin/bfstat $RPM_BUILD_ROOT/usr/bin/bfstat
|
||||||
install -o uucp -g news source/bin/nlookup $RPM_BUILD_ROOT/usr/bin/nlookup
|
install %{_builddir}/%{name}/source/bin/nlookup $RPM_BUILD_ROOT/usr/bin/nlookup
|
||||||
install -o uucp -g news examples/bforce.conf $RPM_BUILD_ROOT/etc/bforce/bforce.conf.sample
|
install %{_builddir}/%{name}/examples/bforce.conf $RPM_BUILD_ROOT/etc/bforce/bforce.conf.sample
|
||||||
install -o uucp -g news examples/bforce.passwd $RPM_BUILD_ROOT/etc/bforce/bforce.passwd.sample
|
install %{_builddir}/%{name}/examples/bforce.passwd $RPM_BUILD_ROOT/etc/bforce/bforce.passwd.sample
|
||||||
install -o uucp -g news examples/bforce.subst $RPM_BUILD_ROOT/etc/bforce/bforce.subst.sample
|
install %{_builddir}/%{name}/examples/bforce.subst $RPM_BUILD_ROOT/etc/bforce/bforce.subst.sample
|
||||||
install -o uucp -g news examples/freq.aliases $RPM_BUILD_ROOT/etc/bforce/freq.aliases.sample
|
install %{_builddir}/%{name}/examples/freq.aliases $RPM_BUILD_ROOT/etc/bforce/freq.aliases.sample
|
||||||
install -o uucp -g news examples/freq.dirs $RPM_BUILD_ROOT/etc/bforce/freq.dirs.sample
|
install %{_builddir}/%{name}/examples/freq.dirs $RPM_BUILD_ROOT/etc/bforce/freq.dirs.sample
|
||||||
install -m755 -o uucp -g news contrib/outman $RPM_BUILD_ROOT/usr/bin/outman
|
install %{_builddir}/%{name}/contrib/outman $RPM_BUILD_ROOT/usr/bin/outman
|
||||||
|
install %{_builddir}/%{name}/contrib/systemd/bforce.service $RPM_BUILD_ROOT/usr/lib/systemd/system/bforce.service
|
||||||
|
cp %{_builddir}/%{name}/man/*.1 $RPM_BUILD_ROOT/usr/share/man/man1/
|
||||||
|
cp %{_builddir}/%{name}/{README.md,CHANGES,COPYING,INSTALL,INSTALL.ru,SYSLOG,TODO} $RPM_BUILD_ROOT/$RPM_DOC_DIR/$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION/
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%doc README README.kst CHANGES CHANGES.kst CHANGES.ugenk COPYING INSTALL.ru README.ugenk SYSLOG TODO
|
%{_mandir}/man1/bforce.1.xz
|
||||||
|
%{_mandir}/man1/bfindex.1.xz
|
||||||
|
%{_mandir}/man1/bfstat.1.xz
|
||||||
|
%{_mandir}/man1/nlookup.1.xz
|
||||||
|
%{_mandir}/man1/outman.1.xz
|
||||||
%defattr(-, root, root)
|
%defattr(-, root, root)
|
||||||
|
|
||||||
%attr(550,uucp,news) /usr/bin/bforce
|
%attr(550,uucp,news) /usr/bin/bforce
|
||||||
@ -56,7 +70,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%attr(550,uucp,news) /usr/bin/bfstat
|
%attr(550,uucp,news) /usr/bin/bfstat
|
||||||
%attr(550,uucp,news) /usr/bin/nlookup
|
%attr(550,uucp,news) /usr/bin/nlookup
|
||||||
%attr(550,uucp,news) /usr/bin/outman
|
%attr(550,uucp,news) /usr/bin/outman
|
||||||
%attr(644,root,root) /usr/share/doc/bforce-0.22.8/*
|
%attr(644,root,root) /usr/share/doc/bforce-%{version}/*
|
||||||
%dir %attr(770,uucp,news) /var/log/bforce
|
%dir %attr(770,uucp,news) /var/log/bforce
|
||||||
%dir %attr(770,uucp,news) /var/spool/fido/ndl
|
%dir %attr(770,uucp,news) /var/spool/fido/ndl
|
||||||
%attr(775,uucp,news) /var/spool/fido/bt
|
%attr(775,uucp,news) /var/spool/fido/bt
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
0.26
|
0.27
|
||||||
|
|||||||
@ -13,13 +13,14 @@ CC = @CC@
|
|||||||
INCLUDES = -I./include
|
INCLUDES = -I./include
|
||||||
CFLAGS = @CFLAGS@ -fno-builtin
|
CFLAGS = @CFLAGS@ -fno-builtin
|
||||||
LIBS = @LIBS@ @CLOCK_LIB@
|
LIBS = @LIBS@ @CLOCK_LIB@
|
||||||
YACC = @YACC@
|
YACC = @YACC@ -l
|
||||||
INSTALL = @INSTALL@
|
INSTALL = @INSTALL@
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
INSTALL_DATA = @INSTALL_DATA@
|
||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
SRCDIRCONF = $(SRCDIR)/../examples
|
SRCDIRCONF = $(SRCDIR)/../examples
|
||||||
CONTRIBDIR = $(SRCDIR)/../contrib
|
CONTRIBDIR = $(SRCDIR)/../contrib
|
||||||
|
CONTRIBMAN = $(SRCDIR)/../man
|
||||||
|
|
||||||
OWNER = @OWNER@
|
OWNER = @OWNER@
|
||||||
GROUP = @GROUP@
|
GROUP = @GROUP@
|
||||||
@ -27,6 +28,8 @@ CONFDIR = @sysconfdir@
|
|||||||
BINDIR = @bindir@
|
BINDIR = @bindir@
|
||||||
LOGDIR = @LOGDIR@
|
LOGDIR = @LOGDIR@
|
||||||
SPOOLDIR = @SPOOLDIR@
|
SPOOLDIR = @SPOOLDIR@
|
||||||
|
MANDIR = /usr/share/man/man1
|
||||||
|
SYSTEMDDIR = /var/lib/systemd/system
|
||||||
|
|
||||||
DAEMON_LOGFILE = $(LOGDIR)/bf-daemon
|
DAEMON_LOGFILE = $(LOGDIR)/bf-daemon
|
||||||
BFORCE_LOGFILE = $(LOGDIR)/bf-log
|
BFORCE_LOGFILE = $(LOGDIR)/bf-log
|
||||||
@ -175,6 +178,7 @@ installdirs:
|
|||||||
if [ ! -d $(SPOOLDIR)/bt/out ]; then mkdir -p $(SPOOLDIR)/bt/out; fi
|
if [ ! -d $(SPOOLDIR)/bt/out ]; then mkdir -p $(SPOOLDIR)/bt/out; fi
|
||||||
if [ ! -d $(SPOOLDIR)/ndl ]; then mkdir -p $(SPOOLDIR)/ndl; fi
|
if [ ! -d $(SPOOLDIR)/ndl ]; then mkdir -p $(SPOOLDIR)/ndl; fi
|
||||||
if [ ! -d $(SPOOLDIR)/bforce ]; then mkdir -p $(SPOOLDIR); fi
|
if [ ! -d $(SPOOLDIR)/bforce ]; then mkdir -p $(SPOOLDIR); fi
|
||||||
|
if [ ! -d $(MANDIR)/man1 ]; then mkdir -p $(MANDIR)/man1; fi
|
||||||
chown $(OWNER):$(GROUP) $(CONFDIR)
|
chown $(OWNER):$(GROUP) $(CONFDIR)
|
||||||
chown $(OWNER):$(GROUP) $(LOGDIR)
|
chown $(OWNER):$(GROUP) $(LOGDIR)
|
||||||
chown $(OWNER):$(GROUP) $(SPOOLDIR)/bt/in
|
chown $(OWNER):$(GROUP) $(SPOOLDIR)/bt/in
|
||||||
@ -195,10 +199,18 @@ install-config:
|
|||||||
$(INSTALL_DATA) -o $(OWNER) -g $(GROUP) $(SRCDIRCONF)/bforce.passwd $(CONFDIR)/bforce.passwd.sample
|
$(INSTALL_DATA) -o $(OWNER) -g $(GROUP) $(SRCDIRCONF)/bforce.passwd $(CONFDIR)/bforce.passwd.sample
|
||||||
$(INSTALL_DATA) -o $(OWNER) -g $(GROUP) $(SRCDIRCONF)/freq.aliases $(CONFDIR)/freq.aliases.sample
|
$(INSTALL_DATA) -o $(OWNER) -g $(GROUP) $(SRCDIRCONF)/freq.aliases $(CONFDIR)/freq.aliases.sample
|
||||||
$(INSTALL_DATA) -o $(OWNER) -g $(GROUP) $(SRCDIRCONF)/freq.dirs $(CONFDIR)/freq.dirs.sample
|
$(INSTALL_DATA) -o $(OWNER) -g $(GROUP) $(SRCDIRCONF)/freq.dirs $(CONFDIR)/freq.dirs.sample
|
||||||
|
|
||||||
|
install-man:
|
||||||
|
$(INSTALL) $(CONTRIBMAN)/bforce.1 $(MANDIR)/man1/bforce.1
|
||||||
|
$(INSTALL) $(CONTRIBMAN)/bfindex.1 $(MANDIR)/man1/bfindex.1
|
||||||
|
$(INSTALL) $(CONTRIBMAN)/bfstat.1 $(MANDIR)/man1/bforce.1
|
||||||
|
$(INSTALL) $(CONTRIBMAN)/nlookup.1 $(MANDIR)/man1/bforce.1
|
||||||
|
$(INSTALL) $(CONTRIBMAN)/outman.1 $(MANDIR)/man1/bforce.1
|
||||||
|
|
||||||
install-contrib:
|
install-contrib:
|
||||||
$(INSTALL_PROGRAM) -o $(OWNER) -g $(GROUP) $(CONTRIBDIR)/outman $(BINDIR)/outman
|
$(INSTALL_PROGRAM) -o $(OWNER) -g $(GROUP) $(CONTRIBDIR)/outman $(BINDIR)/outman
|
||||||
|
$(INSTALL_DATA) -o $(OWNER) -g $(GROUP) $(CONTRIBDIR)/systemd/bforce.service $(SYSTEMDDIR)/bforce.service
|
||||||
@echo "Please, edit $(BINDIR)/outman"
|
@echo "Please, edit $(BINDIR)/outman"
|
||||||
|
|
||||||
install: install-bin install-config
|
install: install-bin install-config install-man
|
||||||
|
|
||||||
|
|||||||
@ -259,11 +259,15 @@ int main(int argc, char *argv[], char *envp[])
|
|||||||
|
|
||||||
mainenv[0] = NULL;
|
mainenv[0] = NULL;
|
||||||
i=0;
|
i=0;
|
||||||
while (envp[i]) {
|
if ( envp[0] ) {
|
||||||
mainenv[i] = malloc(strlen(envp[i])+2);
|
while (envp[i]) {
|
||||||
strcpy(mainenv[i], envp[i]);
|
mainenv[i] = malloc(strlen(envp[i])+2);
|
||||||
mainenv[++i] = NULL;
|
if ( mainenv[i] ) {
|
||||||
DEB((D_FREE, "Program ENV: %s\n", mainenv[(i-1)]));
|
strcpy(mainenv[i], envp[i]);
|
||||||
|
mainenv[++i] = NULL;
|
||||||
|
DEB((D_FREE, "Program ENV: %s\n", mainenv[(i-1)]));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&opts, '\0', sizeof(s_bforce_opts));
|
memset(&opts, '\0', sizeof(s_bforce_opts));
|
||||||
|
|||||||
@ -19,11 +19,15 @@
|
|||||||
s_cval_entry *conf_first(bforce_config_keyword keyword)
|
s_cval_entry *conf_first(bforce_config_keyword keyword)
|
||||||
{
|
{
|
||||||
s_cval_entry *ptrl;
|
s_cval_entry *ptrl;
|
||||||
|
|
||||||
|
DEB((D_CONFIG, "conf_first entry nr %d",(int16_t)keyword));
|
||||||
|
|
||||||
for( ptrl = bforce_config[keyword].data; ptrl; ptrl = ptrl->next )
|
for( ptrl = bforce_config[keyword].data; ptrl; ptrl = ptrl->next )
|
||||||
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) )
|
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) ) {
|
||||||
|
DEB((D_CONFIG, "conf_first ptrl found"));
|
||||||
return ptrl;
|
return ptrl;
|
||||||
|
}
|
||||||
|
DEB((D_CONFIG, "conf_first ptrl not found"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,9 +36,11 @@ s_cval_entry *conf_next(s_cval_entry *ptrl)
|
|||||||
ASSERT(ptrl);
|
ASSERT(ptrl);
|
||||||
|
|
||||||
for( ptrl = ptrl->next; ptrl; ptrl = ptrl->next )
|
for( ptrl = ptrl->next; ptrl; ptrl = ptrl->next )
|
||||||
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) )
|
if( !ptrl->expr.expr || eventexpr(&ptrl->expr) ) {
|
||||||
|
DEB((D_CONFIG, "conf_next ptrl found"));
|
||||||
return ptrl;
|
return ptrl;
|
||||||
|
}
|
||||||
|
DEB((D_CONFIG, "conf_next ptrl not found"));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +97,7 @@ long conf_number(bforce_config_keyword keyword)
|
|||||||
s_override *conf_override(bforce_config_keyword keyword, s_faddr addr)
|
s_override *conf_override(bforce_config_keyword keyword, s_faddr addr)
|
||||||
{
|
{
|
||||||
s_cval_entry *ptrl;
|
s_cval_entry *ptrl;
|
||||||
|
DEB((D_CONFIG, "conf_override entry"));
|
||||||
for( ptrl = conf_first(keyword); ptrl; ptrl = conf_next(ptrl) )
|
for( ptrl = conf_first(keyword); ptrl; ptrl = conf_next(ptrl) )
|
||||||
if( !ftn_addrcomp(ptrl->d.override.addr, addr) )
|
if( !ftn_addrcomp(ptrl->d.override.addr, addr) )
|
||||||
return &ptrl->d.override;
|
return &ptrl->d.override;
|
||||||
|
|||||||
@ -662,7 +662,7 @@ static int proc_domain(s_domain *dest, char *value)
|
|||||||
if( p_path[strlen(p_path)-1] == DIRSEPCHR )
|
if( p_path[strlen(p_path)-1] == DIRSEPCHR )
|
||||||
dest->path = xstrcpy(p_path);
|
dest->path = xstrcpy(p_path);
|
||||||
else
|
else
|
||||||
dest->path = string_concat(p_path, DIRSEPSTR, NULL);
|
dest->path = string_concat(p_path, DIRSEPSTR, '\0');
|
||||||
return(PROC_RC_OK);
|
return(PROC_RC_OK);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -751,7 +751,7 @@ static int proc_path(s_string *dest, char *value)
|
|||||||
if( value[strlen(value)-1] == DIRSEPCHR )
|
if( value[strlen(value)-1] == DIRSEPCHR )
|
||||||
dest->str = xstrcpy(value);
|
dest->str = xstrcpy(value);
|
||||||
else
|
else
|
||||||
dest->str = string_concat(value, DIRSEPSTR, NULL);
|
dest->str = string_concat(value, DIRSEPSTR, '\0');
|
||||||
|
|
||||||
return(PROC_RC_OK);
|
return(PROC_RC_OK);
|
||||||
}
|
}
|
||||||
@ -1004,7 +1004,7 @@ static int proc_filebox(s_filebox *dest, char *value)
|
|||||||
if( p_path[strlen(p_path)-1] == DIRSEPCHR )
|
if( p_path[strlen(p_path)-1] == DIRSEPCHR )
|
||||||
dest->path = xstrcpy(p_path);
|
dest->path = xstrcpy(p_path);
|
||||||
else
|
else
|
||||||
dest->path = string_concat(p_path, DIRSEPSTR, NULL);
|
dest->path = string_concat(p_path, DIRSEPSTR, '\0');
|
||||||
dest->flavor = flavor;
|
dest->flavor = flavor;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -76,8 +76,8 @@ s_daemon_queue daemon_queues[] = {
|
|||||||
/*
|
/*
|
||||||
* Positions of the certain queues in the 'daemon_queues' array
|
* Positions of the certain queues in the 'daemon_queues' array
|
||||||
*/
|
*/
|
||||||
#define MODEM_QUEUE 0
|
#define MODEM_QUEUE 1
|
||||||
#define TCPIP_QUEUE 1
|
#define TCPIP_QUEUE 0
|
||||||
|
|
||||||
static RETSIGTYPE daemon_sighandler_chld(int sig)
|
static RETSIGTYPE daemon_sighandler_chld(int sig)
|
||||||
{
|
{
|
||||||
@ -810,6 +810,7 @@ int daemon_pidfile(int cmd)
|
|||||||
res = fscanf(pf, "%d", &hispid);
|
res = fscanf(pf, "%d", &hispid);
|
||||||
if (res != 1) {
|
if (res != 1) {
|
||||||
log("daemon pidfile: not readable");
|
log("daemon pidfile: not readable");
|
||||||
|
fclose(pf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -854,6 +855,7 @@ int daemon_pidfile(int cmd)
|
|||||||
res = fscanf(pf, "%d", &hispid);
|
res = fscanf(pf, "%d", &hispid);
|
||||||
if (res != 1) {
|
if (res != 1) {
|
||||||
log("daemon pidfile: not readable");
|
log("daemon pidfile: not readable");
|
||||||
|
fclose(pf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -883,6 +885,7 @@ int daemon_pidfile(int cmd)
|
|||||||
res = fscanf(pf, "%d", &hispid);
|
res = fscanf(pf, "%d", &hispid);
|
||||||
if (res != 1) {
|
if (res != 1) {
|
||||||
log("daemon pidfile: not readable");
|
log("daemon pidfile: not readable");
|
||||||
|
fclose(pf);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1032,7 +1035,7 @@ int daemon_run(const char *confname, const char *incname, bool quit)
|
|||||||
/*
|
/*
|
||||||
* Check rescan timer
|
* Check rescan timer
|
||||||
*/
|
*/
|
||||||
if( !timer_running(timer_rescan) || timer_expired(timer_rescan) )
|
if( timer_expired(timer_rescan) )
|
||||||
{
|
{
|
||||||
(void)daemon_rescan_sysqueue(&daemon_sys_queue,
|
(void)daemon_rescan_sysqueue(&daemon_sys_queue,
|
||||||
daemon_queues);
|
daemon_queues);
|
||||||
@ -1042,7 +1045,7 @@ int daemon_run(const char *confname, const char *incname, bool quit)
|
|||||||
/*
|
/*
|
||||||
* Check alive timer
|
* Check alive timer
|
||||||
*/
|
*/
|
||||||
if( !timer_running(timer_alive) || timer_expired(timer_alive) )
|
if( timer_expired(timer_alive) )
|
||||||
{
|
{
|
||||||
daemon_alive_message(&daemon_sys_queue);
|
daemon_alive_message(&daemon_sys_queue);
|
||||||
timer_set(&timer_alive, DAEMON_ALIVE_TIMER);
|
timer_set(&timer_alive, DAEMON_ALIVE_TIMER);
|
||||||
|
|||||||
@ -32,7 +32,7 @@ int daemon_line_add(const char *name, int type)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for( i = 0; i < lines_num; i++ )
|
for( i = 0; i < lines_num; i++ )
|
||||||
if( !strcmp(lines_tab[i].name, name) )
|
if( (lines_tab) && !strcmp(lines_tab[i].name, name) )
|
||||||
return i;
|
return i;
|
||||||
|
|
||||||
log("register new line \"%s\"", name);
|
log("register new line \"%s\"", name);
|
||||||
@ -90,13 +90,12 @@ bool daemon_line_isready(const char *name)
|
|||||||
void daemon_lines_deinit(void)
|
void daemon_lines_deinit(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
if( lines_tab )
|
||||||
for( i = 0; i < lines_num; i++ )
|
|
||||||
if( lines_tab[i].name )
|
|
||||||
free(lines_tab[i].name);
|
|
||||||
|
|
||||||
if( lines_tab )
|
|
||||||
{
|
{
|
||||||
|
for( i = 0; i < lines_num; i++ )
|
||||||
|
if( lines_tab[i].name )
|
||||||
|
free(lines_tab[i].name);
|
||||||
|
|
||||||
free(lines_tab);
|
free(lines_tab);
|
||||||
lines_tab = NULL;
|
lines_tab = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,7 +67,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* First part of user prologue. */
|
/* First part of user prologue. */
|
||||||
#line 49 "expression.y"
|
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
#include "confread.h"
|
#include "confread.h"
|
||||||
@ -110,7 +110,7 @@ static int yyparse(void);
|
|||||||
static int yyerror(const char *s);
|
static int yyerror(const char *s);
|
||||||
|
|
||||||
|
|
||||||
#line 114 "expression.tab.c"
|
|
||||||
|
|
||||||
# ifndef YY_CAST
|
# ifndef YY_CAST
|
||||||
# ifdef __cplusplus
|
# ifdef __cplusplus
|
||||||
@ -950,12 +950,12 @@ int yydebug;
|
|||||||
`-----------------------------------------------*/
|
`-----------------------------------------------*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
yydestruct (const char *yymsg,
|
yydestruct (char *yymsg,
|
||||||
yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
|
yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
|
||||||
{
|
{
|
||||||
YY_USE (yyvaluep);
|
YY_USE (yyvaluep);
|
||||||
if (!yymsg)
|
if (!yymsg)
|
||||||
yymsg = "Deleting";
|
yymsg = "Deleting"; // cppcheck_suppress uselessAssignmentPtrArg
|
||||||
YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
|
YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
|
||||||
|
|
||||||
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
|
||||||
@ -1059,6 +1059,7 @@ yysetstate:
|
|||||||
/* Give user a chance to reallocate the stack. Use copies of
|
/* Give user a chance to reallocate the stack. Use copies of
|
||||||
these so that the &'s don't force the real ones into
|
these so that the &'s don't force the real ones into
|
||||||
memory. */
|
memory. */
|
||||||
|
YYSTYPE *yyls1 = yyls;
|
||||||
yy_state_t *yyss1 = yyss;
|
yy_state_t *yyss1 = yyss;
|
||||||
YYSTYPE *yyvs1 = yyvs;
|
YYSTYPE *yyvs1 = yyvs;
|
||||||
|
|
||||||
@ -1066,10 +1067,13 @@ yysetstate:
|
|||||||
data in use in that stack, in bytes. This used to be a
|
data in use in that stack, in bytes. This used to be a
|
||||||
conditional around just the two extra args, but that might
|
conditional around just the two extra args, but that might
|
||||||
be undefined if yyoverflow is a macro. */
|
be undefined if yyoverflow is a macro. */
|
||||||
|
|
||||||
yyoverflow (YY_("memory exhausted"),
|
yyoverflow (YY_("memory exhausted"),
|
||||||
&yyss1, yysize * YYSIZEOF (*yyssp),
|
&yyss1, yysize * YYSIZEOF (*yyssp), // cppcheck_suppress syntaxError
|
||||||
&yyvs1, yysize * YYSIZEOF (*yyvsp),
|
&yyvs1, yysize * YYSIZEOF (*yyvsp),
|
||||||
|
&yyls1, yysize * YYSIZEOF (*yylsp),
|
||||||
&yystacksize);
|
&yystacksize);
|
||||||
|
yyls = yyls1;
|
||||||
yyss = yyss1;
|
yyss = yyss1;
|
||||||
yyvs = yyvs1;
|
yyvs = yyvs1;
|
||||||
}
|
}
|
||||||
@ -1085,7 +1089,7 @@ yysetstate:
|
|||||||
yy_state_t *yyss1 = yyss;
|
yy_state_t *yyss1 = yyss;
|
||||||
union yyalloc *yyptr =
|
union yyalloc *yyptr =
|
||||||
YY_CAST (union yyalloc *,
|
YY_CAST (union yyalloc *,
|
||||||
YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
|
YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); // cppcheck_suppress sizeofwithnumericparameter
|
||||||
if (! yyptr)
|
if (! yyptr)
|
||||||
YYNOMEM;
|
YYNOMEM;
|
||||||
YYSTACK_RELOCATE (yyss_alloc, yyss);
|
YYSTACK_RELOCATE (yyss_alloc, yyss);
|
||||||
@ -1222,25 +1226,25 @@ yyreduce:
|
|||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
case 2: /* fullline: expression */
|
case 2: /* fullline: expression */
|
||||||
#line 94 "expression.y"
|
|
||||||
{
|
{
|
||||||
DEB((D_EVENT, "[yacc] expression return %d", yyvsp[0]));
|
DEB((D_EVENT, "[yacc] expression return %d", yyvsp[0]));
|
||||||
expr_result = yyvsp[0];
|
expr_result = yyvsp[0];
|
||||||
}
|
}
|
||||||
#line 1231 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: /* expression: elemexp */
|
case 3: /* expression: elemexp */
|
||||||
#line 100 "expression.y"
|
|
||||||
{
|
{
|
||||||
DEB((D_EVENT, "[yacc] elemexp return %d", yyvsp[0]));
|
DEB((D_EVENT, "[yacc] elemexp return %d", yyvsp[0]));
|
||||||
yyval = yyvsp[0];
|
yyval = yyvsp[0];
|
||||||
}
|
}
|
||||||
#line 1240 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: /* expression: NOT expression */
|
case 4: /* expression: NOT expression */
|
||||||
#line 105 "expression.y"
|
|
||||||
{
|
{
|
||||||
DEB((D_EVENT, "[yacc] not exprression %d", yyvsp[0]));
|
DEB((D_EVENT, "[yacc] not exprression %d", yyvsp[0]));
|
||||||
if( (yyvsp[0]) < 0 )
|
if( (yyvsp[0]) < 0 )
|
||||||
@ -1248,190 +1252,190 @@ yyreduce:
|
|||||||
else
|
else
|
||||||
yyval = !(yyvsp[0]);
|
yyval = !(yyvsp[0]);
|
||||||
}
|
}
|
||||||
#line 1252 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5: /* expression: expression LOGOP expression */
|
case 5: /* expression: expression LOGOP expression */
|
||||||
#line 113 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_logic(yyvsp[-2], yyvsp[-1], yyvsp[0]);
|
yyval = expr_check_logic(yyvsp[-2], yyvsp[-1], yyvsp[0]);
|
||||||
}
|
}
|
||||||
#line 1260 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 6: /* expression: OPENB expression CLOSEB */
|
case 6: /* expression: OPENB expression CLOSEB */
|
||||||
#line 117 "expression.y"
|
|
||||||
{
|
{
|
||||||
DEB((D_EVENT, "eventexp: [yacc] backeted.expr %d", yyvsp[-1]));
|
DEB((D_EVENT, "eventexp: [yacc] backeted.expr %d", yyvsp[-1]));
|
||||||
yyval = yyvsp[-1];
|
yyval = yyvsp[-1];
|
||||||
}
|
}
|
||||||
#line 1269 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7: /* elemexp: INCOMING */
|
case 7: /* elemexp: INCOMING */
|
||||||
#line 123 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_incoming();
|
yyval = expr_check_incoming();
|
||||||
}
|
}
|
||||||
#line 1277 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8: /* elemexp: OUTGOING */
|
case 8: /* elemexp: OUTGOING */
|
||||||
#line 127 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_outgoing();
|
yyval = expr_check_outgoing();
|
||||||
}
|
}
|
||||||
#line 1285 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 9: /* elemexp: LISTED */
|
case 9: /* elemexp: LISTED */
|
||||||
#line 131 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_listed();
|
yyval = expr_check_listed();
|
||||||
}
|
}
|
||||||
#line 1293 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 10: /* elemexp: PROTECTED */
|
case 10: /* elemexp: PROTECTED */
|
||||||
#line 135 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_protected();
|
yyval = expr_check_protected();
|
||||||
}
|
}
|
||||||
#line 1301 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 11: /* elemexp: FLAG flagstring */
|
case 11: /* elemexp: FLAG flagstring */
|
||||||
#line 139 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = yyvsp[0];
|
yyval = yyvsp[0];
|
||||||
}
|
}
|
||||||
#line 1309 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 12: /* elemexp: CONNSPEED AROP NUMBER */
|
case 12: /* elemexp: CONNSPEED AROP NUMBER */
|
||||||
#line 143 "expression.y"
|
|
||||||
{
|
{
|
||||||
if( state.valid && state.connspeed > 0 )
|
if( state.valid && state.connspeed > 0 )
|
||||||
yyval = expr_check_arop(state.connspeed, yyvsp[-1], yyvsp[0]);
|
yyval = expr_check_arop(state.connspeed, yyvsp[-1], yyvsp[0]);
|
||||||
else
|
else
|
||||||
yyval = -1;
|
yyval = -1;
|
||||||
}
|
}
|
||||||
#line 1320 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 13: /* elemexp: SPEED AROP NUMBER */
|
case 13: /* elemexp: SPEED AROP NUMBER */
|
||||||
#line 150 "expression.y"
|
|
||||||
{
|
{
|
||||||
if( state.valid && state.node.speed > 0 )
|
if( state.valid && state.node.speed > 0 )
|
||||||
yyval = expr_check_arop(state.node.speed, yyvsp[-1], yyvsp[0]);
|
yyval = expr_check_arop(state.node.speed, yyvsp[-1], yyvsp[0]);
|
||||||
else
|
else
|
||||||
yyval = -1;
|
yyval = -1;
|
||||||
}
|
}
|
||||||
#line 1331 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 14: /* elemexp: TZ AROP NUMBER */
|
case 14: /* elemexp: TZ AROP NUMBER */
|
||||||
#line 157 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_arop(time_gmtoffset(), yyvsp[-1], yyvsp[0]);
|
yyval = expr_check_arop(time_gmtoffset(), yyvsp[-1], yyvsp[0]);
|
||||||
}
|
}
|
||||||
#line 1339 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 15: /* elemexp: PHONE TEXT */
|
case 15: /* elemexp: PHONE TEXT */
|
||||||
#line 161 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_phone(expr_p_text);
|
yyval = expr_check_phone(expr_p_text);
|
||||||
}
|
}
|
||||||
#line 1347 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 16: /* elemexp: TIME timestring */
|
case 16: /* elemexp: TIME timestring */
|
||||||
#line 165 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = yyvsp[0];
|
yyval = yyvsp[0];
|
||||||
}
|
}
|
||||||
#line 1355 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 17: /* elemexp: EXEC TEXT */
|
case 17: /* elemexp: EXEC TEXT */
|
||||||
#line 169 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_exec(expr_p_text);
|
yyval = expr_check_exec(expr_p_text);
|
||||||
}
|
}
|
||||||
#line 1363 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 18: /* elemexp: EXIST TEXT */
|
case 18: /* elemexp: EXIST TEXT */
|
||||||
#line 173 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_exist(expr_p_text);
|
yyval = expr_check_exist(expr_p_text);
|
||||||
}
|
}
|
||||||
#line 1371 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 19: /* elemexp: PORT TEXT */
|
case 19: /* elemexp: PORT TEXT */
|
||||||
#line 177 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_port(expr_p_text);
|
yyval = expr_check_port(expr_p_text);
|
||||||
}
|
}
|
||||||
#line 1379 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 20: /* elemexp: MAILER TEXT */
|
case 20: /* elemexp: MAILER TEXT */
|
||||||
#line 181 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_mailer(expr_p_text);
|
yyval = expr_check_mailer(expr_p_text);
|
||||||
}
|
}
|
||||||
#line 1387 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 21: /* elemexp: TEXT */
|
case 21: /* elemexp: TEXT */
|
||||||
#line 185 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_addr(expr_p_text);
|
yyval = expr_check_addr(expr_p_text);
|
||||||
if( yyval == -2 )
|
if( yyval == -2 )
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
#line 1397 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 22: /* flagstring: TEXT */
|
case 22: /* flagstring: TEXT */
|
||||||
#line 192 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_flag(expr_p_text);
|
yyval = expr_check_flag(expr_p_text);
|
||||||
}
|
}
|
||||||
#line 1405 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 23: /* flagstring: TEXT COMMA flagstring */
|
case 23: /* flagstring: TEXT COMMA flagstring */
|
||||||
#line 196 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_logic(yyvsp[-2], OR, yyvsp[0]);
|
yyval = expr_check_logic(yyvsp[-2], OR, yyvsp[0]);
|
||||||
}
|
}
|
||||||
#line 1413 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 24: /* timestring: TEXT */
|
case 24: /* timestring: TEXT */
|
||||||
#line 201 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_time(expr_p_text);
|
yyval = expr_check_time(expr_p_text);
|
||||||
if( yyval == -2 )
|
if( yyval == -2 )
|
||||||
YYABORT;
|
YYABORT;
|
||||||
}
|
}
|
||||||
#line 1423 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 25: /* timestring: TEXT COMMA timestring */
|
case 25: /* timestring: TEXT COMMA timestring */
|
||||||
#line 207 "expression.y"
|
|
||||||
{
|
{
|
||||||
yyval = expr_check_logic(yyvsp[-2], OR, yyvsp[0]);
|
yyval = expr_check_logic(yyvsp[-2], OR, yyvsp[0]);
|
||||||
}
|
}
|
||||||
#line 1431 "expression.tab.c"
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
#line 1435 "expression.tab.c"
|
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
@ -1624,7 +1628,7 @@ yyreturnlab:
|
|||||||
return yyresult;
|
return yyresult;
|
||||||
}
|
}
|
||||||
|
|
||||||
#line 211 "expression.y"
|
|
||||||
|
|
||||||
|
|
||||||
#include "expression_lex.c"
|
#include "expression_lex.c"
|
||||||
@ -1777,7 +1781,14 @@ static int expr_check_mailer(const char *str)
|
|||||||
|
|
||||||
static int expr_check_addr(const char *str)
|
static int expr_check_addr(const char *str)
|
||||||
{
|
{
|
||||||
s_faddr addr;
|
s_faddr addr = {
|
||||||
|
.inetform = false,
|
||||||
|
.zone = 0,
|
||||||
|
.net = 0,
|
||||||
|
.node = 0,
|
||||||
|
.point = 0,
|
||||||
|
.domain = '\0' };
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
char abuf1[BF_MAXADDRSTR+1];
|
char abuf1[BF_MAXADDRSTR+1];
|
||||||
char abuf2[BF_MAXADDRSTR+1];
|
char abuf2[BF_MAXADDRSTR+1];
|
||||||
|
|||||||
@ -137,7 +137,7 @@ elemexp : INCOMING
|
|||||||
}
|
}
|
||||||
| FLAG flagstring
|
| FLAG flagstring
|
||||||
{
|
{
|
||||||
$$ = $2;
|
$$ = $2; //-V1037
|
||||||
}
|
}
|
||||||
| CONNSPEED AROP NUMBER
|
| CONNSPEED AROP NUMBER
|
||||||
{
|
{
|
||||||
@ -163,7 +163,7 @@ elemexp : INCOMING
|
|||||||
}
|
}
|
||||||
| TIME timestring
|
| TIME timestring
|
||||||
{
|
{
|
||||||
$$ = $2;
|
$$ = $2; //-V1037
|
||||||
}
|
}
|
||||||
| EXEC TEXT
|
| EXEC TEXT
|
||||||
{
|
{
|
||||||
@ -194,7 +194,7 @@ flagstring : TEXT
|
|||||||
}
|
}
|
||||||
| TEXT COMMA flagstring
|
| TEXT COMMA flagstring
|
||||||
{
|
{
|
||||||
$$ = expr_check_logic($1, OR, $3);
|
$$ = expr_check_logic($1, OR, $3); //-V1037
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
timestring : TEXT
|
timestring : TEXT
|
||||||
@ -205,7 +205,7 @@ timestring : TEXT
|
|||||||
}
|
}
|
||||||
| TEXT COMMA timestring
|
| TEXT COMMA timestring
|
||||||
{
|
{
|
||||||
$$ = expr_check_logic($1, OR, $3);
|
$$ = expr_check_logic($1, OR, $3); //-V1037
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
%%
|
%%
|
||||||
@ -360,7 +360,14 @@ static int expr_check_mailer(const char *str)
|
|||||||
|
|
||||||
static int expr_check_addr(const char *str)
|
static int expr_check_addr(const char *str)
|
||||||
{
|
{
|
||||||
s_faddr addr;
|
s_faddr addr = {
|
||||||
|
.inetform = false,
|
||||||
|
.zone = 0,
|
||||||
|
.net = 0,
|
||||||
|
.node = 0,
|
||||||
|
.point = 0,
|
||||||
|
.domain = '\0' };
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
char abuf1[BF_MAXADDRSTR+1];
|
char abuf1[BF_MAXADDRSTR+1];
|
||||||
char abuf2[BF_MAXADDRSTR+1];
|
char abuf2[BF_MAXADDRSTR+1];
|
||||||
@ -368,6 +375,7 @@ static int expr_check_addr(const char *str)
|
|||||||
DEB((D_EVENT, "[yacc] addr: \"%s\" (session with \"%s\")",
|
DEB((D_EVENT, "[yacc] addr: \"%s\" (session with \"%s\")",
|
||||||
ftn_addrstr(abuf1, addr),
|
ftn_addrstr(abuf1, addr),
|
||||||
ftn_addrstr(abuf2, state.node.addr)));
|
ftn_addrstr(abuf2, state.node.addr)));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( !state.valid )
|
if( !state.valid )
|
||||||
|
|||||||
@ -115,7 +115,7 @@ static void req_readfrlist(char *fname, s_frlist **frlist, int magic)
|
|||||||
(*ptrl) = (s_frlist*)xmalloc(sizeof(s_frlist));
|
(*ptrl) = (s_frlist*)xmalloc(sizeof(s_frlist));
|
||||||
memset(*ptrl, '\0', sizeof(s_frlist));
|
memset(*ptrl, '\0', sizeof(s_frlist));
|
||||||
|
|
||||||
if( path && *path ) (*ptrl)->path = xstrcpy(path);
|
if( *path ) (*ptrl)->path = xstrcpy(path);
|
||||||
if( !magic && *(path + strlen(path) - 1) != DIRSEPCHR )
|
if( !magic && *(path + strlen(path) - 1) != DIRSEPCHR )
|
||||||
{
|
{
|
||||||
/* add trailing DIRSEP ('/' or ..) to paths */
|
/* add trailing DIRSEP ('/' or ..) to paths */
|
||||||
@ -200,9 +200,18 @@ static void req_proc_ext(s_freq *freq, char *reqname)
|
|||||||
char srfname[L_tmpnam+5];
|
char srfname[L_tmpnam+5];
|
||||||
char rspname[L_tmpnam+5];
|
char rspname[L_tmpnam+5];
|
||||||
char *comline = NULL;
|
char *comline = NULL;
|
||||||
|
char *chunk;
|
||||||
|
|
||||||
if( tmpnam(srfname) )
|
chunk = xmalloc(L_tmpnam+1);
|
||||||
|
if ( chunk )
|
||||||
{
|
{
|
||||||
|
getrandname(chunk, L_tmpnam);
|
||||||
|
chunk[L_tmpnam]='\0';
|
||||||
|
strnxcpy(srfname, chunk, L_tmpnam);
|
||||||
|
free(chunk);
|
||||||
|
|
||||||
|
//if( tmpnam(srfname) )
|
||||||
|
//{
|
||||||
strncpy(rspname, srfname, L_tmpnam+4);
|
strncpy(rspname, srfname, L_tmpnam+4);
|
||||||
rspname[L_tmpnam+4] = '\0';
|
rspname[L_tmpnam+4] = '\0';
|
||||||
strcat(srfname, ".srf");
|
strcat(srfname, ".srf");
|
||||||
|
|||||||
@ -16,10 +16,11 @@
|
|||||||
#include "logger.h"
|
#include "logger.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
#include <netinet/tcp.h>
|
||||||
|
|
||||||
#define DEFAULT_PORT 60179 /* Birthday .. mother fucker :) */
|
#define DEFAULT_PORT 60179 /* Birthday .. mother fucker :) */
|
||||||
|
|
||||||
struct addrinfo *ai = NULL;
|
struct addrinfo *paddrinfo = NULL;
|
||||||
|
|
||||||
static RETSIGTYPE tcpip_interrupt(int sig)
|
static RETSIGTYPE tcpip_interrupt(int sig)
|
||||||
{
|
{
|
||||||
@ -39,10 +40,13 @@ static RETSIGTYPE tcpip_brokenpipe(int sig)
|
|||||||
static int tcpip_connect2(struct addrinfo *ai)
|
static int tcpip_connect2(struct addrinfo *ai)
|
||||||
{
|
{
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
|
bool connected = FALSE;
|
||||||
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
|
char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
|
||||||
|
int synRetries = 2; // Send a total of 3 SYN packets => Timeout ~7s
|
||||||
|
int usertimeout = 3000;
|
||||||
struct addrinfo *rai;
|
struct addrinfo *rai;
|
||||||
|
|
||||||
|
|
||||||
for (rai = ai; rai != NULL; rai = rai->ai_next)
|
for (rai = ai; rai != NULL; rai = rai->ai_next)
|
||||||
{
|
{
|
||||||
if (getnameinfo(rai->ai_addr, rai->ai_addrlen, hbuf, sizeof(hbuf), sbuf,
|
if (getnameinfo(rai->ai_addr, rai->ai_addrlen, hbuf, sizeof(hbuf), sbuf,
|
||||||
@ -55,14 +59,34 @@ static int tcpip_connect2(struct addrinfo *ai)
|
|||||||
{
|
{
|
||||||
DEB((D_INFO, "tcpip_connect2: socket error"));
|
DEB((D_INFO, "tcpip_connect2: socket error"));
|
||||||
}
|
}
|
||||||
else break;
|
else
|
||||||
|
{
|
||||||
|
DEB((D_INFO, "tcpip_connect2: socket opened - try to connect"));
|
||||||
|
setsockopt(fd, IPPROTO_TCP, TCP_SYNCNT, &synRetries, sizeof(synRetries));
|
||||||
|
setsockopt(fd, IPPROTO_TCP, TCP_USER_TIMEOUT, &usertimeout, sizeof(usertimeout));
|
||||||
|
if( connect(fd, rai->ai_addr, rai->ai_addrlen) == -1 )
|
||||||
|
{
|
||||||
|
DEB((D_INFO, "tcpip_connect2: can't connect %s", hbuf));
|
||||||
|
logerr("can't connect to %s", hbuf);
|
||||||
|
close(fd);
|
||||||
|
fd = -1;
|
||||||
|
} else {
|
||||||
|
DEB((D_INFO, "tcpip_connect2: connect"));
|
||||||
|
connected = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
hbuf[0]='\0';
|
hbuf[0]='\0';
|
||||||
sbuf[0]='\0';
|
sbuf[0]='\0';
|
||||||
|
if (!connected) {
|
||||||
|
DEB((D_INFO, "tcpip_connect2: socket not opened - returning"));
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DEB((D_INFO, "tcpip_connect2: socket success: %d", fd));
|
DEB((D_INFO, "tcpip_connect2: socket: %d", fd));
|
||||||
if (fd < 0 )
|
if ((fd < 0) || !connected)
|
||||||
{
|
{
|
||||||
|
DEB((D_INFO, "tcpip_connect2: can't create socket and connect"));
|
||||||
logerr("can't create socket");
|
logerr("can't create socket");
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
@ -73,6 +97,7 @@ static int tcpip_connect2(struct addrinfo *ai)
|
|||||||
(void)close(0);
|
(void)close(0);
|
||||||
if( dup(fd) != 0 )
|
if( dup(fd) != 0 )
|
||||||
{
|
{
|
||||||
|
DEB((D_INFO, "tcpip_connect2: can't dup socket to stdin"));
|
||||||
logerr("cannot dup socket to stdin");
|
logerr("cannot dup socket to stdin");
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
@ -92,7 +117,7 @@ static int tcpip_connect2(struct addrinfo *ai)
|
|||||||
logerr("cannot dup stdin to stderr");
|
logerr("cannot dup stdin to stderr");
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
DEB((D_INFO, "tcpip_connect2: stdin|out|err are connected"));
|
||||||
if( fd > 2 ) (void)close(fd);
|
if( fd > 2 ) (void)close(fd);
|
||||||
|
|
||||||
/* switch off stdio buffering */
|
/* switch off stdio buffering */
|
||||||
@ -103,22 +128,24 @@ static int tcpip_connect2(struct addrinfo *ai)
|
|||||||
clearerr(stdin);
|
clearerr(stdin);
|
||||||
clearerr(stdout);
|
clearerr(stdout);
|
||||||
clearerr(stderr);
|
clearerr(stderr);
|
||||||
|
DEB((D_INFO, "tcpip_connect2: start connecting"));
|
||||||
if( connect(0, rai->ai_addr, rai->ai_addrlen) == -1 )
|
//if( connect(0, rai->ai_addr, rai->ai_addrlen) == -1 )
|
||||||
{
|
//{
|
||||||
logerr("can't connect to %s", hbuf);
|
// DEB((D_INFO, "tcpip_connect2: can't connect %s", hbuf));
|
||||||
close(0);
|
// logerr("can't connect to %s", hbuf);
|
||||||
close(1);
|
//
|
||||||
close(2);
|
// close(0);
|
||||||
return 1;
|
// close(1);
|
||||||
}
|
// close(2);
|
||||||
|
// return 1;
|
||||||
|
//}
|
||||||
|
|
||||||
if( tcpip_init() )
|
if( tcpip_init() )
|
||||||
{
|
{
|
||||||
tcpip_shutdown();
|
tcpip_shutdown();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
DEB((D_INFO, "tcpip_connect2: TCP/IP connect success to %s on service %s", hbuf, sbuf));
|
||||||
(void)log("TCP/IP connect success to %s on service %s", hbuf, sbuf);
|
(void)log("TCP/IP connect success to %s on service %s", hbuf, sbuf);
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
@ -171,7 +198,7 @@ int tcpip_connect(const char *hostname, e_tcpmode tcpmode)
|
|||||||
//aihints.ai_socktype = SOCK_STREAM;
|
//aihints.ai_socktype = SOCK_STREAM;
|
||||||
aihints.ai_protocol = IPPROTO_TCP;
|
aihints.ai_protocol = IPPROTO_TCP;
|
||||||
|
|
||||||
nameres = getaddrinfo ( host, port, &aihints, &ai );
|
nameres = getaddrinfo ( host, port, &aihints, &paddrinfo );
|
||||||
if ( nameres != 0 )
|
if ( nameres != 0 )
|
||||||
{
|
{
|
||||||
rc = 1;
|
rc = 1;
|
||||||
@ -208,10 +235,10 @@ int tcpip_connect(const char *hostname, e_tcpmode tcpmode)
|
|||||||
|
|
||||||
if( host ) { free(host); host = NULL; }
|
if( host ) { free(host); host = NULL; }
|
||||||
DEB((D_INFO, "tcpip_connect: resolver got result!"));
|
DEB((D_INFO, "tcpip_connect: resolver got result!"));
|
||||||
aisave = ai;
|
aisave = paddrinfo;
|
||||||
|
|
||||||
if (rc == 0 )
|
if (rc == 0 )
|
||||||
rc = tcpip_connect2(ai);
|
rc = tcpip_connect2(paddrinfo);
|
||||||
|
|
||||||
freeaddrinfo( aisave );
|
freeaddrinfo( aisave );
|
||||||
|
|
||||||
|
|||||||
@ -116,7 +116,7 @@ static pid_t lock_read_pid(const char *lckname)
|
|||||||
if( len == sizeof(pid) || sscanf(buf, "%d", &pid) != 1 || pid == 0 )
|
if( len == sizeof(pid) || sscanf(buf, "%d", &pid) != 1 || pid == 0 )
|
||||||
{
|
{
|
||||||
/* We found binary lock file? */
|
/* We found binary lock file? */
|
||||||
pid = *((int *)buf);
|
pid = *((u_int *)buf); //-V1032
|
||||||
#ifndef LOCK_BINARY
|
#ifndef LOCK_BINARY
|
||||||
log("warning: found binary lock file %s", lckname);
|
log("warning: found binary lock file %s", lckname);
|
||||||
#endif
|
#endif
|
||||||
@ -197,12 +197,15 @@ static int lock_create(const char *lckname, const char *tmpname)
|
|||||||
int rc, fd;
|
int rc, fd;
|
||||||
int tries;
|
int tries;
|
||||||
|
|
||||||
|
|
||||||
#ifdef LOCK_BINARY
|
#ifdef LOCK_BINARY
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
#else
|
#else
|
||||||
char buf[32];
|
char buf[32];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ASSERT(lckname != NULL && tmpname != NULL);
|
ASSERT(lckname != NULL && tmpname != NULL);
|
||||||
|
|
||||||
if( (fd = open(tmpname, O_CREAT | O_RDWR, 0644)) < 0 )
|
if( (fd = open(tmpname, O_CREAT | O_RDWR, 0644)) < 0 )
|
||||||
@ -299,8 +302,7 @@ int port_checklock(const char *lockdir, const s_modemport *modemport)
|
|||||||
|
|
||||||
rc = lock_check(lckname);
|
rc = lock_check(lckname);
|
||||||
|
|
||||||
if( lckname )
|
free(lckname);
|
||||||
free(lckname);
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@ -312,20 +314,24 @@ int port_lock(const char *lockdir, const s_modemport *modemport)
|
|||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
char *lckname;
|
char *lckname;
|
||||||
char *tmpname, *p_tmpname;
|
char *tmpname, *p_tmpname, *chunk;
|
||||||
|
|
||||||
if( *lockdir )
|
if( *lockdir )
|
||||||
tmpname = xstrcpy(lockdir);
|
tmpname = xstrcpy(lockdir);
|
||||||
else
|
else
|
||||||
tmpname = xstrcpy(BFORCE_LOCK_DIR);
|
tmpname = xstrcpy(BFORCE_LOCK_DIR);
|
||||||
|
|
||||||
tmpname = xstrcat(tmpname, "bfXXXXXX");
|
//tmpname = xstrcat(tmpname, "bfXXXXXX");
|
||||||
|
|
||||||
if( (p_tmpname = mktemp(tmpname)) == NULL )
|
chunk = xmalloc(7);
|
||||||
{
|
getrandname(chunk,6);
|
||||||
logerr("can't generate unique file name from \"%s\"", tmpname);
|
p_tmpname = string_concat(tmpname, "bf", chunk, '\0');
|
||||||
free(tmpname); return 1;
|
|
||||||
}
|
//if( (p_tmpname = mktemp(tmpname)) == NULL )
|
||||||
|
//{
|
||||||
|
// logerr("can't generate unique file name from \"%s\"", tmpname);
|
||||||
|
// free(tmpname); return 1;
|
||||||
|
//}
|
||||||
|
|
||||||
if( (lckname = lock_getname(lockdir, modemport)) == NULL )
|
if( (lckname = lock_getname(lockdir, modemport)) == NULL )
|
||||||
{
|
{
|
||||||
@ -340,8 +346,7 @@ int port_lock(const char *lockdir, const s_modemport *modemport)
|
|||||||
|
|
||||||
if( tmpname )
|
if( tmpname )
|
||||||
free(tmpname);
|
free(tmpname);
|
||||||
if( lckname )
|
free(lckname);
|
||||||
free(lckname);
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
/*
|
/*
|
||||||
* Local variables for logger
|
* Local variables for logger
|
||||||
*/
|
*/
|
||||||
static FILE *log_fp = NULL;
|
static FILE *log_fp = NULL;
|
||||||
static char log_name[BF_MAXPATH+1] = BFORCE_LOGFILE;
|
static char log_name[BF_MAXPATH+1] = BFORCE_LOGFILE;
|
||||||
static char log_extension[32] = "";
|
static char log_extension[32] = "";
|
||||||
static char log_ident[32] = "";
|
static char log_ident[32] = "";
|
||||||
@ -31,7 +31,7 @@ static char log_ttyname[32] = "";
|
|||||||
/*
|
/*
|
||||||
* Local variables needed to make debug work
|
* Local variables needed to make debug work
|
||||||
*/
|
*/
|
||||||
static FILE *debug_fp = NULL;
|
static FILE *debug_fp = NULL;
|
||||||
static long debug_current_debuglevel = BFORCE_DEBLEVEL;
|
static long debug_current_debuglevel = BFORCE_DEBLEVEL;
|
||||||
static char debug_name[BF_MAXPATH+1] = BFORCE_DEBFILE;
|
static char debug_name[BF_MAXPATH+1] = BFORCE_DEBFILE;
|
||||||
static bool debug_invalid_name = FALSE;
|
static bool debug_invalid_name = FALSE;
|
||||||
@ -58,6 +58,7 @@ struct debuglevel {
|
|||||||
{ "Daemon", D_DAEMON },
|
{ "Daemon", D_DAEMON },
|
||||||
{ "Free", D_FREE },
|
{ "Free", D_FREE },
|
||||||
{ "24554", D_24554 },
|
{ "24554", D_24554 },
|
||||||
|
{ "Index", D_INDEX },
|
||||||
// { "Daemon", D_DAEMON },
|
// { "Daemon", D_DAEMON },
|
||||||
{ "Full", D_FULL },
|
{ "Full", D_FULL },
|
||||||
{ NULL, 0 }
|
{ NULL, 0 }
|
||||||
@ -123,7 +124,7 @@ int log_open(const char *logname, const char *ext, const char *tty)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( log_name )
|
if( log_name[0] )
|
||||||
{
|
{
|
||||||
/* Open previously set log file */
|
/* Open previously set log file */
|
||||||
|
|
||||||
@ -144,7 +145,7 @@ int log_close(void)
|
|||||||
|
|
||||||
ASSERT(log_fp);
|
ASSERT(log_fp);
|
||||||
|
|
||||||
if( log_fp )
|
if( log_fp ) //-V0547
|
||||||
{
|
{
|
||||||
rc = fclose(log_fp);
|
rc = fclose(log_fp);
|
||||||
DEB((D_INFO,"Closing log file."));
|
DEB((D_INFO,"Closing log file."));
|
||||||
@ -161,7 +162,7 @@ int log_reopen(const char *logname, const char *ext, const char *tty)
|
|||||||
if( log_isopened() )
|
if( log_isopened() )
|
||||||
{
|
{
|
||||||
if( !strcmp(logname, log_name)
|
if( !strcmp(logname, log_name)
|
||||||
&& !strcmp(log_extension ? log_extension : "", ext ? ext : "") )
|
&& !strcmp(log_extension, ext ? ext : "") )
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -172,7 +173,7 @@ int log_reopen(const char *logname, const char *ext, const char *tty)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int log(const char *s, ...)
|
void log(const char *s, ...)
|
||||||
|
|
||||||
{
|
{
|
||||||
char timestr[40];
|
char timestr[40];
|
||||||
@ -212,10 +213,10 @@ int log(const char *s, ...)
|
|||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
return 0;
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int logerr(const char *s, ...)
|
void logerr(const char *s, ...)
|
||||||
{
|
{
|
||||||
char timestr[40];
|
char timestr[40];
|
||||||
va_list args;
|
va_list args;
|
||||||
@ -281,7 +282,7 @@ int logerr(const char *s, ...)
|
|||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
return 0;
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_SYSLOG */
|
#endif /* USE_SYSLOG */
|
||||||
@ -308,7 +309,7 @@ int log_open(const char *logname, const char *ext, const char *tty)
|
|||||||
p = xstrcat(p, BF_VERSION);
|
p = xstrcat(p, BF_VERSION);
|
||||||
int fac = conf_number(cf_syslog_facility);
|
int fac = conf_number(cf_syslog_facility);
|
||||||
if( tty && *tty )
|
if( tty && *tty )
|
||||||
strncpy(p, tty, sizeof(p));
|
strncpy(p, tty, strlen(p));
|
||||||
openlog(p, LOG_PID, fac);
|
openlog(p, LOG_PID, fac);
|
||||||
slog_active = TRUE;
|
slog_active = TRUE;
|
||||||
return 0;
|
return 0;
|
||||||
@ -330,7 +331,7 @@ int log_close(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int log(const char *s, ...)
|
void log(const char *s, ...)
|
||||||
|
|
||||||
{
|
{
|
||||||
char timestr[40];
|
char timestr[40];
|
||||||
@ -357,10 +358,10 @@ int log(const char *s, ...)
|
|||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
return 0;
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int logerr(const char *s, ...)
|
void logerr(const char *s, ...)
|
||||||
|
|
||||||
{
|
{
|
||||||
char timestr[40];
|
char timestr[40];
|
||||||
@ -379,7 +380,7 @@ int logerr(const char *s, ...)
|
|||||||
|
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
return 0;
|
// return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* USE_SYSLOG */
|
#endif /* USE_SYSLOG */
|
||||||
@ -463,7 +464,7 @@ int debug_open()
|
|||||||
|
|
||||||
ASSERT(debug_fp == NULL);
|
ASSERT(debug_fp == NULL);
|
||||||
|
|
||||||
if( debug_name )
|
if( debug_name[0] )
|
||||||
{
|
{
|
||||||
|
|
||||||
char log_name[PATH_MAX];
|
char log_name[PATH_MAX];
|
||||||
@ -517,7 +518,7 @@ int debug_close(void)
|
|||||||
|
|
||||||
ASSERT(debug_fp != NULL);
|
ASSERT(debug_fp != NULL);
|
||||||
|
|
||||||
if( debug_fp )
|
if( debug_fp ) //-V0547
|
||||||
{
|
{
|
||||||
fprintf(debug_fp, "****************************************************\n");
|
fprintf(debug_fp, "****************************************************\n");
|
||||||
fprintf(debug_fp, " Closing binkleyforce debug file at %s\n",
|
fprintf(debug_fp, " Closing binkleyforce debug file at %s\n",
|
||||||
@ -530,7 +531,7 @@ int debug_close(void)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
int debug(unsigned long what, const char *str, ...)
|
void debug(unsigned long what, const char *str, ...)
|
||||||
{
|
{
|
||||||
char buf[40];
|
char buf[40];
|
||||||
va_list args;
|
va_list args;
|
||||||
@ -543,7 +544,7 @@ int debug(unsigned long what, const char *str, ...)
|
|||||||
debug_open();
|
debug_open();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( debug_fp )
|
if( debug_fp != NULL )
|
||||||
{
|
{
|
||||||
fprintf(debug_fp, "%s ", time_string_log(buf, sizeof(buf), 0));
|
fprintf(debug_fp, "%s ", time_string_log(buf, sizeof(buf), 0));
|
||||||
va_start(args, str);
|
va_start(args, str);
|
||||||
@ -554,7 +555,7 @@ int debug(unsigned long what, const char *str, ...)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
//return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|||||||
@ -243,7 +243,8 @@ void netspool_acknowledge(s_netspool_state *state)
|
|||||||
|
|
||||||
void netspool_end(s_netspool_state *state)
|
void netspool_end(s_netspool_state *state)
|
||||||
{
|
{
|
||||||
sendstr(state->socket, "END satisfied");
|
int i;
|
||||||
|
i = sendstr(state->socket, "END satisfied");
|
||||||
close(state->socket);
|
close(state->socket);
|
||||||
state->state = NS_NOTINIT;
|
state->state = NS_NOTINIT;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -56,20 +56,27 @@ int nodelist_checkflag(const char *nodeflags, const char *flag)
|
|||||||
const char *searchbase = nodeflags;
|
const char *searchbase = nodeflags;
|
||||||
char *q;
|
char *q;
|
||||||
|
|
||||||
while( p = strstr(searchbase, flag) )
|
DEB((D_NODELIST, "nodelist: checking flag \"%s\" in flags \"%s\"", flag, nodeflags));
|
||||||
{
|
if ( nodeflags ) {
|
||||||
if( p == searchbase || *(p-1) == ',' )
|
while( p = strcasestr(searchbase, flag) ) // p - found flag
|
||||||
{
|
{
|
||||||
if( (q = strchr(p, ',')) == NULL || (q - p) == strlen(flag) )
|
if ( ((p == searchbase)) || (*(p-1) == ','))
|
||||||
return 0;
|
{
|
||||||
if( (strchrnul(p, ':') - p) == strlen(flag) )
|
if( (q = strchr(p, ',')) == NULL || (q - p) == strlen(flag) ) {
|
||||||
return 0;
|
DEB((D_NODELIST, "nodelist: found flag %s", flag));
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
if( (strchrnul(p, ':') - p) == strlen(flag) ) {
|
||||||
|
DEB((D_NODELIST, "nodelist: found flag %s", flag));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
searchbase = p + 1; // avoid finding again the same
|
searchbase = p + 1; // avoid finding again the same
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -191,6 +198,54 @@ int nodelist_parse_Txy(s_node *node, const char *xy)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Pointlist string parser
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* node put here all obtained information
|
||||||
|
* str pointer to the nodelist string
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* zero value if string was parsed successfuly, and non-zero if wasn't
|
||||||
|
*/
|
||||||
|
int nodelist_parsepoint(s_node *node, char *str)
|
||||||
|
{
|
||||||
|
char *argv[NODELIST_POSFLAGS+1];
|
||||||
|
char *p;
|
||||||
|
int cnt;
|
||||||
|
|
||||||
|
DEB((D_NODELIST,"nodelist: parsepoint %s", str));
|
||||||
|
|
||||||
|
cnt = string_parse(argv, NODELIST_POSFLAGS+1, str, ',');
|
||||||
|
if( cnt < NODELIST_POSFLAGS-1 )
|
||||||
|
return -1;
|
||||||
|
DEB((D_NODELIST,"nodelist: parsepoint OK: %d", cnt));
|
||||||
|
strnxcpy(node->name, argv[NODELIST_POSNAME], sizeof(node->name));
|
||||||
|
DEB((D_NODELIST,"nodelist: parsepoint sys: %s", node->name));
|
||||||
|
strnxcpy(node->location, argv[NODELIST_POSLOCATION], sizeof(node->location));
|
||||||
|
DEB((D_NODELIST,"nodelist: parsepoint loc: %s", node->location));
|
||||||
|
strnxcpy(node->sysop, argv[NODELIST_POSSYSOP], sizeof(node->sysop));
|
||||||
|
DEB((D_NODELIST,"nodelist: parsepoint zyz: %s", node->sysop));
|
||||||
|
strnxcpy(node->phone, argv[NODELIST_POSPHONE], sizeof(node->phone));
|
||||||
|
DEB((D_NODELIST,"nodelist: parsepoint pho: %s", node->phone));
|
||||||
|
if (argv[NODELIST_POSFLAGS])
|
||||||
|
strnxcpy(node->flags, argv[NODELIST_POSFLAGS], sizeof(node->flags));
|
||||||
|
DEB((D_NODELIST,"nodelist: parsepoint fl: %s", node->flags));
|
||||||
|
if (argv[NODELIST_POSSPEED])
|
||||||
|
node->speed = atoi(argv[NODELIST_POSSPEED]);
|
||||||
|
DEB((D_NODELIST, "nodelist: Parsed common values SYS: %s, ZYZ: %s, LOC: %s, PHONE: %s", node->name, node->sysop, node->location, node->phone));
|
||||||
|
/*
|
||||||
|
* Replace all '_' by space character
|
||||||
|
*/
|
||||||
|
string_replchar(node->name, '_', ' ');
|
||||||
|
string_replchar(node->location, '_', ' ');
|
||||||
|
string_replchar(node->sysop, '_', ' ');
|
||||||
|
node->keyword = KEYWORD_POINT;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Nodelist string parser
|
* Nodelist string parser
|
||||||
*
|
*
|
||||||
@ -205,7 +260,7 @@ int nodelist_parsestring(s_node *node, char *str)
|
|||||||
{
|
{
|
||||||
char *argv[NODELIST_POSFLAGS+1];
|
char *argv[NODELIST_POSFLAGS+1];
|
||||||
char *p;
|
char *p;
|
||||||
|
DEB((D_NODELIST,"nodelist: parsestring %s", str));
|
||||||
if( string_parse(argv, NODELIST_POSFLAGS+1, str, ',') != NODELIST_POSFLAGS+1 )
|
if( string_parse(argv, NODELIST_POSFLAGS+1, str, ',') != NODELIST_POSFLAGS+1 )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -299,6 +354,78 @@ int nodelist_parsestring(s_node *node, char *str)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************
|
||||||
|
* Hidden adresses adder
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* node a node for which we add HIDDEN lines with IpAddr
|
||||||
|
* str pointer to the flags string
|
||||||
|
*
|
||||||
|
* Return value:
|
||||||
|
* -1 if error
|
||||||
|
* zero value if string had no hidden INA:, pos - num of INA's above
|
||||||
|
* first
|
||||||
|
*/
|
||||||
|
|
||||||
|
int nodelist_parsehiddenina(s_node *node,s_override *ov) {
|
||||||
|
|
||||||
|
int rc = 0;
|
||||||
|
s_override *ovr;
|
||||||
|
s_override *ovrbase = ov;
|
||||||
|
|
||||||
|
|
||||||
|
char *tmp, *p, *q;
|
||||||
|
const char *searchbase = node->flags;
|
||||||
|
int flaglen = 3;
|
||||||
|
|
||||||
|
tmp = xmalloc(BNI_MAXHOST+1);
|
||||||
|
|
||||||
|
while( p = strstr(searchbase, "INA") )
|
||||||
|
{
|
||||||
|
if( p == node->flags || *(p-1) == ',' ) // match flag
|
||||||
|
{
|
||||||
|
if( *(p+flaglen) == 0 || *(p+flaglen) == ',' )
|
||||||
|
{
|
||||||
|
// empty flag
|
||||||
|
memset(tmp, '\0', 1);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if( *(p+flaglen) == ':' ) {
|
||||||
|
// flag has data
|
||||||
|
p += flaglen + 1; // start of data
|
||||||
|
q = strchrnul(p, ','); // end of data: comma or EOS
|
||||||
|
strncpy(tmp, p, q-p);
|
||||||
|
tmp[q-p]='\0';
|
||||||
|
DEB((D_NODELIST, "nodelist: host INA is %s", node->host));
|
||||||
|
if (!strcmp(tmp, node->host)) {
|
||||||
|
DEB((D_NODELIST, "nodelist: found host INA %s", tmp));
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
DEB((D_NODELIST, "nodelist: found hidden INA %s", tmp));
|
||||||
|
rc += 1;
|
||||||
|
// let's find last override to add
|
||||||
|
while (ovrbase->hidden != NULL) ovrbase = ovrbase->hidden;
|
||||||
|
// and add new element to hiddens:
|
||||||
|
ovr = xmalloc(sizeof(s_override));
|
||||||
|
memset(ovr,'\0',sizeof(s_override));
|
||||||
|
ovr->hidden = NULL;
|
||||||
|
ovr->sIpaddr = xstrcpy(tmp);
|
||||||
|
ovr->addr = node->addr;
|
||||||
|
ovrbase->hidden = ovr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
searchbase = p + 1;
|
||||||
|
}
|
||||||
|
free(tmp);
|
||||||
|
return rc;
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Open nodelist, nodelist index, do some checks
|
* Open nodelist, nodelist index, do some checks
|
||||||
*
|
*
|
||||||
@ -455,7 +582,7 @@ s_nodelist *nodelist_open(const char *dir, char *name, int mode)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DEB((D_NODELIST, "nodelist_open: endianness = %x", (uint32_t) tmp.endian));
|
||||||
return xmemcpy(&tmp, sizeof(s_nodelist));
|
return xmemcpy(&tmp, sizeof(s_nodelist));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,6 +630,7 @@ int nodelist_checkheader(s_nodelist *nlp)
|
|||||||
(long)nlstat.st_size, (long)nlsize);
|
(long)nlstat.st_size, (long)nlsize);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
nlp->endian = buffer_getlong(buffer + 12);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -533,7 +661,7 @@ int nodelist_createheader(s_nodelist *nlp)
|
|||||||
|
|
||||||
buffer_putlong(hdrbuf + 0, nlstat.st_mtime);
|
buffer_putlong(hdrbuf + 0, nlstat.st_mtime);
|
||||||
buffer_putlong(hdrbuf + 4, nlstat.st_size);
|
buffer_putlong(hdrbuf + 4, nlstat.st_size);
|
||||||
|
buffer_putlong(hdrbuf + 12, (long) 0xDEADBEEF);
|
||||||
if( fseek(nlp->fp_index, 0L, SEEK_SET) == -1 )
|
if( fseek(nlp->fp_index, 0L, SEEK_SET) == -1 )
|
||||||
{
|
{
|
||||||
logerr("cannot seek to zero offset of index");
|
logerr("cannot seek to zero offset of index");
|
||||||
@ -564,10 +692,10 @@ int nodelist_close(s_nodelist *nlp)
|
|||||||
|
|
||||||
ASSERT(nlp && nlp->fp_nodelist && nlp->fp_index);
|
ASSERT(nlp && nlp->fp_nodelist && nlp->fp_index);
|
||||||
|
|
||||||
if( nlp->fp_nodelist && file_close(nlp->fp_nodelist) )
|
if( nlp->fp_nodelist && file_close(nlp->fp_nodelist) ) //-V0560
|
||||||
logerr("cannot close nodelist \"%s\"", nlp->name_nodelist);
|
logerr("cannot close nodelist \"%s\"", nlp->name_nodelist);
|
||||||
|
|
||||||
if( nlp->fp_index && file_close(nlp->fp_index) )
|
if( nlp->fp_index && file_close(nlp->fp_index) ) //-V0560
|
||||||
{
|
{
|
||||||
logerr("cannot close nodelist index \"%s\"", nlp->name_index);
|
logerr("cannot close nodelist index \"%s\"", nlp->name_index);
|
||||||
rc = 1;
|
rc = 1;
|
||||||
@ -590,7 +718,9 @@ int nodelist_putindex(s_nodelist *nlp, const s_bni *bni)
|
|||||||
buffer_putint(buffer + 6, bni->point);
|
buffer_putint(buffer + 6, bni->point);
|
||||||
buffer_putint(buffer + 8, bni->hub);
|
buffer_putint(buffer + 8, bni->hub);
|
||||||
buffer_putlong(buffer + 10, bni->offset);
|
buffer_putlong(buffer + 10, bni->offset);
|
||||||
|
if (bni->point != 0) {
|
||||||
|
DEB((D_NODELIST, "nodelist: findindex found point z: %d, n: %d, l: %d, p: %d, offset: %l", bni->zone, bni->net, bni->node, bni->point, bni->offset));
|
||||||
|
}
|
||||||
if( fwrite(buffer, sizeof(buffer), 1, nlp->fp_index) != 1 )
|
if( fwrite(buffer, sizeof(buffer), 1, nlp->fp_index) != 1 )
|
||||||
{
|
{
|
||||||
logerr("error writing nodelist index file \"%s\"", nlp->name_index);
|
logerr("error writing nodelist index file \"%s\"", nlp->name_index);
|
||||||
@ -625,6 +755,10 @@ int nodelist_findindex(s_nodelist *nlp, s_bni *bni, s_faddr addr)
|
|||||||
bni->point = buffer_getint(p + 6);
|
bni->point = buffer_getint(p + 6);
|
||||||
bni->hub = buffer_getint(p + 8);
|
bni->hub = buffer_getint(p + 8);
|
||||||
bni->offset = buffer_getlong(p + 10);
|
bni->offset = buffer_getlong(p + 10);
|
||||||
|
if ((uint32_t)nlp->endian == 0xBEEFDEAD) {
|
||||||
|
swap_long((char *)&bni->offset);
|
||||||
|
}
|
||||||
|
DEB((D_NODELIST, "nodelist: findindex found" ));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
p += NODELIST_ENTRYSIZE;
|
p += NODELIST_ENTRYSIZE;
|
||||||
@ -664,6 +798,7 @@ int nodelist_lookup_string(char *buffer, size_t buflen, s_faddr addr)
|
|||||||
*/
|
*/
|
||||||
for( ptrl = conf_first(cf_nodelist); ptrl; ptrl = conf_next(ptrl) )
|
for( ptrl = conf_first(cf_nodelist); ptrl; ptrl = conf_next(ptrl) )
|
||||||
{
|
{
|
||||||
|
DEB((D_NODELIST,"nl_lookup_string: using %s",ptrl->d.falist.what));
|
||||||
if( ftn_addrcomp_mask(addr, ptrl->d.falist.addr) == 0 )
|
if( ftn_addrcomp_mask(addr, ptrl->d.falist.addr) == 0 )
|
||||||
{
|
{
|
||||||
if( (nlp = nodelist_open(ndldir, ptrl->d.falist.what, NODELIST_READ)) )
|
if( (nlp = nodelist_open(ndldir, ptrl->d.falist.what, NODELIST_READ)) )
|
||||||
@ -672,7 +807,7 @@ int nodelist_lookup_string(char *buffer, size_t buflen, s_faddr addr)
|
|||||||
|
|
||||||
if( !rc )
|
if( !rc )
|
||||||
rc = nodelist_getstr(nlp, bni.offset, buffer, buflen);
|
rc = nodelist_getstr(nlp, bni.offset, buffer, buflen);
|
||||||
|
|
||||||
nodelist_close(nlp);
|
nodelist_close(nlp);
|
||||||
|
|
||||||
if( !rc )
|
if( !rc )
|
||||||
@ -694,10 +829,24 @@ int nodelist_lookup(s_node *node, s_faddr addr)
|
|||||||
if( nodelist_lookup_string(buf, sizeof(buf), addr) == 0 )
|
if( nodelist_lookup_string(buf, sizeof(buf), addr) == 0 )
|
||||||
{
|
{
|
||||||
node->listed = TRUE;
|
node->listed = TRUE;
|
||||||
if( nodelist_parsestring(node, buf) == -1 )
|
if (addr.point == 0)
|
||||||
{
|
{
|
||||||
log("invalid nodelist string for address %s",
|
if( nodelist_parsestring(node, buf) == -1 )
|
||||||
ftn_addrstr(abuf, addr));
|
{
|
||||||
|
DEB((D_NODELIST,"invalid nodelist string for address %s",
|
||||||
|
ftn_addrstr(abuf, addr)));
|
||||||
|
log("invalid nodelist string for address %s",
|
||||||
|
ftn_addrstr(abuf, addr));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ( nodelist_parsepoint(node, buf) == -1 )
|
||||||
|
{
|
||||||
|
DEB((D_NODELIST,"invalid nodelist string for address %s",
|
||||||
|
ftn_addrstr(abuf, addr)));
|
||||||
|
log("invalid nodelist string for address %s",
|
||||||
|
ftn_addrstr(abuf, addr));
|
||||||
|
}
|
||||||
|
node->addr = addr;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -714,5 +863,6 @@ void nodelist_initnode(s_node *node, s_faddr addr)
|
|||||||
strcpy(node->sysop, "<none>");
|
strcpy(node->sysop, "<none>");
|
||||||
strcpy(node->location, "<none>");
|
strcpy(node->location, "<none>");
|
||||||
strcpy(node->phone, "<none>");
|
strcpy(node->phone, "<none>");
|
||||||
|
strcpy(node->flags, "<none>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -152,10 +152,11 @@ int exec_redirect_descriptor(int desc, const char *fname, int flags)
|
|||||||
{
|
{
|
||||||
log("exec error: cannot open \"%s\" <--> %d (got %d)",
|
log("exec error: cannot open \"%s\" <--> %d (got %d)",
|
||||||
fname, desc, fd);
|
fname, desc, fd);
|
||||||
|
close(fd);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0; //cppcheck-suppress resourceLeak
|
||||||
}
|
}
|
||||||
|
|
||||||
int exec_command(s_exec_options *eopt)
|
int exec_command(s_exec_options *eopt)
|
||||||
@ -329,7 +330,8 @@ int xsystem(const char *command, const char *p_input, const char *p_output)
|
|||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int status;
|
int status;
|
||||||
|
int fd;
|
||||||
|
|
||||||
ASSERT(command != NULL);
|
ASSERT(command != NULL);
|
||||||
|
|
||||||
DEB((D_INFO, "xsystem: command \"%s\", input \"%s\", output \"%s\"",
|
DEB((D_INFO, "xsystem: command \"%s\", input \"%s\", output \"%s\"",
|
||||||
@ -342,27 +344,30 @@ int xsystem(const char *command, const char *p_input, const char *p_output)
|
|||||||
if( p_input )
|
if( p_input )
|
||||||
{
|
{
|
||||||
close(0);
|
close(0);
|
||||||
if( open(p_input, O_RDONLY) != 0 )
|
fd = open(p_input, O_RDONLY);
|
||||||
|
if( fd != 0 )
|
||||||
{
|
{
|
||||||
logerr("can't open stdin \"%s\"", p_input);
|
logerr("can't open stdin \"%s\"", p_input);
|
||||||
|
close(fd);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( p_output )
|
if( p_output )
|
||||||
{
|
{
|
||||||
close(1);
|
close(1);
|
||||||
if( open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600) != 1 )
|
fd = open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600);
|
||||||
|
if( fd != 1 )
|
||||||
{
|
{
|
||||||
logerr("can't open stdout \"%s\"", p_output);
|
logerr("can't open stdout \"%s\"", p_output);
|
||||||
|
close(fd);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if( p_output )
|
|
||||||
{
|
|
||||||
close(2);
|
close(2);
|
||||||
if( open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600) != 2 )
|
fd = open(p_output, O_WRONLY|O_APPEND|O_CREAT, 0600);
|
||||||
|
if( fd != 2 )
|
||||||
{
|
{
|
||||||
logerr("can't open stderr \"%s\"", p_output);
|
logerr("can't open stderr \"%s\"", p_output);
|
||||||
|
close(fd);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -369,7 +369,7 @@ static int out_bsy_convert_csy_to_bsy(s_bsylist *ptrl)
|
|||||||
out_bsy_file_link(lockname, ".csy", lockname, ".bsy")
|
out_bsy_file_link(lockname, ".csy", lockname, ".bsy")
|
||||||
|
|
||||||
/* Create BSY file in 4D outbound */
|
/* Create BSY file in 4D outbound */
|
||||||
if( !isfailed && ptrl->name_4d )
|
if( ptrl->name_4d )
|
||||||
{
|
{
|
||||||
switch( LINK_CSY_TO_BSY(ptrl->name_4d) ) {
|
switch( LINK_CSY_TO_BSY(ptrl->name_4d) ) {
|
||||||
case PLOCK_OK: locked_4d = TRUE; break;
|
case PLOCK_OK: locked_4d = TRUE; break;
|
||||||
|
|||||||
@ -46,7 +46,7 @@ char *out_getname_4d(s_faddr addr)
|
|||||||
else
|
else
|
||||||
sprintf(buf, "%04x%04x.pnt/%08x", addr.net, addr.node, addr.point);
|
sprintf(buf, "%04x%04x.pnt/%08x", addr.net, addr.node, addr.point);
|
||||||
|
|
||||||
dest = string_concat(p_outbound, buf, NULL);
|
dest = string_concat(p_outbound, buf, '\0');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ char *out_getname_4d(s_faddr addr)
|
|||||||
else
|
else
|
||||||
sprintf(buf, ".%03x/%04x%04x.pnt/%08x", addr.zone, addr.net, addr.node, addr.point);
|
sprintf(buf, ".%03x/%04x%04x.pnt/%08x", addr.zone, addr.net, addr.node, addr.point);
|
||||||
|
|
||||||
dest = string_concat(out_root, out_main, buf, NULL);
|
dest = string_concat(out_root, out_main, buf, '\0');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ char *out_getname_domain(s_faddr addr)
|
|||||||
else
|
else
|
||||||
sprintf(buf, "%04x%04x.pnt/%08x", addr.net, addr.node, addr.point);
|
sprintf(buf, "%04x%04x.pnt/%08x", addr.net, addr.node, addr.point);
|
||||||
|
|
||||||
dest = string_concat(cfptr->d.domain.path, buf, NULL);
|
dest = string_concat(cfptr->d.domain.path, buf, '\0');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -102,7 +102,7 @@ char *out_getname_amiga(s_faddr addr)
|
|||||||
if( p_amigaoutbound && *p_amigaoutbound )
|
if( p_amigaoutbound && *p_amigaoutbound )
|
||||||
{
|
{
|
||||||
sprintf(buf, "%d.%d.%d.%d", addr.zone, addr.net, addr.node, addr.point);
|
sprintf(buf, "%d.%d.%d.%d", addr.zone, addr.net, addr.node, addr.point);
|
||||||
dest = string_concat(p_amigaoutbound, buf, NULL);
|
dest = string_concat(p_amigaoutbound, buf, '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
|
|||||||
@ -155,7 +155,7 @@ static int out_scan_bso_dir(s_outbound_callback_data *callback,
|
|||||||
|
|
||||||
if( alst || !fa_list )
|
if( alst || !fa_list )
|
||||||
{
|
{
|
||||||
p = string_concat(path, dirent->d_name, "/", NULL);
|
p = string_concat(path, dirent->d_name, "/", '\0');
|
||||||
out_scan_bso_dir(callback, fa_list, addr, p, 1);
|
out_scan_bso_dir(callback, fa_list, addr, p, 1);
|
||||||
if( p ) { free(p); p = NULL; }
|
if( p ) { free(p); p = NULL; }
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ static int out_scan_bso_dir(s_outbound_callback_data *callback,
|
|||||||
|
|
||||||
if( alst || !fa_list )
|
if( alst || !fa_list )
|
||||||
{
|
{
|
||||||
callback->path = string_concat(path, dirent->d_name, NULL);
|
callback->path = string_concat(path, dirent->d_name, '\0');
|
||||||
callback->addr = *addr;
|
callback->addr = *addr;
|
||||||
callback->type = OUTB_TYPE_BSO;
|
callback->type = OUTB_TYPE_BSO;
|
||||||
callback->flavor = -1;
|
callback->flavor = -1;
|
||||||
@ -250,7 +250,7 @@ static int out_scan_bso(s_outbound_callback_data *callback,
|
|||||||
|
|
||||||
if( alst || mailfor == NULL )
|
if( alst || mailfor == NULL )
|
||||||
{
|
{
|
||||||
newpath = string_concat(out_root, dirent->d_name, "/", NULL);
|
newpath = string_concat(out_root, dirent->d_name, "/", '\0');
|
||||||
out_scan_bso_dir(callback, mailfor, &addr, newpath, 0);
|
out_scan_bso_dir(callback, mailfor, &addr, newpath, 0);
|
||||||
free(newpath);
|
free(newpath);
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ static int out_parse_name_lbox(s_faddr *addr, const char *filename)
|
|||||||
ASSERT(addr && filename);
|
ASSERT(addr && filename);
|
||||||
|
|
||||||
memset(&tmp, '\0', sizeof(s_faddr));
|
memset(&tmp, '\0', sizeof(s_faddr));
|
||||||
if( sscanf(filename, "%d.%d.%d.%d",
|
if( sscanf(filename, "%u.%u.%u.%u",
|
||||||
&tmp.zone, &tmp.net, &tmp.node, &tmp.point) == 4 )
|
&tmp.zone, &tmp.net, &tmp.node, &tmp.point) == 4 )
|
||||||
{
|
{
|
||||||
*addr = tmp;
|
*addr = tmp;
|
||||||
@ -296,7 +296,7 @@ static int out_scan_fbox_dir(s_outbound_callback_data *callback,
|
|||||||
|
|
||||||
while( (dirent = readdir(dir)) )
|
while( (dirent = readdir(dir)) )
|
||||||
{
|
{
|
||||||
callback->path = string_concat(path, dirent->d_name, NULL);
|
callback->path = string_concat(path, dirent->d_name, '\0');
|
||||||
if( is_regfile(callback->path) )
|
if( is_regfile(callback->path) )
|
||||||
{
|
{
|
||||||
callback->addr = addr;
|
callback->addr = addr;
|
||||||
@ -340,7 +340,7 @@ static int out_scan_lbox(s_outbound_callback_data *callback,
|
|||||||
alst = alst->next );
|
alst = alst->next );
|
||||||
if( alst )
|
if( alst )
|
||||||
{
|
{
|
||||||
newpath = string_concat(path, dirent->d_name, "/", NULL);
|
newpath = string_concat(path, dirent->d_name, "/", '\0');
|
||||||
(void)out_scan_fbox_dir(callback, newpath, addr, FLAVOR_HOLD);
|
(void)out_scan_fbox_dir(callback, newpath, addr, FLAVOR_HOLD);
|
||||||
free(newpath);
|
free(newpath);
|
||||||
}
|
}
|
||||||
@ -348,7 +348,7 @@ static int out_scan_lbox(s_outbound_callback_data *callback,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Scan all fileboxes */
|
/* Scan all fileboxes */
|
||||||
newpath = string_concat(path, dirent->d_name, "/", NULL);
|
newpath = string_concat(path, dirent->d_name, "/", '\0');
|
||||||
(void)out_scan_fbox_dir(callback, newpath, addr, FLAVOR_HOLD);
|
(void)out_scan_fbox_dir(callback, newpath, addr, FLAVOR_HOLD);
|
||||||
free(newpath);
|
free(newpath);
|
||||||
}
|
}
|
||||||
@ -377,7 +377,7 @@ int out_parse_name_aso(s_faddr *addr, const char *filename)
|
|||||||
ASSERT(addr && filename);
|
ASSERT(addr && filename);
|
||||||
|
|
||||||
memset(&tmp, '\0', sizeof(s_faddr));
|
memset(&tmp, '\0', sizeof(s_faddr));
|
||||||
if( sscanf(filename, "%d.%d.%d.%d.%*s", &tmp.zone,
|
if( sscanf(filename, "%u.%u.%u.%u.%*s", &tmp.zone,
|
||||||
&tmp.net, &tmp.node, &tmp.point) == 4 )
|
&tmp.net, &tmp.node, &tmp.point) == 4 )
|
||||||
{
|
{
|
||||||
*addr = tmp;
|
*addr = tmp;
|
||||||
@ -424,7 +424,7 @@ static int out_scan_aso(s_outbound_callback_data *callback,
|
|||||||
|
|
||||||
if( alst || !mailfor )
|
if( alst || !mailfor )
|
||||||
{
|
{
|
||||||
callback->path = string_concat(path, dirent->d_name, NULL);
|
callback->path = string_concat(path, dirent->d_name, '\0');
|
||||||
callback->addr = addr;
|
callback->addr = addr;
|
||||||
callback->type = OUTB_TYPE_ASO;
|
callback->type = OUTB_TYPE_ASO;
|
||||||
callback->flavor = -1;
|
callback->flavor = -1;
|
||||||
|
|||||||
@ -186,9 +186,9 @@ int out_handle_sysqueue(s_outbound_callback_data *callback)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Try to found existing entry for this address */
|
/* Try to found existing entry for this address */
|
||||||
if( (sentry = out_getsysentry((s_sysqueue*)callback->dest,
|
sentry = out_getsysentry((s_sysqueue*)callback->dest,
|
||||||
callback->addr)) == NULL )
|
callback->addr);
|
||||||
return -1;
|
// if (!sentry) return -1;
|
||||||
|
|
||||||
if( type == TYPE_NETMAIL || type == TYPE_REQUEST || type == TYPE_FILEBOX )
|
if( type == TYPE_NETMAIL || type == TYPE_REQUEST || type == TYPE_FILEBOX )
|
||||||
{
|
{
|
||||||
@ -283,7 +283,7 @@ void log_sysqueue(const s_sysqueue *q)
|
|||||||
if( q->systab[i].flavors & FLAVOR_CRASH ) strcat(tmp, "Crash,");
|
if( q->systab[i].flavors & FLAVOR_CRASH ) strcat(tmp, "Crash,");
|
||||||
if( q->systab[i].flavors & FLAVOR_NORMAL ) strcat(tmp, "Normal,");
|
if( q->systab[i].flavors & FLAVOR_NORMAL ) strcat(tmp, "Normal,");
|
||||||
if( q->systab[i].flavors & FLAVOR_HOLD ) strcat(tmp, "Hold,");
|
if( q->systab[i].flavors & FLAVOR_HOLD ) strcat(tmp, "Hold,");
|
||||||
if( tmp[0] ) tmp[strlen(tmp)-1] = '\0';
|
if( strlen(tmp)>0 ) tmp[strlen(tmp)-1] = '\0';
|
||||||
DEB((D_OUTBOUND, "log_sysqueue: \tflavors: \"%s\"", tmp));
|
DEB((D_OUTBOUND, "log_sysqueue: \tflavors: \"%s\"", tmp));
|
||||||
|
|
||||||
tmp[0] = '\0';
|
tmp[0] = '\0';
|
||||||
@ -294,7 +294,7 @@ void log_sysqueue(const s_sysqueue *q)
|
|||||||
if( q->systab[i].types & TYPE_FILEECHO ) strcat(tmp, "fileecho,");
|
if( q->systab[i].types & TYPE_FILEECHO ) strcat(tmp, "fileecho,");
|
||||||
if( q->systab[i].types & TYPE_FILEBOX ) strcat(tmp, "filebox,");
|
if( q->systab[i].types & TYPE_FILEBOX ) strcat(tmp, "filebox,");
|
||||||
if( q->systab[i].types & TYPE_FROMFLO ) strcat(tmp, "fromflo,");
|
if( q->systab[i].types & TYPE_FROMFLO ) strcat(tmp, "fromflo,");
|
||||||
if( tmp[0] ) tmp[strlen(tmp)-1] = '\0';
|
if( strlen(tmp)>0 ) tmp[strlen(tmp)-1] = '\0';
|
||||||
DEB((D_OUTBOUND, "log_sysqueue: \ttypes: \"%s\"", tmp));
|
DEB((D_OUTBOUND, "log_sysqueue: \ttypes: \"%s\"", tmp));
|
||||||
}
|
}
|
||||||
DEB((D_OUTBOUND, "log_sysqueue: END"));
|
DEB((D_OUTBOUND, "log_sysqueue: END"));
|
||||||
|
|||||||
@ -281,9 +281,9 @@ int binkp_loop(s_binkp_state *bstate) {
|
|||||||
int binkp_outgoing(s_binkp_sysinfo *local_data, s_binkp_sysinfo *remote_data)
|
int binkp_outgoing(s_binkp_sysinfo *local_data, s_binkp_sysinfo *remote_data)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
init_keys(remote_data->keys_out, local_data->passwd ? local_data->passwd : "-");
|
init_keys(remote_data->keys_out, local_data->passwd[0] ? local_data->passwd : "-");
|
||||||
init_keys(remote_data->keys_in, "-");
|
init_keys(remote_data->keys_in, "-");
|
||||||
for (p=local_data->passwd ? local_data->passwd : "-"; *p; p++)
|
for (p=local_data->passwd[0] ? local_data->passwd : "-"; *p; p++)
|
||||||
update_keys(remote_data->keys_in, (int)*p);
|
update_keys(remote_data->keys_in, (int)*p);
|
||||||
s_binkp_state s;
|
s_binkp_state s;
|
||||||
s.mode = bmode_outgoing_handshake;
|
s.mode = bmode_outgoing_handshake;
|
||||||
@ -469,8 +469,10 @@ case 2:
|
|||||||
|
|
||||||
case 3: // send password on outgoing or pw confirmation on incoming
|
case 3: // send password on outgoing or pw confirmation on incoming
|
||||||
// special empty password is sent if there is no password for the remote addr
|
// special empty password is sent if there is no password for the remote addr
|
||||||
if (bstate->mode==bmode_incoming_handshake) {
|
if (bstate->mode==bmode_incoming_handshake)
|
||||||
if (bstate->password_received) {
|
{
|
||||||
|
if (bstate->password_received)
|
||||||
|
{
|
||||||
DEB((D_24554, "send OK, password verified"));
|
DEB((D_24554, "send OK, password verified"));
|
||||||
buf[0] = BPMSG_OK;
|
buf[0] = BPMSG_OK;
|
||||||
*block_type = BINKP_BLK_CMD;
|
*block_type = BINKP_BLK_CMD;
|
||||||
@ -481,62 +483,72 @@ case 3: // send password on outgoing or pw confirmation on incoming
|
|||||||
DEB((D_24554, "waiting for password from remote"));
|
DEB((D_24554, "waiting for password from remote"));
|
||||||
return 0; // nothing to send
|
return 0; // nothing to send
|
||||||
}
|
}
|
||||||
else if (bstate->mode==bmode_outgoing_handshake) {
|
else
|
||||||
if (!bstate->address_established) {
|
{
|
||||||
DEB((D_24554, "address not received still"));
|
if (!bstate->address_established)
|
||||||
return 0;
|
{
|
||||||
}
|
DEB((D_24554, "address not received still"));
|
||||||
DEB((D_24554, "send password"));
|
return 0;
|
||||||
|
}
|
||||||
|
DEB((D_24554, "send password"));
|
||||||
|
|
||||||
buf[0] = BPMSG_PWD;
|
buf[0] = BPMSG_PWD;
|
||||||
*block_type = BINKP_BLK_CMD;
|
*block_type = BINKP_BLK_CMD;
|
||||||
|
|
||||||
if( bstate->local_data->passwd[0] == '\0' ) {
|
if( bstate->local_data->passwd[0] == '\0' )
|
||||||
*block_length = 1 + sprintf(buf+1, "-");
|
{
|
||||||
}
|
*block_length = 1 + sprintf(buf+1, "-");
|
||||||
else if( bstate->remote_data->options & BINKP_OPT_MD5 ) {
|
}
|
||||||
char digest_bin[16];
|
else
|
||||||
char digest_hex[33];
|
if( bstate->remote_data->options & BINKP_OPT_MD5 )
|
||||||
|
{
|
||||||
if(bstate->remote_data->challenge_length==0) {
|
char digest_bin[16];
|
||||||
DEB((D_24554, "waiting for challenge"));
|
char digest_hex[33];
|
||||||
return 0;
|
|
||||||
|
if(bstate->remote_data->challenge_length==0)
|
||||||
|
{
|
||||||
|
DEB((D_24554, "waiting for challenge"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
md5_cram_get(bstate->local_data->passwd,
|
||||||
|
bstate->remote_data->challenge,
|
||||||
|
bstate->remote_data->challenge_length,
|
||||||
|
digest_bin);
|
||||||
|
|
||||||
|
/* Encode digest to the hex string */
|
||||||
|
string_bin_to_hex(digest_hex, digest_bin, 16);
|
||||||
|
|
||||||
|
*block_length = 1 + sprintf(buf+1,
|
||||||
|
"CRAM-MD5-%s", digest_hex);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*block_length = 1 + sprintf(buf+1, "%s", bstate->local_data->passwd);
|
||||||
|
}
|
||||||
|
bstate->phase += 1;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
md5_cram_get(bstate->local_data->passwd, bstate->remote_data->challenge,
|
return -1;
|
||||||
bstate->remote_data->challenge_length, digest_bin);
|
|
||||||
|
|
||||||
/* Encode digest to the hex string */
|
|
||||||
string_bin_to_hex(digest_hex, digest_bin, 16);
|
|
||||||
|
|
||||||
*block_length = 1 + sprintf(buf+1, "CRAM-MD5-%s", digest_hex);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
*block_length = 1 + sprintf(buf+1, "%s", bstate->local_data->passwd);
|
|
||||||
}
|
|
||||||
bstate->phase += 1;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
log("impossible mode");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
char *p;
|
;
|
||||||
char pbuf[32];
|
char pbuf[32];
|
||||||
int pwset = 0;
|
int pwset = 0;
|
||||||
|
|
||||||
if (bstate->mode==bmode_incoming_handshake) {
|
if (bstate->mode==bmode_incoming_handshake) {
|
||||||
|
char * p;
|
||||||
DEB((D_24554, "incoming handshake is complete"));
|
DEB((D_24554, "incoming handshake is complete"));
|
||||||
bstate->complete = true;
|
bstate->complete = true;
|
||||||
|
|
||||||
for (i=0;i<state.n_remoteaddr;i++)
|
for (i=0;i<state.n_remoteaddr;i++)
|
||||||
if( !session_get_password(state.remoteaddrs[i].addr, pbuf, sizeof(pbuf)) ){
|
if( !session_get_password(state.remoteaddrs[i].addr, pbuf, sizeof(pbuf)) ){
|
||||||
pwset = 1;
|
pwset = 1;
|
||||||
init_keys(bstate->remote_data->keys_in, pbuf?pbuf:"-");
|
init_keys(bstate->remote_data->keys_in, pbuf[0]?pbuf:"-");
|
||||||
init_keys(bstate->remote_data->keys_out, "-");
|
init_keys(bstate->remote_data->keys_out, "-");
|
||||||
for (p=pbuf?pbuf:"-"; *p; p++)
|
for (p=pbuf[0]?pbuf:"-"; *p; p++)
|
||||||
update_keys(bstate->remote_data->keys_out, (int)*p);
|
update_keys(bstate->remote_data->keys_out, (int)*p);
|
||||||
}
|
}
|
||||||
//TODO: FIX incoming options
|
//TODO: FIX incoming options
|
||||||
@ -592,7 +604,7 @@ else if (bstate->mode == bmode_transfer) {
|
|||||||
case 1: //send M_FILE - M_GET forcibly sets this phase. M_GET must open needed file
|
case 1: //send M_FILE - M_GET forcibly sets this phase. M_GET must open needed file
|
||||||
DEB((D_24554, "send M_FILE"));
|
DEB((D_24554, "send M_FILE"));
|
||||||
buf[0] = BPMSG_FILE;
|
buf[0] = BPMSG_FILE;
|
||||||
*block_length = 1+sprintf(buf+1, "%s %ld %ld 0", bstate->pi->send->net_name,
|
*block_length = 1+sprintf(buf+1, "%s %zu %lu 0", bstate->pi->send->net_name,
|
||||||
bstate->pi->send->bytes_total, bstate->pi->send->mod_time);
|
bstate->pi->send->bytes_total, bstate->pi->send->mod_time);
|
||||||
DEB((D_24554, "M_FILE: %s", buf+1));
|
DEB((D_24554, "M_FILE: %s", buf+1));
|
||||||
*block_type = BINKP_BLK_CMD;
|
*block_type = BINKP_BLK_CMD;
|
||||||
@ -698,12 +710,11 @@ case BPMSG_ADR: /* List of addresses */
|
|||||||
if (bstate->address_established) {
|
if (bstate->address_established) {
|
||||||
PROTO_ERROR("remote tries to change address");
|
PROTO_ERROR("remote tries to change address");
|
||||||
}
|
}
|
||||||
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend !!!
|
if( bstate->extracmd[0] != (char)0xFF ) return 0; // suspend !!!
|
||||||
binkp_process_ADR(buf+1);
|
binkp_process_ADR(buf+1);
|
||||||
|
|
||||||
if( !state.n_remoteaddr ) {
|
if( !state.n_remoteaddr ) {
|
||||||
log("error: remote did not supplied any addresses");
|
log("error: remote did not supplied any addresses");
|
||||||
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend
|
|
||||||
bstate->extracmd[0] = BPMSG_BSY;
|
bstate->extracmd[0] = BPMSG_BSY;
|
||||||
strcpy(bstate->extracmd+1, "No addresses was presented");
|
strcpy(bstate->extracmd+1, "No addresses was presented");
|
||||||
bstate->extraislast = true;
|
bstate->extraislast = true;
|
||||||
@ -717,14 +728,17 @@ case BPMSG_ADR: /* List of addresses */
|
|||||||
bstate->extraislast = false;
|
bstate->extraislast = false;
|
||||||
sprintf(bstate->extracmd+1,"OPT MB CRYPT");
|
sprintf(bstate->extracmd+1,"OPT MB CRYPT");
|
||||||
s_override ovr;
|
s_override ovr;
|
||||||
|
DEB((D_24554, "process adr overrides"));
|
||||||
for(i = 0; i < state.n_remoteaddr; i++) {
|
for(i = 0; i < state.n_remoteaddr; i++) {
|
||||||
ovr.sFlags = "";
|
ovr.sFlags = "";
|
||||||
override_get (&ovr, state.remoteaddrs[i].addr, 0);
|
override_get (&ovr, state.remoteaddrs[i].addr, 0);
|
||||||
|
DEB((D_24554, "got adr overrides"));
|
||||||
if (nodelist_checkflag (ovr.sFlags, "NR")==0) {
|
if (nodelist_checkflag (ovr.sFlags, "NR")==0) {
|
||||||
strcat (bstate->extracmd+1, " NR");
|
strcat (bstate->extracmd+1, " NR");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
DEB((D_24554, "process adr overrides"));
|
||||||
}
|
}
|
||||||
// further use extracmd only for errors
|
// further use extracmd only for errors
|
||||||
|
|
||||||
@ -779,7 +793,7 @@ case BPMSG_PWD: /* Session password */
|
|||||||
// lock addresses
|
// lock addresses
|
||||||
if( session_addrs_lock(state.remoteaddrs, state.n_remoteaddr) ) {
|
if( session_addrs_lock(state.remoteaddrs, state.n_remoteaddr) ) {
|
||||||
log("error locking addresses of the remote");
|
log("error locking addresses of the remote");
|
||||||
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend if extra is occupied
|
if( bstate->extracmd[0] != (char)0xFF ) return 0; // suspend if extra is occupied
|
||||||
bstate->extracmd[0] = BPMSG_BSY;
|
bstate->extracmd[0] = BPMSG_BSY;
|
||||||
strcpy(bstate->extracmd+1, "All addresses are busy");
|
strcpy(bstate->extracmd+1, "All addresses are busy");
|
||||||
bstate->extraislast = true;
|
bstate->extraislast = true;
|
||||||
@ -819,7 +833,7 @@ case BPMSG_FILE: /* File information */
|
|||||||
DEB((D_24554, "no, skipping; TODO: accept it"));
|
DEB((D_24554, "no, skipping; TODO: accept it"));
|
||||||
if( bstate->extracmd[0] != (char)-1 ) return 0;
|
if( bstate->extracmd[0] != (char)-1 ) return 0;
|
||||||
bstate->extracmd[0] = BPMSG_SKIP;
|
bstate->extracmd[0] = BPMSG_SKIP;
|
||||||
sprintf(bstate->extracmd+1, "%s %ld %ld %ld", recvfi.fn, recvfi.sz, recvfi.tm, recvfi.offs);
|
sprintf(bstate->extracmd+1, "%s %zu %lu %zu", recvfi.fn, recvfi.sz, recvfi.tm, recvfi.offs);
|
||||||
bstate->extraislast = false;
|
bstate->extraislast = false;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -866,7 +880,7 @@ case 2:
|
|||||||
default:
|
default:
|
||||||
PROTO_ERROR("p_rx_fopen_error");
|
PROTO_ERROR("p_rx_fopen_error");
|
||||||
}
|
}
|
||||||
PROTO_ERROR("never should get here");
|
// PROTO_ERROR("never should get here");
|
||||||
|
|
||||||
case BPMSG_OK: /* Password was acknowleged (data ignored) */
|
case BPMSG_OK: /* Password was acknowleged (data ignored) */
|
||||||
DEB((D_24554, "received M_OK len=%d", block_length));
|
DEB((D_24554, "received M_OK len=%d", block_length));
|
||||||
@ -875,7 +889,7 @@ case BPMSG_OK: /* Password was acknowleged (data ignored) */
|
|||||||
}
|
}
|
||||||
if (session_addrs_lock(state.remoteaddrs, state.n_remoteaddr)) {
|
if (session_addrs_lock(state.remoteaddrs, state.n_remoteaddr)) {
|
||||||
log("error: unable to lock");
|
log("error: unable to lock");
|
||||||
if (bstate->extracmd[0]!= (char)-1) return 0;
|
if (bstate->extracmd[0]!= (char)0xFF) return 0;
|
||||||
bstate->extracmd[0] = BPMSG_BSY;
|
bstate->extracmd[0] = BPMSG_BSY;
|
||||||
strcpy(bstate->extracmd+1, "All addresses are busy");
|
strcpy(bstate->extracmd+1, "All addresses are busy");
|
||||||
bstate->extraislast = true;
|
bstate->extraislast = true;
|
||||||
@ -951,10 +965,10 @@ got_skip:
|
|||||||
|
|
||||||
check_that_all_files_are_confirmed:
|
check_that_all_files_are_confirmed:
|
||||||
{
|
{
|
||||||
int i;
|
int j;
|
||||||
for (i = 0; i < bstate->pi->n_sentfiles; i++) {
|
for (j = 0; j < bstate->pi->n_sentfiles; j++) {
|
||||||
if (bstate->pi->sentfiles[i].status == FSTAT_WAITACK) {
|
if (bstate->pi->sentfiles[i].status == FSTAT_WAITACK) {
|
||||||
DEB((D_24554, "sent file %d waits for acknowlede", i));
|
DEB((D_24554, "sent file %d waits for acknowlede", j));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -985,7 +999,7 @@ case BPMSG_GET: /* Get a file from offset */
|
|||||||
}
|
}
|
||||||
DEB((D_24554, "M_GET file %s size %d time %d offset %d", getfi.fn, getfi.sz, getfi.tm, getfi.offs));
|
DEB((D_24554, "M_GET file %s size %d time %d offset %d", getfi.fn, getfi.sz, getfi.tm, getfi.offs));
|
||||||
|
|
||||||
if (bstate->extracmd[0] != (char)-1) return 0;
|
if (bstate->extracmd[0] != (char)0xFF) return 0;
|
||||||
|
|
||||||
if (bstate->pi->send) if (p_compfinfo(bstate->pi->send, getfi.fn, getfi.sz, getfi.tm)==0) {
|
if (bstate->pi->send) if (p_compfinfo(bstate->pi->send, getfi.fn, getfi.sz, getfi.tm)==0) {
|
||||||
DEB((D_24554, "M_GET for currently transmitted file"));
|
DEB((D_24554, "M_GET for currently transmitted file"));
|
||||||
@ -1075,7 +1089,7 @@ case BINKP_BLK_DATA:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bstate->extracmd[0] != (char)-1) return 0;
|
if (bstate->extracmd[0] != (char)0xFF) return 0;
|
||||||
|
|
||||||
long int n;
|
long int n;
|
||||||
n = p_rx_writefile(buf, block_length, bstate->pi);
|
n = p_rx_writefile(buf, block_length, bstate->pi);
|
||||||
@ -1142,7 +1156,7 @@ case BINKP_BLK_DATA:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PROTO_ERROR("never should be here");
|
PROTO_ERROR("never should be here"); //-V0779
|
||||||
default:
|
default:
|
||||||
PROTO_ERROR("impossible block_type");
|
PROTO_ERROR("impossible block_type");
|
||||||
}
|
}
|
||||||
@ -1153,7 +1167,7 @@ default:
|
|||||||
|
|
||||||
void binkp_process_NUL(s_binkp_sysinfo *remote_data, char *buffer)
|
void binkp_process_NUL(s_binkp_sysinfo *remote_data, char *buffer)
|
||||||
{
|
{
|
||||||
char *p, *q;
|
|
||||||
|
|
||||||
if( strncmp(buffer, "SYS ", 4) == 0 )
|
if( strncmp(buffer, "SYS ", 4) == 0 )
|
||||||
strnxcpy(remote_data->systname, buffer+4, sizeof(remote_data->systname));
|
strnxcpy(remote_data->systname, buffer+4, sizeof(remote_data->systname));
|
||||||
@ -1181,9 +1195,11 @@ void binkp_process_NUL(s_binkp_sysinfo *remote_data, char *buffer)
|
|||||||
}
|
}
|
||||||
else if( strncmp(buffer, "VER ", 4) == 0 )
|
else if( strncmp(buffer, "VER ", 4) == 0 )
|
||||||
{
|
{
|
||||||
|
char *p;
|
||||||
/* <mailer> [<protocol>/<vermaj>.<vermin>] */
|
/* <mailer> [<protocol>/<vermaj>.<vermin>] */
|
||||||
if( (p = strchr(buffer+4, ' ')) )
|
if( (p = strchr(buffer+4, ' ')) )
|
||||||
{
|
{
|
||||||
|
char *q;
|
||||||
strnxcpy(remote_data->progname, buffer+4,
|
strnxcpy(remote_data->progname, buffer+4,
|
||||||
MIN(sizeof(remote_data->progname), p - (buffer+4) + 1));
|
MIN(sizeof(remote_data->progname), p - (buffer+4) + 1));
|
||||||
++p;
|
++p;
|
||||||
@ -1217,13 +1233,16 @@ void binkp_process_ADR(char *buffer)
|
|||||||
{
|
{
|
||||||
s_faddr addr;
|
s_faddr addr;
|
||||||
char *p, *q;
|
char *p, *q;
|
||||||
|
DEB((D_24554, "process ADR: %s", buffer));
|
||||||
for( p = string_token(buffer, &q, NULL, 0); p; p = string_token(NULL, &q, NULL, 0) )
|
for( p = string_token(buffer, &q, NULL, 0); p; p = string_token(NULL, &q, NULL, 0) )
|
||||||
{
|
{
|
||||||
|
DEB((D_24554, "binkp_process_ADR got token \"%s\" ",p ));
|
||||||
if( ftn_addrparse(&addr, p, FALSE) )
|
if( ftn_addrparse(&addr, p, FALSE) )
|
||||||
log("BinkP got unparsable address \"%s\"", string_printable(p));
|
log("BinkP got unparsable address \"%s\"", string_printable(p));
|
||||||
else
|
else {
|
||||||
session_addrs_add(&state.remoteaddrs, &state.n_remoteaddr, addr);
|
session_addrs_add(&state.remoteaddrs, &state.n_remoteaddr, addr);
|
||||||
|
DEB((D_24554, "process ADR complete"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -43,18 +43,18 @@ const char *Protocols[] =
|
|||||||
|
|
||||||
static int prot_get_next_file(s_filelist **dest, s_protinfo *pi)
|
static int prot_get_next_file(s_filelist **dest, s_protinfo *pi)
|
||||||
{
|
{
|
||||||
DEB((D_OUTBOUND, "prot_get_next_file")); // %s %d", hint->fn, hint->sz);
|
DEB((D_OUTBOUND, "prot_get_next_file")); // %s %d", hint->fn, hint->sz);
|
||||||
s_filelist *ptrl = NULL;
|
s_filelist *ptrl = NULL;
|
||||||
s_filelist *best = NULL;
|
s_filelist *best = NULL;
|
||||||
s_fsqueue *q = &state.queue;
|
s_fsqueue *q = &state.queue;
|
||||||
s_filehint *hint = NULL; // M_GET hinting does not work good here as it spec net_name and it is unknown here (especially for PKTs)
|
s_filehint *hint = NULL; // M_GET hinting does not work good here as it spec net_name and it is unknown here (especially for PKTs)
|
||||||
|
|
||||||
*dest = NULL;
|
*dest = NULL;
|
||||||
|
|
||||||
/* local queue */
|
/* local queue */
|
||||||
for( ptrl = q->fslist; ptrl; ptrl = ptrl->next ) {
|
for( ptrl = q->fslist; ptrl; ptrl = ptrl->next ) {
|
||||||
//DEB((D_OUTBOUND, "scan %s", ptrl->fname));
|
//DEB((D_OUTBOUND, "scan %s", ptrl->fname));
|
||||||
if (hint) if (strcmp(hint->fn, ptrl->fname) !=0 || hint->sz != ptrl->size) continue;
|
if (hint) if (strcmp(hint->fn, ptrl->fname) !=0 || hint->sz != ptrl->size) continue; //-V0547
|
||||||
if( ptrl->status == STATUS_WILLSEND )
|
if( ptrl->status == STATUS_WILLSEND )
|
||||||
{
|
{
|
||||||
if( pi->reqs_only )
|
if( pi->reqs_only )
|
||||||
@ -100,7 +100,7 @@ static int prot_get_next_file(s_filelist **dest, s_protinfo *pi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for( ptrl = pi->filelist; ptrl; ptrl = ptrl->next ) {
|
for( ptrl = pi->filelist; ptrl; ptrl = ptrl->next ) {
|
||||||
if (hint) if (strcmp(hint->fn, ptrl->fname) !=0 || hint->sz != ptrl->size) continue;
|
if (hint) if (strcmp(hint->fn, ptrl->fname) !=0 || hint->sz != ptrl->size) continue; //-V0547
|
||||||
if( ptrl->status == STATUS_WILLSEND )
|
if( ptrl->status == STATUS_WILLSEND )
|
||||||
{
|
{
|
||||||
*dest = ptrl;
|
*dest = ptrl;
|
||||||
@ -112,7 +112,7 @@ static int prot_get_next_file(s_filelist **dest, s_protinfo *pi)
|
|||||||
/* network queue */
|
/* network queue */
|
||||||
#ifdef NETSPOOL
|
#ifdef NETSPOOL
|
||||||
|
|
||||||
if (hint) return 1; // cannot choose
|
if (hint) return 1; //-V0547 cannot choose
|
||||||
|
|
||||||
/*DEB((D_OUTBOUND, log("netspool next file");*/
|
/*DEB((D_OUTBOUND, log("netspool next file");*/
|
||||||
if(state.netspool.state == NS_NOTINIT) {
|
if(state.netspool.state == NS_NOTINIT) {
|
||||||
@ -296,10 +296,10 @@ get_next_file:
|
|||||||
pi->send_left_num -= 1;
|
pi->send_left_num -= 1;
|
||||||
pi->send_left_size -= ptrl->size;
|
pi->send_left_size -= ptrl->size;
|
||||||
|
|
||||||
if( pi->send_left_size < 0 )
|
//if( pi->send_left_size < 0 )
|
||||||
pi->send_left_size = 0;
|
// pi->send_left_size = 0;
|
||||||
if( pi->send_left_num < 0 )
|
if( pi->send_left_num < 0 )
|
||||||
pi->send_left_num = 0;
|
pi->send_left_num = 0;
|
||||||
|
|
||||||
DEB((D_PROT, "p_tx_fopen: now opening \"%s\"", ptrl->fname));
|
DEB((D_PROT, "p_tx_fopen: now opening \"%s\"", ptrl->fname));
|
||||||
|
|
||||||
@ -1053,7 +1053,7 @@ int p_rx_fopen(s_protinfo *pi, char *fn, size_t sz, time_t tm, mode_t mode)
|
|||||||
/*
|
/*
|
||||||
* Check, there is enough space in our inbound
|
* Check, there is enough space in our inbound
|
||||||
*/
|
*/
|
||||||
if (openmode == "a") needed_bytes_total = minfree + pi->recv->bytes_total - pi->recv->bytes_skipped;
|
if ( strcmp(openmode, "a") == 0 ) needed_bytes_total = minfree + pi->recv->bytes_total - pi->recv->bytes_skipped;
|
||||||
else needed_bytes_total = minfree + pi->recv->bytes_total;
|
else needed_bytes_total = minfree + pi->recv->bytes_total;
|
||||||
|
|
||||||
if( minfree > 0 && getfreespace(state.inbound) < needed_bytes_total )
|
if( minfree > 0 && getfreespace(state.inbound) < needed_bytes_total )
|
||||||
|
|||||||
@ -449,8 +449,8 @@ static int sm_rx_waitseq(s_rx_emsidat *d)
|
|||||||
static int sm_rx_getdat(s_rx_emsidat *d)
|
static int sm_rx_getdat(s_rx_emsidat *d)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int pos = 0;
|
u_int pos = 0;
|
||||||
int emsi_len = 0;
|
u_int emsi_len = 0;
|
||||||
short unsigned ourcrc;
|
short unsigned ourcrc;
|
||||||
short unsigned remcrc;
|
short unsigned remcrc;
|
||||||
char *emsi_dat = NULL;
|
char *emsi_dat = NULL;
|
||||||
@ -599,7 +599,7 @@ void emsi_set_sysinfo(s_emsi *emsi, s_emsi *remote_emsi, int hrc,
|
|||||||
s_cval_entry *hide_ptr;
|
s_cval_entry *hide_ptr;
|
||||||
s_faddr *primary = NULL;
|
s_faddr *primary = NULL;
|
||||||
char xdt[EMSI_MAXXDATETIME+1];
|
char xdt[EMSI_MAXXDATETIME+1];
|
||||||
time_t xtm;
|
time_t xtm = 0;
|
||||||
|
|
||||||
const long options = conf_options(cf_options);
|
const long options = conf_options(cf_options);
|
||||||
const long speed = conf_number(cf_max_speed);
|
const long speed = conf_number(cf_max_speed);
|
||||||
|
|||||||
@ -113,13 +113,13 @@ void emsi_deinit(s_handshake_protocol *THIS)
|
|||||||
ASSERT(THIS->remote_data);
|
ASSERT(THIS->remote_data);
|
||||||
ASSERT(THIS->local_data);
|
ASSERT(THIS->local_data);
|
||||||
|
|
||||||
if( THIS->remote_data )
|
if( THIS->remote_data ) //-V0547
|
||||||
{
|
{
|
||||||
memset(THIS->remote_data, '\0', sizeof(s_emsi));
|
memset(THIS->remote_data, '\0', sizeof(s_emsi));
|
||||||
free(THIS->remote_data);
|
free(THIS->remote_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( THIS->local_data )
|
if( THIS->local_data ) //-V0547
|
||||||
{
|
{
|
||||||
memset(THIS->local_data, '\0', sizeof(s_emsi));
|
memset(THIS->local_data, '\0', sizeof(s_emsi));
|
||||||
free(THIS->local_data);
|
free(THIS->local_data);
|
||||||
|
|||||||
@ -65,7 +65,7 @@ static char *add_str(char *source, const char *add)
|
|||||||
{
|
{
|
||||||
len += 2;
|
len += 2;
|
||||||
dest = (char *)xrealloc(dest, len);
|
dest = (char *)xrealloc(dest, len);
|
||||||
sprintf(&dest[pos], "\\%02hd", *(unsigned char*)add);
|
sprintf(&dest[pos], "\\%02hhu", *(unsigned char*)add);
|
||||||
add += 1;
|
add += 1;
|
||||||
pos += 3;
|
pos += 3;
|
||||||
}
|
}
|
||||||
@ -200,38 +200,12 @@ char *emsi_createdat(s_emsi *emsi)
|
|||||||
if( emsi->compcodes.NCP ) tmp = add_str(tmp, "NCP,");
|
if( emsi->compcodes.NCP ) tmp = add_str(tmp, "NCP,");
|
||||||
} else {
|
} else {
|
||||||
ord = xmalloc(4);
|
ord = xmalloc(4);
|
||||||
DEB((D_HSHAKE,"Protocol order found: %s", p_order));
|
if (ord)
|
||||||
ord = strncpy(ord, p_order,3);
|
{
|
||||||
ord[3] = '\0';
|
DEB((D_HSHAKE,"Protocol order found: %s", p_order));
|
||||||
DEB((D_HSHAKE,"Protocol order chunk: %s", ord));
|
|
||||||
if ( ord == NULL )
|
|
||||||
DEB((D_HSHAKE,"EMSI create order error"));
|
|
||||||
if ( !strcmp(ord,"HYD") )
|
|
||||||
if ( emsi->compcodes.HYD) tmp = add_str(tmp, "HYD,");
|
|
||||||
if ( !strcmp(ord,"JAN") )
|
|
||||||
if ( emsi->compcodes.JAN) tmp = add_str(tmp, "JAN,");
|
|
||||||
if ( !strcmp(ord,"DZA") )
|
|
||||||
if ( emsi->compcodes.DZA) tmp = add_str(tmp, "DZA,");
|
|
||||||
if ( !strcmp(ord,"ZAP") )
|
|
||||||
if ( emsi->compcodes.ZAP) tmp = add_str(tmp, "ZAP,");
|
|
||||||
if ( !strcmp(ord,"ZMO") )
|
|
||||||
if ( emsi->compcodes.ZMO) tmp = add_str(tmp, "ZMO,");
|
|
||||||
if ( !strcmp(ord,"TZA") )
|
|
||||||
if ( emsi->compcodes.TZA) tmp = add_str(tmp, "TZA,");
|
|
||||||
if ( !strcmp(ord,"SLK") )
|
|
||||||
if ( emsi->compcodes.SLK) tmp = add_str(tmp, "SLK,");
|
|
||||||
if ( !strcmp(ord,"KER") )
|
|
||||||
if ( emsi->compcodes.KER) tmp = add_str(tmp, "KER,");
|
|
||||||
if ( !strcmp(ord,"NCP") )
|
|
||||||
if ( emsi->compcodes.NCP) tmp = add_str(tmp, "NCP,");
|
|
||||||
p_order = strchr(p_order, ',');
|
|
||||||
if ( p_order ) p_order = p_order+1; /* skip ',' */
|
|
||||||
while ( p_order ) {
|
|
||||||
ord = strncpy(ord, p_order,3);
|
ord = strncpy(ord, p_order,3);
|
||||||
ord[3] = '\0';
|
ord[3] = '\0';
|
||||||
DEB((D_HSHAKE,"Protocol order chunk: %s", ord));
|
DEB((D_HSHAKE,"Protocol order chunk: %s", ord));
|
||||||
if ( ord == NULL )
|
|
||||||
DEB((D_HSHAKE,"EMSI create order error"));
|
|
||||||
if ( !strcmp(ord,"HYD") )
|
if ( !strcmp(ord,"HYD") )
|
||||||
if ( emsi->compcodes.HYD) tmp = add_str(tmp, "HYD,");
|
if ( emsi->compcodes.HYD) tmp = add_str(tmp, "HYD,");
|
||||||
if ( !strcmp(ord,"JAN") )
|
if ( !strcmp(ord,"JAN") )
|
||||||
@ -251,9 +225,34 @@ char *emsi_createdat(s_emsi *emsi)
|
|||||||
if ( !strcmp(ord,"NCP") )
|
if ( !strcmp(ord,"NCP") )
|
||||||
if ( emsi->compcodes.NCP) tmp = add_str(tmp, "NCP,");
|
if ( emsi->compcodes.NCP) tmp = add_str(tmp, "NCP,");
|
||||||
p_order = strchr(p_order, ',');
|
p_order = strchr(p_order, ',');
|
||||||
if ( p_order ) p_order = p_order+1; /* skip ',' */
|
if ( p_order ) p_order = p_order+1; /* skip ',' */
|
||||||
|
while ( p_order ) {
|
||||||
|
ord = strncpy(ord, p_order,3);
|
||||||
|
ord[3] = '\0';
|
||||||
|
DEB((D_HSHAKE,"Protocol order chunk: %s", ord));
|
||||||
|
if ( !strcmp(ord,"HYD") )
|
||||||
|
if ( emsi->compcodes.HYD) tmp = add_str(tmp, "HYD,");
|
||||||
|
if ( !strcmp(ord,"JAN") )
|
||||||
|
if ( emsi->compcodes.JAN) tmp = add_str(tmp, "JAN,");
|
||||||
|
if ( !strcmp(ord,"DZA") )
|
||||||
|
if ( emsi->compcodes.DZA) tmp = add_str(tmp, "DZA,");
|
||||||
|
if ( !strcmp(ord,"ZAP") )
|
||||||
|
if ( emsi->compcodes.ZAP) tmp = add_str(tmp, "ZAP,");
|
||||||
|
if ( !strcmp(ord,"ZMO") )
|
||||||
|
if ( emsi->compcodes.ZMO) tmp = add_str(tmp, "ZMO,");
|
||||||
|
if ( !strcmp(ord,"TZA") )
|
||||||
|
if ( emsi->compcodes.TZA) tmp = add_str(tmp, "TZA,");
|
||||||
|
if ( !strcmp(ord,"SLK") )
|
||||||
|
if ( emsi->compcodes.SLK) tmp = add_str(tmp, "SLK,");
|
||||||
|
if ( !strcmp(ord,"KER") )
|
||||||
|
if ( emsi->compcodes.KER) tmp = add_str(tmp, "KER,");
|
||||||
|
if ( !strcmp(ord,"NCP") )
|
||||||
|
if ( emsi->compcodes.NCP) tmp = add_str(tmp, "NCP,");
|
||||||
|
p_order = strchr(p_order, ',');
|
||||||
|
if ( p_order ) p_order = p_order+1; /* skip ',' */
|
||||||
|
}
|
||||||
|
free(ord);
|
||||||
}
|
}
|
||||||
free(ord);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( emsi->compcodes.FRQ ) tmp = add_str(tmp, "FRQ,");
|
if( emsi->compcodes.FRQ ) tmp = add_str(tmp, "FRQ,");
|
||||||
@ -440,7 +439,7 @@ char *emsi_createdat(s_emsi *emsi)
|
|||||||
* Write total length of <data_pkt>
|
* Write total length of <data_pkt>
|
||||||
*/
|
*/
|
||||||
sprintf(buf, "%04hX", (short unsigned)strlen(tmp+14));
|
sprintf(buf, "%04hX", (short unsigned)strlen(tmp+14));
|
||||||
memcpy(tmp+10, buf, 4);
|
memcpy(tmp+10, buf, 4); //-V1086
|
||||||
|
|
||||||
return(tmp);
|
return(tmp);
|
||||||
}
|
}
|
||||||
@ -452,7 +451,7 @@ char *emsi_createdat(s_emsi *emsi)
|
|||||||
static char *get_field(char **str, char from, char to)
|
static char *get_field(char **str, char from, char to)
|
||||||
{
|
{
|
||||||
char *dst, *src, *dest = NULL;
|
char *dst, *src, *dest = NULL;
|
||||||
int ch;
|
u_int ch;
|
||||||
|
|
||||||
src = *str;
|
src = *str;
|
||||||
|
|
||||||
@ -555,7 +554,7 @@ int emsi_parsedat(char *emsi_dat, s_emsi *emsi)
|
|||||||
|
|
||||||
/* password */
|
/* password */
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->passwd, p, sizeof(emsi->passwd));
|
if( *p ) strnxcpy(emsi->passwd, p, sizeof(emsi->passwd));
|
||||||
|
|
||||||
/* link codes */
|
/* link codes */
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
@ -670,21 +669,22 @@ int emsi_parsedat(char *emsi_dat, s_emsi *emsi)
|
|||||||
else if( !strcmp(p, "HFR") ) emsi->compcodes.HFR = 1;
|
else if( !strcmp(p, "HFR") ) emsi->compcodes.HFR = 1;
|
||||||
}
|
}
|
||||||
/* Delete last comma from order list */
|
/* Delete last comma from order list */
|
||||||
emsi->proto_order[strlen(emsi->proto_order)-1] = '\0';
|
if (strlen(emsi->proto_order) > 0)
|
||||||
|
emsi->proto_order[strlen(emsi->proto_order)-1] = '\0';
|
||||||
DEB((D_HSHAKE,"Ordered compcodes: %s",emsi->proto_order));
|
DEB((D_HSHAKE,"Ordered compcodes: %s",emsi->proto_order));
|
||||||
|
|
||||||
/* mailer information */
|
/* mailer information */
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->m_pid, p, sizeof(emsi->m_pid));
|
if( *p ) strnxcpy(emsi->m_pid, p, sizeof(emsi->m_pid));
|
||||||
|
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->m_name, p, sizeof(emsi->m_name));
|
if( *p ) strnxcpy(emsi->m_name, p, sizeof(emsi->m_name));
|
||||||
|
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->m_ver, p, sizeof(emsi->m_ver));
|
if( *p ) strnxcpy(emsi->m_ver, p, sizeof(emsi->m_ver));
|
||||||
|
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->m_reg, p, sizeof(emsi->m_reg));;
|
if( *p ) strnxcpy(emsi->m_reg, p, sizeof(emsi->m_reg));;
|
||||||
}
|
}
|
||||||
else if( strcmp(tmp, "IDENT") == 0 )
|
else if( strcmp(tmp, "IDENT") == 0 )
|
||||||
{
|
{
|
||||||
@ -692,17 +692,17 @@ int emsi_parsedat(char *emsi_dat, s_emsi *emsi)
|
|||||||
|
|
||||||
if( (tmp=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (tmp=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->sname, p, sizeof(emsi->sname));
|
if( *p ) strnxcpy(emsi->sname, p, sizeof(emsi->sname));
|
||||||
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->location, p, sizeof(emsi->location));
|
if( *p ) strnxcpy(emsi->location, p, sizeof(emsi->location));
|
||||||
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->sysop, p, sizeof(emsi->sysop));
|
if( *p ) strnxcpy(emsi->sysop, p, sizeof(emsi->sysop));
|
||||||
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->phone, p, sizeof(emsi->phone));;
|
if( *p ) strnxcpy(emsi->phone, p, sizeof(emsi->phone));;
|
||||||
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
||||||
if( p && *p ) sscanf(p, "%d", &emsi->speed);
|
if( *p ) sscanf(p, "%d", &emsi->speed);
|
||||||
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
if( (p=get_field(&tmp, '[', ']')) == NULL ) return(1);
|
||||||
if( p && *p ) strnxcpy(emsi->flags, p, sizeof(emsi->flags));
|
if( *p ) strnxcpy(emsi->flags, p, sizeof(emsi->flags));
|
||||||
}
|
}
|
||||||
else if( strcmp(tmp, "TRX#") == 0 )
|
else if( strcmp(tmp, "TRX#") == 0 )
|
||||||
{
|
{
|
||||||
@ -720,9 +720,9 @@ int emsi_parsedat(char *emsi_dat, s_emsi *emsi)
|
|||||||
else if( strcmp(tmp, "TRAF") == 0 )
|
else if( strcmp(tmp, "TRAF") == 0 )
|
||||||
{
|
{
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( p && *p )
|
if( *p )
|
||||||
{
|
{
|
||||||
if( sscanf(p, "%08X %08X", &emsi->netmail_size, &emsi->arcmail_size) == 2 )
|
if( sscanf(p, "%08zX %08zX", &emsi->netmail_size, &emsi->arcmail_size) == 2 )
|
||||||
{
|
{
|
||||||
emsi->have_traf = 1;
|
emsi->have_traf = 1;
|
||||||
}
|
}
|
||||||
@ -736,9 +736,9 @@ int emsi_parsedat(char *emsi_dat, s_emsi *emsi)
|
|||||||
{
|
{
|
||||||
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
if( (p=get_field(&emsi_dat, '{', '}')) == NULL ) return(1);
|
||||||
if( (p=get_field(&p, '[', ']')) == NULL ) return(1);
|
if( (p=get_field(&p, '[', ']')) == NULL ) return(1);
|
||||||
if( p && *p )
|
if( *p )
|
||||||
{
|
{
|
||||||
if( sscanf(p, "%08X", &emsi->files_size) == 1 )
|
if( sscanf(p, "%08zX", &emsi->files_size) == 1 )
|
||||||
{
|
{
|
||||||
emsi->have_moh = 1;
|
emsi->have_moh = 1;
|
||||||
}
|
}
|
||||||
@ -781,21 +781,24 @@ int emsi_parsedat(char *emsi_dat, s_emsi *emsi)
|
|||||||
/* Parse EMSI TZUTC in fmt (+|-)HHMM */
|
/* Parse EMSI TZUTC in fmt (+|-)HHMM */
|
||||||
if( *p ) {
|
if( *p ) {
|
||||||
tzc = malloc(2);
|
tzc = malloc(2);
|
||||||
DEB((D_HSHAKE, "Got TZUTC=%s for parsing", p));
|
if (tzc)
|
||||||
tzn = sscanf( p, "%1c%02u%02u", tzc, &tzh, &tzm);
|
{
|
||||||
tzc[1] = '\0';
|
DEB((D_HSHAKE, "Got TZUTC=%s for parsing", p));
|
||||||
if ( tzn == 3) {
|
tzn = sscanf( p, "%1c%02u%02u", tzc, &tzh, &tzm);
|
||||||
DEB((D_HSHAKE, "Got TZC=%s , H=%u, M=%u", tzc, tzh,tzm));
|
tzc[1] = '\0';
|
||||||
emsi->have_tzutc = 1;
|
if ( tzn == 3) {
|
||||||
if ( strcmp(tzc, "-") == 0 ) {
|
DEB((D_HSHAKE, "Got TZC=%s , H=%u, M=%u", tzc, tzh,tzm));
|
||||||
emsi->tzutc = -(tzh*60 + tzm);
|
emsi->have_tzutc = 1;
|
||||||
|
if ( strcmp(tzc, "-") == 0 ) {
|
||||||
|
emsi->tzutc = -(tzh*60 + tzm);
|
||||||
|
} else {
|
||||||
|
emsi->tzutc = tzh*60 + tzm;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
emsi->tzutc = tzh*60 + tzm;
|
DEB((D_HSHAKE,"TZUTC value not parsed!"));
|
||||||
}
|
}
|
||||||
} else {
|
free(tzc);
|
||||||
DEB((D_HSHAKE,"TZUTC value not parsed!"));
|
|
||||||
}
|
}
|
||||||
free(tzc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -878,7 +881,7 @@ void emsi_logdat(s_emsi *emsi)
|
|||||||
if( emsi->compcodes.HFR )
|
if( emsi->compcodes.HFR )
|
||||||
strcat(flags, "HFR,");
|
strcat(flags, "HFR,");
|
||||||
|
|
||||||
if( *flags )
|
if( *flags && (strlen(flags) > 0) )
|
||||||
{
|
{
|
||||||
flags[strlen(flags)-1] = '\0';
|
flags[strlen(flags)-1] = '\0';
|
||||||
log(" Options : %s", flags);
|
log(" Options : %s", flags);
|
||||||
@ -919,7 +922,7 @@ void emsi_logdat(s_emsi *emsi)
|
|||||||
if( emsi->have_emsi )
|
if( emsi->have_emsi )
|
||||||
{
|
{
|
||||||
if( emsi->m_name[0] || emsi->m_pid[0]
|
if( emsi->m_name[0] || emsi->m_pid[0]
|
||||||
|| emsi->m_ver[0] || emsi->m_reg )
|
|| emsi->m_ver[0] || emsi->m_reg[0] )
|
||||||
{
|
{
|
||||||
log(" Mailer : %s [%s] %s/%s",
|
log(" Mailer : %s [%s] %s/%s",
|
||||||
emsi->m_name[0] ? string_printable(emsi->m_name) : "?",
|
emsi->m_name[0] ? string_printable(emsi->m_name) : "?",
|
||||||
|
|||||||
@ -100,7 +100,8 @@ char *hydra_pkttype_names[] =
|
|||||||
"HPKT_EOFACK",
|
"HPKT_EOFACK",
|
||||||
"HPKT_END",
|
"HPKT_END",
|
||||||
"HPKT_IDLE",
|
"HPKT_IDLE",
|
||||||
"HPKT_DEVDATA"
|
"HPKT_DEVDATA",
|
||||||
|
"HPKT_DEVDACK"
|
||||||
};
|
};
|
||||||
|
|
||||||
char *hydra_char_names[] =
|
char *hydra_char_names[] =
|
||||||
@ -285,10 +286,11 @@ static char *hydra_putword(char *buf, int val)
|
|||||||
|
|
||||||
static long hydra_getlong(const char *buf)
|
static long hydra_getlong(const char *buf)
|
||||||
{
|
{
|
||||||
return ( (unsigned long) ((unsigned char) buf[0]) )
|
return (int32_t)(( (uint32_t) ((uint8_t) buf[0]) )
|
||||||
| ( (unsigned long) ((unsigned char) buf[1]) << 8 )
|
| ( (uint32_t) ((uint8_t) buf[1]) << 8 )
|
||||||
| ( (unsigned long) ((unsigned char) buf[2]) << 16 )
|
| ( (uint32_t) ((uint8_t) buf[2]) << 16 )
|
||||||
| ( (unsigned long) ((unsigned char) buf[3]) << 24 );
|
| ( (uint32_t) ((uint8_t) buf[3]) << 24 ));
|
||||||
|
//return ( buf[3]<<24 | buf[2]<<16 | buf[1]<<8 | buf[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hydra_getword(const char *buf)
|
static int hydra_getword(const char *buf)
|
||||||
@ -479,7 +481,7 @@ static char *hydra_putuueblock(char *buf, char *src, size_t szsrc)
|
|||||||
*buf++ = HYDRA_UUENC(src[0] >> 2);
|
*buf++ = HYDRA_UUENC(src[0] >> 2);
|
||||||
*buf++ = HYDRA_UUENC(((src[0] << 4) & 0x30) | ((src[1] >> 4) & 0x0f));
|
*buf++ = HYDRA_UUENC(((src[0] << 4) & 0x30) | ((src[1] >> 4) & 0x0f));
|
||||||
*buf++ = HYDRA_UUENC(((src[1] << 2) & 0x3c) | ((src[2] >> 6) & 0x03));
|
*buf++ = HYDRA_UUENC(((src[1] << 2) & 0x3c) | ((src[2] >> 6) & 0x03));
|
||||||
*buf++ = HYDRA_UUENC(src[2] & 0x3f);
|
*buf++ = HYDRA_UUENC(src[2] & 0x3f); //-V0578
|
||||||
}
|
}
|
||||||
|
|
||||||
if( szsrc > 0 )
|
if( szsrc > 0 )
|
||||||
@ -1049,8 +1051,8 @@ static int hydra_parse_init(s_hydrainfo *hi, char *pkt, size_t pktlen)
|
|||||||
if( appinf && canopt && desopt && window && prefix )
|
if( appinf && canopt && desopt && window && prefix )
|
||||||
{
|
{
|
||||||
char buf[256];
|
char buf[256];
|
||||||
long txwindow = 0L;
|
unsigned long txwindow = 0UL;
|
||||||
long rxwindow = 0L;
|
unsigned long rxwindow = 0UL;
|
||||||
|
|
||||||
DEB((D_PROT, "hydra: revtime = \"%s\"", time_string_long(buf, sizeof(buf), revtime)));
|
DEB((D_PROT, "hydra: revtime = \"%s\"", time_string_long(buf, sizeof(buf), revtime)));
|
||||||
DEB((D_PROT, "hydra: appinf = \"%s\"", appinf));
|
DEB((D_PROT, "hydra: appinf = \"%s\"", appinf));
|
||||||
@ -1073,8 +1075,8 @@ static int hydra_parse_init(s_hydrainfo *hi, char *pkt, size_t pktlen)
|
|||||||
|
|
||||||
sscanf(window, "%08lx%08lx", &txwindow, &rxwindow);
|
sscanf(window, "%08lx%08lx", &txwindow, &rxwindow);
|
||||||
|
|
||||||
if( txwindow < 0 ) txwindow = 0L;
|
//if( txwindow < 0 ) txwindow = 0L;
|
||||||
if( rxwindow < 0 ) rxwindow = 0L;
|
//if( rxwindow < 0 ) rxwindow = 0L;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Log other's hydra information only at 1st batch
|
* Log other's hydra information only at 1st batch
|
||||||
@ -1548,7 +1550,9 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
/*
|
/*
|
||||||
* Check current CPS, session time limits, etc.
|
* Check current CPS, session time limits, etc.
|
||||||
*/
|
*/
|
||||||
if( (rc = p_info(pi, 1)) ) gotoexit(rc);
|
rc = p_info(pi, 1);
|
||||||
|
|
||||||
|
if( rc != PRC_NOERROR ) gotoexit(rc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Send/receive as much data as possible, but without delays
|
* Send/receive as much data as possible, but without delays
|
||||||
@ -1591,7 +1595,7 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HPKT_START:
|
case HPKT_START:
|
||||||
if( txstate == HTX_START || txstate == HTX_SWAIT )
|
if( txstate == HTX_START || txstate == HTX_SWAIT ) //-V0560
|
||||||
{
|
{
|
||||||
txtries = 0;
|
txtries = 0;
|
||||||
txstate = HTX_INIT;
|
txstate = HTX_INIT;
|
||||||
@ -1599,7 +1603,7 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HPKT_INIT:
|
case HPKT_INIT:
|
||||||
if( rxstate == HRX_INIT )
|
if( rxstate == HRX_INIT )
|
||||||
{
|
{
|
||||||
if( hydra_parse_init(hi, hi->ibuf, hi->isize) )
|
if( hydra_parse_init(hi, hi->ibuf, hi->isize) )
|
||||||
{
|
{
|
||||||
@ -1612,7 +1616,7 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HPKT_INITACK:
|
case HPKT_INITACK:
|
||||||
if( txstate == HTX_INIT || txstate == HTX_INITACK )
|
if( txstate == HTX_INIT || txstate == HTX_INITACK ) //-V0560
|
||||||
{
|
{
|
||||||
txtries = 0;
|
txtries = 0;
|
||||||
txstate = HTX_RINIT;
|
txstate = HTX_RINIT;
|
||||||
@ -1637,7 +1641,7 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
/* Get file modification time and size */
|
/* Get file modification time and size */
|
||||||
sscanf(hi->ibuf, "%08lx%08x%*08x%*08x%*08x",
|
sscanf(hi->ibuf, "%08lx%08zx%*08zx%*08zx%*08zx",
|
||||||
(unsigned long *)&modtime, &filesize);
|
(unsigned long *)&modtime, &filesize);
|
||||||
|
|
||||||
/* Convert local time -> UTC */
|
/* Convert local time -> UTC */
|
||||||
@ -1706,7 +1710,7 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case HPKT_FINFOACK:
|
case HPKT_FINFOACK:
|
||||||
if( txstate == HTX_FINFO || txstate == HTX_FINFOACK )
|
if( txstate == HTX_FINFO || txstate == HTX_FINFOACK ) //-V0560
|
||||||
{
|
{
|
||||||
long offs = 0L;
|
long offs = 0L;
|
||||||
|
|
||||||
@ -1721,7 +1725,7 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
{
|
{
|
||||||
log("Hydra: got invalid FINFOACK packet (ignored)");
|
log("Hydra: got invalid FINFOACK packet (ignored)");
|
||||||
}
|
}
|
||||||
else if( (offs = hydra_getlong(hi->ibuf)) == 0 )
|
else if( (offs = hydra_getlong(hi->ibuf)) == 0 ) //-V0560 do not touch
|
||||||
{
|
{
|
||||||
txlastack = 0;
|
txlastack = 0;
|
||||||
txtries = 0;
|
txtries = 0;
|
||||||
@ -1989,7 +1993,7 @@ int hydra_batch(s_hydrainfo *hi, s_protinfo *pi)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( rxstate == HRX_Skip || rxstate == HRX_SkipAck )
|
else if( rxstate == HRX_Skip || rxstate == HRX_SkipAck ) //-V0560
|
||||||
{
|
{
|
||||||
if( hi->isize < 4 )
|
if( hi->isize < 4 )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -85,13 +85,12 @@ static void yoohoo_put_hello(char *buffer, s_yoohoo_sysinfo *myhello)
|
|||||||
* Add domain after the end of 'Node name'
|
* Add domain after the end of 'Node name'
|
||||||
* TODO: check it for buffer overflows %-I
|
* TODO: check it for buffer overflows %-I
|
||||||
*/
|
*/
|
||||||
if( state.n_localaddr > 0 && state.localaddrs[0].addr.domain
|
if( state.n_localaddr > 0 && *state.localaddrs[0].addr.domain )
|
||||||
&& *state.localaddrs[0].addr.domain )
|
|
||||||
{
|
{
|
||||||
char *q;
|
char *q;
|
||||||
if( strlen(myhello->system) + strlen(state.localaddrs[0].addr.domain) > 57 )
|
if( strlen(myhello->system) + strlen(state.localaddrs[0].addr.domain) > 57 )
|
||||||
{
|
{
|
||||||
if( strlen(state.localaddrs[0].addr.domain) < 60 )
|
if( strlen(state.localaddrs[0].addr.domain) < 60 ) //-V0547
|
||||||
q = p + (60 - strlen(state.localaddrs[0].addr.domain));
|
q = p + (60 - strlen(state.localaddrs[0].addr.domain));
|
||||||
else
|
else
|
||||||
q = p;
|
q = p;
|
||||||
|
|||||||
@ -81,13 +81,13 @@ void yoohoo_deinit(s_handshake_protocol *THIS)
|
|||||||
ASSERT(THIS->remote_data);
|
ASSERT(THIS->remote_data);
|
||||||
ASSERT(THIS->local_data);
|
ASSERT(THIS->local_data);
|
||||||
|
|
||||||
if( THIS->remote_data )
|
if( THIS->remote_data ) //-V0547
|
||||||
{
|
{
|
||||||
memset(THIS->remote_data, '\0', sizeof(s_yoohoo_sysinfo));
|
memset(THIS->remote_data, '\0', sizeof(s_yoohoo_sysinfo));
|
||||||
free(THIS->remote_data);
|
free(THIS->remote_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( THIS->local_data )
|
if( THIS->local_data ) //-V0547
|
||||||
{
|
{
|
||||||
memset(THIS->local_data, '\0', sizeof(s_yoohoo_sysinfo));
|
memset(THIS->local_data, '\0', sizeof(s_yoohoo_sysinfo));
|
||||||
free(THIS->local_data);
|
free(THIS->local_data);
|
||||||
|
|||||||
@ -67,7 +67,7 @@ static const char *FrameTypes[] =
|
|||||||
"ZCOMMAND",
|
"ZCOMMAND",
|
||||||
"ZSTDERR",
|
"ZSTDERR",
|
||||||
"Unused"
|
"Unused"
|
||||||
#define FRTYPES 22 /* Total number of frame types in this array */
|
#define FRTYPES 20 /* Total number of frame types in this array */
|
||||||
/* not including psuedo negative entries */
|
/* not including psuedo negative entries */
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@ -360,12 +360,12 @@ static int noxrd7(void)
|
|||||||
if( (c = GETCHAR(Z_Rxwait)) < 0 )
|
if( (c = GETCHAR(Z_Rxwait)) < 0 )
|
||||||
return(c);
|
return(c);
|
||||||
|
|
||||||
switch( c &= 0177 ) {
|
switch( c &= 0x7F ) { // was octal 0177
|
||||||
case XON:
|
case XON:
|
||||||
case XOFF:
|
case XOFF:
|
||||||
continue;
|
continue;
|
||||||
default:
|
default:
|
||||||
if( Z_Ctlesc && !(c & 0140) )
|
if( Z_Ctlesc && !(c & 0x60) ) //was octal 0140 b01100000 hex 0x60
|
||||||
continue;
|
continue;
|
||||||
case '\r':
|
case '\r':
|
||||||
case '\n':
|
case '\n':
|
||||||
@ -1056,8 +1056,8 @@ static int zrhhdr(char *hdr)
|
|||||||
/* There is some characters available.. */
|
/* There is some characters available.. */
|
||||||
|
|
||||||
switch( (c = GETCHAR(1)) ) {
|
switch( (c = GETCHAR(1)) ) {
|
||||||
case 0215:
|
case 0x8D: //was octal 0215 dec 141 b 10001101 hex 0x8D ZCRC
|
||||||
case 015:
|
case 0x0D: //was octal 015 dec 13 b 00001101 hex 0x0D ZCRC
|
||||||
/* Throw away possible cr/lf */
|
/* Throw away possible cr/lf */
|
||||||
if( (c = GETCHAR(1)) < 0 && c != ZTIMER )
|
if( (c = GETCHAR(1)) < 0 && c != ZTIMER )
|
||||||
return(c);
|
return(c);
|
||||||
|
|||||||
@ -248,8 +248,8 @@ int rx_zmodem(s_protinfo *pi, bool caller)
|
|||||||
break;
|
break;
|
||||||
} /* end of switch(rxstate) */
|
} /* end of switch(rxstate) */
|
||||||
|
|
||||||
|
// && rxstate != ZRX_GOTFILE - always true, :131 changes it
|
||||||
if( rxstate != ZRX_INIT && rxstate != ZRX_GOTFILE
|
if( rxstate != ZRX_INIT
|
||||||
&& rxstate != ZRX_SENDRPOS && rxstate != ZRX_WAITDATA
|
&& rxstate != ZRX_SENDRPOS && rxstate != ZRX_WAITDATA
|
||||||
&& rxstate != ZRX_SKIP && rxstate != ZRX_REFUSE )
|
&& rxstate != ZRX_SKIP && rxstate != ZRX_REFUSE )
|
||||||
{
|
{
|
||||||
@ -548,7 +548,7 @@ static int zmodem_proc_ZFILE(s_protinfo *pi, char *blkptr, size_t blklen)
|
|||||||
fileiptr = blkptr + strlen(blkptr) + 1;
|
fileiptr = blkptr + strlen(blkptr) + 1;
|
||||||
|
|
||||||
if( fileiptr >= (blkptr + blklen) ||
|
if( fileiptr >= (blkptr + blklen) ||
|
||||||
sscanf(fileiptr, "%d%lo", &filesize, (unsigned long *)&filetime) < 1 )
|
sscanf(fileiptr, "%zu%lo", &filesize, (unsigned long *)&filetime) < 1 )
|
||||||
{
|
{
|
||||||
log("zmodem: got invalid ZFILE packet");
|
log("zmodem: got invalid ZFILE packet");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -47,14 +47,18 @@ static void zmodem_add_empty_packet(s_protinfo *pi)
|
|||||||
s_filelist **ptrl;
|
s_filelist **ptrl;
|
||||||
s_packet pkt;
|
s_packet pkt;
|
||||||
char tmpname[] = "/tmp/bfXXXXXX";
|
char tmpname[] = "/tmp/bfXXXXXX";
|
||||||
|
char *chunk;
|
||||||
char *p_tmpname;
|
char *p_tmpname;
|
||||||
|
|
||||||
if( (p_tmpname = mktemp(tmpname)) == NULL )
|
chunk = xmalloc(7);
|
||||||
{
|
if (!chunk) {
|
||||||
logerr("cannot generate temp. file name for packet from \"%s\"", tmpname);
|
logerr("cannot generate temp. file name for packet");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
getrandname(chunk, 6);
|
||||||
|
p_tmpname = string_concat("/tmp/bf", chunk, '\0');
|
||||||
|
|
||||||
|
free(chunk);
|
||||||
memset(&pkt, '\0', sizeof(s_packet));
|
memset(&pkt, '\0', sizeof(s_packet));
|
||||||
|
|
||||||
pkt.dest = state.node.addr;
|
pkt.dest = state.node.addr;
|
||||||
@ -129,6 +133,7 @@ int tx_zmodem(s_protinfo *pi, bool caller)
|
|||||||
int dtype, n;
|
int dtype, n;
|
||||||
int ftype;
|
int ftype;
|
||||||
char c, *p;
|
char c, *p;
|
||||||
|
int ichar = 0;
|
||||||
long unsigned crc32;
|
long unsigned crc32;
|
||||||
enum ztxstates txstate;
|
enum ztxstates txstate;
|
||||||
time_t deadtimer;
|
time_t deadtimer;
|
||||||
@ -385,8 +390,9 @@ int tx_zmodem(s_protinfo *pi, bool caller)
|
|||||||
/* Ignore them all */
|
/* Ignore them all */
|
||||||
break;
|
break;
|
||||||
} /* end of switch(txstate) */
|
} /* end of switch(txstate) */
|
||||||
|
|
||||||
if( txstate != ZTX_START && txstate != ZTX_RQINIT
|
// txstate != ZTX_START always true
|
||||||
|
if( txstate != ZTX_RQINIT
|
||||||
&& txstate != ZTX_FINFO && txstate != ZTX_DATA
|
&& txstate != ZTX_FINFO && txstate != ZTX_DATA
|
||||||
&& txstate != ZTX_EOF && txstate != ZTX_FIN )
|
&& txstate != ZTX_EOF && txstate != ZTX_FIN )
|
||||||
{
|
{
|
||||||
@ -644,8 +650,8 @@ int tx_zmodem(s_protinfo *pi, bool caller)
|
|||||||
log(" Send file's CRC-32 ");
|
log(" Send file's CRC-32 ");
|
||||||
crc32 = 0xFFFFFFFFL;
|
crc32 = 0xFFFFFFFFL;
|
||||||
|
|
||||||
while( ((c = getc(pi->send->fp)) != EOF) && --Z_Rxpos )
|
while( ((ichar = getc(pi->send->fp)) != EOF) && --Z_Rxpos )
|
||||||
crc32 = updcrc32(c, crc32);
|
crc32 = updcrc32(ichar, crc32);
|
||||||
|
|
||||||
crc32 = ~crc32;
|
crc32 = ~crc32;
|
||||||
|
|
||||||
|
|||||||
@ -210,7 +210,7 @@ int call_system_quiet(const char *connstr, bool inet)
|
|||||||
if( (exec_cmd = conf_string(cf_run_before_session)) != NULL )
|
if( (exec_cmd = conf_string(cf_run_before_session)) != NULL )
|
||||||
{
|
{
|
||||||
exec_result = system(exec_cmd);
|
exec_result = system(exec_cmd);
|
||||||
if( exec_result = 0 )
|
if( exec_result == 0 )
|
||||||
log("external application %s executed with zero return code (%i)", exec_cmd, exec_result);
|
log("external application %s executed with zero return code (%i)", exec_cmd, exec_result);
|
||||||
else
|
else
|
||||||
logerr("external application %s executed with non-zero return code %i", exec_cmd, exec_result);
|
logerr("external application %s executed with non-zero return code %i", exec_cmd, exec_result);
|
||||||
@ -378,7 +378,7 @@ int call_system_modem(void)
|
|||||||
|
|
||||||
log("calling with modem %s (%s, %s)",
|
log("calling with modem %s (%s, %s)",
|
||||||
ftn_addrstr(abuf, state.node.addr),
|
ftn_addrstr(abuf, state.node.addr),
|
||||||
(state.node.name && *state.node.name) ? state.node.name : "<none>",
|
( *state.node.name) ? state.node.name : "<none>",
|
||||||
string_printable(dialstring));
|
string_printable(dialstring));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -519,15 +519,15 @@ case CALL_TCPIP_TELNET:
|
|||||||
state.session = SESSION_UNKNOWN;
|
state.session = SESSION_UNKNOWN;
|
||||||
target = xstrcpy("ITN");
|
target = xstrcpy("ITN");
|
||||||
break;
|
break;
|
||||||
defalt:
|
default:
|
||||||
log("invalid protocol for TCP/IP module");
|
log("invalid protocol for TCP/IP module");
|
||||||
return BFERR_FATALERROR;
|
return BFERR_FATALERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
log("calling with internet %s (%s, %s)",
|
log("calling with internet %s (%s, %s)",
|
||||||
ftn_addrstr(abuf, state.node.addr),
|
ftn_addrstr(abuf, state.node.addr),
|
||||||
(state.node.name && *state.node.name ) ? state.node.name : "<none>",
|
(*state.node.name ) ? state.node.name : "<none>",
|
||||||
(state.node.host && *state.node.host) ? state.node.host : "<none>");
|
( *state.node.host) ? state.node.host : "<none>");
|
||||||
|
|
||||||
memset(abuf, '\0', BF_MAXADDRSTR+1);
|
memset(abuf, '\0', BF_MAXADDRSTR+1);
|
||||||
pbuf = xmalloc(1024);
|
pbuf = xmalloc(1024);
|
||||||
@ -536,7 +536,7 @@ defalt:
|
|||||||
if ( ! resflg )
|
if ( ! resflg )
|
||||||
{
|
{
|
||||||
|
|
||||||
char *p = strcasestr(pbuf, target);
|
const char *p = string_casestr(pbuf, target);
|
||||||
|
|
||||||
if ( p )
|
if ( p )
|
||||||
{
|
{
|
||||||
@ -568,7 +568,7 @@ defalt:
|
|||||||
|
|
||||||
|
|
||||||
if( (rc = tcpip_connect(pbuf, state.tcpmode)) == 0
|
if( (rc = tcpip_connect(pbuf, state.tcpmode)) == 0
|
||||||
&& (rc = tcpip_init() == 0) )
|
&& ( (rc = tcpip_init()) == 0) )
|
||||||
{
|
{
|
||||||
TTYSTATUS(1);
|
TTYSTATUS(1);
|
||||||
rc = session();
|
rc = session();
|
||||||
@ -591,7 +591,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
log(s);
|
log(s);
|
||||||
DEB((D_EVENT, s));
|
DEB((D_EVENT, s));
|
||||||
// find suitable way of connection and try to make session
|
// find suitable way of connection and try to make session
|
||||||
|
s_override *tmpovr;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
int runrc = 0;
|
int runrc = 0;
|
||||||
char abuf[BF_MAXADDRSTR+1];
|
char abuf[BF_MAXADDRSTR+1];
|
||||||
@ -599,7 +599,9 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
char *errmsg = NULL;
|
char *errmsg = NULL;
|
||||||
int call_mustuse = 0;
|
int call_mustuse = 0;
|
||||||
int call_mayuse = 0;
|
int call_mayuse = 0;
|
||||||
|
char origphone[BNI_MAXPHONE+1];
|
||||||
|
char origflags[BNI_MAXFLAGS+1];
|
||||||
|
char orighost[BNI_MAXHOST+1];
|
||||||
init_state(&state);
|
init_state(&state);
|
||||||
|
|
||||||
state.caller = TRUE;
|
state.caller = TRUE;
|
||||||
@ -611,12 +613,38 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
{
|
{
|
||||||
errmsg = "incorrect hidden line number";
|
errmsg = "incorrect hidden line number";
|
||||||
gotoexit(BFERR_PHONE_UNKNOWN);
|
gotoexit(BFERR_PHONE_UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
// We can do it even if no nodelist string for node
|
||||||
|
// we got overrides, so apply ALL configs, except tuned by options
|
||||||
|
// BEFORE we decide how to call
|
||||||
|
if (state.override.sFlags) {
|
||||||
|
(void)strnxcpy(state.node.flags, state.override.sFlags, strlen(state.override.sFlags)+1);
|
||||||
|
state.node.do_binkp = (nodelist_checkflag(state.node.flags, "IBN") == 0);
|
||||||
|
state.node.do_ifcico = (nodelist_checkflag(state.node.flags, "IFC") == 0);
|
||||||
|
state.node.do_telnet = (nodelist_checkflag(state.node.flags, "ITN") == 0);
|
||||||
|
memset(state.node.host,'\0',sizeof(state.node.host));
|
||||||
|
nodelist_flagvalue(state.node.flags, "INA",state.node.host);
|
||||||
|
|
||||||
|
DEB((D_EVENT, "sess_call: applied override flags=%s", state.node.flags));
|
||||||
}
|
}
|
||||||
|
if (state.override.sPhone && !(opts->phone)) {
|
||||||
|
(void)strnxcpy(state.node.phone, state.override.sPhone, strlen(state.override.sPhone)+1);
|
||||||
|
DEB((D_EVENT, "sess_call: applied override phone=%s", state.node.phone));
|
||||||
|
}
|
||||||
|
if (state.override.sIpaddr && !(opts->iphost)) {
|
||||||
|
(void)strnxcpy(state.node.host, state.override.sIpaddr, strlen(state.override.sIpaddr)+1);
|
||||||
|
DEB((D_EVENT, "sess_call: applied override ipaddr=%s", state.node.host));
|
||||||
|
}
|
||||||
|
if (nodelist_parsehiddenina(&state.node, &state.override) > 0) {
|
||||||
|
DEB((D_EVENT, "sess_call: got hidden INAs"));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
state.listed = state.node.listed;
|
state.listed = state.node.listed;
|
||||||
//DEB((D_EVENT, "Calling init, listed=%d", state.listed));
|
//DEB((D_EVENT, "Calling init, listed=%d", state.listed));
|
||||||
state.node.addr.domain[0] = '\0'; /* Discard domain for node address */
|
state.node.addr.domain[0] = '\0'; /* Discard domain for node address */
|
||||||
|
|
||||||
// 1. If call method specified in cmdline, do use it
|
// 1. If call method specified in cmdline, do use it
|
||||||
// 2. If not, use nodelist data and overrides and call all available methods
|
// 2. If not, use nodelist data and overrides and call all available methods
|
||||||
// If override contains Phone or IP flags, ignore nodelist connect methods (but save INA if not overrided)
|
// If override contains Phone or IP flags, ignore nodelist connect methods (but save INA if not overrided)
|
||||||
@ -640,7 +668,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
}
|
}
|
||||||
else if( opts->runmode == MODE_CALL_IP )
|
else if( opts->runmode == MODE_CALL_IP )
|
||||||
{
|
{
|
||||||
DEB((D_EVENT, "Calling init, MODE_CALL_IP"));
|
DEB((D_EVENT, "sess_call: MODE_CALL_IP - from cli"));
|
||||||
if( !(opts->ipproto) ) // determine from nodelist/override
|
if( !(opts->ipproto) ) // determine from nodelist/override
|
||||||
{
|
{
|
||||||
DEB((D_EVENT, "ipproto not set"));
|
DEB((D_EVENT, "ipproto not set"));
|
||||||
@ -676,9 +704,9 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
call_mayuse |= call_mustuse; // it simplifies logics: all required is allowed
|
call_mayuse |= call_mustuse; // it simplifies logics: all required is allowed
|
||||||
|
|
||||||
//char s[300];
|
//char s[300];
|
||||||
//snprintf(s, 299, "initial: may use %d must use %d", call_mayuse, call_mustuse);
|
snprintf(s, 299, "initial: may use %d must use %d", call_mayuse, call_mustuse);
|
||||||
//log(s);
|
//log(s);
|
||||||
//DEB((D_EVENT, s));
|
DEB((D_EVENT, s));
|
||||||
|
|
||||||
|
|
||||||
if( (call_mayuse & CALL_MODEM) )
|
if( (call_mayuse & CALL_MODEM) )
|
||||||
@ -691,16 +719,17 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
{
|
{
|
||||||
(void)strnxcpy(state.node.phone, opts->phone, sizeof(state.node.phone));
|
(void)strnxcpy(state.node.phone, opts->phone, sizeof(state.node.phone));
|
||||||
//log("phone from options");
|
//log("phone from options");
|
||||||
}
|
} // Moved to top
|
||||||
else if( state.override.sPhone )
|
//else if( state.override.sPhone )
|
||||||
{
|
//{
|
||||||
(void)strnxcpy(state.node.phone, state.override.sPhone, sizeof(state.node.phone));
|
// (void)strnxcpy(state.node.phone, state.override.sPhone, sizeof(state.node.phone));
|
||||||
//log("phone from override");
|
// //log("phone from override");
|
||||||
}
|
//}
|
||||||
|
|
||||||
if( !modem_isgood_phone(state.node.phone) )
|
if( !modem_isgood_phone(state.node.phone) )
|
||||||
{
|
{
|
||||||
log("bad phone, excluding modem");
|
log("bad phone, excluding modem");
|
||||||
|
DEB((D_EVENT, "sess_call: bad phone, excluding modem" ));
|
||||||
call_mayuse &= ~CALL_MODEM;
|
call_mayuse &= ~CALL_MODEM;
|
||||||
if( !(call_mayuse) )
|
if( !(call_mayuse) )
|
||||||
{
|
{
|
||||||
@ -749,14 +778,14 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
//log(s);
|
//log(s);
|
||||||
//DEB((D_EVENT, s));
|
//DEB((D_EVENT, s));
|
||||||
/*
|
/*
|
||||||
* Apply overrides to the node information
|
* Apply overrides to the node information - 2025 moved to start
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if( state.override.sFlags )
|
//if( state.override.sFlags )
|
||||||
{
|
//{
|
||||||
strnxcat(state.node.flags, ",", sizeof(state.node.flags));
|
// strnxcat(state.node.flags, ",", sizeof(state.node.flags));
|
||||||
strnxcat(state.node.flags, state.override.sFlags, sizeof(state.node.flags));
|
// strnxcat(state.node.flags, state.override.sFlags, sizeof(state.node.flags));
|
||||||
}
|
//}
|
||||||
|
|
||||||
// state.node nodelist
|
// state.node nodelist
|
||||||
// state.override config
|
// state.override config
|
||||||
@ -764,44 +793,50 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
|
|
||||||
// filter unavailable protos if not obligated to use it
|
// filter unavailable protos if not obligated to use it
|
||||||
|
|
||||||
if( !(call_mustuse & CALL_TCPIP_BINKP) && (call_mayuse & CALL_TCPIP_BINKP) )
|
// Decide protos on calling by flags with override
|
||||||
|
if( (call_mustuse & CALL_TCPIP_BINKP) && (call_mayuse & CALL_TCPIP_BINKP) )
|
||||||
{
|
{
|
||||||
//if( nodelist_checkflag(state.node.flags, "BINKP") != 0 && nodelist_checkflag(state.node.flags, "IBN") != 0 )
|
//if( nodelist_checkflag(state.node.flags, "IBN") != 0 )
|
||||||
if( state.node.do_binkp == 0 )
|
if( state.node.do_binkp == 0 )
|
||||||
{
|
{
|
||||||
call_mayuse &= ~CALL_TCPIP_BINKP;
|
call_mayuse &= ~CALL_TCPIP_BINKP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(call_mustuse & CALL_TCPIP_IFCICO) && (call_mayuse & CALL_TCPIP_IFCICO) )
|
if( (call_mustuse & CALL_TCPIP_IFCICO) && (call_mayuse & CALL_TCPIP_IFCICO) )
|
||||||
{
|
{
|
||||||
//if( nodelist_checkflag(state.node.flags, "IFC") != 0 && nodelist_checkflag(state.node.flags, "IFC") != 0 )
|
//if( nodelist_checkflag(state.node.flags, "IFC") != 0 )
|
||||||
if( state.node.do_ifcico == 0 )
|
if( state.node.do_ifcico == 0 )
|
||||||
{
|
{
|
||||||
call_mayuse &= ~CALL_TCPIP_IFCICO;
|
call_mayuse &= ~CALL_TCPIP_IFCICO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !(call_mustuse & CALL_TCPIP_TELNET) && (call_mayuse & CALL_TCPIP_TELNET) )
|
if( (call_mustuse & CALL_TCPIP_TELNET) && (call_mayuse & CALL_TCPIP_TELNET) )
|
||||||
{
|
{
|
||||||
//if( nodelist_checkflag(state.node.flags, "TELN") != 0 && nodelist_checkflag(state.node.flags, "TLN") != 0 )
|
//if( nodelist_checkflag(state.node.flags, "TLN") != 0 )
|
||||||
if( state.node.do_telnet == 0 )
|
if( state.node.do_telnet == 0 )
|
||||||
{
|
{
|
||||||
call_mayuse &= ~CALL_TCPIP_TELNET;
|
call_mayuse &= ~CALL_TCPIP_TELNET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
snprintf(s, 299, "after 1 check: may use %d must use %d", call_mayuse, call_mustuse);
|
||||||
|
log(s);
|
||||||
|
DEB((D_EVENT, s));
|
||||||
|
|
||||||
if( opts->iphost && *opts->iphost )
|
if( opts->iphost && *opts->iphost )
|
||||||
{
|
{
|
||||||
|
memset(state.node.host,'\0',sizeof(state.node.host));
|
||||||
(void)strnxcpy(state.node.host, opts->iphost, sizeof(state.node.host));
|
(void)strnxcpy(state.node.host, opts->iphost, sizeof(state.node.host));
|
||||||
}
|
}
|
||||||
else if( state.override.sIpaddr )
|
// Moved to start
|
||||||
{
|
//else if( state.override.sIpaddr )
|
||||||
(void)strnxcpy(state.node.host,
|
//{
|
||||||
state.override.sIpaddr, sizeof(state.node.host));
|
// (void)strnxcpy(state.node.host,
|
||||||
}
|
// state.override.sIpaddr, sizeof(state.node.host));
|
||||||
|
//}
|
||||||
|
|
||||||
//DEB((D_EVENT, "Calling init, IPHOST", state.node.host));
|
DEB((D_EVENT, "Calling init, IPHOST %s", state.node.host));
|
||||||
|
|
||||||
// We have at least one protocol and not valid address - try to
|
// We have at least one protocol and not valid address - try to
|
||||||
// find INA with through Fidonet DNS
|
// find INA with through Fidonet DNS
|
||||||
@ -862,7 +897,7 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
}
|
}
|
||||||
if( NULL != state.override.run && strlen(state.override.run) > 0 )
|
if( NULL != state.override.run && strlen(state.override.run) > 0 )
|
||||||
{
|
{
|
||||||
if ( (runrc = system(state.override.run) != 0 ))
|
if ( (runrc = system(state.override.run)) != 0 )
|
||||||
{
|
{
|
||||||
logerr("run script \"%s\" executed with non-zero return value", state.override.run);
|
logerr("run script \"%s\" executed with non-zero return value", state.override.run);
|
||||||
}
|
}
|
||||||
@ -871,31 +906,129 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
|
|
||||||
// try allowed methods and break if rc == 0
|
// try allowed methods and break if rc == 0
|
||||||
rc = -1;
|
rc = -1;
|
||||||
|
// START CALLING
|
||||||
|
// ROTATE HIDDEN LINES IF ANY
|
||||||
|
|
||||||
if( rc && (call_mayuse & CALL_STDIO) )
|
|
||||||
|
//snprintf(s, 299, "before call: may use %d must use %d", call_mayuse, call_mustuse);
|
||||||
|
//log(s);
|
||||||
|
//DEB((D_EVENT, s));
|
||||||
|
// Hidden lines - if smth is not in place - use orig overriden hard
|
||||||
|
memcpy(&origphone, &state.node.phone,sizeof(origphone));
|
||||||
|
memcpy(&origflags, &state.node.flags,sizeof(origflags));
|
||||||
|
memcpy(&orighost, &state.node.host,sizeof(orighost));
|
||||||
|
|
||||||
|
if( call_mayuse & CALL_STDIO )
|
||||||
{
|
{
|
||||||
DEB((D_EVENT,"sess_call: calling stdio"));
|
DEB((D_EVENT,"sess_call: calling stdio, mayuse=%x", call_mayuse));
|
||||||
rc = call_system_quiet(opts->connect, opts->inetd);
|
rc = call_system_quiet(opts->connect, opts->inetd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( rc && (call_mayuse & CALL_TCPIP_BINKP) )
|
if( rc && (call_mayuse & CALL_TCPIP_BINKP) )
|
||||||
{
|
{
|
||||||
DEB((D_EVENT,"sess_call: calling binkp"));
|
DEB((D_EVENT,"sess_call: calling binkp, mayuse=%x", call_mayuse));
|
||||||
rc = call_system_tcpip(CALL_TCPIP_BINKP);
|
rc = call_system_tcpip(CALL_TCPIP_BINKP);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( rc && (call_mayuse & CALL_TCPIP_IFCICO) )
|
if( rc && (call_mayuse & CALL_TCPIP_IFCICO) )
|
||||||
{
|
{
|
||||||
DEB((D_EVENT,"sess_call: calling ifcico"));
|
DEB((D_EVENT,"sess_call: calling ifcico, mayuse=%x", call_mayuse));
|
||||||
rc = call_system_tcpip(CALL_TCPIP_IFCICO);
|
rc = call_system_tcpip(CALL_TCPIP_IFCICO);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( rc && (call_mayuse & CALL_TCPIP_TELNET) )
|
if( rc && (call_mayuse & CALL_TCPIP_TELNET) )
|
||||||
{
|
{
|
||||||
DEB((D_EVENT,"sess_call: calling telnet"));
|
DEB((D_EVENT,"sess_call: calling telnet, mayuse=%x", call_mayuse));
|
||||||
rc = call_system_tcpip(CALL_TCPIP_TELNET);
|
rc = call_system_tcpip(CALL_TCPIP_TELNET);
|
||||||
}
|
}
|
||||||
|
tmpovr = &state.override;
|
||||||
|
while (tmpovr->hidden != NULL && rc) {
|
||||||
|
DEB((D_EVENT, "sess_call: starting hidden, current is %x", tmpovr->hidden));
|
||||||
|
tmpovr = tmpovr->hidden;
|
||||||
|
|
||||||
|
if (tmpovr->sFlags) {
|
||||||
|
if (nodelist_checkflag(tmpovr->sFlags, "INA") == 0) {
|
||||||
|
memset(state.node.host,'\0',sizeof(state.node.host));
|
||||||
|
nodelist_flagvalue(tmpovr->sFlags, "INA",state.node.host);
|
||||||
|
}
|
||||||
|
(void)strnxcpy(state.node.flags, tmpovr->sFlags, strlen(tmpovr->sFlags)+1);
|
||||||
|
call_mayuse |= call_mustuse;
|
||||||
|
state.node.do_binkp = nodelist_checkflag(state.node.flags, "IBN") == 0;
|
||||||
|
state.node.do_ifcico = nodelist_checkflag(state.node.flags, "IFC") == 0;
|
||||||
|
state.node.do_telnet = nodelist_checkflag(state.node.flags, "ITN") == 0;
|
||||||
|
|
||||||
|
DEB((D_EVENT, "sess_call: applied hidden flags=%s", state.node.flags));
|
||||||
|
} else {
|
||||||
|
memcpy(&state.node.flags, &origflags, sizeof(origflags));
|
||||||
|
call_mayuse |= call_mustuse;
|
||||||
|
state.node.do_binkp = nodelist_checkflag(state.node.flags, "IBN") == 0;
|
||||||
|
state.node.do_ifcico = nodelist_checkflag(state.node.flags, "IFC") == 0;
|
||||||
|
state.node.do_telnet = nodelist_checkflag(state.node.flags, "ITN") == 0;
|
||||||
|
DEB((D_EVENT, "sess_call: applied original flags=%s", state.node.flags));
|
||||||
|
}
|
||||||
|
if (tmpovr->sPhone && !(opts->phone)) {
|
||||||
|
(void)strnxcpy(state.node.phone, tmpovr->sPhone, strlen(tmpovr->sPhone)+1);
|
||||||
|
DEB((D_EVENT, "sess_call: ?skipping hidden phone=%s", state.node.phone));
|
||||||
|
if ( !(tmpovr->sFlags) && !(tmpovr->sIpaddr) ) continue; // skip only telephone
|
||||||
|
} else {
|
||||||
|
memcpy(&state.node.phone, &origphone, sizeof(origphone));
|
||||||
|
DEB((D_EVENT, "sess_call: applied original phone=%s", state.node.phone));
|
||||||
|
}
|
||||||
|
if (tmpovr->sIpaddr && !(opts->iphost)) {
|
||||||
|
(void)strnxcpy(state.node.host, tmpovr->sIpaddr, strlen(tmpovr->sIpaddr)+1);
|
||||||
|
DEB((D_EVENT, "sess_call: applied hidden ipaddr=%s", state.node.host));
|
||||||
|
}
|
||||||
|
|
||||||
|
if( (call_mustuse & CALL_TCPIP_BINKP) && (call_mayuse & CALL_TCPIP_BINKP) )
|
||||||
|
{
|
||||||
|
//if( nodelist_checkflag(state.node.flags, "IBN") != 0 )
|
||||||
|
if( state.node.do_binkp == 0 )
|
||||||
|
{
|
||||||
|
call_mayuse &= ~CALL_TCPIP_BINKP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( (call_mustuse & CALL_TCPIP_IFCICO) && (call_mayuse & CALL_TCPIP_IFCICO) )
|
||||||
|
{
|
||||||
|
//if( nodelist_checkflag(state.node.flags, "IFC") != 0 )
|
||||||
|
if( state.node.do_ifcico == 0 )
|
||||||
|
{
|
||||||
|
call_mayuse &= ~CALL_TCPIP_IFCICO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( (call_mustuse & CALL_TCPIP_TELNET) && (call_mayuse & CALL_TCPIP_TELNET) )
|
||||||
|
{
|
||||||
|
//if( nodelist_checkflag(state.node.flags, "TLN") != 0 )
|
||||||
|
if( state.node.do_telnet == 0 )
|
||||||
|
{
|
||||||
|
call_mayuse &= ~CALL_TCPIP_TELNET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( rc && (call_mayuse & CALL_TCPIP_BINKP) )
|
||||||
|
{
|
||||||
|
DEB((D_EVENT,"sess_call: calling binkp"));
|
||||||
|
rc = call_system_tcpip(CALL_TCPIP_BINKP);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( rc && (call_mayuse & CALL_TCPIP_IFCICO) )
|
||||||
|
{
|
||||||
|
DEB((D_EVENT,"sess_call: calling ifcico"));
|
||||||
|
rc = call_system_tcpip(CALL_TCPIP_IFCICO);
|
||||||
|
}
|
||||||
|
|
||||||
|
if( rc && (call_mayuse & CALL_TCPIP_TELNET) )
|
||||||
|
{
|
||||||
|
DEB((D_EVENT,"sess_call: calling telnet"));
|
||||||
|
rc = call_system_tcpip(CALL_TCPIP_TELNET);
|
||||||
|
}
|
||||||
|
DEB((D_EVENT, "sess_call: finished hidden, next is %x", tmpovr->hidden));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DIALING_
|
||||||
if( rc && (call_mayuse & CALL_MODEM) )
|
if( rc && (call_mayuse & CALL_MODEM) )
|
||||||
{
|
{
|
||||||
DEB((D_EVENT,"sess_call: calling MODEM"));
|
DEB((D_EVENT,"sess_call: calling MODEM"));
|
||||||
@ -932,7 +1065,54 @@ int call_system(s_faddr addr, const s_bforce_opts *opts)
|
|||||||
{
|
{
|
||||||
errmsg = "unable to get modem port";
|
errmsg = "unable to get modem port";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmpovr = &state.override;
|
||||||
|
while (tmpovr->hidden != NULL && rc) {
|
||||||
|
DEB((D_EVENT, "sess_call: starting hidden, current is %x", tmpovr->hidden));
|
||||||
|
tmpovr = tmpovr->hidden;
|
||||||
|
|
||||||
|
// As for now - no effect in phone calls
|
||||||
|
if (tmpovr->sFlags) {
|
||||||
|
(void)strnxcpy(state.node.flags, tmpovr->sFlags, strlen(tmpovr->sFlags)+1);
|
||||||
|
DEB((D_EVENT, "sess_call: applied hidden flags=%s", state.node.flags));
|
||||||
|
} else {
|
||||||
|
memcpy(&state.node.flags, &origflags, sizeof(origflags));
|
||||||
|
DEB((D_EVENT, "sess_call: applied original flags=%s", state.node.flags));
|
||||||
|
}
|
||||||
|
if (tmpovr->sPhone && !(opts->phone)) {
|
||||||
|
(void)strnxcpy(state.node.phone, tmpovr->sPhone, strlen(tmpovr->sPhone)+1);
|
||||||
|
DEB((D_EVENT, "sess_call: applied hidden phone=%s", state.node.phone));
|
||||||
|
} else {
|
||||||
|
DEB((D_EVENT, "sess_call: no hidden phone - skipping"));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( state.modemport )
|
||||||
|
{
|
||||||
|
|
||||||
|
if( port_lock(p_lockdir, state.modemport) == 0 ) /* Successfuly locked port */
|
||||||
|
{
|
||||||
|
DEB((D_EVENT,"sess_call: hidden call_system_modem running"));
|
||||||
|
rc = call_system_modem();
|
||||||
|
port_unlock(p_lockdir, state.modemport);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errmsg = "cannot lock modem port";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
errmsg = "unable to get modem port";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// END_DIALING
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// END CALLING
|
||||||
|
|
||||||
if( rc )
|
if( rc )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -135,14 +135,16 @@ int override_get(s_override *dest, s_faddr addr, int line)
|
|||||||
{
|
{
|
||||||
s_override *p;
|
s_override *p;
|
||||||
int curline = 0;
|
int curline = 0;
|
||||||
|
|
||||||
p = conf_override(cf_override, addr);
|
p = conf_override(cf_override, addr);
|
||||||
|
|
||||||
curline = 0;
|
curline = 0;
|
||||||
while( p && curline < line )
|
if (line > 0)
|
||||||
{
|
{
|
||||||
p = p->hidden;
|
while( p && curline < line )
|
||||||
++curline;
|
{
|
||||||
|
p = p->hidden;
|
||||||
|
++curline;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( p && curline == line )
|
if( p && curline == line )
|
||||||
@ -152,7 +154,7 @@ int override_get(s_override *dest, s_faddr addr, int line)
|
|||||||
}
|
}
|
||||||
else if( line == 0 )
|
else if( line == 0 )
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -223,7 +223,8 @@ int session_init_outgoing()
|
|||||||
}
|
}
|
||||||
else if( c == ENQ )
|
else if( c == ENQ )
|
||||||
{
|
{
|
||||||
if( enq_need && ++enqcount >= enq_need && canyoohoo )
|
if ( ++enqcount >= enq_need && canyoohoo )
|
||||||
|
//if( enq_need && ++enqcount >= enq_need && canyoohoo )
|
||||||
{
|
{
|
||||||
DEB((D_HSHAKE, "tx_init: exit with YooHoo"));
|
DEB((D_HSHAKE, "tx_init: exit with YooHoo"));
|
||||||
state.session = SESSION_YOOHOO;
|
state.session = SESSION_YOOHOO;
|
||||||
@ -232,7 +233,8 @@ int session_init_outgoing()
|
|||||||
}
|
}
|
||||||
else if( c == TSYNC )
|
else if( c == TSYNC )
|
||||||
{
|
{
|
||||||
if( nak_need && ++nakcount > nak_need && canftsc )
|
if( ++nakcount > nak_need && canftsc )
|
||||||
|
//if( nak_need && ++nakcount > nak_need && canftsc )
|
||||||
{
|
{
|
||||||
DEB((D_HSHAKE, "tx_init: exit with FTS-1"));
|
DEB((D_HSHAKE, "tx_init: exit with FTS-1"));
|
||||||
state.session = SESSION_FTSC;
|
state.session = SESSION_FTSC;
|
||||||
|
|||||||
@ -264,7 +264,7 @@ int session_check_addr(s_faddr addr)
|
|||||||
int session_get_password(s_faddr addr, char *buffer, size_t buflen)
|
int session_get_password(s_faddr addr, char *buffer, size_t buflen)
|
||||||
{
|
{
|
||||||
s_cval_entry *pwd_ptr;
|
s_cval_entry *pwd_ptr;
|
||||||
|
buffer[0]='\0';
|
||||||
for( pwd_ptr = conf_first(cf_password); pwd_ptr;
|
for( pwd_ptr = conf_first(cf_password); pwd_ptr;
|
||||||
pwd_ptr = conf_next(pwd_ptr) )
|
pwd_ptr = conf_next(pwd_ptr) )
|
||||||
{
|
{
|
||||||
@ -612,7 +612,7 @@ void session_traffic_log(bool incoming, s_traffic *traff)
|
|||||||
strcat(msg, buf);
|
strcat(msg, buf);
|
||||||
strcat(msg, " files, ");
|
strcat(msg, " files, ");
|
||||||
}
|
}
|
||||||
if( *msg )
|
if( *msg && strlen(msg)>2 )
|
||||||
msg[strlen(msg)-2] = '\0';
|
msg[strlen(msg)-2] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -58,11 +58,11 @@ static char *session_stat_get_stsfile(s_faddr *addr, int linenum)
|
|||||||
addr->zone, addr->net,
|
addr->zone, addr->net,
|
||||||
addr->node, addr->point);
|
addr->node, addr->point);
|
||||||
else
|
else
|
||||||
sprintf(buf, "%u.%u.%u.%u-%u.sts",
|
sprintf(buf, "%u.%u.%u.%u-%d.sts",
|
||||||
addr->zone, addr->net,
|
addr->zone, addr->net,
|
||||||
addr->node, addr->point, linenum);
|
addr->node, addr->point, linenum);
|
||||||
|
|
||||||
yield = string_concat(p_stsdir, buf, NULL);
|
yield = string_concat(p_stsdir, buf, '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
return yield;
|
return yield;
|
||||||
@ -283,15 +283,14 @@ int session_stat_update(s_faddr *addr, s_sess_stat *stat, bool caller, int rc)
|
|||||||
stat->tries_nodial++;
|
stat->tries_nodial++;
|
||||||
if( BFERR_CANT_CONNECT10 <= rc && rc <= BFERR_CANT_CONNECT19 )
|
if( BFERR_CANT_CONNECT10 <= rc && rc <= BFERR_CANT_CONNECT19 )
|
||||||
stat->tries_noconn++;
|
stat->tries_noconn++;
|
||||||
if( rc >= BFERR_CONNECT_TOOLOW )
|
if( rc >= BFERR_CONNECT_TOOLOW )
|
||||||
stat->tries_sessns++;
|
|
||||||
|
|
||||||
/* Reset some counters */
|
|
||||||
if( rc >= BFERR_CONNECT_TOOLOW )
|
|
||||||
{
|
{
|
||||||
|
stat->tries_sessns++;
|
||||||
|
/* Reset some counters */
|
||||||
stat->tries_noansw = TRIES_RESET;
|
stat->tries_noansw = TRIES_RESET;
|
||||||
stat->tries_noconn = TRIES_RESET;
|
stat->tries_noconn = TRIES_RESET;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( rc > BFERR_HANDSHAKE_ERROR )
|
if( rc > BFERR_HANDSHAKE_ERROR )
|
||||||
stat->tries_hshake = TRIES_RESET;
|
stat->tries_hshake = TRIES_RESET;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -109,6 +109,22 @@ int file_lock_wait(FILE *fp, bool exclusive)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getrandname(char * buf, u_int size)
|
||||||
|
{
|
||||||
|
srand((unsigned int)time(NULL));
|
||||||
|
char c;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i<size; i++)
|
||||||
|
{
|
||||||
|
c = rand();
|
||||||
|
// Only ASCII 0..9A..Z
|
||||||
|
while ( (c > 90) || (c < 48) || ( ( c > 57) && ( c < 65 ) ) )
|
||||||
|
c = rand();
|
||||||
|
buf[i] = c;
|
||||||
|
}
|
||||||
|
buf[size]='\0';
|
||||||
|
}
|
||||||
|
|
||||||
bool file_name_issafe(int ch)
|
bool file_name_issafe(int ch)
|
||||||
{
|
{
|
||||||
if( ch == '!' ) return TRUE;
|
if( ch == '!' ) return TRUE;
|
||||||
@ -151,12 +167,21 @@ char *file_getname(char *filename)
|
|||||||
|
|
||||||
char *file_gettmp(void)
|
char *file_gettmp(void)
|
||||||
{
|
{
|
||||||
char *tmp = xstrcpy("/tmp/bforce-XXXXXX");
|
char *chunk = xmalloc(7);
|
||||||
char *res = mktemp(tmp);
|
char *res = NULL;
|
||||||
|
if (chunk)
|
||||||
if( !res )
|
{
|
||||||
free(tmp);
|
getrandname(chunk,6);
|
||||||
|
chunk[6] = '\0';
|
||||||
|
|
||||||
|
char *tmp = xstrcpy("/tmp/bforce-");
|
||||||
|
|
||||||
|
res = string_concat(tmp, chunk, '\0');
|
||||||
|
|
||||||
|
free(chunk);
|
||||||
|
if( !res )
|
||||||
|
free(tmp);
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -176,7 +176,7 @@ int strcasemask(const char *str, const char *mask)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return( *s != '\0' || *m != '\0' );
|
return( *s != '\0' || *m != '\0' ); //-V0560 It seems more logical
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -290,10 +290,10 @@ char *buffer_putint(char *buffer, int val)
|
|||||||
*/
|
*/
|
||||||
long buffer_getlong(const char *buffer)
|
long buffer_getlong(const char *buffer)
|
||||||
{
|
{
|
||||||
return ( (unsigned long) ((unsigned char) buffer[0]) )
|
return (long)( (unsigned long) ((unsigned char) buffer[0]) )
|
||||||
| ( (unsigned long) ((unsigned char) buffer[1]) << 8 )
|
| ( (unsigned long) ((unsigned char) buffer[1]) << 8 )
|
||||||
| ( (unsigned long) ((unsigned char) buffer[2]) << 16 )
|
| ( (unsigned long) ((unsigned char) buffer[2]) << 16 )
|
||||||
| ( (unsigned long) ((unsigned char) buffer[3]) << 24 );
|
| ( (unsigned long) ((unsigned char) buffer[3]) << 24 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -307,8 +307,17 @@ long buffer_getlong(const char *buffer)
|
|||||||
*/
|
*/
|
||||||
int buffer_getint(const char *buffer)
|
int buffer_getint(const char *buffer)
|
||||||
{
|
{
|
||||||
return ( (unsigned int) ((unsigned char) buffer[0]) )
|
return (int)( (unsigned int) ((unsigned char) buffer[0]) )
|
||||||
| ( (unsigned int) ((unsigned char) buffer[1]) << 8 );
|
| ( (unsigned int) ((unsigned char) buffer[1]) << 8 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void swap_long(char *buffer){
|
||||||
|
char *temp = xmemcpy(buffer, sizeof(uint32_t));
|
||||||
|
temp[0] = buffer[2];
|
||||||
|
temp[1] = buffer[3];
|
||||||
|
temp[2] = buffer[0];
|
||||||
|
temp[3] = buffer[1];
|
||||||
|
memcpy(buffer,temp,sizeof(uint32_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
void printf_usage(const char *ident, const char *fmt, ...)
|
void printf_usage(const char *ident, const char *fmt, ...)
|
||||||
@ -329,7 +338,7 @@ void printf_usage(const char *ident, const char *fmt, ...)
|
|||||||
else
|
else
|
||||||
printf("Sorry, no usage information available\n\n");
|
printf("Sorry, no usage information available\n\n");
|
||||||
|
|
||||||
printf("Mail bug reports to <adb@newmail.ru>\n");
|
printf("Mail bug reports to <zx@zxalexis.ru>\n");
|
||||||
|
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -152,7 +152,13 @@ int plock_link(const char *lockname, const char *tmpname)
|
|||||||
int plock_create(const char *lockname)
|
int plock_create(const char *lockname)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
char *tmpname, *p;
|
char *tmpname, *p, *chunk;
|
||||||
|
chunk = xmalloc(7);
|
||||||
|
if (!chunk) {
|
||||||
|
logerr("can't malloc mem for generation of lock name");
|
||||||
|
DEB((D_FREE, "plock freed"));
|
||||||
|
return PLOCK_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
ASSERT(lockname != NULL);
|
ASSERT(lockname != NULL);
|
||||||
|
|
||||||
@ -166,16 +172,10 @@ int plock_create(const char *lockname)
|
|||||||
DEB((D_FREE, "plock freed"));
|
DEB((D_FREE, "plock freed"));
|
||||||
return PLOCK_ERROR;
|
return PLOCK_ERROR;
|
||||||
}
|
}
|
||||||
tmpname = xstrcat(tmpname, "bforce-XXXXXX");
|
tmpname = xstrcat(tmpname, "bforce-");
|
||||||
|
|
||||||
if( (p = mktemp(tmpname)) == NULL )
|
getrandname(chunk,6);
|
||||||
{
|
p = string_concat(tmpname,chunk,'\0');
|
||||||
logerr("can't generate unique file name from \"%s\"", tmpname);
|
|
||||||
DEB((D_FREE, "plock free"));
|
|
||||||
free(tmpname);
|
|
||||||
DEB((D_FREE, "plock freed"));
|
|
||||||
return PLOCK_ERROR;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( (rc = plock_write(p)) == PLOCK_OK )
|
if( (rc = plock_write(p)) == PLOCK_OK )
|
||||||
rc = plock_link(lockname, p);
|
rc = plock_link(lockname, p);
|
||||||
|
|||||||
@ -60,7 +60,11 @@ char *xstrcpy(const char *src)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
tmp = xmalloc(strlen(src)+1);
|
tmp = xmalloc(strlen(src)+1);
|
||||||
strcpy(tmp, src);
|
if (!tmp)
|
||||||
|
return NULL;
|
||||||
|
else
|
||||||
|
strcpy(tmp, src);
|
||||||
|
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
@ -85,15 +89,16 @@ char *xstrcat(char *src, const char *add)
|
|||||||
|
|
||||||
size = (src ? strlen(src) : 0) + strlen(add);
|
size = (src ? strlen(src) : 0) + strlen(add);
|
||||||
tmp = (char*)xmalloc(size+1);
|
tmp = (char*)xmalloc(size+1);
|
||||||
|
if (tmp) {
|
||||||
if( src )
|
if( src )
|
||||||
{
|
{
|
||||||
strcpy(tmp, src);
|
strcpy(tmp, src);
|
||||||
free(src);
|
free(src);
|
||||||
} else
|
} else
|
||||||
*tmp = '\0';
|
*tmp = '\0';
|
||||||
|
|
||||||
strcat(tmp, add);
|
strcat(tmp, add);
|
||||||
|
}
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
@ -216,7 +221,7 @@ char *string_chomp(char *str)
|
|||||||
|
|
||||||
ASSERT(str != NULL);
|
ASSERT(str != NULL);
|
||||||
|
|
||||||
if( str && *str )
|
if( *str )
|
||||||
{
|
{
|
||||||
p = str + strlen(str + 1);
|
p = str + strlen(str + 1);
|
||||||
if( *p == '\n' )
|
if( *p == '\n' )
|
||||||
@ -383,7 +388,7 @@ char *string_trimright(char *str)
|
|||||||
|
|
||||||
ASSERT(str != NULL);
|
ASSERT(str != NULL);
|
||||||
|
|
||||||
if( str && *str )
|
if( *str )
|
||||||
{
|
{
|
||||||
p = str + strlen(str+1);
|
p = str + strlen(str+1);
|
||||||
while( p >= str && isspace(*p) ) *p-- = '\0';
|
while( p >= str && isspace(*p) ) *p-- = '\0';
|
||||||
@ -407,7 +412,7 @@ char *string_trimleft(char *str)
|
|||||||
|
|
||||||
ASSERT(str != NULL);
|
ASSERT(str != NULL);
|
||||||
|
|
||||||
if( str && *str )
|
if( *str )
|
||||||
{
|
{
|
||||||
p = str;
|
p = str;
|
||||||
while( isspace(*p) ) p++;
|
while( isspace(*p) ) p++;
|
||||||
@ -433,7 +438,7 @@ char *string_trimboth(char *str)
|
|||||||
|
|
||||||
ASSERT(str != NULL);
|
ASSERT(str != NULL);
|
||||||
|
|
||||||
if( str && *str )
|
if( *str )
|
||||||
{
|
{
|
||||||
/* Remove leading spaces */
|
/* Remove leading spaces */
|
||||||
p = str;
|
p = str;
|
||||||
@ -598,6 +603,8 @@ int string_parse(char **dest, int items, char *str, int separator)
|
|||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
char *p = str;
|
char *p = str;
|
||||||
|
//if ( *((unsigned char *)p) == separator )
|
||||||
|
// p++;
|
||||||
|
|
||||||
dest[count++] = str;
|
dest[count++] = str;
|
||||||
|
|
||||||
@ -606,6 +613,7 @@ int string_parse(char **dest, int items, char *str, int separator)
|
|||||||
if( *((unsigned char *)p) == separator )
|
if( *((unsigned char *)p) == separator )
|
||||||
{
|
{
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
|
// DEB((D_INDEX,"Parsed string: %s", dest[count]));
|
||||||
dest[count++] = p;
|
dest[count++] = p;
|
||||||
} else
|
} else
|
||||||
++p;
|
++p;
|
||||||
@ -673,7 +681,7 @@ char *string_translate(const char *str, const char *find, const char *repl)
|
|||||||
size_t sz_find = strlen(find);
|
size_t sz_find = strlen(find);
|
||||||
size_t sz_repl = strlen(repl);
|
size_t sz_repl = strlen(repl);
|
||||||
size_t sz_dest = strlen(str);
|
size_t sz_dest = strlen(str);
|
||||||
char *dest, *p;
|
char *tmp, *dest, *p;
|
||||||
|
|
||||||
p = dest = xstrcpy(str);
|
p = dest = xstrcpy(str);
|
||||||
|
|
||||||
@ -686,9 +694,13 @@ char *string_translate(const char *str, const char *find, const char *repl)
|
|||||||
size_t offset = p - dest;
|
size_t offset = p - dest;
|
||||||
size_t newsize = sz_dest + (sz_repl - sz_find);
|
size_t newsize = sz_dest + (sz_repl - sz_find);
|
||||||
|
|
||||||
if( newsize > sz_dest )
|
if( newsize > sz_dest ) {
|
||||||
dest = xrealloc(dest, newsize+1);
|
tmp = xrealloc(dest, newsize+1);
|
||||||
|
if (!tmp) {
|
||||||
|
free(dest);
|
||||||
|
return NULL;
|
||||||
|
} else dest = tmp;
|
||||||
|
}
|
||||||
if( sz_repl > sz_find )
|
if( sz_repl > sz_find )
|
||||||
memmove(dest + offset + (sz_repl - sz_find), dest + offset, sz_dest - offset + 1);
|
memmove(dest + offset + (sz_repl - sz_find), dest + offset, sz_dest - offset + 1);
|
||||||
else if( sz_repl < sz_find )
|
else if( sz_repl < sz_find )
|
||||||
@ -839,18 +851,19 @@ char *string_concat(const char *str, ...)
|
|||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
yield = xmalloc(yield_len + 1);
|
yield = xmalloc(yield_len + 1);
|
||||||
strncpy(yield, str, yield_len);
|
if (yield) {
|
||||||
yield[yield_len] = '\0';
|
strncpy(yield, str, yield_len);
|
||||||
yield_ptr = yield + strlen(yield);
|
yield[yield_len] = '\0';
|
||||||
|
yield_ptr = yield + strlen(yield);
|
||||||
|
|
||||||
va_start(args, str);
|
va_start(args, str);
|
||||||
while( (p = va_arg(args, char *)) )
|
while( (p = va_arg(args, char *)) )
|
||||||
{
|
{
|
||||||
strcpy(yield_ptr, p);
|
strcpy(yield_ptr, p);
|
||||||
yield_ptr += strlen(p);
|
yield_ptr += strlen(p);
|
||||||
|
}
|
||||||
|
va_end(args);
|
||||||
}
|
}
|
||||||
va_end(args);
|
|
||||||
|
|
||||||
return yield;
|
return yield;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -469,7 +469,7 @@ int timevec_parse(s_timevec *dest, const char *str)
|
|||||||
|
|
||||||
end_day = beg_day;
|
end_day = beg_day;
|
||||||
|
|
||||||
if( beg_day >= DAY_MONDAY && beg_day <= DAY_SUNDAY )
|
if( beg_day <= DAY_SUNDAY )
|
||||||
str += 3;
|
str += 3;
|
||||||
else if( beg_day == DAY_ANY )
|
else if( beg_day == DAY_ANY )
|
||||||
str += 3;
|
str += 3;
|
||||||
|
|||||||
@ -29,11 +29,12 @@ bool eventexpr(s_expr *expr)
|
|||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf_usage("nodelist compiler",
|
printf_usage("nodelist compiler",
|
||||||
"usage: bfindex [-fh]\n"
|
"usage: bfindex [-fh] [-C config]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"options:\n"
|
"options:\n"
|
||||||
" -f force nodelist compiling\n"
|
" -f force nodelist compiling\n"
|
||||||
" -h show this help message\n"
|
" -h show this help message\n"
|
||||||
|
" -C config use config\n"
|
||||||
"\n"
|
"\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -42,6 +43,7 @@ static int nodelist_makeindex(s_nodelist *nlp, s_faddr addr)
|
|||||||
{
|
{
|
||||||
s_bni bni;
|
s_bni bni;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
bool modepoint = FALSE;
|
||||||
long countnodes = 0L;
|
long countnodes = 0L;
|
||||||
long countlines = 0L;
|
long countlines = 0L;
|
||||||
enum nodelist_keyword keyword;
|
enum nodelist_keyword keyword;
|
||||||
@ -52,6 +54,9 @@ static int nodelist_makeindex(s_nodelist *nlp, s_faddr addr)
|
|||||||
bni.node = addr.node;
|
bni.node = addr.node;
|
||||||
bni.point = addr.point;
|
bni.point = addr.point;
|
||||||
|
|
||||||
|
DEB((D_INDEX, "Start create index for addr: %u:%u/%u.%u", bni.zone,
|
||||||
|
bni.net, bni.node, bni.point));
|
||||||
|
|
||||||
if( nodelist_createheader(nlp) == -1 )
|
if( nodelist_createheader(nlp) == -1 )
|
||||||
{
|
{
|
||||||
log("cannot create nodelist index header");
|
log("cannot create nodelist index header");
|
||||||
@ -80,13 +85,16 @@ static int nodelist_makeindex(s_nodelist *nlp, s_faddr addr)
|
|||||||
|
|
||||||
if( (p = strchr(buf, ',')) )
|
if( (p = strchr(buf, ',')) )
|
||||||
{
|
{
|
||||||
|
//DEB((D_INDEX, "index: parse comma: %s", p ));
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
if( (q = strchr(p, ',')) ) *q = '\0';
|
if( (q = strchr(p, ',')) ) *q = '\0';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( p == NULL || *p == '\0' )
|
if( p == NULL || *p == '\0' )
|
||||||
{
|
{
|
||||||
log("incorrect nodelist line %ld: Short line", countlines);
|
log("incorrect nodelist line %ld: Short line", countlines);
|
||||||
|
DEB((D_INDEX,"incorrect nodelist line %ld: Short line", countlines));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,20 +102,28 @@ static int nodelist_makeindex(s_nodelist *nlp, s_faddr addr)
|
|||||||
{
|
{
|
||||||
log("incorrect nodelist line %d: Bad keyword \"%s\"",
|
log("incorrect nodelist line %d: Bad keyword \"%s\"",
|
||||||
countlines, buf);
|
countlines, buf);
|
||||||
|
DEB((D_INDEX,"incorrect nodelist line %d: Bad keyword \"%s\"",
|
||||||
|
countlines, buf));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
//DEB((D_INDEX,"index: keyword=%d", keyword));
|
||||||
if( keyword == KEYWORD_BOSS )
|
if( keyword == KEYWORD_BOSS )
|
||||||
{
|
{
|
||||||
s_faddr tmpaddr;
|
s_faddr tmpaddr;
|
||||||
|
|
||||||
if( ftn_addrparse(&tmpaddr, p, FALSE) )
|
if( ftn_addrparse(&tmpaddr, p, FALSE) )
|
||||||
{
|
{
|
||||||
|
DEB((D_INDEX,"incorrect nodelist line %ld: Bad boss address \"%s\"",
|
||||||
|
countlines, p));
|
||||||
log("incorrect nodelist line %ld: Bad boss address \"%s\"",
|
log("incorrect nodelist line %ld: Bad boss address \"%s\"",
|
||||||
countlines, p);
|
countlines, p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
DEB((D_INDEX,"index: parsing Boss %u:%u/%u.0",
|
||||||
|
tmpaddr.zone, tmpaddr.net, tmpaddr.node));
|
||||||
|
if (addr.point == -1 )
|
||||||
|
modepoint = true;
|
||||||
bni.zone = tmpaddr.zone;
|
bni.zone = tmpaddr.zone;
|
||||||
bni.net = tmpaddr.net;
|
bni.net = tmpaddr.net;
|
||||||
bni.node = tmpaddr.node;
|
bni.node = tmpaddr.node;
|
||||||
@ -131,36 +147,43 @@ static int nodelist_makeindex(s_nodelist *nlp, s_faddr addr)
|
|||||||
bni.node = 0;
|
bni.node = 0;
|
||||||
bni.point = 0;
|
bni.point = 0;
|
||||||
bni.hub = 0;
|
bni.hub = 0;
|
||||||
|
modepoint = false;
|
||||||
break;
|
break;
|
||||||
case KEYWORD_REGION:
|
case KEYWORD_REGION:
|
||||||
|
case KEYWORD_HOST: //-V1037
|
||||||
bni.net = value;
|
bni.net = value;
|
||||||
bni.node = 0;
|
bni.node = 0;
|
||||||
bni.point = 0;
|
bni.point = 0;
|
||||||
bni.hub = 0;
|
bni.hub = 0;
|
||||||
|
modepoint = false;
|
||||||
break;
|
break;
|
||||||
case KEYWORD_HOST:
|
case KEYWORD_HUB: //-V1037
|
||||||
bni.net = value;
|
|
||||||
bni.node = 0;
|
|
||||||
bni.point = 0;
|
|
||||||
bni.hub = 0;
|
|
||||||
break;
|
|
||||||
case KEYWORD_HUB:
|
|
||||||
bni.node = value;
|
bni.node = value;
|
||||||
bni.point = 0;
|
bni.point = 0;
|
||||||
bni.hub = value;
|
bni.hub = value;
|
||||||
|
modepoint = false;
|
||||||
break;
|
break;
|
||||||
case KEYWORD_EMPTY:
|
case KEYWORD_EMPTY:
|
||||||
|
if (modepoint)
|
||||||
|
{
|
||||||
|
//DEB((D_INDEX,"found empty value=%u",value ));
|
||||||
|
bni.point = value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case KEYWORD_PVT:
|
case KEYWORD_PVT:
|
||||||
case KEYWORD_HOLD:
|
case KEYWORD_HOLD:
|
||||||
case KEYWORD_DOWN:
|
case KEYWORD_DOWN:
|
||||||
bni.node = value;
|
bni.node = value;
|
||||||
bni.point = 0;
|
bni.point = 0;
|
||||||
|
modepoint = false;
|
||||||
break;
|
break;
|
||||||
case KEYWORD_POINT:
|
case KEYWORD_POINT:
|
||||||
|
DEB((D_INDEX,"index: kw point"));
|
||||||
bni.point = value;
|
bni.point = value;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ASSERT_MSG();
|
ASSERT_MSG();
|
||||||
|
DEB((D_INDEX,"index: default assert"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if( nodelist_putindex(nlp, &bni) == -1 )
|
if( nodelist_putindex(nlp, &bni) == -1 )
|
||||||
@ -182,10 +205,12 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
s_cval_entry *cfptr;
|
s_cval_entry *cfptr;
|
||||||
char *nodelistdir = NULL;
|
char *nodelistdir = NULL;
|
||||||
|
char *confname = NULL;
|
||||||
time_t starttime = 0L;
|
time_t starttime = 0L;
|
||||||
bool forcecompile = FALSE;
|
bool forcecompile = FALSE;
|
||||||
long countnodes = 0L;
|
long countnodes = 0L;
|
||||||
char c;
|
char c;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
/* Initialise random number generation */
|
/* Initialise random number generation */
|
||||||
(void)srand((unsigned)time(0));
|
(void)srand((unsigned)time(0));
|
||||||
@ -193,7 +218,7 @@ int main(int argc, char *argv[])
|
|||||||
(void)setlocale(LC_ALL, "");
|
(void)setlocale(LC_ALL, "");
|
||||||
/* Set our name (for logging only) */
|
/* Set our name (for logging only) */
|
||||||
|
|
||||||
while( (c = getopt(argc, argv, "hf")) != (char)-1 )
|
while( (c = getopt(argc, argv, "hfC:")) != (char)-1 )
|
||||||
{
|
{
|
||||||
switch( c ) {
|
switch( c ) {
|
||||||
case 'f':
|
case 'f':
|
||||||
@ -202,15 +227,25 @@ int main(int argc, char *argv[])
|
|||||||
case 'h':
|
case 'h':
|
||||||
usage();
|
usage();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
case 'C':
|
||||||
|
if( confname || !optarg ) { usage(); exit(5); }
|
||||||
|
confname = (char *)xstrcpy(optarg);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
exit(5);
|
exit(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( conf_readconf(conf_getconfname(), 0, false) )
|
if( confname && *confname )
|
||||||
|
rc = conf_readconf(confname, 0, false);
|
||||||
|
else
|
||||||
|
rc = conf_readconf(conf_getconfname(), 0, false);
|
||||||
|
|
||||||
|
if( rc )
|
||||||
{
|
{
|
||||||
|
log("Can not find config");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,7 @@ bool eventexpr(s_expr *expr)
|
|||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf_usage("outbound viewer",
|
printf_usage("outbound viewer",
|
||||||
"usage: bfstat [-afhprst] [-n<number>]\n"
|
"usage: bfstat [-C config] [-afhprst] [-n<number>]\n"
|
||||||
"\n"
|
"\n"
|
||||||
"options:\n"
|
"options:\n"
|
||||||
" -a sort by FTN address (default)\n"
|
" -a sort by FTN address (default)\n"
|
||||||
@ -56,6 +56,7 @@ static void usage(void)
|
|||||||
" -r reverse order while sorting\n"
|
" -r reverse order while sorting\n"
|
||||||
" -s sort by total files size\n"
|
" -s sort by total files size\n"
|
||||||
" -t disable total sizes printing\n"
|
" -t disable total sizes printing\n"
|
||||||
|
" -C config use config file\n"
|
||||||
"\n"
|
"\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -248,8 +249,10 @@ int main(int argc, char *argv[])
|
|||||||
s_opts opts;
|
s_opts opts;
|
||||||
s_sysqueue queue;
|
s_sysqueue queue;
|
||||||
s_outbound_callback_data ocb;
|
s_outbound_callback_data ocb;
|
||||||
|
char *confname = NULL;
|
||||||
char c;
|
char c;
|
||||||
int i;
|
int i;
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
bfstat_opts_default(&opts);
|
bfstat_opts_default(&opts);
|
||||||
|
|
||||||
@ -288,6 +291,10 @@ int main(int argc, char *argv[])
|
|||||||
if( ISDEC(optarg) )
|
if( ISDEC(optarg) )
|
||||||
opts.nodeslimit = atoi(optarg);
|
opts.nodeslimit = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'C':
|
||||||
|
if( confname || !optarg ) { usage(); exit(BFERR_FATALERROR); }
|
||||||
|
confname = (char *)xstrcpy(optarg);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
exit(1);
|
exit(1);
|
||||||
@ -301,8 +308,16 @@ int main(int argc, char *argv[])
|
|||||||
/* Initialise current locale */
|
/* Initialise current locale */
|
||||||
(void)setlocale(LC_ALL, "");
|
(void)setlocale(LC_ALL, "");
|
||||||
|
|
||||||
if( conf_readconf(conf_getconfname(), 0, false) )
|
if( confname && *confname )
|
||||||
exit(1);
|
rc = conf_readconf(confname, 0, false);
|
||||||
|
else
|
||||||
|
rc = conf_readconf(conf_getconfname(), 0, false);
|
||||||
|
|
||||||
|
if( rc )
|
||||||
|
{
|
||||||
|
log("Can not find config");
|
||||||
|
exit(BFERR_FATALERROR);
|
||||||
|
}
|
||||||
|
|
||||||
memset(&ocb, '\0', sizeof(s_outbound_callback_data));
|
memset(&ocb, '\0', sizeof(s_outbound_callback_data));
|
||||||
ocb.callback = out_handle_sysqueue;
|
ocb.callback = out_handle_sysqueue;
|
||||||
|
|||||||
@ -28,12 +28,15 @@ bool eventexpr(s_expr *expr)
|
|||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
printf_usage("nodelist lookup utility",
|
printf_usage("nodelist lookup utility",
|
||||||
"usage: nlookup [-rmh] <address>\n"
|
"usage: nlookup [-C config] [-romh] <address>\n"
|
||||||
"\n"
|
"\n"
|
||||||
"options:\n"
|
"options:\n"
|
||||||
" -r show nodelist string\n"
|
" -r show nodelist string\n"
|
||||||
" -m show email address\n"
|
" -m show email address\n"
|
||||||
|
" -o show overrides\n"
|
||||||
|
" -t show calltable\n"
|
||||||
" -h show this help message\n"
|
" -h show this help message\n"
|
||||||
|
" -C config use config file\n"
|
||||||
"\n"
|
"\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -42,7 +45,7 @@ void print_nodemail(const s_node *node)
|
|||||||
{
|
{
|
||||||
char abuf[BF_MAXADDRSTR+1];
|
char abuf[BF_MAXADDRSTR+1];
|
||||||
|
|
||||||
if( node->sysop && *node->sysop && strcmp(node->sysop, "<none>") )
|
if( *node->sysop && strcmp(node->sysop, "<none>") )
|
||||||
{
|
{
|
||||||
char username[BNI_MAXSYSOP+1];
|
char username[BNI_MAXSYSOP+1];
|
||||||
|
|
||||||
@ -67,7 +70,7 @@ void print_nodeinfo(const s_node *node)
|
|||||||
printf("Phone : %s\n", node->phone);
|
printf("Phone : %s\n", node->phone);
|
||||||
printf("Sysop : %s\n", node->sysop);
|
printf("Sysop : %s\n", node->sysop);
|
||||||
printf("Location : %s\n", node->location);
|
printf("Location : %s\n", node->location);
|
||||||
printf("Speed : %lu\n", node->speed);
|
printf("Speed : %ld\n", node->speed);
|
||||||
printf("Flags : %s\n", node->flags);
|
printf("Flags : %s\n", node->flags);
|
||||||
|
|
||||||
if( node->worktime.num )
|
if( node->worktime.num )
|
||||||
@ -82,7 +85,7 @@ void print_nodeinfo(const s_node *node)
|
|||||||
timevec_check(&node->worktime, now) ? "false" : "true");
|
timevec_check(&node->worktime, now) ? "false" : "true");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( node->sysop && *node->sysop && strcmp(node->sysop, "<none>") )
|
if( (node->keyword != KEYWORD_POINT) && *node->sysop && strcmp(node->sysop, "<none>") )
|
||||||
{
|
{
|
||||||
char username[BNI_MAXSYSOP+1];
|
char username[BNI_MAXSYSOP+1];
|
||||||
|
|
||||||
@ -122,20 +125,174 @@ void print_nodeinfo(const s_node *node)
|
|||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_overrides(const s_override *override_info)
|
||||||
|
{
|
||||||
|
s_override *p;
|
||||||
|
char abuf[BF_MAXADDRSTR+1];
|
||||||
|
int lin = 0;
|
||||||
|
printf("----------- Overrides ------------\n");
|
||||||
|
printf("Address : %s\n", ftn_addrstr(abuf, override_info->addr));
|
||||||
|
printf("IpAddr : %s\n", override_info->sIpaddr);
|
||||||
|
printf("Phone : %s\n", override_info->sPhone);
|
||||||
|
printf("Flags : %s\n", override_info->sFlags);
|
||||||
|
printf("Run before: %s\n", override_info->run);
|
||||||
|
p = override_info->hidden;
|
||||||
|
if (p) {
|
||||||
|
printf("Hidden lines:\n");
|
||||||
|
|
||||||
|
while( p )
|
||||||
|
{
|
||||||
|
printf(" %5d: ",++lin);
|
||||||
|
if (p->sIpaddr) printf("IpAddr: %s, ", p->sIpaddr);
|
||||||
|
if (p->sPhone) printf("Phone: %s", p->sPhone);
|
||||||
|
if (p->sFlags) printf("Flags: %s", p->sFlags);
|
||||||
|
printf("\n");
|
||||||
|
p = p->hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool check_phone(const char *str)
|
||||||
|
{
|
||||||
|
if( !str || !str[0] )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if( str[0] == '-' && str[1] == '\0' )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if( string_casestr(str, "unpublished") )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if( string_casestr(str, "unknown") )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if( string_casestr(str, "none") )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if( string_casestr(str, "00-00-000000") )
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void print_calltable(s_faddr addr){
|
||||||
|
s_node nnode;
|
||||||
|
s_override *ovr, *tmpovr;
|
||||||
|
char *tmphost, *tmpphone;
|
||||||
|
int rc,ln = 0;
|
||||||
|
|
||||||
|
|
||||||
|
if( nodelist_lookup(&nnode, addr) == 0 )
|
||||||
|
{
|
||||||
|
// we got nodelist string
|
||||||
|
ovr = conf_override(cf_override, addr);
|
||||||
|
// be aware - ovr may not be, but second INA may
|
||||||
|
if (ovr) {
|
||||||
|
ovr->addr = addr;
|
||||||
|
if (ovr->sIpaddr) strcpy (nnode.host, ovr->sIpaddr);
|
||||||
|
if (ovr->sPhone) strcpy (nnode.phone, ovr->sPhone);
|
||||||
|
if (ovr->sFlags) strcpy (nnode.flags, ovr->sFlags);
|
||||||
|
} else {
|
||||||
|
ovr = xmalloc(sizeof(s_override));
|
||||||
|
memset(ovr,'\0',sizeof(s_override));
|
||||||
|
ovr->addr=addr;
|
||||||
|
ovr->hidden=NULL;
|
||||||
|
ovr->sIpaddr=NULL;
|
||||||
|
}
|
||||||
|
rc = nodelist_parsehiddenina(&nnode, ovr);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
// we have no nodelist string - only overrides
|
||||||
|
ovr = conf_override(cf_override, addr);
|
||||||
|
if (ovr) {
|
||||||
|
ovr->addr = addr;
|
||||||
|
if (ovr->sIpaddr) strcpy (nnode.host, ovr->sIpaddr);
|
||||||
|
if (ovr->sPhone) strcpy (nnode.phone, ovr->sPhone);
|
||||||
|
if (ovr->sFlags) strcpy (nnode.flags, ovr->sFlags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Let's print this table
|
||||||
|
// begin with HOST itself
|
||||||
|
ln = 0;
|
||||||
|
if (nnode.host[0]) {
|
||||||
|
tmphost = nnode.host;
|
||||||
|
}
|
||||||
|
if (!nodelist_checkflag(nnode.flags, "IBN")) {
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. %s:binkp\n", ln, tmphost);
|
||||||
|
}
|
||||||
|
if (!nodelist_checkflag(nnode.flags, "IFC")) {
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. %s:ifcico\n", ln, tmphost);
|
||||||
|
}
|
||||||
|
if (!nodelist_checkflag(nnode.flags, "ITN")) {
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. %s:telnet\n", ln, tmphost);
|
||||||
|
}
|
||||||
|
if (ovr->hidden) {
|
||||||
|
tmpovr = ovr;
|
||||||
|
while (ovr->hidden != NULL) {
|
||||||
|
ovr = ovr->hidden;
|
||||||
|
if (ovr->sIpaddr) {
|
||||||
|
tmphost = ovr->sIpaddr;
|
||||||
|
if (!nodelist_checkflag(nnode.flags, "IBN")) {
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. %s:binkp\n", ln, tmphost);
|
||||||
|
}
|
||||||
|
if (!nodelist_checkflag(nnode.flags, "IFC")) {
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. %s:ifcico\n", ln, tmphost);
|
||||||
|
}
|
||||||
|
if (!nodelist_checkflag(nnode.flags, "ITN")) {
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. %s:telnet\n", ln, tmphost);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ovr = tmpovr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calltable for pstn
|
||||||
|
if (nnode.phone[0] && check_phone(nnode.phone) ) {
|
||||||
|
tmpphone = nnode.phone;
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. PSTN %s\n", ln, tmpphone);
|
||||||
|
if (ovr->hidden) {
|
||||||
|
tmpovr = ovr;
|
||||||
|
while (ovr->hidden != NULL) {
|
||||||
|
ovr = ovr->hidden;
|
||||||
|
if (ovr->sPhone && check_phone(ovr->sPhone)) {
|
||||||
|
tmpphone = ovr->sPhone;
|
||||||
|
ln +=1;
|
||||||
|
printf ("%5d. PSTN %s\n", ln, tmpphone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ovr = tmpovr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// free ovr elements
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
s_node node;
|
s_node node;
|
||||||
s_faddr addr;
|
s_faddr addr;
|
||||||
|
s_override *ovr;
|
||||||
char ch;
|
char ch;
|
||||||
|
int rc = 0;
|
||||||
|
char *confname = NULL;
|
||||||
bool rawstring = FALSE;
|
bool rawstring = FALSE;
|
||||||
bool emailaddr = FALSE;
|
bool emailaddr = FALSE;
|
||||||
|
bool overrides = FALSE;
|
||||||
|
bool calltable = FALSE;
|
||||||
|
|
||||||
/* Initialise random number generation */
|
/* Initialise random number generation */
|
||||||
(void)srand((unsigned)time(0));
|
(void)srand((unsigned)time(0));
|
||||||
/* Initialise current locale */
|
/* Initialise current locale */
|
||||||
(void)setlocale(LC_ALL, "");
|
(void)setlocale(LC_ALL, "");
|
||||||
|
|
||||||
while( (ch=getopt(argc, argv, "hrm")) != (char)-1 )
|
while( (ch=getopt(argc, argv, "hdrtmoC:")) != (char)-1 )
|
||||||
{
|
{
|
||||||
switch( ch ) {
|
switch( ch ) {
|
||||||
case 'h':
|
case 'h':
|
||||||
@ -147,6 +304,16 @@ int main(int argc, char *argv[])
|
|||||||
case 'm':
|
case 'm':
|
||||||
emailaddr = TRUE;
|
emailaddr = TRUE;
|
||||||
break;
|
break;
|
||||||
|
case 't':
|
||||||
|
calltable = TRUE;
|
||||||
|
break;
|
||||||
|
case 'o':
|
||||||
|
overrides = TRUE;
|
||||||
|
break;
|
||||||
|
case 'C':
|
||||||
|
if( confname || !optarg ) { usage(); exit(BFERR_FATALERROR); }
|
||||||
|
confname = (char *)xstrcpy(optarg);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
exit(BFERR_FATALERROR);
|
exit(BFERR_FATALERROR);
|
||||||
@ -159,8 +326,18 @@ int main(int argc, char *argv[])
|
|||||||
exit(BFERR_FATALERROR);
|
exit(BFERR_FATALERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( conf_readconf(conf_getconfname(), 0, false) )
|
if( confname && *confname )
|
||||||
|
rc = conf_readconf(confname, 0, false);
|
||||||
|
else
|
||||||
|
rc = conf_readconf(conf_getconfname(), 0, false);
|
||||||
|
|
||||||
|
if( rc )
|
||||||
|
{
|
||||||
|
DEB((D_NODELIST,"nlookup: Can not find config"));
|
||||||
exit(BFERR_FATALERROR);
|
exit(BFERR_FATALERROR);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEB((D_NODELIST,"Starting nlookup"));
|
||||||
|
|
||||||
if( rawstring )
|
if( rawstring )
|
||||||
{
|
{
|
||||||
@ -171,10 +348,38 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if( nodelist_lookup(&node, addr) == 0 )
|
else if( nodelist_lookup(&node, addr) == 0 )
|
||||||
{
|
{
|
||||||
if( emailaddr )
|
// Overrides
|
||||||
print_nodemail(&node);
|
ovr = conf_override(cf_override, addr);
|
||||||
else
|
|
||||||
print_nodeinfo(&node);
|
if (addr.point == 0) {
|
||||||
|
if( emailaddr )
|
||||||
|
print_nodemail(&node);
|
||||||
|
else
|
||||||
|
print_nodeinfo(&node);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print_nodeinfo(&node);
|
||||||
|
}
|
||||||
|
if (overrides && ovr) {
|
||||||
|
print_overrides(ovr);
|
||||||
|
}
|
||||||
|
if (calltable) {
|
||||||
|
printf ("----------- Calltable ------------\n");
|
||||||
|
print_calltable(addr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (overrides) {
|
||||||
|
ovr = conf_override(cf_override, addr);
|
||||||
|
if (ovr) {
|
||||||
|
printf ("-------- No nodelist info --------");
|
||||||
|
print_overrides(ovr);
|
||||||
|
if (calltable) {
|
||||||
|
printf ("----- Calltable-on-overrides -----\n");
|
||||||
|
print_calltable(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deinit_conf();
|
deinit_conf();
|
||||||
|
|||||||
11
source/configure
vendored
11
source/configure
vendored
@ -580,12 +580,12 @@ MAKEFLAGS=
|
|||||||
# Identity of this package.
|
# Identity of this package.
|
||||||
PACKAGE_NAME='bforce'
|
PACKAGE_NAME='bforce'
|
||||||
PACKAGE_TARNAME='bforce'
|
PACKAGE_TARNAME='bforce'
|
||||||
PACKAGE_VERSION='0.24.1'
|
PACKAGE_VERSION='0.26.2'
|
||||||
PACKAGE_STRING='bforce 0.24.1'
|
PACKAGE_STRING='bforce 0.26.2'
|
||||||
PACKAGE_BUGREPORT='zx@zxalexis.ru'
|
PACKAGE_BUGREPORT='zx@zxalexis.ru'
|
||||||
PACKAGE_URL='https://prj.zxalexis.ru/gitea/zx/bforce.git'
|
PACKAGE_URL='https://prj.zxalexis.ru/gitea/zx/bforce.git'
|
||||||
|
|
||||||
ac_default_prefix=/usr/local/fido
|
ac_default_prefix=/usr
|
||||||
# Factoring default headers for most tests.
|
# Factoring default headers for most tests.
|
||||||
ac_includes_default="\
|
ac_includes_default="\
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -1436,7 +1436,7 @@ fi
|
|||||||
test -n "$ac_init_help" && exit $ac_status
|
test -n "$ac_init_help" && exit $ac_status
|
||||||
if $ac_init_version; then
|
if $ac_init_version; then
|
||||||
cat <<\_ACEOF
|
cat <<\_ACEOF
|
||||||
bforce configure 0.24
|
bforce configure 0.26
|
||||||
generated by GNU Autoconf 2.69
|
generated by GNU Autoconf 2.69
|
||||||
|
|
||||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||||
@ -5792,7 +5792,7 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
|
|||||||
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ac_config_files="$ac_config_files ../debian/Makefile"
|
ac_config_files="$ac_config_files"
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
@ -6486,7 +6486,6 @@ do
|
|||||||
case $ac_config_target in
|
case $ac_config_target in
|
||||||
"include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
|
"include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
|
||||||
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
|
||||||
"../debian/Makefile") CONFIG_FILES="$CONFIG_FILES ../debian/Makefile" ;;
|
|
||||||
|
|
||||||
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@ -3,7 +3,7 @@ dnl
|
|||||||
dnl $Id$
|
dnl $Id$
|
||||||
dnl
|
dnl
|
||||||
#AC_INIT(bforce/bforce.c)
|
#AC_INIT(bforce/bforce.c)
|
||||||
AC_INIT([bforce],[0.24.1],[zx@zxalexis.ru])
|
AC_INIT([bforce],[0.27],[zx@zxalexis.ru])
|
||||||
AC_CONFIG_HEADER(include/config.h)
|
AC_CONFIG_HEADER(include/config.h)
|
||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
dnl # Minimum Autoconf version required.
|
dnl # Minimum Autoconf version required.
|
||||||
|
|||||||
@ -141,8 +141,8 @@ typedef struct override {
|
|||||||
char *sPhone;
|
char *sPhone;
|
||||||
char *sFlags;
|
char *sFlags;
|
||||||
s_timevec worktime;
|
s_timevec worktime;
|
||||||
s_timevec freqtime;
|
s_timevec freqtime;
|
||||||
char *run;
|
char *run;
|
||||||
struct override *hidden; /* Hidden lines list */
|
struct override *hidden; /* Hidden lines list */
|
||||||
} s_override;
|
} s_override;
|
||||||
|
|
||||||
@ -159,130 +159,130 @@ typedef struct filebox {
|
|||||||
} s_filebox;
|
} s_filebox;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
cf_address,
|
cf_address, // 0
|
||||||
cf_amiga_outbound_directory,
|
cf_amiga_outbound_directory, // 1
|
||||||
cf_binkp_timeout,
|
cf_binkp_timeout, // 2
|
||||||
cf_daemon_circle,
|
cf_daemon_circle, // 3
|
||||||
cf_daemon_circle_crash,
|
cf_daemon_circle_crash, // 4
|
||||||
cf_daemon_circle_direct,
|
cf_daemon_circle_direct, // 5
|
||||||
cf_daemon_circle_immed,
|
cf_daemon_circle_immed, // 6
|
||||||
cf_daemon_circle_modem,
|
cf_daemon_circle_modem, // 7
|
||||||
cf_daemon_circle_normal,
|
cf_daemon_circle_normal, // 8
|
||||||
cf_daemon_circle_rescan,
|
cf_daemon_circle_rescan, // 9
|
||||||
cf_daemon_maxclients_modem,
|
cf_daemon_maxclients_modem, // 10
|
||||||
cf_daemon_maxclients_tcpip,
|
cf_daemon_maxclients_tcpip, // 11
|
||||||
cf_daemon_pid_file,
|
cf_daemon_pid_file, // 12
|
||||||
cf_delay_files_recv,
|
cf_delay_files_recv, // 13
|
||||||
cf_delay_files_send,
|
cf_delay_files_send, // 14
|
||||||
cf_disable_aka_matching,
|
cf_disable_aka_matching, // 15
|
||||||
cf_domain,
|
cf_domain, // 16
|
||||||
cf_emsi_FR_time,
|
cf_emsi_FR_time, // 17
|
||||||
cf_emsi_OH_time,
|
cf_emsi_OH_time, // 18
|
||||||
cf_emsi_slave_sends_nak,
|
cf_emsi_slave_sends_nak, // 19
|
||||||
cf_emsi_send_tz,
|
cf_emsi_send_tz, // 20
|
||||||
cf_emsi_send_time,
|
cf_emsi_send_time, // 21
|
||||||
cf_filebox,
|
cf_filebox, // 22
|
||||||
cf_filebox_directory,
|
cf_filebox_directory, // 23
|
||||||
cf_flags,
|
cf_flags, // 24
|
||||||
cf_flo_translate,
|
cf_flo_translate, // 25
|
||||||
cf_freq_alias_list,
|
cf_freq_alias_list, // 26
|
||||||
cf_freq_dir_list,
|
cf_freq_dir_list, // 27
|
||||||
cf_freq_ignore_masks,
|
cf_freq_ignore_masks, // 28
|
||||||
cf_freq_limit_number,
|
cf_freq_limit_number, // 29
|
||||||
cf_freq_limit_size,
|
cf_freq_limit_size, // 30
|
||||||
cf_freq_limit_time,
|
cf_freq_limit_time, // 31
|
||||||
cf_freq_min_speed,
|
cf_freq_min_speed, // 32
|
||||||
cf_freq_srif_command,
|
cf_freq_srif_command, // 33
|
||||||
cf_incnet_flag,
|
cf_incnet_flag, // 34
|
||||||
cf_incarc_flag,
|
cf_incarc_flag, // 35
|
||||||
cf_inctic_flag,
|
cf_inctic_flag, // 36
|
||||||
cf_incfile_flag,
|
cf_incfile_flag, // 37
|
||||||
cf_hide_our_aka,
|
cf_hide_our_aka, // 38
|
||||||
cf_history_file,
|
cf_history_file, // 39
|
||||||
cf_hydra_options,
|
cf_hydra_options, // 40
|
||||||
cf_hydra_mincps_recv,
|
cf_hydra_mincps_recv, // 41
|
||||||
cf_hydra_mincps_send,
|
cf_hydra_mincps_send, // 42
|
||||||
cf_hydra_tx_window,
|
cf_hydra_tx_window, // 43
|
||||||
cf_hydra_rx_window,
|
cf_hydra_rx_window, // 44
|
||||||
cf_inbound_directory,
|
cf_inbound_directory, // 45
|
||||||
cf_location,
|
cf_location, // 46
|
||||||
cf_log_file,
|
cf_log_file, // 47
|
||||||
cf_log_file_daemon,
|
cf_log_file_daemon, // 48
|
||||||
cf_max_speed,
|
cf_max_speed, // 49
|
||||||
cf_maxtries,
|
cf_maxtries, // 50
|
||||||
cf_maxtries_nodial,
|
cf_maxtries_nodial, // 51
|
||||||
cf_maxtries_noansw,
|
cf_maxtries_noansw, // 52
|
||||||
cf_maxtries_noconn,
|
cf_maxtries_noconn, // 53
|
||||||
cf_maxtries_hshake,
|
cf_maxtries_hshake, // 54
|
||||||
cf_maxtries_sessions,
|
cf_maxtries_sessions, // 55
|
||||||
cf_min_cps_recv,
|
cf_min_cps_recv, // 56
|
||||||
cf_min_cps_send,
|
cf_min_cps_send, // 57
|
||||||
cf_min_cps_time,
|
cf_min_cps_time, // 58
|
||||||
cf_min_free_space,
|
cf_min_free_space, // 59
|
||||||
cf_min_speed_in,
|
cf_min_speed_in, // 60
|
||||||
cf_min_speed_out,
|
cf_min_speed_out, // 61
|
||||||
cf_mode_netmail,
|
cf_mode_netmail, // 62
|
||||||
cf_mode_arcmail,
|
cf_mode_arcmail, // 63
|
||||||
cf_mode_request,
|
cf_mode_request, // 64
|
||||||
cf_mode_ticfile,
|
cf_mode_ticfile, // 65
|
||||||
cf_mode_default,
|
cf_mode_default, // 66
|
||||||
cf_modem_can_send_break,
|
cf_modem_can_send_break, // 67
|
||||||
cf_modem_dial_prefix,
|
cf_modem_dial_prefix, // 68
|
||||||
cf_modem_dial_suffix,
|
cf_modem_dial_suffix, // 69
|
||||||
cf_modem_dial_response,
|
cf_modem_dial_response, // 70
|
||||||
cf_modem_hangup_command,
|
cf_modem_hangup_command, // 71
|
||||||
cf_modem_port,
|
cf_modem_port, // 72
|
||||||
cf_modem_reset_command,
|
cf_modem_reset_command, // 73
|
||||||
cf_modem_stat_command,
|
cf_modem_stat_command, // 74
|
||||||
cf_nodelist,
|
cf_nodelist, // 75
|
||||||
cf_nodelist_directory,
|
cf_nodelist_directory, // 76
|
||||||
cf_nodial_flag,
|
cf_nodial_flag, // 77
|
||||||
cf_override,
|
cf_override, // 78
|
||||||
cf_options,
|
cf_options, // 79
|
||||||
cf_outbound_directory,
|
cf_outbound_directory, // 80
|
||||||
cf_password,
|
cf_password, // 81
|
||||||
cf_phone,
|
cf_phone, // 82
|
||||||
cf_phone_translate,
|
cf_phone_translate, // 83
|
||||||
cf_proto_order,
|
cf_proto_order, // 84
|
||||||
cf_recode_file_in,
|
cf_recode_file_in, // 85
|
||||||
cf_recode_file_out,
|
cf_recode_file_out, // 86
|
||||||
cf_recode_intro_in,
|
cf_recode_intro_in, // 87
|
||||||
cf_recv_buffer_size,
|
cf_recv_buffer_size, // 88
|
||||||
cf_rescan_delay,
|
cf_rescan_delay, // 89
|
||||||
cf_run_after_handshake,
|
cf_run_after_handshake, // 90
|
||||||
cf_run_after_session,
|
cf_run_after_session, // 91
|
||||||
cf_run_before_session,
|
cf_run_before_session, // 92
|
||||||
cf_session_limit_in,
|
cf_session_limit_in, // 93
|
||||||
cf_session_limit_out,
|
cf_session_limit_out, // 94
|
||||||
cf_skip_files_recv,
|
cf_skip_files_recv, // 95
|
||||||
cf_status_directory,
|
cf_status_directory, // 96
|
||||||
cf_system_name,
|
cf_system_name, // 97
|
||||||
cf_sysop_name,
|
cf_sysop_name, // 98
|
||||||
cf_uucp_lock_directory,
|
cf_uucp_lock_directory, // 99
|
||||||
cf_wait_carrier_in,
|
cf_wait_carrier_in, // 100
|
||||||
cf_wait_carrier_out,
|
cf_wait_carrier_out, // 101
|
||||||
cf_zmodem_mincps_recv,
|
cf_zmodem_mincps_recv, // 102
|
||||||
cf_zmodem_mincps_send,
|
cf_zmodem_mincps_send, // 103
|
||||||
cf_zmodem_send_dummy_pkt,
|
cf_zmodem_send_dummy_pkt, // 104
|
||||||
cf_zmodem_skip_by_pos,
|
cf_zmodem_skip_by_pos, // 105
|
||||||
cf_zmodem_start_block_size,
|
cf_zmodem_start_block_size, // 106
|
||||||
cf_zmodem_tx_window,
|
cf_zmodem_tx_window, // 107
|
||||||
cf_nomail_flag,
|
cf_nomail_flag, // 108
|
||||||
cf_bind_ip,
|
cf_bind_ip, // 109
|
||||||
cf_recieved_to_lower,
|
cf_recieved_to_lower, // 110
|
||||||
#ifdef USE_SYSLOG
|
#ifdef USE_SYSLOG
|
||||||
cf_syslog_facility,
|
cf_syslog_facility,
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cf_debug_file,
|
cf_debug_file, // 111
|
||||||
cf_debug_level,
|
cf_debug_level, // 112
|
||||||
#endif
|
#endif
|
||||||
cf_split_inbound,
|
cf_split_inbound, // 113
|
||||||
#ifdef NETSPOOL
|
#ifdef NETSPOOL
|
||||||
cf_netspool_host,
|
cf_netspool_host,
|
||||||
cf_netspool_port,
|
cf_netspool_port,
|
||||||
#endif
|
#endif
|
||||||
cf_fidodnszone,
|
cf_fidodnszone, // 114
|
||||||
BFORCE_NUMBER_OF_KEYWORDS
|
BFORCE_NUMBER_OF_KEYWORDS
|
||||||
} bforce_config_keyword;
|
} bforce_config_keyword;
|
||||||
|
|
||||||
|
|||||||
@ -48,6 +48,7 @@ enum { LOG_FILE_DAEMON, LOG_FILE_SESSION, LOG_FILE_DEBUG, LOG_FILE_HISTORY };
|
|||||||
#define D_DAEMON 0x0001000L
|
#define D_DAEMON 0x0001000L
|
||||||
#define D_24554 0x0002000L
|
#define D_24554 0x0002000L
|
||||||
#define D_FREE 0x0004000L
|
#define D_FREE 0x0004000L
|
||||||
|
#define D_INDEX 0x0008000L
|
||||||
#define D_FULL 0xfffffffL
|
#define D_FULL 0xfffffffL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -65,8 +66,8 @@ void log_setident(const char *ident);
|
|||||||
int log_open(const char *logname, const char *ext, const char *tty);
|
int log_open(const char *logname, const char *ext, const char *tty);
|
||||||
int log_close(void);
|
int log_close(void);
|
||||||
int log_reopen(const char *logname, const char *ext, const char *tty);
|
int log_reopen(const char *logname, const char *ext, const char *tty);
|
||||||
int log(const char *s, ...);
|
void log(const char *s, ...);
|
||||||
int logerr(const char *s, ...);
|
void logerr(const char *s, ...);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
//void debug_setlevel(long newlevel, bool logit);
|
//void debug_setlevel(long newlevel, bool logit);
|
||||||
@ -75,7 +76,7 @@ bool debug_isopened(void);
|
|||||||
//int debug_parsestring(char *str, unsigned long *deblevel);
|
//int debug_parsestring(char *str, unsigned long *deblevel);
|
||||||
int debug_open();
|
int debug_open();
|
||||||
int debug_close();
|
int debug_close();
|
||||||
int debug(unsigned long what, const char *str, ...);
|
void debug(unsigned long what, const char *str, ...);
|
||||||
void debug_configure();
|
void debug_configure();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
* 0x0000 4 bytes Nodelist file date
|
* 0x0000 4 bytes Nodelist file date
|
||||||
* 0x0004 4 bytes Nodelist file size
|
* 0x0004 4 bytes Nodelist file size
|
||||||
* 0x0008 4 bytes Total number of entries in index file
|
* 0x0008 4 bytes Total number of entries in index file
|
||||||
* 0x000c 4 bytes Unused
|
* 0x000c 4 bytes ENDIANNES MARK
|
||||||
*
|
*
|
||||||
* Nodelist index is an array of next entries:
|
* Nodelist index is an array of next entries:
|
||||||
*
|
*
|
||||||
@ -123,6 +123,7 @@ typedef struct nodelist
|
|||||||
char name_index[BF_MAXPATH+1];
|
char name_index[BF_MAXPATH+1];
|
||||||
char name_nodelist[BF_MAXPATH+1];
|
char name_nodelist[BF_MAXPATH+1];
|
||||||
long entries;
|
long entries;
|
||||||
|
long endian;
|
||||||
}
|
}
|
||||||
s_nodelist;
|
s_nodelist;
|
||||||
|
|
||||||
@ -137,6 +138,18 @@ typedef struct bni
|
|||||||
}
|
}
|
||||||
s_bni;
|
s_bni;
|
||||||
|
|
||||||
|
typedef struct pbline
|
||||||
|
{
|
||||||
|
bool inet;
|
||||||
|
bool prot_binkp;
|
||||||
|
bool prot_cico;
|
||||||
|
char *phone;
|
||||||
|
char *ina;
|
||||||
|
int port;
|
||||||
|
struct pbline *nextline;
|
||||||
|
}
|
||||||
|
s_pbline;
|
||||||
|
|
||||||
typedef struct node
|
typedef struct node
|
||||||
{
|
{
|
||||||
s_faddr addr;
|
s_faddr addr;
|
||||||
@ -154,11 +167,13 @@ typedef struct node
|
|||||||
bool do_telnet;
|
bool do_telnet;
|
||||||
char host[BNI_MAXHOST+1];
|
char host[BNI_MAXHOST+1];
|
||||||
s_timevec worktime;
|
s_timevec worktime;
|
||||||
|
s_pbline phbook;
|
||||||
}
|
}
|
||||||
s_node;
|
s_node;
|
||||||
|
|
||||||
int nodelist_checkflag(const char *nodeflags, const char *flag);
|
int nodelist_checkflag(const char *nodeflags, const char *flag);
|
||||||
int nodelist_keywordval(const char *keyword);
|
int nodelist_keywordval(const char *keyword);
|
||||||
|
int nodelist_parsepoint(s_node *node, char *str);
|
||||||
int nodelist_parsestring(s_node *node, char *str);
|
int nodelist_parsestring(s_node *node, char *str);
|
||||||
s_nodelist *nodelist_open(const char *dir, char *name, int mode);
|
s_nodelist *nodelist_open(const char *dir, char *name, int mode);
|
||||||
int nodelist_checkheader(s_nodelist *nlp);
|
int nodelist_checkheader(s_nodelist *nlp);
|
||||||
@ -170,7 +185,7 @@ int nodelist_getstr(s_nodelist *nlp, size_t offset, char *buffer, size_t bufle
|
|||||||
int nodelist_lookup_string(char *buffer, size_t buflen, s_faddr addr);
|
int nodelist_lookup_string(char *buffer, size_t buflen, s_faddr addr);
|
||||||
int nodelist_lookup(s_node *node, s_faddr addr);
|
int nodelist_lookup(s_node *node, s_faddr addr);
|
||||||
void nodelist_initnode(s_node *node, s_faddr addr);
|
void nodelist_initnode(s_node *node, s_faddr addr);
|
||||||
|
int nodelist_parsehiddenina(s_node *node, s_override *ov);
|
||||||
|
int nodelist_flagvalue(const char *nodeflags, const char *flag, char *res);
|
||||||
|
|
||||||
#endif /* _NODELIST_H_ */
|
#endif /* _NODELIST_H_ */
|
||||||
|
|||||||
@ -78,13 +78,13 @@ typedef struct {
|
|||||||
} s_session_passwd;
|
} s_session_passwd;
|
||||||
|
|
||||||
typedef struct sendopts {
|
typedef struct sendopts {
|
||||||
int fnc:1, /* Convert outgoing file names to 8+3 format */
|
unsigned int fnc:1, /* Convert outgoing file names to 8+3 format */
|
||||||
holdreq:1, /* Hold .REQ files? (file requests) */
|
holdreq:1, /* Hold .REQ files? (file requests) */
|
||||||
holdhold:1, /* Hold files with HOLD flavor? */
|
holdhold:1, /* Hold files with HOLD flavor? */
|
||||||
holdfiles:1, /* Hold all files except netmail + arcmail */
|
holdfiles:1, /* Hold all files except netmail + arcmail */
|
||||||
holdxt:1, /* Hold all except netmail? */
|
holdxt:1, /* Hold all except netmail? */
|
||||||
holdall:1, /* Hold ALL trafic!? */
|
holdall:1, /* Hold ALL trafic!? */
|
||||||
hydraRH1; /* Hydra RH1 mode (EMSI only) */
|
hydraRH1; /* Hydra RH1 mode (EMSI only) */
|
||||||
} s_sendopts;
|
} s_sendopts;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -46,10 +46,10 @@ enum day
|
|||||||
|
|
||||||
typedef struct faddr {
|
typedef struct faddr {
|
||||||
bool inetform; /* Is address in domain form? */
|
bool inetform; /* Is address in domain form? */
|
||||||
int zone; /* -1 value means any?! */
|
u_int zone; /* -1 value means any?! */
|
||||||
int net;
|
u_int net;
|
||||||
int node;
|
u_int node;
|
||||||
int point;
|
u_int point;
|
||||||
char domain[BF_MAXDOMAIN+1];
|
char domain[BF_MAXDOMAIN+1];
|
||||||
} s_faddr;
|
} s_faddr;
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ typedef struct message {
|
|||||||
typedef struct packet {
|
typedef struct packet {
|
||||||
s_faddr orig;
|
s_faddr orig;
|
||||||
s_faddr dest;
|
s_faddr dest;
|
||||||
int baud;
|
u_int baud;
|
||||||
char password[8+1];
|
char password[8+1];
|
||||||
s_message *msgs;
|
s_message *msgs;
|
||||||
int n_msgs;
|
int n_msgs;
|
||||||
@ -161,6 +161,7 @@ bool is_regfile(const char *filename);
|
|||||||
int directory_create(const char *dirname, mode_t access_mode);
|
int directory_create(const char *dirname, mode_t access_mode);
|
||||||
FILE *file_open(const char *path, const char *mode);
|
FILE *file_open(const char *path, const char *mode);
|
||||||
int file_close(FILE *stream);
|
int file_close(FILE *stream);
|
||||||
|
void getrandname(char * buf, u_int size);
|
||||||
|
|
||||||
/* u_ftn.c */
|
/* u_ftn.c */
|
||||||
int ftn_addrparse(s_faddr *addr, const char *s, bool wildcard);
|
int ftn_addrparse(s_faddr *addr, const char *s, bool wildcard);
|
||||||
@ -188,8 +189,10 @@ char *buffer_putlong(char *buffer, long val);
|
|||||||
char *buffer_putint(char *buf, int val);
|
char *buffer_putint(char *buf, int val);
|
||||||
long buffer_getlong(const char *buf);
|
long buffer_getlong(const char *buf);
|
||||||
int buffer_getint(const char *buf);
|
int buffer_getint(const char *buf);
|
||||||
|
void swap_long(char *buffer);
|
||||||
void printf_usage(const char *ident, const char *fmt, ...);
|
void printf_usage(const char *ident, const char *fmt, ...);
|
||||||
|
|
||||||
|
|
||||||
/* u_pkt.c */
|
/* u_pkt.c */
|
||||||
int pkt_createpacket(const char *pktname, const s_packet *pkt);
|
int pkt_createpacket(const char *pktname, const s_packet *pkt);
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
#define BF_VERSION RELEASE_VERSION
|
#define BF_VERSION RELEASE_VERSION
|
||||||
#define BF_CDATE __DATE__ __TIME__
|
#define BF_CDATE __DATE__ __TIME__
|
||||||
#define BF_REG "free software"
|
#define BF_REG "free software"
|
||||||
#define BF_COPYRIGHT "(c) 1997-2000 by Alexander Belkin"
|
#define BF_COPYRIGHT "(c) 1997-2000 by Alexander Belkin, 2004-2025 fidonet members"
|
||||||
|
|
||||||
#define BF_BANNERVER BF_NAME" "BF_VERSION"/"BF_OS
|
#define BF_BANNERVER BF_NAME" "BF_VERSION"/"BF_OS
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ proto_order %PROTO%
|
|||||||
#domain schoolnet /var/spool/ftn/schoolnet/ 461
|
#domain schoolnet /var/spool/ftn/schoolnet/ 461
|
||||||
log_file %TESTZONE%/logsA/bf-log
|
log_file %TESTZONE%/logsA/bf-log
|
||||||
debug_file %TESTZONE%/logsA/bf-debug
|
debug_file %TESTZONE%/logsA/bf-debug
|
||||||
debug_level modem hshake event freq
|
debug_level info modem hshake event prot outbound override
|
||||||
nodial_flag %TESTZONE%/etc/nodial
|
nodial_flag %TESTZONE%/etc/nodial
|
||||||
inbound_directory (Protected) %TESTZONE%/inboundA
|
inbound_directory (Protected) %TESTZONE%/inboundA
|
||||||
inbound_directory %TESTZONE%/inbound-unsecureA
|
inbound_directory %TESTZONE%/inbound-unsecureA
|
||||||
@ -19,6 +19,7 @@ status_directory %TESTZONE%/logsA
|
|||||||
history_file %TESTZONE%/logsA/history
|
history_file %TESTZONE%/logsA/history
|
||||||
|
|
||||||
password 99:1/2 testpwd1
|
password 99:1/2 testpwd1
|
||||||
|
override 99:1/2 flags INA:localhost,IFC:59999,IBN:59999
|
||||||
#min_speed_in 1200
|
#min_speed_in 1200
|
||||||
#min_speed_out 1200
|
#min_speed_out 1200
|
||||||
#session_limit_in 1800
|
#session_limit_in 1800
|
||||||
|
|||||||
@ -6,7 +6,7 @@ proto_order %PROTO%
|
|||||||
#domain schoolnet /var/spool/ftn/schoolnet/ 461
|
#domain schoolnet /var/spool/ftn/schoolnet/ 461
|
||||||
log_file %TESTZONE%/logsB/bf-log
|
log_file %TESTZONE%/logsB/bf-log
|
||||||
debug_file %TESTZONE%/logsB/bf-debug
|
debug_file %TESTZONE%/logsB/bf-debug
|
||||||
debug_level modem hshake event freq
|
debug_level info modem hshake event prot outbound override
|
||||||
nodial_flag %TESTZONE%/etc/nodial
|
nodial_flag %TESTZONE%/etc/nodial
|
||||||
inbound_directory (Protected) %TESTZONE%/inboundB
|
inbound_directory (Protected) %TESTZONE%/inboundB
|
||||||
inbound_directory %TESTZONE%/inbound-unsecureB
|
inbound_directory %TESTZONE%/inbound-unsecureB
|
||||||
@ -19,6 +19,7 @@ status_directory %TESTZONE%/logsB
|
|||||||
history_file %TESTZONE%/logsB/history
|
history_file %TESTZONE%/logsB/history
|
||||||
|
|
||||||
password 99:1/1 testpwd1
|
password 99:1/1 testpwd1
|
||||||
|
override 99:1/1 flags INA:localhost,IFC:59999,IBN:59999
|
||||||
#min_speed_in 1200
|
#min_speed_in 1200
|
||||||
#min_speed_out 1200
|
#min_speed_out 1200
|
||||||
#session_limit_in 1800
|
#session_limit_in 1800
|
||||||
|
|||||||
0
tests/configs/genpkt.sh
Executable file → Normal file
0
tests/configs/genpkt.sh
Executable file → Normal file
159
tests/mktests.sh
159
tests/mktests.sh
@ -1,52 +1,93 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Making tests of BForce
|
# Making tests of BForce
|
||||||
CURDIR=$(pwd)
|
CURDIR="${CURDIR:-$(pwd)}"
|
||||||
BFBIN=$(pwd)/../source/bin/bforce
|
BFBIN=${BFBIN:-$(pwd)/../source/bin/bforce}
|
||||||
|
SOCATCMD=${SOCATCMD:-$(which socat)}
|
||||||
|
|
||||||
function prepconfig() {
|
function prepconfig() {
|
||||||
echo "Preparing configs with $1 as protocol..."
|
echo "Preparing configs with $1 as protocol..."
|
||||||
cp ${CURDIR}/configs/bforceA.conf ${CURDIR}/etc/bforceA.conf
|
if [[ ! -d "${CURDIR}/ftntest" ]] ;
|
||||||
sed -i -e "s/%PROTO%/$1/" ${CURDIR}/etc/bforceA.conf
|
then
|
||||||
sed -i -e "s#%TESTZONE%#${CURDIR}#" ${CURDIR}/etc/bforceA.conf
|
echo -n "(o_O) "
|
||||||
|
else
|
||||||
|
echo "Dir exists!"
|
||||||
|
rm -rf ${CURDIR}/ftntest/{etc,inboundA,inboundB,inbound-unsecureA,inbound-unsecureB,logsA,logsB,outboundA,outboundB}
|
||||||
|
fi
|
||||||
|
|
||||||
cp ${CURDIR}/configs/bforceB.conf ${CURDIR}/etc/bforceB.conf
|
mkdir -p "${CURDIR}"/ftntest/{etc,inbound-unsecureA,inbound-unsecureB,inboundA,inboundB,logsA,logsB,outboundA,outboundB}
|
||||||
sed -i -e "s/%PROTO%/$1/" ${CURDIR}/etc/bforceB.conf
|
|
||||||
sed -i -e "s#%TESTZONE%#${CURDIR}#" ${CURDIR}/etc/bforceB.conf
|
cp -f ${CURDIR}/configs/bforceA.conf ${CURDIR}/ftntest/etc/bforceA.conf
|
||||||
|
sed -i -e "s/%PROTO%/$1/" ${CURDIR}/ftntest/etc/bforceA.conf
|
||||||
|
sed -i -e "s#%TESTZONE%#${CURDIR}/ftntest#" ${CURDIR}/ftntest/etc/bforceA.conf
|
||||||
|
|
||||||
cp ${CURDIR}/configs/00010002.cut ${CURDIR}/outboundA/00010002.cut
|
cp -f ${CURDIR}/configs/bforceB.conf ${CURDIR}/ftntest/etc/bforceB.conf
|
||||||
cp ${CURDIR}/configs/00010001.cut ${CURDIR}/outboundB/00010001.cut
|
sed -i -e "s/%PROTO%/$1/" ${CURDIR}/ftntest/etc/bforceB.conf
|
||||||
|
sed -i -e "s#%TESTZONE%#${CURDIR}/ftntest#" ${CURDIR}/ftntest/etc/bforceB.conf
|
||||||
|
|
||||||
|
cp -f ${CURDIR}/configs/00010002.cut ${CURDIR}/ftntest/outboundA/00010002.cut
|
||||||
|
cp -f ${CURDIR}/configs/00010001.cut ${CURDIR}/ftntest/outboundB/00010001.cut
|
||||||
}
|
}
|
||||||
|
|
||||||
function testcomm() {
|
function testcomm() {
|
||||||
rm -rf ${CURDIR}/inboundA/*
|
rm -rf ${CURDIR}/ftntest/inboundA/*
|
||||||
rm -rf ${CURDIR}/inboundB/*
|
rm -rf ${CURDIR}/ftntest/inboundB/*
|
||||||
|
echo " over ${1}"
|
||||||
|
# for V1 and V2
|
||||||
|
#mkfifo ${CURDIR}/bforceAtoB
|
||||||
|
#mkfifo ${CURDIR}/bforceBtoA
|
||||||
|
|
||||||
mkfifo ${CURDIR}/bforceAtoB
|
BFCFGA=${CURDIR}/ftntest/etc/bforceA.conf
|
||||||
mkfifo ${CURDIR}/bforceBtoA
|
BFCFGB=${CURDIR}/ftntest/etc/bforceB.conf
|
||||||
|
|
||||||
BFCFGA=${CURDIR}/etc/bforceA.conf
|
|
||||||
BFCFGB=${CURDIR}/etc/bforceB.conf
|
|
||||||
|
|
||||||
# Works for Linux
|
# Works for Linux
|
||||||
|
# Variant 1
|
||||||
BFCONFIG=${BFCFGA}
|
#BFCONFIG=${BFCFGA}
|
||||||
BFCONFIG=${BFCFGA} ${BFBIN} -o 99:1/2 > ${CURDIR}/bforceAtoB < ${CURDIR}/bforceBtoA &
|
#BFCONFIG=${BFCFGA} ${BFBIN} -o 99:1/2 > ${CURDIR}/bforceAtoB < ${CURDIR}/bforceBtoA &
|
||||||
#
|
#
|
||||||
|
|
||||||
BFCONFIG=${BFCFGB}
|
#BFCONFIG=${BFCFGB}
|
||||||
BFCONFIG=${BFCFGB} ${BFBIN} -S"CONNECT 9600" auto < ${CURDIR}/bforceAtoB > ${CURDIR}/bforceBtoA
|
#BFCONFIG=${BFCFGB} ${BFBIN} -S"CONNECT 9600" auto < ${CURDIR}/bforceAtoB > ${CURDIR}/bforceBtoA
|
||||||
|
|
||||||
|
# Variant 2
|
||||||
|
#${CURDIR}/runbfA.sh ${BFBIN} ${BFCFGA} > ${CURDIR}/bforceAtoB < ${CURDIR}/bforceBtoA &
|
||||||
|
#${CURDIR}/runbfB.sh ${BFBIN} ${BFCFGB} < ${CURDIR}/bforceAtoB > ${CURDIR}/bforceBtoA
|
||||||
|
|
||||||
|
# Variant 3 works with sockets and pipes - not pty
|
||||||
|
case ${1} in
|
||||||
|
"PSTN")
|
||||||
|
socat -T5 -ly -Wlock EXEC:"${CURDIR}/runbfB.sh ${BFBIN} ${BFCFGB}" EXEC:"${CURDIR}/runbfA.sh ${BFBIN} ${BFCFGA}"
|
||||||
|
sleep 2
|
||||||
|
;;
|
||||||
|
"IFC")
|
||||||
|
${CURDIR}/runbfC.sh ${BFBIN} ${BFCFGA} &
|
||||||
|
socat -ly -Wlock TCP4-LISTEN:59999,accept-timeout=3 EXEC:"${CURDIR}/runbfD.sh ${BFBIN} ${BFCFGB}"
|
||||||
|
sleep 2
|
||||||
|
;;
|
||||||
|
"BKP")
|
||||||
|
${CURDIR}/runbfE.sh ${BFBIN} ${BFCFGA} &
|
||||||
|
socat -ly -Wlock TCP4-LISTEN:59999,accept-timeout=3 EXEC:"${CURDIR}/runbfF.sh ${BFBIN} ${BFCFGB}"
|
||||||
|
sleep 2
|
||||||
|
;;
|
||||||
|
esac
|
||||||
# For [Free]BSD it need to be replaced - pipes are bidirectional:
|
# For [Free]BSD it need to be replaced - pipes are bidirectional:
|
||||||
|
|
||||||
# ./ping <&1 | ./pong >&0
|
# ./ping <&1 | ./pong >&0
|
||||||
|
|
||||||
rm ${CURDIR}/{bforceAtoB,bforceBtoA}
|
# for V1 and V2
|
||||||
|
#rm ${CURDIR}/{bforceAtoB,bforceBtoA}
|
||||||
|
|
||||||
## WE MUST CHECK THAT INBOUND ARE FULL!!! ##
|
## WE MUST CHECK THAT INBOUND ARE FULL!!! ##
|
||||||
FCNTA=$( find ${CURDIR}/inboundA -name *.pkt | wc -l )
|
FCNTA=$( find ${CURDIR}/ftntest/inboundA -name *.pkt | wc -l )
|
||||||
FCNTB=$( find ${CURDIR}/inboundB -name *.pkt | wc -l )
|
FCNTB=$( find ${CURDIR}/ftntest/inboundB -name *.pkt | wc -l )
|
||||||
DIFFA=$( diff ${CURDIR}/inboundA/*.pkt ${CURDIR}/configs/00010001.cut && echo $? )
|
if [[ "${FCNTA}" -eq "1" ]]
|
||||||
DIFFB=$( diff ${CURDIR}/inboundB/*.pkt ${CURDIR}/configs/00010002.cut && echo $? )
|
then
|
||||||
|
DIFFA=$( diff ${CURDIR}/ftntest/inboundA/*.pkt ${CURDIR}/configs/00010001.cut && echo $? )
|
||||||
|
fi
|
||||||
|
if [[ "${FCNTB}" -eq "1" ]]
|
||||||
|
then
|
||||||
|
DIFFB=$( diff ${CURDIR}/ftntest/inboundB/*.pkt ${CURDIR}/configs/00010002.cut && echo $? )
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${DIFFA}" -eq "0" ]] && [[ "${FCNTA}" -eq "1" ]]
|
if [[ "${DIFFA}" -eq "0" ]] && [[ "${FCNTA}" -eq "1" ]]
|
||||||
then
|
then
|
||||||
@ -55,48 +96,76 @@ function testcomm() {
|
|||||||
echo "....Result: OK"
|
echo "....Result: OK"
|
||||||
else
|
else
|
||||||
echo "....Failed DiffB"
|
echo "....Failed DiffB"
|
||||||
|
RES=2
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "....Failed DiffA"
|
echo "....Failed DiffA"
|
||||||
|
RES=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat ${CURDIR}/logsA/bf-debug >> ${CURDIR}/debugA.log
|
if [[ -f ${CURDIR}/ftntest/logsA/bf-debug ]]
|
||||||
cat ${CURDIR}/logsB/bf-debug >> ${CURDIR}/debugB.log
|
then
|
||||||
|
cat ${CURDIR}/ftntest/logsA/bf-debug >> ${CURDIR}/debugA.log
|
||||||
|
fi
|
||||||
|
if [[ -f ${CURDIR}/ftntest/logsB/bf-debug ]]
|
||||||
|
then
|
||||||
|
cat ${CURDIR}/ftntest/logsB/bf-debug >> ${CURDIR}/debugB.log
|
||||||
|
fi
|
||||||
|
|
||||||
|
rm -rf ${CURDIR}/ftntest
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ ! -d "${CURDIR}/inboundA" ]]
|
|
||||||
then
|
|
||||||
echo "All clear to begin"
|
|
||||||
else
|
|
||||||
echo "Dir exists!"
|
|
||||||
rm -rf {etc,inboundA,inboundB,inbound-unsecureA,inbound-unsecureB,logsA,logsB,outboundA,outboundB}
|
|
||||||
fi
|
|
||||||
mkdir -p "${CURDIR}"/{etc,inbound-unsecureA,inbound-unsecureB,inboundA,inboundB,logsA,logsB,outboundA,outboundB}
|
|
||||||
|
|
||||||
if [[ ! -f "${BFBIN}" ]]
|
if [[ ! -f "${BFBIN}" ]]
|
||||||
then
|
then
|
||||||
# No executable to test!
|
# No executable to test!
|
||||||
echo "No executable to run! Aborting..."
|
echo "No executable to run! Aborting..."
|
||||||
|
exit -1
|
||||||
else
|
else
|
||||||
|
|
||||||
|
if [[ ! -f "${SOCATCMD}" ]]
|
||||||
|
then
|
||||||
|
# No socat
|
||||||
|
echo "No socat cmd! Aborting..."
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
# All doing here
|
# All doing here
|
||||||
echo "Bforce executable found"
|
echo "Bforce executable found: ${BFBIN}"
|
||||||
|
RES=0
|
||||||
|
|
||||||
prepconfig "ZMO"
|
prepconfig "ZMO"
|
||||||
echo -n "--> Running ZMO test..."
|
echo -n "--> Running ZMO test..."
|
||||||
testcomm
|
testcomm "PSTN"
|
||||||
|
|
||||||
prepconfig "ZAP"
|
prepconfig "ZAP"
|
||||||
echo -n "--> Running ZAP test..."
|
echo -n "--> Running ZAP test..."
|
||||||
testcomm
|
testcomm "PSTN"
|
||||||
|
|
||||||
prepconfig "HYD"
|
prepconfig "HYD"
|
||||||
echo -n "--> Running Hydra test..."
|
echo -n "--> Running Hydra test..."
|
||||||
testcomm
|
testcomm "PSTN"
|
||||||
|
|
||||||
|
prepconfig "ZMO"
|
||||||
|
echo -n "--> Running ZMO test..."
|
||||||
|
testcomm "IFC"
|
||||||
|
|
||||||
|
prepconfig "ZAP"
|
||||||
|
echo -n "--> Running ZAP test..."
|
||||||
|
testcomm "IFC"
|
||||||
|
|
||||||
|
prepconfig "HYD"
|
||||||
|
echo -n "--> Running HYD test..."
|
||||||
|
testcomm "IFC"
|
||||||
|
|
||||||
|
prepconfig "ZMO"
|
||||||
|
echo -n "--> Running BINKP test..."
|
||||||
|
testcomm "BKP"
|
||||||
|
|
||||||
# TODO: make binkd test over netcat possibly
|
# TODO: make binkd test over netcat possibly
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# rm -rf ${CURDIR}/ftntest/{etc,inboundA,inboundB,inbound-unsecureA,inbound-unsecureB,logsA,logsB,outboundA,outboundB}
|
||||||
|
rm -rf ${CURDIR}/ftntest
|
||||||
rm -rf {etc,inboundA,inboundB,inbound-unsecureA,inbound-unsecureB,logsA,logsB,outboundA,outboundB}
|
# printf $RES
|
||||||
|
exit ${RES}
|
||||||
3
tests/runbfA.sh
Executable file
3
tests/runbfA.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
BFCONFIG=${2} ${1} -C ${2} -o 99:1/2
|
||||||
|
|
||||||
2
tests/runbfB.sh
Executable file
2
tests/runbfB.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
BFCONFIG=${2} ${1} -C ${2} -S"CONNECT 9600" -i auto
|
||||||
2
tests/runbfC.sh
Executable file
2
tests/runbfC.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
BFCONFIG=${2} ${1} -C ${2} -a 127.0.0.1:59999 -u ifcico 99:1/2
|
||||||
2
tests/runbfD.sh
Executable file
2
tests/runbfD.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
BFCONFIG=${2} ${1} -C ${2} -S"" -i auto
|
||||||
2
tests/runbfE.sh
Executable file
2
tests/runbfE.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
BFCONFIG=${2} ${1} -C ${2} -a 127.0.0.1:59999 -u binkp 99:1/2
|
||||||
2
tests/runbfF.sh
Executable file
2
tests/runbfF.sh
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
BFCONFIG=${2} ${1} -C ${2} -i binkp
|
||||||
Loading…
x
Reference in New Issue
Block a user