Preventing Idle in telnet, security, and bg.

George Kyriazis kyriazis at iear.arts.rpi.edu
Sat Sep 29 14:41:05 AEST 1990


In article <DAVIS.90Sep28015809 at pacific.mps.ohio-state.edu> davis at pacific.mps.ohio-state.edu  (John E. Davis) writes:
>Hi,
>
>   I have a vt320 that I use all the time.  When I logon to our system, I
>start up a process in the background that sleeps for a minute, checks my
>mailbox for newmail then just before going back to sleep, it sends the time
>and number of mail messages to my vt320 status line.  It has worked fine so
>far with no problems.
>
>   However, sometimes I forget to kill it before I logout.  I was wondering
>what is the best way to put it into the background so that when I logout, it
>dies?  I wrote the program in c, if this helps.
>
In your C program, send a signal 0 to your parent process (see getppid()).
If kill(2)  returns a -1 then the parent process (the shell in this case)
has exited, so exit yourself.

>   A friend of mine once told me that when he logged on, it started writing to
>his terminal.  Apparantly, I was once attached to that tty and left it
>executing when I logged out.  I really do not understand this particular
>occurence at all.  Perhaps some kind soul will tell me what happened.
>
The C program inherits the tty from the parent process (the shell).
ttys are, by default, writeable.  So when the guy logged in, he still
got the output from your program that was not killed.

>   On another subject,  One person on our system has in his home directory an
>executable file called 'ls'.  Here it is:
>
Yes, this is a security problem.  What you can do to get rid of
annoyances like that is to put '.' in the end of your path.  'ls' will
be found in its normal place intead of ./ls, that happens when you have
'.' in the beginning of your path.


----------------------------------------------------------------------
  George Kyriazis                 kyriazis at rdrc.rpi.edu
 				  kyriazis at iear.arts.rpi.edu



More information about the Comp.unix.questions mailing list