Skip to content

Commit

Permalink
filemgr: Add ZMODEM transfer support.
Browse files Browse the repository at this point in the history
This adds a simple file manager program to the external directory,
which can be called by the BBS as an external door (using isoexec)
to allow users to browse files from within the BBS, without using
an external client. Notably, it supports file uploads and downloads
via the ZMODEM protocol, supported by many (but not all) terminal
emulators.

As with the recent addition of an official supported terminal mail
client, this helps integrate files into the BBS itself, rather than
it remaining as something "external" to the terminal system.

Also fixes erroneous partial revert of 184878f,
which fixed package installation on Fedora.
  • Loading branch information
InterLinked1 committed Mar 23, 2024
1 parent e799e13 commit 4db4cb1
Show file tree
Hide file tree
Showing 6 changed files with 752 additions and 12 deletions.
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ INSTALL = install
# Uncomment this to see all build commands instead of 'quiet' output
#NOISY_BUILD=yes

# XXX missing terms since currently no term modules
MOD_SUBDIR:=doors modules nets
SUBDIRS:=$(MOD_SUBDIR)
SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
Expand Down Expand Up @@ -88,10 +87,14 @@ $(MOD_SUBDIR):
external tests :
@+$(SUBMAKE) --no-builtin-rules -C $@ all

modcheck : external
# Make only modcheck, but not any of the other external programs
modcheckrule :
@+$(SUBMAKE) --no-builtin-rules -C external modman

modcheck : modcheckrule
@external/modman -t

modconfig : external
modconfig : modcheckrule
@external/modman -d

clean :
Expand Down Expand Up @@ -141,6 +144,7 @@ extinstall:
mkdir /var/lib/lbbs/external;\
fi
$(SUBMAKE) --no-builtin-rules -C external install
@find /var/lib/lbbs/external -size 0 -delete; \
ln -s -f /var/lib/lbbs/external/rsysop /usr/local/sbin/rsysop

scripts :
Expand Down Expand Up @@ -194,6 +198,9 @@ helgrind :
.PHONY: bbs
.PHONY: $(MOD_SUBDIR)
.PHONY: external
.PHONY: modcheckrule
.PHONY: modcheck
.PHONE: modconfig
.PHONY: tests
.PHONY: scripts
.PHONY: clean
Expand Down
1 change: 1 addition & 0 deletions configs/menus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ title = Welcome to the BBS! ; Title to print on first line of screen.
; but you should NOT do this because you will blow the menu stack.
C = door:chat:general|Chat ; Execute the "chat" door with argument "general" (name of the channel, in this case)
M = door:mail|Mail|minpriv=1 ; Launch the evergreen mail client (recommended for LBBS)
F = isoexec:/bin/filemgr -d -u|Files ; File manager for uploading/downloading files via ZMODEM. DO NOT CHANGE isoexec to exec as that will expose your entire filesystem!
U = menu:utilities|${COLOR_RED}Utilities${COLOR_NONE} ; you can also specify the colors to use. Colors are global variables
;R = file:/home/bbs/announcements.txt|Read Announcements ; the file handler allows navigating a file from the terminal using the BBS file viewer.
W = door:listusers:active|Who's Online ; List all users that are online currently
Expand Down
8 changes: 7 additions & 1 deletion external/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
SRCS := $(wildcard *.c)
OBJS = $(SRCS:.c=.o)
EXES = $(patsubst %.o,%,$(OBJS))
OBJS_NOFILEMGR = $(filter-out filemgr.o,$(OBJS))
EXES_NOFLEMGR = $(patsubst %.o,%,$(OBJS_NOFILEMGR))

CC = gcc
CFLAGS = -Wall -Werror -Wunused -Wextra -Wmaybe-uninitialized -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-declarations -Wmissing-format-attribute -Wnull-dereference -Wformat=2 -Wshadow -Wsizeof-pointer-memaccess -std=gnu99 -pthread -O3 -g -Wstack-protector -Wno-unused-result -fno-omit-frame-pointer -fwrapv -D_FORTIFY_SOURCE=2
Expand All @@ -13,10 +15,14 @@ all: $(EXES)

# XXX: This is not quite right, as it recreates all binaries whenever an object file needs to be recreated.
# What we really want to do is have each EXE depend on its corresponding OBJ file (with .o extension)
$(EXES): $(OBJS)
$(EXES_NOFLEMGR): $(OBJS_NOFILEMGR)
@echo " [LD] $@.o -> $@"
$(CC) $(CFLAGS) -o $@ $@.o

filemgr: filemgr.o
@echo " [LD] $@.o -> $@"
$(CC) $(CFLAGS) -o $@ $@.o -lmenu -lncurses

%.o : %.c
@echo " [CC] $< -> $@"
$(CC) $(CFLAGS) -c $^
Expand Down
Loading

0 comments on commit 4db4cb1

Please sign in to comment.