
aD!BBS 2.x Message Base System, v. 1.3
(c) 1996 Chris Church / aD! Data Systems


1. Setting Up The System
  a. configuring message.pl
  b. creating bases
  c. format of bases

2. Securing The Bases

3. Scan.pl

4. Bugs



1 - Setting up the system

  a) Configuring message.pl

	Before you add an option to your menu, to run message.pl, you should
change a few things first :

$MESDIR = '/usr/multi/bbs/mess';
$basest = "The following bases are available for reading :\n";
$basecst = "Which base would you like to read? \[Hit \'E\' To Exit\] -> ";
$mestop = "The Following Messages Are Available:\n";
$whichm = "\nWhich message to read? \[\'B\' Return To Bases, \'P\' To Post\]-> ";
$maction = "\n[R]eply [D]elete [C]ontinue -> ";
$ed = "/usr/local/bin/pico.safe -t";

These are the user defineable variables in message.pl..

$MESDIR
	the directory in which the bases will be located (must exist!)

$basest
	the string displayed to users at the top of the 'bases' listing when
entering the message base system

$basecst
	the string displayed after listing the bases, at this prompt they
may hit the number of the base, or E to exit.

$mestop 
	the string displayed before displaying the list of messages

$whichm
	the string displayed after displaying list of messages, a user may
hit B to return to the base listings, P to post a message or the number of a
message to read.

$maction
	The string displayed after a user reads a message, they may hit R to
reply, D to delete (if they are allowed to) or any other key to return to
the message list.

$ed
	This is the editor that will be invoked when a user posts or replies
to a message, I would reccomend a secure editor for this,
ftp://ftp.aD.org/pub/aD/adbbs/safepico.tgz is a version of pico with several
options disabled for security.
 

    b) creating bases

	To create a message base, simply create a directory that will be the
name of the base inside the message directory.. e.g, if the base name is
"Music" create adirectory labelled Music inside the message dir.  For
multi-word bases, use quotes; e.g.: mkdir "General Discussion".
	The base dirs should be mode 1777, e.g.: chmod 1777 basename.


    c) format of the bases

	The tree format is as follows :

	MESDIR/BASEDIR/MESSAGES
	
	inside the basedir, the message files exist, as numbers, i.e.
0,1,2,3 etc..  Thus, message 0 would be file 0, and message 1, file 1 and so
forth..  e.g.:
-rw-r--r--   1 root     staff          88 Nov 19 11:04 0
-rw-r--r--   1 root     staff          23 Nov 19 12:02 1
-rw-r--r--   1 root     staff         129 Nov 21 09:48 10
-rw-r--r--   1 root     staff         168 Nov 21 09:51 11
-rw-r--r--   1 root     staff          76 Nov 21 09:53 12
-rw-r--r--   1 root     staff          78 Nov 21 09:58 13
-rw-r--r--   1 root     staff          99 Nov 21 10:17 14
-rw-r--r--   1 root     staff         138 Nov 21 10:42 15
-rw-r--r--   1 root     staff          93 Nov 21 10:42 16
-rw-r--r--   1 root     staff         112 Nov 21 10:42 17
-rw-r--r--   1 root     staff          82 Nov 21 10:43 18
-rw-r--r--   1 root     staff          56 Nov 21 10:52 19
-rw-r--r--   1 root     staff          91 Nov 19 13:22 2
-rw-r--r--   1 root     staff          56 Nov 21 10:52 20
-rw-r--r--   1 root     staff          55 Nov 21 10:52 21
-rw-r--r--   1 root     staff          57 Nov 21 10:52 22
-rw-r--r--   1 root     staff          59 Nov 21 10:52 23
-rw-r--r--   1 root     staff          54 Nov 21 10:53 24
-rw-r--r--   1 root     staff          55 Nov 21 10:54 25
-rw-r--r--   1 root     staff          98 Nov 19 13:46 3
-rw-r--r--   1 root     staff          94 Nov 19 13:49 4
-rw-r--r--   1 root     staff          87 Nov 19 13:50 5
-rw-r--r--   1 root     staff          73 Nov 19 13:52 6
-rw-r--r--   1 root     staff          80 Nov 19 13:54 7
-rw-r--r--   1 root     staff         112 Nov 19 13:59 8
-rw-r--r--   1 root     staff         100 Nov 21 09:46 9

(note : all these messages were posted by root, the file owner will reflect
the poster)

	The messages have a few special lines in them, which can be placed
anywhere. they are :
Subject:
	the subject of the message
From:
	the poster of the message
Time:	
	the time & date the message was posted


2.	Securing the bases

	Obviously, we run into a problem when allowing everyone to write to
a directory (or two! =) that is, that anyone can write over anyone else's
files..  Fortunatly, the great gods of UNIX (*snicker*) came up with this
lovely idea of what's known as a 'sticky bit'.  The sticky bit keeps other
users (except root) from overwriting or deleting another users files, this
is most commonly seen with the /tmp dir..  If you chmod 1777 your base dirs,
they will look something like this :

drwxrwxrwt   2 root     staff        1024 Nov 19 10:44 General Discussion

note the 't' at the end of the permissions.

If your sticky bit implementation isn't exactly working, or if you have
problems with world-writeable directories, then this system isn't for you.
=)


3.	scan.pl

	This is just a quick and dirty program to see if there are more
messages than the last time a person logs in.

4.	Bugs 

	None that I know of (other than that this is written as a seperate
entitity to the bbs, and should be loaded via rtpi, maybe next version =)

	If you happen to run across any, please email me at psylark@aD.org


Chris Church
psylark@aD.org
ftp://ftp.aD.org/pub/aD/adbbs/
