Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pine patch for security on BBSes

0 views
Skip to first unread message

Zachariah Baum

unread,
Jan 30, 1995, 1:16:23 AM1/30/95
to

I created a patch in order to have a '-s' secure option. We are running
a BBS, and didn't want users below a certain level to be able to send
mail outside of the local BBS. So this patch, from the pine3.91
directory made from the tar file using the -p1 option, adds a command
line argument '-s' so that the user can't compose, reply to, or forward
messages. If they attempt to, they get a message saying that they don't
have write-mail privileges.

Inside our BBS, we have it check the level of the user, and if they
attempt to call pine, we call it with or without the '-s' option. The
BBS software checks if they're trying to put people's names to send to on
the commandline, and if they are, checks if it's an external user (I
check for '@' and '.'s). It won't let users of a lesser security
clearance send mail from the commandline to the outside world.

This, for us, allows the public to connect without us having to worry if
they're sending death threats to the president, or whatever, until we
have their address or whatever we require of them.

Here you go...

---------CUT HERE----------
diff -U 2 pine3.91/pine/args.c pine3.91.secure/pine/args.c
--- pine3.91/pine/args.c Thu Aug 18 10:19:47 1994
+++ pine3.91.secure/pine/args.c Sun Jan 29 21:05:43 1995
@@ -101,4 +101,5 @@
struct variable *vars = pine_state->vars;

+ secure = 0;

ac = argc;
@@ -160,4 +161,7 @@
}else{
switch(c = **av) {
+ case 's':
+ secure = 1;
+ break;
case 'h':
do_help = 1;
Only in pine3.91.secure/pine: date.c
diff -U 2 pine3.91/pine/headers.h pine3.91.secure/pine/headers.h
--- pine3.91/pine/headers.h Wed Aug 3 19:20:35 1994
+++ pine3.91.secure/pine/headers.h Sun Jan 29 19:49:24 1995
@@ -106,4 +106,6 @@
extern char tmp_20k_buf[];

+extern int secure;
+
#ifdef DEBUG
extern FILE *debugfile; /* file for debug output */
diff -U 2 pine3.91/pine/mailcmd.c pine3.91.secure/pine/mailcmd.c
--- pine3.91/pine/mailcmd.c Tue Oct 11 09:37:59 1994
+++ pine3.91.secure/pine/mailcmd.c Sun Jan 29 20:56:59 1995
@@ -437,10 +437,14 @@
case PF11:
case 'r':
- if(state->anonymous && command == PF11) {
- if(in_index)
- goto do_sortindex;
- else
- goto do_index;
- }
+ if (secure)
+ q_status_message(0,2,3,"You do not have write-mail privileges.");
+ else {
+ if(state->anonymous && command == PF11) {
+ if(in_index)
+ goto do_sortindex;
+ else
+ goto do_index;
+
+ }

if(state->nr_mode && command == PF11)
@@ -451,4 +455,5 @@
cmd_reply(state, msgmap, 0);
cur_msgno = mn_get_cur(msgmap);
+ }
break;

@@ -458,4 +463,7 @@
case 'f':
do_forward:
+ if (secure)
+ q_status_message(0,2,3,"You do not have write-mail privileges.");
+ else {
if(command == PF12) {
if(state->anonymous)
@@ -467,4 +475,5 @@
cmd_forward(state, msgmap, 0);
cur_msgno = mn_get_cur(msgmap);
+ }
break;

@@ -484,4 +493,7 @@
case OPF4:
case 'c':
+ if (secure)
+ q_status_message(0,2,3,"You do not have write-mail privileges.");
+ else {
if(state->anonymous)
goto bogus;
@@ -493,4 +505,5 @@
compose_screen(state);
state->mangled_screen = 1;
+ }
break;

@@ -3731,9 +3744,16 @@

case 'r' : /* reply */
- cmd_reply(state, msgmap, 1);
+ if (secure) q_status_message(0,2,3,"You do not have write-mail privileges.");
+ else {
+ cmd_reply(state, msgmap, 1);
+ }
break;

case 'f' : /* Forward */
+ if (secure)
+ q_status_message(0,2,3,"You do not have write-mail privileges.");
+ else {
cmd_forward(state, msgmap, 1);
+ }
break;

diff -U 2 pine3.91/pine/makefile.lnx pine3.91.secure/pine/makefile.lnx
--- pine3.91/pine/makefile.lnx Tue Oct 11 15:24:30 1994
+++ pine3.91.secure/pine/makefile.lnx Sun Jan 29 21:12:09 1995
@@ -58,7 +58,7 @@
LN= ln -s
MAKE= make
-OPTIMIZE= # -O2
+OPTIMIZE= -O2
IMAPDIR= ../c-client
Only in pine3.91.secure/pine: os.c
Common subdirectories: pine3.91/pine/osdep and pine3.91.secure/pine/osdep
Only in pine3.91.secure/pine: pine
diff -U 2 pine3.91/pine/pine.c pine3.91.secure/pine/pine.c
--- pine3.91/pine/pine.c Mon Oct 10 17:27:18 1994
+++ pine3.91.secure/pine/pine.c Sun Jan 29 21:06:04 1995
@@ -70,4 +70,5 @@
char *pine_version = PINE_VERSION; /* version string */
int timeout = NEW_MAIL_TIME; /* referenced in pico */
+int secure;


@@ -1091,5 +1092,8 @@
case OPF4:
case 'c':
- pine_state->next_screen = compose_screen;
+ if (secure) q_status_message(0,2,3,"You do not have write-mail privileges.");
+ else {
+ pine_state->next_screen = compose_screen;
+ }
return;

--------CUT HERE---------

PS... It also adds to the Linux makefile the -O2 option instead of the
-O, and removes the -g. You can remove this, and it won't effect the
patch's functioning.

Jesus Chrysler
jchr...@catch22.com

--

Brian P. Hampson

unread,
Jan 30, 1995, 11:58:21 AM1/30/95
to
On 30 Jan 1995, Zachariah Baum wrote:

>
> I created a patch in order to have a '-s' secure option. We are running
> a BBS, and didn't want users below a certain level to be able to send
> mail outside of the local BBS. So this patch, from the pine3.91
> directory made from the tar file using the -p1 option, adds a command
> line argument '-s' so that the user can't compose, reply to, or forward
> messages. If they attempt to, they get a message saying that they don't
> have write-mail privileges.
>
> Inside our BBS, we have it check the level of the user, and if they
> attempt to call pine, we call it with or without the '-s' option. The
> BBS software checks if they're trying to put people's names to send to on
> the commandline, and if they are, checks if it's an external user (I
> check for '@' and '.'s). It won't let users of a lesser security
> clearance send mail from the commandline to the outside world.
>
> This, for us, allows the public to connect without us having to worry if
> they're sending death threats to the president, or whatever, until we
> have their address or whatever we require of them.
>

How do you keep people from simply cursoring up and changing the "To: "
field?

B.

------------------------------------------------------------------------
|Brian P. Hampson Internet: br...@asl-labs.bc.ca |
|System Administration, |
|Analytical Service Labs Fidonet : Brian Hampson 1:153/733 |
|Vancouver, BC |
| |
| Specialists in Environmental Chemistry |
| |
------------------------------------------------------------------------

0 new messages