home *** CD-ROM | disk | FTP | other *** search
- *** /u/news/xbbs/bbsc1.c Wed Mar 21 23:28:02 1990
- --- bbsc1.c Sun Apr 29 23:17:19 1990
- ***************
- *** 185,199 ****
- error_config();
- strip(buf128);
- MAXKBYTE = atoi(buf128);
- ! if ((fgets(TAR, 49, inbuf) == NULL))
- error_config();
- ! strip(TAR);
- ! if ((fgets(ZCAT, 49, inbuf) == NULL))
- error_config();
- ! strip(ZCAT);
- ! if ((fgets(ARC, 49, inbuf) == NULL))
- error_config();
- ! strip(ARC);
- if ((fgets(ZIP, 49, inbuf) == NULL))
- error_config();
- strip(ZIP);
- --- 185,199 ----
- error_config();
- strip(buf128);
- MAXKBYTE = atoi(buf128);
- ! if ((fgets(MAILER, 49, inbuf) == NULL))
- error_config();
- ! strip(MAILER);
- ! if ((fgets(MAILADR, 49, inbuf) == NULL))
- error_config();
- ! strip(MAILADR);
- ! if ((fgets(EXTENS, 49, inbuf) == NULL))
- error_config();
- ! strip(EXTENS);
- if ((fgets(ZIP, 49, inbuf) == NULL))
- error_config();
- strip(ZIP);
- ***************
- *** 544,560 ****
- which_timer = 1;
- alarm(sec);
-
- ! if (signal(SIGALRM, timer) == (int (*) ()) -1)
- exit(1);
- ! if (signal(SIGUSR1, mon_toggle) == (int (*) ()) -1)
- exit(1);
- ! if (signal(SIGUSR2, sys_toggle) == (int (*) ()) -1)
- ! exit(1);
- ! if (signal(SIGPIPE, chat) == (int (*) ()) -1)
- ! exit(1);
- ! if (signal(SIGINT, STOP) == (int (*) ()) -1)
- exit(1);
- ! if (signal(SIGHUP, hanged) == (int (*) ()) -1)
- exit(1);
-
-
- --- 544,560 ----
- which_timer = 1;
- alarm(sec);
-
- ! if ((int) signal(SIGALRM, timer) == (int (*) ()) -1)
- exit(1);
- ! if ((int) signal(SIGUSR1, mon_toggle) == (int (*) ()) -1)
- exit(1);
- ! if ((int) signal(SIGUSR2, sys_toggle) == (int (*) ()) -1)
- ! exit(1);
- ! if ((int) signal(SIGPIPE, chat) == (int (*) ()) -1)
- ! exit(1);
- ! if ((int) signal(SIGINT, STOP) == (int (*) ()) -1)
- exit(1);
- ! if ((int) signal(SIGHUP, hanged) == (int (*) ()) -1)
- exit(1);
-
-
- ***************
- *** 1565,1576 ****
- goto ffile;
- }
- }
- file_c()
- {
- ! int result, zcat;
- ! char *ptr, temp[16];
- ! zcat = 0;
- ! portsout("\n\r\n\rArchive Contents Listing Option for .tar(.Z), .zip or .arc files\n\r\n\r");
- portsout("Input archive file name to list ====> ");
- portsin(x_filename, 15);
- portsout(CRLF);
- --- 1565,1578 ----
- goto ffile;
- }
- }
- +
- file_c()
- {
- ! FILE *fpt;
- ! char cmd_line[1024];
- ! int ext_flag, result;
- !
- ! portsout("\n\r\n\rList the Contents of an Archive\n\r\n\r");
- portsout("Input archive file name to list ====> ");
- portsin(x_filename, 15);
- portsout(CRLF);
- ***************
- *** 1578,1668 ****
- return;
- strcpy(x_pathandfile, f_pathname);
- strcat(x_pathandfile, x_filename);
- ! ptr = strrchr(x_pathandfile, '.');
- ! if (ptr == NULL) {
- ! portsout("\n\rImproper file extension\n\r");
- return;
- }
- ! *ptr++;
- ! strcpy(temp, ptr);
- ! if (strcmp(temp, "Z") == 0) {
- ! zcat = 1;
- ! strcpy(buf128, x_pathandfile);
- ! ptr = strrchr(buf128, '.');
- ! if (ptr == NULL) {
- ! portsout("\n\rImproper file extension\n\r");
- ! return;
- ! }
- ! *ptr = '\0';
- ! ptr = strrchr(buf128, '.');
- ! if (ptr == NULL) {
- ! portsout("\n\rImproper file extension\n\r");
- ! return;
- ! }
- ! *ptr++;
- ! strcpy(temp, ptr);
- ! }
- ! if ((strcmp(temp, "arc") == 0) || (strcmp(temp, "ARC") == 0) || (strcmp(temp, "tar") == 0) || (strcmp(temp,"zip") == 0) || (strcmp(temp,"ZIP") ==0)) {
- ! result = stat(x_pathandfile, &statbuf);
- ! if (result != 0) {
- ! portsout("\n\r\n\rThe requested file was not found!\n\r\n\r");
- ! return;
- ! }
- ! if ((strcmp(temp, "arc") == 0 || strcmp(temp, "ARC") == 0)) {
- ! strcpy(buf128, ARC);
- ! strcat(buf128, x_pathandfile);
- ! strcat(buf128, " > ");
- ! strcat(buf128, TMPFILE);
- ! strcat(buf128, port_id);
- ! (void) system(buf128);
- ! portsout("\n\r\n\r");
- ! strcpy(buf128, TMPFILE);
- ! strcat(buf128, port_id);
- ! cmd_p(buf128);
- ! portsout("\n\r\n\r");
- ! return;
- ! }
- ! if ((strcmp(temp, "zip") == 0 || strcmp(temp, "ZIP") == 0)) {
- ! strcpy(buf128, ZIP);
- ! strcat(buf128, x_pathandfile);
- ! strcat(buf128, " > ");
- ! strcat(buf128, TMPFILE);
- ! strcat(buf128, port_id);
- ! (void) system(buf128);
- ! portsout("\n\r\n\r");
- ! strcpy(buf128, TMPFILE);
- ! strcat(buf128, port_id);
- ! cmd_p(buf128);
- ! portsout("\n\r\n\r");
- ! return;
- ! }
- ! if (strcmp(temp, "tar") == 0) {
- ! if (!zcat) {
- ! strcpy(buf128, TAR);
- ! strcat(buf128, x_pathandfile);
- ! } else {
- ! strcpy(buf128, ZCAT);
- ! strcat(buf128, x_pathandfile);
- ! strcat(buf128, " | ");
- ! strcat(buf128, TAR);
- ! strcat(buf128, "-");
- }
-
- ! strcat(buf128, " > ");
- ! strcat(buf128, TMPFILE);
- ! strcat(buf128, port_id);
- ! portsout("\n\rOne moment please ....");
- ! (void) system(buf128);
- ! portsout("\n\r\n\r");
- ! strcpy(buf128, TMPFILE);
- ! strcat(buf128, port_id);
- ! cmd_p(buf128);
- ! portsout("\n\r\n\r");
- ! return;
- }
- }
- ! portsout("\n\r\n\rIllegal file extension!\n\r\n\r");
- }
- file_r()
- {
- int result;
- --- 1580,1687 ----
- return;
- strcpy(x_pathandfile, f_pathname);
- strcat(x_pathandfile, x_filename);
- !
- ! result=stat(x_pathandfile, &statbuf);
- ! if(result != 0) {
- ! portsout("\n\r\n\rThe requested file was not found!\n\r\n\r");
- return;
- }
- !
- ! strcpy(buf128, EXTENS);
- ! if((fpt=fopen(buf128, "r")) == NULL) {
- ! portsout("\n\r\n\rDescription File for Extensions missing: Notify Sysop\n\r\n\r");
- ! return;
- ! }
- !
- ! ext_flag=0;
- ! while(1) {
- ! if((fgets(buf128,80,fpt)==NULL)) {
- ! if(ext_flag==0) {
- ! portsout("\n\r\n\rNot an Archive or Extension currently not supported\n\r\n\r");
- ! portsout("If you have the C-Source of a Programm supporting this Archive\n\r");
- ! portsout("under Unix - please upload it\n\r\n\r");
- ! return;
- ! }
- ! else break;
- ! }
- !
- ! if(buf128[0] == '#') /* Comment Line */
- ! continue;
- !
- ! if(buf128[0] == '*') /* Continuation Line */
- ! if(!ext_flag)
- ! continue;
- ! else {
- ! strcat(cmd_line, " | ");
- ! strcat(cmd_line, get_ext(&buf128[10],'\n'));
- ! continue;
- }
-
- ! if(check_ext(buf128) == 0) { /* Line with Extension */
- ! strcpy(cmd_line, get_ext(&buf128[10],'\n'));
- ! strcat(cmd_line, " ");
- ! strcat(cmd_line, x_pathandfile);
- ! ext_flag=1;
- ! } else {
- ! if(ext_flag)
- ! break;
- ! else
- ! continue;
- }
- }
- ! fclose(fpt);
- ! strcat(cmd_line, " > ");
- ! strcat(cmd_line, TMPFILE);
- ! strcat(cmd_line, port_id);
- ! portsout("\n\rOne moment please ....");
- ! (void) system(cmd_line);
- ! portsout("\n\r\n\r");
- ! strcpy(buf128, TMPFILE);
- ! strcat(buf128, port_id);
- ! cmd_p(buf128);
- ! portsout("\n\r\n\r");
- ! return;
- ! }
- !
- ! check_ext(str)
- ! char *str;
- ! {
- ! int i1, i2;
- ! char s2[80];
- !
- ! strcpy(s2,get_ext(str,' '));
- ! i1=strlen(x_pathandfile);
- ! i2=strlen(s2);
- !
- ! if(i1<=i2)
- ! return (1);
- ! if(strcmp(&x_pathandfile[i1-i2], s2) == 0) {
- ! return(0);
- ! }
- ! return (1);
- ! }
- !
- ! char *get_ext(str,delim) /* Parameters: string and the ending delimiter */
- ! char *str, delim;
- ! {
- ! char s2[80];
- ! int i;
- !
- ! i=0;
- ! while(*str != '\0') {
- ! s2[i]=*str;
- ! if(*str == delim) {
- ! s2[i]='\0';
- ! return (s2);
- ! }
- ! str++;
- ! i++;
- ! }
- ! s2[i]='\0';
- ! return (s2);
- }
- +
- +
- file_r()
- {
- int result;
- ***************
- *** 2504,2509 ****
- --- 2523,2529 ----
- }
- strcat(x_pathandfile, x_filename);
- strcpy(buf128, ORGPATH);
- + strcat(buf128, "temp/");
- strcat(buf128, x_filename);
- code = link(x_pathandfile, buf128);
- if( code == -1) {
- ***************
- *** 3265,3274 ****
-
- savemsg()
- { /* save a message */
- ! int fd;
-
- portsout("Saving...\r\n");
- -
- strcpy(msg_delete, pubpriv); /* delete byte */
- strcpy(msg_date, mm);
- strcat(msg_date, "/");
- --- 3285,3295 ----
-
- savemsg()
- { /* save a message */
- ! FILE *fdm;
- ! int fd, no_uucp;
- ! char mail_file[128], m_date[128];
-
- portsout("Saving...\r\n");
- strcpy(msg_delete, pubpriv); /* delete byte */
- strcpy(msg_date, mm);
- strcat(msg_date, "/");
- ***************
- *** 3306,3311 ****
- --- 3327,3357 ----
-
- strcpy(h_date, msg_date);
- hdrwrt(); /* update the header file */
- +
- + /* Write msg to another system via uucp */
- +
- + strcpy(mail_file, "/tmp/mail_XXXXXX");
- + mktemp(mail_file);
- + if(!(fdm = fopen(mail_file, "w"))) {
- + portsout(CRLF);
- + portsout("Mail tempfile has problems writing");
- + portsout(CRLF);
- + }
- + strcpy(m_date, msg_date);
- + strcat(m_date, " ");
- + strcat(m_date, msg_time);
- + fprintf(fdm, "XBBX_Date: %s\n", m_date);
- + fprintf(fdm, "XBBS_From: %s\n", msg_from);
- + fprintf(fdm, "XBBS_To: %s\n", msg_to);
- + fprintf(fdm, "XBBS_Subject: %s\n\n", msg_subject);
- + fprintf(fdm, "%s\n", msg_text);
- + fclose(fdm);
- + strcpy(m_date, MAILER);
- + strcat(m_date, MAILADR);
- + strcat(m_date, " <");
- + strcat(m_date, mail_file);
- + system(m_date);
- + unlink(mail_file);
- }
- /* end of function */
-
- ***************
- *** 3397,3413 ****
- char *logname();
-
- static char shell[] = "SHELL=/bin/sh";
- ! static char home[150];
- ! static char logn[50];
- char cmd[512];
- char news[520];
- char tmp[512];
- FILE *newsf;
- ! int mask;
- char term;
-
- - strcpy(home, "HOME=");
- - strcpy(logn,"LOGNAME=");
- strcat(home, ORGPATH);
- strcat(home, "usenet/");
- strcat(home, u_fname);
- --- 3443,3457 ----
- char *logname();
-
- static char shell[] = "SHELL=/bin/sh";
- ! static char home[150] = "HOME=";
- ! static char logn[50] = "LOGNAME=";
- char cmd[512];
- char news[520];
- char tmp[512];
- FILE *newsf;
- ! int mask, mode_dumb;
- char term;
-
- strcat(home, ORGPATH);
- strcat(home, "usenet/");
- strcat(home, u_fname);
- ***************
- *** 3434,3452 ****
- umask(mask);
- }
- menu:
- portsout("\n\rWhich type of terminal do you have:\n\r");
- portsout("1) Ansi Standard Monitor\n\r");
- ! portsout("2) ANSI.SYS for MS-DOS\n\r");
- ! portsout("3) VT100\n\r");
- ! portsout("4) Macintosh MacTerm in VT-100 mode\n\r");
- ! portsout("5) VT52 Terminal\n\r");
- ! portsout("6) Televideo 925\n\r");
- ! portsout("7) Televideo 910\n\r");
- ! portsout("8) Tandy DT-100\n\r");
- ! portsout("9) Dumb - Use this when nothing else works correctly.\n\r");
- ! portsout(" Instead of the normal \"- MORE -\" inbetween pages\n\r");
- ! portsout(" You will see nothing, BUT you will hear a beep.\n\r");
- ! portsout(" This is the same thing. \"?\" is for help\n\r");
- portsout("\n\rQ) Return to main menu\n\r");
- portsout("===> ");
- term = portin();
- --- 3478,3488 ----
- umask(mask);
- }
- menu:
- + mode_dumb=0;
- portsout("\n\rWhich type of terminal do you have:\n\r");
- portsout("1) Ansi Standard Monitor\n\r");
- ! portsout("2) VT100\n\r");
- ! portsout("3) Wyse 60\n\r");
- portsout("\n\rQ) Return to main menu\n\r");
- portsout("===> ");
- term = portin();
- ***************
- *** 3456,3483 ****
- putenv("TERM=ansi");
- break;
- case ('2'):
- - putenv("TERM=dosansi");
- - break;
- - case ('3'):
- putenv("TERM=vt100");
- break;
- ! case ('4'):
- ! putenv("TERM=macterm");
- ! break;
- ! case ('5'):
- ! putenv("TERM=vt52so");
- ! break;
- ! case ('6'):
- ! putenv("TERM=tvi925co");
- ! break;
- ! case ('7'):
- ! putenv("TERM=tvi910");
- ! break;
- ! case ('8'):
- ! putenv("TERM=dt100");
- ! break;
- ! case ('9'):
- ! putenv("TERM=dumb");
- break;
- case ('Q'):
- case ('q'):
- --- 3492,3501 ----
- putenv("TERM=ansi");
- break;
- case ('2'):
- putenv("TERM=vt100");
- break;
- ! case ('3'):
- ! putenv("TERM=wyse60");
- break;
- case ('Q'):
- case ('q'):
- ***************
- *** 3493,3537 ****
- putenv(shell);
- putenv(home);
- putenv(logn);
- ! choose:
- ! portsout("\n\rDo you wish to:\n\r");
- ! portsout("1) Readnews\n\r");
- ! portsout("2) Postnews\n\r");
- ! portsout("\n\rQ) Return to main menu\n\r");
- ! portsout("===>");
- ! term = portin();
- ! portsout("\n\r");
- ! switch (term) {
- ! case ('1'):
- ! restoremodes();
- ! portrst();
- ! STDerr = freopen("/dev/tty", "w+", stderr);
- ! sprintf(cmd, "%s -n all",READN);
- ! system(cmd);
- ! break;
- ! case ('2'):
- ! restoremodes();
- ! portrst();
- ! STDerr = freopen("/dev/tty", "w+", stderr);
- ! sprintf(cmd, "%s",POSTN);
- ! system(cmd);
- ! break;
- ! case ('Q'):
- ! case ('q'):
- ! portsout("\n\r");
- ! strcpy(home, "HOME=");
- ! strcpy(logn, "LOGNAME=");
- ! cmd[0] = '\0';
- ! news[0] = '\0';
- ! tmp[0] = '\0';
- ! return (0);
- ! break;
- ! default:
- ! portsout("Please try again\n\r");
- ! goto choose;
- ! break;
- ! }
- !
- strcpy(home, "HOME=");
- strcpy(logn, "LOGNAME=");
- cmd[0] = '\0';
- --- 3511,3521 ----
- putenv(shell);
- putenv(home);
- putenv(logn);
- ! restoremodes();
- ! portrst();
- ! STDerr = freopen("/dev/tty", "w+", stderr);
- ! sprintf(cmd, READN);
- ! system(cmd);
- strcpy(home, "HOME=");
- strcpy(logn, "LOGNAME=");
- cmd[0] = '\0';
- ***************
- *** 3550,3555 ****
- --- 3534,3540 ----
- signal(SIGPIPE, chat);
-
- }
- +
- restoresig()
- {
- signal(SIGALRM, timer);
- *** /u/news/xbbs/bbsc2.c Mon Jul 3 14:28:08 1989
- --- bbsc2.c Sun Apr 29 17:35:17 1990
- ***************
- *** 1248,1253 ****
- --- 1248,1254 ----
- char foo;
- int result;
- strcpy(buf128, ORGPATH);
- + strcat(buf128, "daylogs/");
- strcat(buf128, mnd);
- if ((inbuf = fopen(buf128, "r+")) == NULL) {
- portsout(CRLF);
- ***************
- *** 1418,1423 ****
- --- 1419,1425 ----
- {
- char firstz[20], lastz[20], dsize[20];
- strcpy(buf128, ORGPATH);
- + strcat(buf128, "daylogs/");
- strcat(buf128, mnd);
- if ((inbuf = fopen(buf128, "r")) == NULL) {
- fclose(inbuf);
- *** /u/news/xbbs/bbscconf.c Thu Mar 15 23:26:42 1990
- --- bbscconf.c Sun Apr 29 17:32:52 1990
- ***************
- *** 19,43 ****
- struct stat thisstat;
- char *getlogin();
-
- - #ifdef SYSV
- - #define opendir(path) fopen (path, "r")
- - #define closedir(dirp) fclose (dirp)
- - struct dirent *
- - readdir(dirp)
- - DIR *dirp;
- - {
- - static struct dirent entry;
- - if (dirp == NULL)
- - return (NULL);
- - for (;;) {
- - if (fread(&entry, sizeof(struct dirent), 1, dirp) == 0)
- - return (NULL);
- - if (entry.d_ino)
- - return (&entry);
- - }
- - }
- - #endif
- -
- conf()
- {
- int mypid, loginpid, uid;
- --- 19,24 ----
- ***************
- *** 233,240 ****
- fclose(infile);
- j = kill(i, 0); /* see if it is a good pid */
- if (!j) {
- ! strcpy(buf128, ORGPATH);
- ! strcat(buf128, "lastcall.bbs");
- ptr1 = who_am_i + 3;
- ptr2 = who_am_I;
- for (i = 3; i < 5; i++)
- --- 214,220 ----
- fclose(infile);
- j = kill(i, 0); /* see if it is a good pid */
- if (!j) {
- ! strcpy(buf128, LASTCALL);
- ptr1 = who_am_i + 3;
- ptr2 = who_am_I;
- for (i = 3; i < 5; i++)
- *** /u/news/xbbs/bbscport.c Mon Jul 3 14:28:26 1989
- --- bbscport.c Sun Apr 29 22:03:14 1990
- ***************
- *** 6,11 ****
- --- 6,12 ----
- #include "bbscdef.h"
- #include <string.h>
- #include <ctype.h>
- + #include <termio.h>
- #include <sys/types.h>
- #include <sys/locking.h>
- extern int no_cntrl_k;
- ***************
- *** 77,82 ****
- --- 78,84 ----
- int cnt, byte ; char bytex ;
- cnt = 0;
- byte = FALSE;
- + ioctl(0, TCFLSH, 0); /* Flush input */
- while (++cnt <= max && byte != '\r')
- {
- while((byte = (int)portin()) < ' ' || byte > '}')
- ***************
- *** 106,111 ****
- --- 108,114 ----
- int cnt, byte ; char bytex ;
- cnt = 0;
- byte = FALSE;
- + ioctl(0, TCFLSH, 0); /* Flush input */
- while (++cnt <= max && byte != '\r')
- {
- while((byte = (int)portin()) < ' ' || byte > '}')
- ***************
- *** 138,143 ****
- --- 141,147 ----
- cnt = 0;
- new_max = max;
- byte = FALSE;
- + ioctl(0, TCFLSH, 0); /* Flush input */
- while (++cnt <= new_max && byte != '\r')
- {
- while((byte = (int)portin()) < ' ' || byte > '}')
- ***************
- *** 180,185 ****
- --- 184,190 ----
- char *result;
- cnt = 0;
- byte = FALSE;
- + ioctl(0, TCFLSH, 0); /* Flush input */
- while (++cnt <= max && byte != '\r')
- {
- while((byte = (int)portin()) < ' ' || byte > '}')
- *** /u/news/xbbs/bbsc12.h Wed Mar 21 23:28:10 1990
- --- bbsc12.h Sun Apr 29 15:17:30 1990
- ***************
- *** 20,25 ****
- --- 20,26 ----
- #define VERSION " 7.91 "
- #define CONFIG ".config.bbs"
- char *ttyname();
- + char *get_ext();
- char *tty;
- char *this_ttyname;
- static unsigned Xsec, Sec;
- *** /u/news/xbbs/bbscdef.h Wed Mar 21 23:27:54 1990
- --- bbscdef.h Sun Apr 29 21:53:36 1990
- ***************
- *** 48,54 ****
- --- 48,60 ----
- #define MESSAGES "messages.bbs" /* file name */
- #define HEADER "header.bbs"
- #define MSGLOG "messages.log"
- +
- + #ifdef SYSV
- + #define BBSMAIL "/usr/mail/bbsuser"
- + #else
- #define BBSMAIL "/usr/spool/mail/bbsuser" /* group mail */
- + #endif
- +
- #define CROSSREF "crossref.bbs"
- #define FILES "files.bbs"
- #define TMPFILE "/tmp/files"
- ***************
- *** 56,64 ****
- #define STDERR "/tmp/error_out"
- #define SYSTTY "/tmp/ttydev"
- char FOO[10];
- ! char TAR[50];
- ! char ZCAT[50];
- ! char ARC[50];
- char ZIP[50];
- char MONITOR[30]; /* Monitor device */
- char CONSOLE[30]; /* The main console */
- --- 62,70 ----
- #define STDERR "/tmp/error_out"
- #define SYSTTY "/tmp/ttydev"
- char FOO[10];
- ! char MAILER[50];
- ! char MAILADR[50];
- ! char EXTENS[50];
- char ZIP[50];
- char MONITOR[30]; /* Monitor device */
- char CONSOLE[30]; /* The main console */
-