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

unix system enhancements

5 views
Skip to first unread message

Brad Silva

unread,
Oct 6, 1986, 7:13:18 PM10/6/86
to
In article <1986Oct1.1...@sq.uucp>, da...@sq.UUCP writes:
>
> In article <7...@hropus.UUCP> j...@hropus.UUCP (Jim Webb) writes:
> >> 3. And lastly modify the tty driver to support "advising." This would
> >> allow root to watch the characters sent to a terminal and have the
> >> characters that he types inserted into that port's input character
> >> stream.
> >
> > A hackers' delight, a simple rm -rf will remove this "advising" :-)
> >--
> >Jim Webb "Out of phase--get help" ...!ihnp4!hropus!jrw
>
> A year or so ago a program called "force" was posted to
> net.sources. (Sorry but author and date elude me)
> This allowed for root to force characters, as if typed
> by the user, to a particular tty.
> ---------------
> David R. Seaman !utzoo!sq!dave SoftQuad Publishing Software

If anybody has a copy of this program I would be greatly interested in it, or
anything similar. I occasionally have to help users through problems, or do
short training in various programs, and this would be VERY helpful.


--
----------------
Brad Silva "Seeker"
...!ptfsa!gilbbs!altunv!brad

No disclaimer
No cute joke
No nothin'
.... Yet!
---------------

John Owens

unread,
Oct 14, 1986, 4:28:27 PM10/14/86
to
In article <1...@altunv.UUCP>, br...@altunv.UUCP (Brad Silva) writes:
> In article <1986Oct1.1...@sq.uucp>, da...@sq.UUCP writes:
> > A year or so ago a program called "force" was posted to
> > net.sources. (Sorry but author and date elude me)

Well, I'm the original author, and here it is. (Of course it is
possible that I never bothered to post it, and that someone else
posted a similar program with the same name. Naahhh...)

#include <sgtty.h>
#include <stdio.h>

main(argc,argv)
char *argv[];
{
char ch, *tty;
static char ttyn[32] = "tty";
static char devn[32] = "/dev/";
int fd;
struct sgttyb ttyb;
char *strcat();

if (argc != 2) {
fprintf(stderr,"Usage: force ttyname\n");
exit(1);
}
tty = argv[1];
if (*tty >= '0' && *tty <= '9')
tty=strcat(ttyn,tty);
if (*tty != '/')
tty=strcat(devn,tty);
fprintf(stderr,"force to %s:\n",tty);
if ((fd=open(tty,2)) == -1) {
fprintf(stderr,"force: Can't open %s\n",tty);
exit(1);
}
gtty(0,&ttyb);
ttyb.sg_flags |= RAW;
stty(0,&ttyb);
for (;;) {
if (read(0,&ch,1) != 1) {
fprintf(stderr,"read error\r\n");
break;
}
if (ch == 'P' - 0100)
break;
if (ioctl(fd,TIOCSTI,&ch)) {
fprintf(stderr,"ioctl error\r\n");
break;
}
}
ttyb.sg_flags &= ~RAW;
stty(0,&ttyb);
exit(0);
}

--
John Owens General Electric Company - Charlottesville, VA
j...@edison.GE.COM old arpa: jso%edison...@seismo.CSS.GOV
+1 804 978 5726 old uucp: {seismo,decuac,houxm,calma}!edison!jso

Biochemical Endocrinology

unread,
Oct 17, 1986, 2:53:39 PM10/17/86
to
In article <8...@edison.UUCP>, j...@edison.UUCP (John Owens) writes:
>
> Well, I'm the original author, and here it is. (Of course it is
> possible that I never bothered to post it, and that someone else
> posted a similar program with the same name. Naahhh...)
>
> #include <sgtty.h>
> #include <stdio.h>
>
> main(argc,argv)
> char *argv[];
....
....
....

Question: What is this supposed to do?

Thank you.

--
UUCP:
seismo|
philabs|
phri| -> cmcl2!rna!rocky2!kreek
harvard|
ihnp4|

ARPANET: kr...@rockefeller.arpa
BITNET: KREEK@ROCKVAX

Mark Steven Jeghers

unread,
Oct 22, 1986, 8:58:12 PM10/22/86
to
In article <8...@edison.UUCP> j...@edison.UUCP (John Owens) writes:
>In article <1...@altunv.UUCP>, br...@altunv.UUCP (Brad Silva) writes:
>> In article <1986Oct1.1...@sq.uucp>, da...@sq.UUCP writes:
>> > A year or so ago a program called "force" was posted to
>> > net.sources. (Sorry but author and date elude me)
>
>Well, I'm the original author, and here it is. (Of course it is
>possible that I never bothered to post it, and that someone else
>posted a similar program with the same name. Naahhh...)
>
I tried compiling force.c and got the following error:

"force.c", line 39: TIOCSTI undefined

Do I need to include some library or some such thing?

--
+----------------------------------------------------------------------------+
| Mark Steven Jeghers - the living incarnation of "Deep-Thought" |
| ("You won't like the answer ... you didn't ask it very well.") |
| |
| {ihnp4,cbosgd,lll-lcc,lll-crg}|{dual,ptsfa}!cogent!mark |
| ^^^^^^-------recommended------^^^^^ |
| |
| "A poodle-free world within a decade. We can do it...together!" |
| |
| Cogent Software Solutions can not be held responsible for anything said |
| by the above person since they have no control over him in the first place |
+----------------------------------------------------------------------------+

g...@sun.uucp

unread,
Oct 23, 1986, 2:18:45 PM10/23/86
to
> I tried compiling force.c and got the following error:
>
> "force.c", line 39: TIOCSTI undefined
>
> Do I need to include some library or some such thing?

No, you need to give up and build "force" only on machines whose operating
system supports the operation needed for a process to be able to force
characters to be "typed" on another terminal. TIOCSTI is an "ioctl" that
takes a character and makes the terminal referred to by the file descriptor
argument act as if that character had been typed on it. If you don't have
this "ioctl", or something like it, you can't make "force" work.
--
Guy Harris
{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
g...@sun.com (or g...@sun.arpa)

0 new messages