Added doors single user mode

This commit is contained in:
Michiel Broek 2003-10-11 21:22:16 +00:00
parent 060cbe407f
commit 183ea655cd
33 changed files with 1588 additions and 1407 deletions

View File

@ -1,5 +1,40 @@
$Id$
WARNING: This code contains unfinished changes, if you use the bbs
then do not use this version.
This code also contains changes in the hydra code, this
should be safe to use because the code is disabled for
endusers.
v0.39.0 09-Oct-2003
general:
Added menu setup switches for doors: Singe user door and
hidden from lists.
Added configure settings for zlib, disabled for endusers.
mbsebbs:
The whoson list displays the doorname if set in the menus.
If a door is single user and the door is in use, the second
user can't start the door but gets a message about this
situation.
mbsetup:
Added menu settings for single user door and hide door. Added
setting for the door name in the menus and removed the never
used password for the menu (Was only present in the setup).
mbcico:
Started adding code for zlib compression of hydra packets.
Not functional yet and disabled by configure.
lang:
Added language prompt 20.
examples:
Updated English and Spanish menus with the new door settings.
v0.38.0 26-Dec-2002 - 03-Oct-2003

View File

@ -302,3 +302,6 @@
/* Define if you have the <iconv.h> header file. */
#undef HAVE_ICONV_H
/* Define if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H

View File

@ -131,6 +131,7 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(malloc.h sys/file.h sys/ioctl.h sys/time.h termios.h syslog.h sys/vfs.h unistd.h netinet/in.h regex.h)
AC_CHECK_HEADERS(sys/resource.h usersec.h utime.h ulimit.h gshadow.h shadow.h)
AC_CHECK_HEADERS(limits.h utmp.h utmpx.h lastlog.h rpc/key_prot.h)
dnl AC_CHECK_HEADERS(zlib.h) FIXME: enable when ready for endusers.
AC_CHECK_HEADERS(iconv.h)
AC_STRUCT_TIMEZONE

Binary file not shown.

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -13,8 +13,8 @@
<BODY>
<BLOCKQUOTE>
<center><img SRC="images/mbse.png" BORDER=0></center>
<div align=center><h1>MBSE BBS System Guide v0.38.0</h1></div>
<div align=right><h5>Last update 03-Oct-2003</h5></div>
<div align=center><h1>MBSE BBS System Guide v0.39.0</h1></div>
<div align=right><h5>Last update 11-Oct-2003</h5></div>
<P>

View File

@ -12,11 +12,10 @@
</HEAD>
<BODY>
<BLOCKQUOTE>
<h5>Last update 06-Mar-2002</h5>
<P>&nbsp;<P>
<div align=right><h5>Last update 11-Oct-2003</h5></div>
<div align=center><H1>MBSE BBS Menu System</H1></div>
<H1>MBSE BBS Menu System</H1>
<P ALIGN=CENTER>Menus sections:
<P>Menus sections:
<A HREF="menu0.html">Global menus</A>&nbsp;
<A HREF="menu100.html">File areas</A>&nbsp;
<A HREF="menu200.html">Message areas</A>&nbsp;
@ -104,7 +103,7 @@ display and finally show the prompt.
this menu. This field is ignored when AutoExec is set to Yes. </LI>
<LI><B>Type nr.</B> this is the menu type to execute. For a description
of all available types see below. </LI>
of all available types see the links at the top of this page.</LI>
<LI><B>Optional data.</B> Some menus need optional data, for example the
function goto another menu needs the name of that menu file here. </LI>
@ -123,15 +122,6 @@ everyone must be able to execute. </LI>
You may want to restrict access to certain areas to users older than 18
years. If you leave this to 0, every one can execute this menu. </LI>
<LI><B>Max. lvl.</B> The maximum level a user must have to execute this
menu. If you leave this at 0 then the maximum level has no effect. </LI>
<LI><B>Password.</B> You can protect the menu selection with a password.
If this field is empty, no password check is done. </LI>
<LI><B>Credit.</B> How much credit a user must have to execute this menu
selection. This field is not in use yet. </LI>
<LI><B>Lo-colors.</B> The normal display color for the display line.
</LI>
@ -139,25 +129,40 @@ selection. This field is not in use yet. </LI>
<LI><B>AutoExec.</B> If this is an automatic executed selection. </LI>
<LI><B>No door.sys</B> Suppress writing of a door.sys file in the users
home directory. This item is only visible with menu type 7.</LI>
<LI><B>Door Name</B> The name of the door that will be displayed to other users.
This name is also used to count the same doors running if the door only allows a
single user. It is important that you use the same name in every language menu
file for the same door. This item is only visible with menu type 7.</LI>
<LI><B>Y2K style</B> Writes the dates in the door.sys file in the new style,
with 4 digit year numbers, else the old 2 digit style is used. This item
is only visible with menu type 7.</LI>
<LI><B>Use Comport</B> Writes real comport to the door.sys file, this is
for dosemu with the vmodem patch. This item is only visible with menu
<LI><B>No door.sys</B> Suppress writing of a door.sys file in the users
home directory. This item is only visible with menu type 7.</LI>
<LI><B>Use Comport</B> Writes COM1: with 19200 as baudrate to the door.sys file,
this is for dosemu with the vmodem patch. This item is only visible with menu
type 7.</LI>
<LI><B>Run nosuid</B> If set to Yes the door will run in non-suid mode.
You need this to run DOS doors using dosemu. This item is only visible
Most doors need this. This item is only visible
with menu type 7.</LI>
<LI><B>No Prompt</B> If set to Yes then when the door is finished there will be
no prompt to press Enter, instead the bbs menu will show up immediatly. This
item is only visible with menu type 7.</LI>
<LI><B>Single User</B> Set to yes of the door only allows one user at the same
time. Make sure you have set a unique name that must be the same for the door in
every language file so that the bbs is able to count the instances of the door
running. This item is only visible with menu type 7.</LI>
<LI><B>Hidden door</B> Set to yes to hide the door from being visible for other
users. If someone is using that door the whoson list displays "External Door"
instead of the door name. This may be good to hide some special sysop only
doors. This item is only visible with menu type 7.</LI>
</OL>
<P>&nbsp;<P>

View File

@ -18,7 +18,7 @@
17 file.c |This is not a plain textfile.
18 user.c |You may only login
19 user.c |times at the same time
20 .c |
20 door.c |The door is in use by another user, try again later
21 .c |
22 .c |
23 .c |

View File

@ -18,7 +18,7 @@ HR|Exporteer naar (H)ome of (R)egels directory:
|Dit is geen normaal tekst bestand
|U mag maar
|keer tegelijk inloggen
|
|De door is in gebruik door een andere gebruiker, probeer het later nog eens
|
|
|

View File

@ -18,7 +18,7 @@ HR|Export to (H)ome or (R)ules directory:
|This is not a plain textfile.
|You may only login
|times at the same time
|
|The door is in use by another user, try again later
|
|
|

View File

@ -18,7 +18,7 @@ HR|Exportar
|This is not a plain textfile.
|You may only login
|times at the same time
|
|The door is in use by another user, try again later
|
|
|

View File

@ -18,7 +18,7 @@ HR|Export in (H)ome oder (R)ules Direktorie:
|Dies ist keine Textdatei.
|Du darfst nur
|mal gleichzeitig eingewaehlt sein
|
|The door is in use by another user, try again later
|
|
|

View File

@ -18,7 +18,7 @@ HR|Export in (H)ome oder (R)ules Direktorie:
|Dies ist keine Textdatei.
|Du darfst nur
|mal gleichzeitig eingewaehlt sein
|
|The door is in use by another user, try again later
|
|
|

View File

@ -18,7 +18,7 @@ HR|Export to (H)ome or (R)ules directory:
|This is not a plain textfile.
|You may only login
|times at the same time
|
|The door is in use by another user, try again later
|
|
|

View File

@ -18,7 +18,7 @@ PR|Exportar al directorio (P)ersonal o de (R)eglas:
|This is not a plain textfile.
|You may only login
|times at the same time
|
|The door is in use by another user, try again later
|
|
|

View File

@ -236,11 +236,12 @@ unsigned long StringCRC32(char *str)
/*
* Update CRC32, first initialize CRC with 0xffffffff.
*/
unsigned long crc32(int octet, unsigned long crc)
/*
unsigned long update_crc32(int octet, unsigned long crc)
{
return (crc32tab[((int)crc ^ ((long)octet)) & 0xff] ^ ((((unsigned long)crc) >> 8) & 0x00ffffff));
}
*/
/*

View File

@ -1,11 +1,11 @@
/*****************************************************************************
*
* $Id$
* File ..................: libs.h
* Purpose ...............: Libraries include list
* Last modification date : 05-Aug-2001
*
*****************************************************************************
* Copyright (C) 1997-2001
* Copyright (C) 1997-2003
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -86,6 +86,9 @@
#ifdef HAVE_ICONV_H
#include <iconv.h>
#endif
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
#pragma pack(1)

View File

@ -839,7 +839,7 @@ struct menufile {
securityrec MenuSecurity; /* Menu Security Level */
int Age; /* Minimum Age to use menu */
unsigned int xMaxSecurity;
char Password[15]; /* Menu Password */
char DoorName[15]; /* Door name */
char TypeDesc[30]; /* Menu Type Description */
#ifdef __i386__
unsigned AutoExec : 1; /* Auto Exec Menu Type */
@ -848,10 +848,12 @@ struct menufile {
unsigned Comport : 1; /* Vmodem comport mode */
unsigned NoSuid : 1; /* Execute door nosuid */
unsigned NoPrompt : 1; /* No prompt after door */
unsigned SingleUser : 1; /* Single user door */
unsigned HideDoor : 1; /* Hide door from lists */
#else
/* All bits swapped */
unsigned xxLE_Dummy1 : 1;
unsigned xxLE_Dummy2 : 1;
unsigned HideDoor : 1; /* Hide door from lists */
unsigned SingleUser : 1; /* Single user door */
unsigned NoPrompt : 1; /* No prompt after door */
unsigned NoSuid : 1; /* Execute noduid */
unsigned Comport : 1; /* Vmodem comport mode */
@ -859,7 +861,7 @@ struct menufile {
unsigned NoDoorsys : 1; /* Suppress door.sys */
unsigned AutoExec : 1; /* Auto Exec Menu Type */
#endif
long xCredit;
long xUnused;
int HiForeGnd; /* High ForeGround color */
int HiBackGnd; /* High ForeGround color */
int ForeGnd; /* Normal ForeGround color */

View File

@ -98,6 +98,9 @@ static struct h_flags_struct {
{ (char *)"C32", HOPT_CRC32 },
{ (char *)"DEV", HOPT_DEVICE },
{ (char *)"FPT", HOPT_FPT },
#ifdef HAVE_ZLIB_H
{ (char *)"PLZ", HOPT_CANPLZ },
#endif
{ NULL , 0x0L }
};
@ -125,10 +128,8 @@ static long get_long(char *buffer)
#if defined(__i386__)
return *(long *) buffer;
#else
return ((unsigned long) ((unsigned char) buffer[0])) |
((unsigned long) ((unsigned char) buffer[1]) << 8) |
((unsigned long) ((unsigned char) buffer[2]) << 16) |
((unsigned long) ((unsigned char) buffer[3]) << 24);
return ((unsigned long) ((unsigned char) buffer[0])) | ((unsigned long) ((unsigned char) buffer[1]) << 8) |
((unsigned long) ((unsigned char) buffer[2]) << 16) | ((unsigned long) ((unsigned char) buffer[3]) << 24);
#endif
}
@ -152,6 +153,9 @@ char *PktS(int c)
case 'L' : return (char *)"IDLE";
case 'M' : return (char *)"DEVDATA";
case 'N' : return (char *)"DEVDACK";
#ifdef HAVE_ZLIB_H
case 'O' : return (char *)"ZIPDATA";
#endif
case 'a' : return (char *)"PKTEND";
case 'b' : return (char *)"BINPKT";
case 'c' : return (char *)"HEXPKT";
@ -357,15 +361,14 @@ void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen)
char *outbuf, *inbuf;
enum HyPktFormats format;
if (pkttype == 'G')
if (pkttype == HPKT_DATAACK)
Syslog('h', "ACK 0x%02x%02x%02x%02x", txbuf[0], txbuf[1], txbuf[2], txbuf[3]);
/*
* some packets have to be transferred in HEX mode
*/
if ((pkttype == HPKT_START) || (pkttype == HPKT_INIT) ||
(pkttype == HPKT_INITACK) || (pkttype == HPKT_END) ||
(pkttype == HPKT_IDLE)) {
if ((pkttype == HPKT_START) || (pkttype == HPKT_INIT) || (pkttype == HPKT_INITACK) ||
(pkttype == HPKT_END) || (pkttype == HPKT_IDLE)) {
format = HCHR_HEXPKT;
} else {
/* do we need to strip high bit */
@ -456,7 +459,11 @@ void hytxpkt(enum HyPktTypes pkttype, char *txbuf, int txlen)
*outbuf++ = H_DLE;
*outbuf++ = HCHR_PKTEND;
if ((pkttype != HPKT_DATA) && (format != HCHR_BINPKT)) {
if ((pkttype != HPKT_DATA)
#ifdef HAVE_ZLIB_H
&& (pkttype != HPKT_ZIPDATA)
#endif
&& (format != HCHR_BINPKT)) {
*outbuf++ = '\r';
*outbuf++ = '\n';
}
@ -543,6 +550,7 @@ int hydra_batch(int role, file_list *to_send)
int goodneeded;
enum HyTxStates txstate;
enum HyRxStates rxstate;
enum HyCompStates compstate;
int txwaitpkt, rxwaitpkt;
enum HyPktTypes pkttype;
int waitputget = 0;
@ -572,6 +580,7 @@ int hydra_batch(int role, file_list *to_send)
tz.tz_minuteswest = tz.tz_dsttime = 0;
rxstate = HRX_INIT;
rxoptions = HRXI_OPTIONS;
compstate = HCMP_NONE;
while ((txstate != HTX_DONE) && (txstate != HTX_Abort)) {
/*
@ -579,17 +588,14 @@ int hydra_batch(int role, file_list *to_send)
*/
txwaitpkt = ((txstate == HTX_SWAIT) || (txstate == HTX_INITACK)
|| ((txstate == HTX_RINIT) && (rxstate == HRX_INIT))
|| (txstate == HTX_FINFOACK) || (txstate == HTX_DATA)
|| (txstate == HTX_DATAACK)
|| (txstate == HTX_FINFOACK) || (txstate == HTX_DATA) || (txstate == HTX_DATAACK)
|| ((txstate == HTX_XWAIT) && (rxstate != HRX_DONE))
|| (txstate == HTX_EOFACK) || (txstate == HTX_ENDACK)
|| (txstate == HTX_REND));
|| (txstate == HTX_EOFACK) || (txstate == HTX_ENDACK) || (txstate == HTX_REND));
/*
* Is receiver waiting for packet?
*/
rxwaitpkt = ((rxstate == HRX_INIT) || (rxstate == HRX_FINFO) ||
(rxstate == HRX_DATA) || (rxstate == HRX_DONE));
rxwaitpkt = ((rxstate == HRX_INIT) || (rxstate == HRX_FINFO) || (rxstate == HRX_DATA) || (rxstate == HRX_DONE));
/*
* Do we have to wait for a packet?
@ -667,8 +673,10 @@ int hydra_batch(int role, file_list *to_send)
if (goodneeded > 8192)
goodneeded = 8192;
/* if we receive an RPOS packet in EOFACK-state we have to
change back to DATA-state */
/*
* if we receive an RPOS packet in EOFACK-state we have to
* change back to DATA-state
*/
if (txstate == HTX_EOFACK)
txstate = HTX_DATA;
@ -1000,6 +1008,7 @@ int hydra_batch(int role, file_list *to_send)
txstate = HTX_EOF;
}
} else {
// FIXME: Here we must add the compression code
txpos += txlen;
sentbytes += txlen;
goodbytes += txlen;
@ -1374,6 +1383,7 @@ int hydra_batch(int role, file_list *to_send)
case HRX_DATA:
Syslog('h', "SM 'HRX' entering 'DATA'");
// FIXME: Here the zlib extensions.
if ((pkttype == HPKT_DATA) && (rxlen > 4)) {
longnum = get_long(rxbuf);
Syslog('h', "Hydra: rcvd DATA (0x%08lx, 0x%08lx) %lu", longnum, rxpos, rxlen-4);
@ -1420,8 +1430,7 @@ int hydra_batch(int role, file_list *to_send)
if (!closefile()) {
srxpos = rxpos - srxpos;
Syslog('+', "Hydra: OK %s",
transfertime(rxstarttime, rxendtime, srxpos, FALSE));
Syslog('+', "Hydra: OK %s", transfertime(rxstarttime, rxendtime, srxpos, FALSE));
rxstate = HRX_OkEOF;
} else {
@ -1435,8 +1444,7 @@ int hydra_batch(int role, file_list *to_send)
rxstate = HRX_BadPos;
}
} else {
Syslog('+', "Hydra: receiver skipped file after %ld seconds",
rxendtime.tv_sec - rxstarttime.tv_sec);
Syslog('+', "Hydra: receiver skipped file after %ld seconds", rxendtime.tv_sec - rxstarttime.tv_sec);
if (rxfp) {
closefile();
@ -1617,14 +1625,7 @@ int hydra(int role)
eff_remote = remote;
}
if (role) {
// if (localoptions & NOHOLD)
nonhold_mail = (char *)ALL_MAIL;
// else
// nonhold_mail = (char *)NONHOLD_MAIL;
} else {
nonhold_mail = (char *)ALL_MAIL;
}
if (emsi_remote_lcodes & LCODE_HAT) {
Syslog('+', "Hydra: remote requested \"hold all traffic\", no send");
@ -1667,8 +1668,7 @@ int hydra(int role)
tmpfl->next = respond;
rc = hydra_batch(role, tosend);
tmpfl->next = NULL; /* split filelist into tosend
and respond again */
tmpfl->next = NULL; /* split filelist into tosend and respond again */
} else {
rc = hydra_batch(role, respond);
}

View File

@ -1,8 +1,14 @@
/* As this file has been derived from the HydraCom source, here is the
/* $Id$ */
/*
* As this file has been derived from the HydraCom source, here is the
* original copyright information:
*
* Note that you can find the file LICENSE.DOC from HydraCom in
* misc/HYDRACOM-LICENSE
*
* Some changes are made in this file to customize for use with MBSE BBS.
* There are also some extensions not in the original Hydra code for zlib
* packet compression of data packets.
*/
/*=============================================================================
@ -147,10 +153,24 @@ enum HyPktTypes
HPKT_IDLE = 'L', /* Idle - just saying I'm alive */
HPKT_DEVDATA = 'M', /* Data to specified device */
HPKT_DEVDACK = 'N', /* Response to DEVDATA pkt */
#ifdef HAVE_ZLIB_H
HPKT_ZIPDATA = 'O', /* Zlib compressed file data packet */
HPKT_HIGHEST = 'O' /* Highest known pkttype in this imp */
#else
HPKT_HIGHEST = 'N' /* Highest known pkttype in this imp */
#endif
};
/* HYDRA compression types ------------------------------------------------- */
enum HyCompStates
{
HCMP_NONE, /* No compression, default */
HCMP_GZ, /* Gzip compression */
HCMP_BZ2, /* Bzip2 compression */
};
/* HYDRA Internal Pseudo Packet Types -------------------------------------- */
#define H_NOPKT 0 /* No packet (yet) */
#define H_CANCEL (-1) /* Received cancel sequence 5*Ctrl-X */
@ -182,17 +202,33 @@ enum HyPktFormats
#define HOPT_CRC32 (0x00000100L) /* Packets with CRC-32 allowed */
#define HOPT_DEVICE (0x00000200L) /* DEVICE packets allowed */
#define HOPT_FPT (0x00000400L) /* Can handle filenames with paths */
#ifdef HAVE_ZLIB_H
#define HOPT_CANPLZ (0x00000800L) /* Can handle zlib packet compress */
#endif
/* What we can do */
#ifdef HAVE_ZLIB_H
#define HCAN_OPTIONS (HOPT_XONXOFF | HOPT_TELENET | HOPT_CTLCHRS | HOPT_HIGHCTL | HOPT_HIGHBIT | HOPT_CRC32 | HOPT_CANPLZ)
#else
#define HCAN_OPTIONS (HOPT_XONXOFF | HOPT_TELENET | HOPT_CTLCHRS | HOPT_HIGHCTL | HOPT_HIGHBIT | HOPT_CRC32)
#endif
/* Vital options if we ask for any; abort if other side doesn't support them */
#define HNEC_OPTIONS (HOPT_XONXOFF | HOPT_TELENET | HOPT_CTLCHRS | HOPT_HIGHCTL | HOPT_HIGHBIT | HOPT_CANBRK)
/* Non-vital options; nice if other side supports them, but doesn't matter */
#ifdef HAVE_ZLIB_H
#define HUNN_OPTIONS (HOPT_CANASC | HOPT_CANUUE | HOPT_CRC32 | HOPT_CANPLZ)
#else
#define HUNN_OPTIONS (HOPT_CANASC | HOPT_CANUUE | HOPT_CRC32)
#endif
/* Default options */
#define HDEF_OPTIONS (HOPT_CRC32)
/* rxoptions during init (needs to handle ANY link yet unknown at that point */
#define HRXI_OPTIONS (HOPT_XONXOFF | HOPT_TELENET | HOPT_CTLCHRS | HOPT_HIGHCTL | HOPT_HIGHBIT)
/* ditto, but this time txoptions */
#define HTXI_OPTIONS (HOPT_XONXOFF | HOPT_TELENET | HOPT_CTLCHRS | HOPT_HIGHCTL | HOPT_HIGHBIT)

View File

@ -62,10 +62,13 @@ void Good_Bye(int onsig)
if (onsig != SIGHUP)
DisplayFile((char *)"goodbye");
Syslog('b', "goodbye displayed");
if (do_mailout)
CreateSema((char *)"mailout");
SaveLastCallers();
Syslog('b', "Lastcallers written");
/*
* Update the users database record.

View File

@ -175,7 +175,7 @@ void Chat(char *username, char *channel)
char sbuf[81], resp[128], *cnt, *msg;
static char buf[200];
WhosDoingWhat(SYSOPCHAT);
WhosDoingWhat(SYSOPCHAT, NULL);
clear();
rsize = exitinfo.iScreenLen - 5;

View File

@ -97,17 +97,54 @@ char *Rdate(char *ind, int Y2K)
/*
* Function will run a external program or door
*/
void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSuid, int NoPrompt)
void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSuid, int NoPrompt, int SingleUser, char *What)
{
char *String, *String1;
int i, rc;
char *temp1;
int i, rc, Start;
char *temp1, buf[128];
FILE *fp;
temp1 = calloc(PATH_MAX, sizeof(char));
String = calloc(81, sizeof(char));
WhosDoingWhat(DOOR);
Start = TRUE;
if (SingleUser && What) {
/*
* Check if the door is in use
*/
while (TRUE) {
if (Start)
sprintf(buf, "GMON:1,1;");
else
sprintf(buf, "GMON:1,0;");
Start = FALSE;
if (socket_send(buf) == 0) {
strcpy(buf, socket_receive());
if (strncmp(buf, "100:0;", 6) == 0)
break; /* No more data */
if (strstr(buf, "mbsebbs")) {
strtok(buf, ","); /* Nr of parameters */
strtok(NULL, ","); /* Pid */
strtok(NULL, ","); /* tty */
strtok(NULL, ","); /* username */
strtok(NULL, ","); /* program name */
strtok(NULL, ","); /* location */
if (strcmp(strtok(NULL, ","), menus.DoorName) == 0) {
Syslog('+', "User tried single user door %s, but door is in use", menus.DoorName);
colour(LIGHTRED, BLACK);
/* The door is in use by another user, try again later */
printf("\n%s\n\n", (char *) Language(20));
Pause();
free(temp1);
free(String);
return;
}
}
}
}
}
WhosDoingWhat(DOOR, What);
if ((strstr(Program, "/N")) != NULL) {
sprintf(temp1, "%d", iNode);

View File

@ -3,7 +3,7 @@
#ifndef _DOOR_H
#define _DOOR_H
void ExtDoor(char *, int, int, int, int, int); /* Run external door */
void ExtDoor(char *, int, int, int, int, int, int, char *); /* Run external door */
int exec_nosuid(char *); /* Execute as real user */
#endif

View File

@ -178,7 +178,7 @@ int Export_a_Email(unsigned long Num)
LastNum = Num;
iLineCount = 7;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
Syslog('+', "Export email %d in area %s", Num, sMailbox);
/*
@ -374,7 +374,7 @@ int Read_a_Email(unsigned long Num)
LastNum = Num;
iLineCount = 7;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
/*
* The area data is already set, so we can do the next things
@ -519,7 +519,7 @@ int EmailPanel(void)
{
int input;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
colour(15, 4);
/* (A)gain, (N)ext, (L)ast, (R)eply, (E)nter, (D)elete, (Q)uit, e(X)port */
@ -681,7 +681,7 @@ void Reply_Email(int IsReply)
x = 0;
Line = 1;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
clear();
colour(1,7);
printf(" %-71s", sMailbox);
@ -817,7 +817,7 @@ void Write_Email(void)
orgbox = xstrcpy(sMailbox);
SetEmailArea((char *)"mailbox");
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
clear();
for (i = 0; i < (TEXTBUFSIZE + 1); i++)
@ -907,7 +907,7 @@ void QuickScan_Email(void)
long i;
iLineCount = 2;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
if (EmailBase.Total == 0) {
Enter(1);

View File

@ -99,7 +99,7 @@ void File_List()
_Tag T;
iLineCount = 0;
WhosDoingWhat(FILELIST);
WhosDoingWhat(FILELIST, NULL);
Syslog('+', "Listing File Area # %d", iAreaNumber);
@ -184,7 +184,7 @@ void Download(void)
Enter(2);
OldArea = iAreaNumber;
WhosDoingWhat(DOWNLOAD);
WhosDoingWhat(DOWNLOAD, NULL);
system("rm -f ./tag/*");
if ((tf = fopen("taglist", "r+")) == NULL) {
@ -1005,7 +1005,7 @@ int Upload()
char *arc;
WhosDoingWhat(UPLOAD);
WhosDoingWhat(UPLOAD, NULL);
/*
* Select default protocol if users hasn't any.
@ -1278,7 +1278,7 @@ int DownloadDirect(char *Name, int Wait)
return FALSE;
}
WhosDoingWhat(DOWNLOAD);
WhosDoingWhat(DOWNLOAD, NULL);
ReadExitinfo();
clear();
@ -1524,7 +1524,7 @@ int Download_Home()
File = calloc(PATH_MAX, sizeof(char));
temp = calloc(PATH_MAX, sizeof(char));
WhosDoingWhat(DOWNLOAD);
WhosDoingWhat(DOWNLOAD, NULL);
colour(14,0);
/* Please enter filename: */
@ -1589,7 +1589,7 @@ int Upload_Home()
int err;
struct stat statfile;
WhosDoingWhat(UPLOAD);
WhosDoingWhat(UPLOAD, NULL);
if (!ForceProtocol())
return 0;

View File

@ -402,7 +402,7 @@ void Post_Msg()
unsigned short point;
Line = 1;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
SetMsgArea(iMsgAreaNumber);
clear();
@ -811,7 +811,7 @@ int Export_a_Msg(unsigned long Num)
LastNum = Num;
iLineCount = 7;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
/*
* The sysop has a choice to export to the rules directory.
@ -960,7 +960,7 @@ int Read_a_Msg(unsigned long Num, int UpdateLR)
LastNum = Num;
iLineCount = 7;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
/*
* The area data is already set, so we can do the next things
@ -1172,7 +1172,7 @@ int ReadPanel()
{
int input;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
colour(WHITE, RED);
/*
@ -1310,7 +1310,7 @@ void Reply_Msg(int IsReply)
strncpy(msgid, Msg.Msgid, 80);
x = 0;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
clear();
colour(BLUE, LIGHTGRAY);
printf(" %-71s", sMsgAreaDesc);
@ -1486,7 +1486,7 @@ void QuickScan_Msgs()
long i;
iLineCount = 2;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
if (MsgBase.Total == 0) {
Enter(1);
@ -1552,7 +1552,7 @@ void Delete_Msg()
char *temp;
unsigned long Msgnum = 0L;
WhosDoingWhat(READ_POST);
WhosDoingWhat(READ_POST, NULL);
/*
* The area data is already set, so we can do the next things
@ -2524,7 +2524,7 @@ int Ext_Edit()
}
fclose(fd);
stat( tmpname, &st1 );
ExtDoor(CFG.externaleditor,FALSE,TRUE,TRUE,FALSE,TRUE);
ExtDoor(CFG.externaleditor,FALSE,TRUE,TRUE,FALSE,TRUE, FALSE, (char *)"Write message");
stat( tmpname, &st2 );
}

View File

@ -104,7 +104,7 @@ void menu()
*/
while (TRUE) {
WhosDoingWhat(BROWSING);
WhosDoingWhat(BROWSING, NULL);
/*
* Open menufile, first users language menu, if it fails
@ -333,7 +333,15 @@ void DoMenu(int Type)
case 7:
/* Run external program */
ExtDoor(menus.OptionalData, menus.NoDoorsys, menus.Y2Kdoorsys, menus.Comport, menus.NoSuid, menus.NoPrompt);
if (strlen(menus.DoorName) && !menus.HideDoor) {
memset(temp, 0, sizeof(temp));
strcpy(temp, menus.DoorName);
ExtDoor(menus.OptionalData, menus.NoDoorsys, menus.Y2Kdoorsys, menus.Comport,
menus.NoSuid, menus.NoPrompt, menus.SingleUser, temp);
} else {
ExtDoor(menus.OptionalData, menus.NoDoorsys, menus.Y2Kdoorsys, menus.Comport,
menus.NoSuid, menus.NoPrompt, menus.SingleUser, NULL);
}
break;
case 8:

View File

@ -232,7 +232,7 @@ void OLR_TagArea()
long total, Offset, Area;
int lines, input, ignore = FALSE, maxlines;
WhosDoingWhat(OLR);
WhosDoingWhat(OLR, NULL);
Msgname = calloc(PATH_MAX, sizeof(char));
Tagname = calloc(PATH_MAX, sizeof(char));
@ -375,7 +375,7 @@ void OLR_UntagArea()
long total, Offset, Area;
int lines, input, ignore = FALSE, maxlines;
WhosDoingWhat(OLR);
WhosDoingWhat(OLR, NULL);
Msgname = calloc(PATH_MAX, sizeof(char));
Tagname = calloc(PATH_MAX, sizeof(char));
@ -719,7 +719,7 @@ void OLR_ViewTags()
long total, Area = 0;
int lines, input, ignore = FALSE, maxlines;
WhosDoingWhat(OLR);
WhosDoingWhat(OLR, NULL);
Tagname = calloc(PATH_MAX, sizeof(char));
Msgname = calloc(PATH_MAX, sizeof(char));
@ -813,7 +813,7 @@ int OLR_Prescan()
FILE *mf, *tf;
int x;
WhosDoingWhat(OLR);
WhosDoingWhat(OLR, NULL);
clear();
colour(LIGHTMAGENTA, BLACK);
/* Offline Reader Download */
@ -939,7 +939,7 @@ void DrawBar(char *Pktname)
void OLR_RestrictDate()
{
WhosDoingWhat(OLR);
WhosDoingWhat(OLR, NULL);
printf("Not Yet Implemented\n");
Pause();
@ -1022,7 +1022,7 @@ void OLR_Upload(void)
return;
}
WhosDoingWhat(OLR);
WhosDoingWhat(OLR, NULL);
clear();
colour(LIGHTMAGENTA, BLACK);
/* Offline Reader Upload */

View File

@ -62,7 +62,7 @@ void WhosOn(char *OpData)
Underline = calloc(81, sizeof(char));
Heading = calloc(81, sizeof(char));
WhosDoingWhat(WHOSON);
WhosDoingWhat(WHOSON, NULL);
clear();
Enter(1);
@ -174,9 +174,15 @@ void WhosOn(char *OpData)
else if (strstr(isdoing, "Offline"))
/* Offline Reader */
printf("%-15s", (char *) Language(429));
else
/* Browsing */ /* This is default when nothing matches */
printf("%-15s", (char *) Language(418));
else {
/*
* This is default when nothing matches, with doors this
* will show the name of the door.
*/
if (strlen(isdoing) > 15)
isdoing[15] = '\0';
printf("%-15s", isdoing);
}
colour(LIGHTRED, BLACK);
printf("%-25s\n", location);
@ -200,7 +206,7 @@ void WhosOn(char *OpData)
/*
* Function will update users file and and update exitinfo.iStatus
*/
void WhosDoingWhat(int iStatus)
void WhosDoingWhat(int iStatus, char *what)
{
char *temp;
@ -226,7 +232,10 @@ void WhosDoingWhat(int iStatus)
LC_Read = TRUE;
break;
case DOOR: strcpy(temp, "External Door");
case DOOR: if (what)
strcpy(temp, what);
else
strcpy(temp, "External Door");
LC_Door = TRUE;
break;

View File

@ -4,7 +4,7 @@
#define _WHOSON_H
void WhosOn(char *); /* What users are currently online */
void WhosDoingWhat(int); /* Update what user is doing */
void WhosDoingWhat(int, char *); /* Update what user is doing */
void SendOnlineMsg(char *); /* Send On-Line Message to User */
#endif

View File

@ -108,16 +108,18 @@ void Show_A_Menu(void)
mvprintw(11, 2, "4. Display");
mvprintw(12, 2, "5. Security");
mvprintw(13, 2, "6. Min. age");
mvprintw(14, 2, "7. Password");
mvprintw(15, 2, "8. Lo-colors");
mvprintw(16, 2, "9. Hi-colors");
mvprintw(17, 2, "10. Autoexec");
mvprintw(14, 2, "7. Lo-colors");
mvprintw(15, 2, "8. Hi-colors");
mvprintw(16, 2, "9. Autoexec");
if (le_int(menus.MenuType) == 7) {
mvprintw(13,42, "11. No door.sys");
mvprintw(14,42, "12. Y2K style");
mvprintw(15,42, "13. Use Comport");
mvprintw(16,42, "14. Run nosuid");
mvprintw(17,42, "15. No Prompt");
mvprintw(17, 2, "10. Door Name");
mvprintw(18, 2, "11. Y2K style");
mvprintw(13,42, "12. No door.sys");
mvprintw(14,42, "13. Use COMport");
mvprintw(15,42, "14. Run nosuid");
mvprintw(16,42, "15. No Prompt");
mvprintw(17,42, "16. Single User");
mvprintw(18,42, "17. Hidden door");
}
set_color(WHITE, BLACK);
@ -128,20 +130,19 @@ void Show_A_Menu(void)
show_str(11,16,64, menus.Display);
show_sec(12,16, menus.MenuSecurity);
show_int(13,16, le_int(menus.Age));
if (strlen(menus.Password))
show_str(14,16,14, (char *)"**************");
else
show_str(14,16,14, (char *)"<null>");
S_COL(15,16, "Normal display color", le_int(menus.ForeGnd), le_int(menus.BackGnd))
S_COL(16,16, "Bright display color", le_int(menus.HiForeGnd), le_int(menus.HiBackGnd))
S_COL(14,16, "Normal display color", le_int(menus.ForeGnd), le_int(menus.BackGnd))
S_COL(15,16, "Bright display color", le_int(menus.HiForeGnd), le_int(menus.HiBackGnd))
set_color(WHITE, BLACK);
show_bool(17,16, menus.AutoExec);
show_bool(16,16, menus.AutoExec);
if (le_int(menus.MenuType) == 7) {
show_str(17,16,14, menus.DoorName);
show_bool(18,16, menus.Y2Kdoorsys);
show_bool(13,58, menus.NoDoorsys);
show_bool(14,58, menus.Y2Kdoorsys);
show_bool(15,58, menus.Comport);
show_bool(16,58, menus.NoSuid);
show_bool(17,58, menus.NoPrompt);
show_bool(14,58, menus.Comport);
show_bool(15,58, menus.NoSuid);
show_bool(16,58, menus.NoPrompt);
show_bool(17,58, menus.SingleUser);
show_bool(18,58, menus.HideDoor);
}
}
@ -214,7 +215,7 @@ void Edit_A_Menu(void)
Show_A_Menu();
for (;;) {
switch(select_menu(15)) {
switch(select_menu(17)) {
case 0: return;
break;
case 1: E_UPS( 7,16, 1, menus.MenuKey, "The ^key^ to select this menu item")
@ -238,41 +239,76 @@ void Edit_A_Menu(void)
temp = edit_int(13,16, temp, (char *)"The minimum ^Age^ to select this menu, 0 is don't care");
menus.Age = le_int(temp);
break;
case 7: E_STR(14,16,14, menus.Password, "The ^password^ to access this menu item")
case 8: fg = le_int(menus.ForeGnd);
case 7: fg = le_int(menus.ForeGnd);
bg = le_int(menus.BackGnd);
edit_color(&fg, &bg, (char *)"8.3.8 EDIT COLOR", (char *)"normal");
edit_color(&fg, &bg, (char *)"8.3.7 EDIT COLOR", (char *)"normal");
menus.ForeGnd = le_int(fg);
menus.BackGnd = le_int(bg);
Show_A_Menu();
break;
case 9: fg = le_int(menus.HiForeGnd);
case 8: fg = le_int(menus.HiForeGnd);
bg = le_int(menus.HiBackGnd);
edit_color(&fg, &bg, (char *)"8.3.9 EDIT COLOR", (char *)"bright");
edit_color(&fg, &bg, (char *)"8.3.8 EDIT COLOR", (char *)"bright");
menus.HiForeGnd = le_int(fg);
menus.HiBackGnd = le_int(bg);
Show_A_Menu();
break;
case 10:menus.AutoExec = edit_bool(17,16, menus.AutoExec, (char *)"Is this an ^Autoexecute^ menu item");
case 9: menus.AutoExec = edit_bool(16,16, menus.AutoExec, (char *)"Is this an ^Autoexecute^ menu item");
break;
case 10:if (le_int(menus.MenuType) == 7) {
E_STR(17,16,14, menus.DoorName, (char *)"The ^name^ of the door to show to the users")
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
case 11:if (le_int(menus.MenuType) == 7) {
menus.NoDoorsys = edit_bool(13,58, menus.NoDoorsys, (char *)"Suppress writing ^door.sys^ dropfile");
menus.Y2Kdoorsys = edit_bool(18,16, menus.Y2Kdoorsys, (char *)"Create ^door.sys^ with 4 digit yearnumbers");
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
case 12:if (le_int(menus.MenuType) == 7) {
menus.Y2Kdoorsys = edit_bool(14,58, menus.Y2Kdoorsys, (char *)"Create ^door.sys^ with 4 digit yearnumbers");
menus.NoDoorsys = edit_bool(13,58, menus.NoDoorsys, (char *)"Suppress writing ^door.sys^ dropfile");
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
case 13:if (le_int(menus.MenuType) == 7) {
menus.Comport = edit_bool(15,58, menus.Comport, (char *)"Write real ^COM port^ in door.sys for Vmodem patch");
menus.Comport = edit_bool(14,58, menus.Comport, (char *)"Write real ^COM port^ in door.sys for Vmodem patch");
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
case 14:if (le_int(menus.MenuType) == 7) {
menus.NoSuid = edit_bool(16,58, menus.NoSuid, (char *)"Run the door as ^real user (nosuid)^");
menus.NoSuid = edit_bool(15,58, menus.NoSuid, (char *)"Run the door as ^real user (nosuid)^");
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
case 15:if (le_int(menus.MenuType) == 7) {
menus.NoPrompt = edit_bool(17,58, menus.NoPrompt, (char *)"^Don't display prompt^ when door is finished");
menus.NoPrompt = edit_bool(16,58, menus.NoPrompt, (char *)"^Don't display prompt^ when door is finished");
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
case 16:if (le_int(menus.MenuType) == 7) {
menus.SingleUser = edit_bool(17,58, menus.SingleUser, (char *)"Set if door is for ^single user^ only");
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
case 17:if (le_int(menus.MenuType) == 7) {
menus.HideDoor = edit_bool(18,58, menus.HideDoor, (char *)"^Hide door^ from user display lists");
} else {
working(2, 0, 0);
working(0, 0, 0);
}
break;
}
@ -596,17 +632,19 @@ int bbs_menu_doc(FILE *fp, FILE *toc, int page)
fprintf(fp, " Display %s\n", menus.Display);
fprintf(fp, " Security %s\n", get_secstr(menus.MenuSecurity));
fprintf(fp, " Minimum age %d\n", menus.Age);
fprintf(fp, " Password %s\n", menus.Password);
fprintf(fp, " Lo-colors %s on %s\n",
get_color(le_int(menus.ForeGnd)), get_color(le_int(menus.BackGnd)));
fprintf(fp, " Hi-colors %s on %s\n",
get_color(le_int(menus.HiForeGnd)), get_color(le_int(menus.HiBackGnd)));
if (le_int(menus.MenuType) == 7) {
fprintf(fp, " No door.sys %s\n", getboolean(menus.NoDoorsys));
fprintf(fp, " Y2K door.sys %s\n", getboolean(menus.Y2Kdoorsys));
fprintf(fp, " Door Name %s\n", menus.DoorName);
fprintf(fp, " No door.sys %s", getboolean(menus.NoDoorsys));
fprintf(fp, " Y2K door.sys %s", getboolean(menus.Y2Kdoorsys));
fprintf(fp, " Use COM port %s\n", getboolean(menus.Comport));
fprintf(fp, " No setuid %s\n", getboolean(menus.NoSuid));
fprintf(fp, " No Prompt %s\n", getboolean(menus.NoPrompt));
fprintf(fp, " Run nosuid %s", getboolean(menus.NoSuid));
fprintf(fp, " No Prompt %s", getboolean(menus.NoPrompt));
fprintf(fp, " Single user %s\n", getboolean(menus.SingleUser));
fprintf(fp, " Hidden door %s\n", getboolean(menus.HideDoor));
}
fprintf(fp, "\n\n");
j++;