serveral updates for running DOS doors
This commit is contained in:
@@ -290,9 +290,14 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu
|
||||
|
||||
WhosDoingWhat(DOOR);
|
||||
|
||||
if((strstr(Program, "/A")) != NULL) {
|
||||
if ((strstr(Program, "/N")) != NULL) {
|
||||
sprintf(temp1, "%d", iNode);
|
||||
strreplace(Program, (char *)"/N", temp1);
|
||||
}
|
||||
|
||||
if ((strstr(Program, "/A")) != NULL) {
|
||||
colour(3, 0);
|
||||
if((String = strstr(Program, "/T=")) != NULL) {
|
||||
if ((String = strstr(Program, "/T=")) != NULL) {
|
||||
String1 = String + 3;
|
||||
printf("\n%s", String1);
|
||||
} else
|
||||
@@ -305,9 +310,9 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu
|
||||
strreplace(Program, (char *)"/A", temp1);
|
||||
|
||||
for(i = 0; i < strlen(Program); i++) {
|
||||
if(*(Program + i) == '\0')
|
||||
if (*(Program + i) == '\0')
|
||||
break;
|
||||
if(*(Program + i) == '/')
|
||||
if (*(Program + i) == '/')
|
||||
*(Program + i) = '\0';
|
||||
}
|
||||
}
|
||||
@@ -340,7 +345,7 @@ void ExtDoor(char *Program, int NoDoorsys, int Y2Kdoorsys, int Comport, int NoSu
|
||||
fprintf(fp, "0\r\n"); /* Effective baudrate */
|
||||
}
|
||||
fprintf(fp, "8\r\n"); /* Databits */
|
||||
fprintf(fp, "1\r\n"); /* Node number */
|
||||
fprintf(fp, "%d\r\n", iNode); /* Node number */
|
||||
if (Comport)
|
||||
fprintf(fp, "115200\r\n");/* Locked baudrate */
|
||||
else
|
||||
@@ -425,6 +430,7 @@ int exec_nosuid(char *mandato)
|
||||
|
||||
if (mandato == NULL)
|
||||
return 1; /* Prevent running a shell */
|
||||
|
||||
Syslog('+', "Execve: /bin/sh -c %s", mandato);
|
||||
pid = fork();
|
||||
if (pid == -1)
|
||||
|
@@ -1,8 +1,8 @@
|
||||
/*****************************************************************************
|
||||
*
|
||||
* File ..................: bbs/mbsebbs.c
|
||||
* File ..................: mbsebbs/mbsebbs.c
|
||||
* Purpose ...............: Main startup
|
||||
* Last modification date : 28-Jun-2001
|
||||
* Last modification date : 22-Oct-2001
|
||||
*
|
||||
*****************************************************************************
|
||||
* Copyright (C) 1997-2001
|
||||
@@ -102,13 +102,6 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
exit(1);
|
||||
}
|
||||
// if (seteuid(pw->pw_uid) == -1) {
|
||||
// perror("Can't seteuid() to \"mbse\" user");
|
||||
//#ifdef MEMWATCH
|
||||
// mwTerm();
|
||||
//#endif
|
||||
// exit(1);
|
||||
// }
|
||||
|
||||
/*
|
||||
* Set local time and statistic indexes.
|
||||
@@ -214,13 +207,15 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
sprintf(temp, "%s/etc/ttyinfo.data", getenv("MBSE_ROOT"));
|
||||
|
||||
iNode = 0;
|
||||
if ((pTty = fopen(temp, "r")) == NULL) {
|
||||
WriteError("Can't read %s", temp);
|
||||
} else {
|
||||
fread(&ttyinfohdr, sizeof(ttyinfohdr), 1, pTty);
|
||||
|
||||
while (fread(&ttyinfo, ttyinfohdr.recsize, 1, pTty) == 1) {
|
||||
if (strcmp(ttyinfo.tty, pTTY) == 0)
|
||||
iNode++;
|
||||
if (strcmp(ttyinfo.tty, pTTY) == 0)
|
||||
break;
|
||||
}
|
||||
fclose(pTty);
|
||||
@@ -230,6 +225,7 @@ int main(int argc, char **argv)
|
||||
printf("No BBS on this port allowed!\n\n");
|
||||
Quick_Bye(0);
|
||||
}
|
||||
Syslog('b', "Node number %d", iNode);
|
||||
|
||||
/*
|
||||
* Ask whether to display Connect String
|
||||
|
Reference in New Issue
Block a user