Article View: alt.msdos.programmer
Article #1140BSD i386 - binary sought - .C source provided here
From: Christopher Drake
Date: Fri, 01 Sep 1995 17:49
Date: Fri, 01 Sep 1995 17:49
103 lines
3985 bytes
3985 bytes
Hi - I don't have a compiler at my site, and I want the binary for this C
program. I can trade almost anything if you want something in return - please
ask.
My system - for which I need the executable, identifies itself thus:-
BSDI BSD/OS 2.0
BSD/OS sitename.com.au 2.0 BSDI BSD/OS 2.0 Kernel #6: Tue Aug 8 10:28:52 EST 1995
root@sitename.com.au:/usr/src/sys/compile/SHELL i386
The .C program I wish to have a binary for is as follows (it runs, massages
a few files, and prints a single number upon exit)
prox.c
---------------------------cut-here---------------------------------------------
#include <stdio.h>
#include <string.h>
/* Program to process mail on my behalf.
Input (stdin) The entire mail message
Paramater 1: Name of a file to write the commands to
Paramaters 2..n: Name of recipient(s) (me) to forward mail to
Output: (stdout) 0 = error
5 = command is ready to run
6 = command is ready to run, send output to me also
7 = do not do command - it would bounce if you did.
*/
char buffer[1024],lbuffer[1024],tbuffer[1024],xbuffer[1024];
int main(int argc,char *argv[])
{
FILE *file;
int i,j=0;
if(argc<3) { /* Not enough args */
printf("0\n");
} else {
buffer[0]=0; fscanf(stdin,"%[^\n] ",buffer); /* Get who it's from */
for(i=5;buffer[i]>0;i++) lbuffer[i-5]=tolower(buffer[i]); lbuffer[i-5]=0;
tbuffer[0]=0;
for(i=2;i<argc;i++) {
sprintf(xbuffer,"%s ",argv[i]);
if(strstr(lbuffer,xbuffer)==0) { /* ignore if the same person */
sprintf(xbuffer,"%s",tbuffer);
if(tbuffer[0]==0) sprintf(tbuffer,"%s",argv[i]);
else sprintf(tbuffer,"%s, %s",xbuffer,argv[i]);
}
}
sprintf("T=%s L=%s X=%s\n",tbuffer,lbuffer,xbuffer);
if(tbuffer[0]==0) {
printf("7\n");
} else {
file=fopen(argv[1],"w");
if(file == NULL) {
printf("0\n");
} else {
fprintf(file,"#!/bin/sh\nMail -s 'chris_from: %s' %s <<\\n\n",lbuffer,tbuffer); /* Script start */
do {
for(i=0;buffer[i]>0;i++) lbuffer[i]=tolower(buffer[i]); lbuffer[i]=0;
if(strstr(lbuffer,"chris_to:")==lbuffer) {
fclose(file); file=fopen(argv[1],"w"); /* Discard headers */
fprintf(file,"#!/bin/sh\nMail %s <<\\n\n",buffer+10); /* Script start */
}
if(strstr(lbuffer,"chris_please_do:")==lbuffer) {
fclose(file); file=fopen(argv[1],"w"); /* Discard headers */
fprintf(file,"#!/bin/sh\n"); /* Script start */
buffer[0]=0;
}
if(strstr(lbuffer,"chris_end_do:")==lbuffer) {
fclose(file); printf("6\n"); exit(6);
}
fprintf(file,"%s\n",buffer);
if(j==0) { /* 1st line */
j=5;
sprintf(buffer,"%s",lbuffer+5); /* Get who it's from */
for(i=2;i<argc;i++) if(strstr(buffer,argv[i])==buffer) j=7;
}
fscanf(stdin,"%c",buffer); /* Discard \n */
buffer[0]=0; fscanf(stdin,"%[^\n]",buffer);
} while ( ! feof(stdin) );
fclose(file);
printf("%d\n",j);
} } } }
-------------------------------cut-here----------------------------------------
I regularly help heaps of folks - please someone help me now that I actually
need help for a change !
Thanks in advance everyone !!
Chris.
cnd@triode.apana.org.au
Technical Details
Message-ID:
<427h3n$fk6@triode.apana.org.au>Path:
arc1-ca.pugleaf.net!triode.apana.org.au!triode!cndShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!triode.apana.org.au!triode!cnd From: cnd@triode.apana.org.au (Christopher Drake) Newsgroups: alt.msdos.programmer,comp.lang.c,rec.games.programmer,comp.unix.programmer Subject: BSD i386 - binary sought - .C source provided here Date: 1 Sep 1995 17:49:43 GMT Organization: APANA - Australian Public Access Network Association Message-ID: <427h3n$fk6@triode.apana.org.au> NNTP-Posting-Host: localhost.apana.org.au X-Newsreader: TIN [version 1.2 PL2]