C Board  

Go Back   C Board > Platform Specific Boards > Linux Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-11-2003, 08:49 PM   #1
Registered User
 
jacktibet's Avatar
 
Join Date: Mar 2003
Posts: 18
Question Unix probelm--can you help me?

I want to write a shell script which will lock the terminal and prevent other people from using it. It must prompt your twice to entry a key, if the keys match, it should sit in a loop prompting a user to enter a third key. If the keymatches the ones you entered the script should exit to the shell prompt. If i enter the wrong key 5 time, the system will log off.
-----------------------------------------------------------------------------------
I think i cannot use vlock here.
jacktibet is offline   Reply With Quote
Old 04-11-2003, 09:07 PM   #2
Registered User
 
Join Date: Mar 2003
Posts: 102
What shell are you doing this in and why should we do your hw? Why not post what you already have and then we MIGHT help you debug it.
squid is offline   Reply With Quote
Old 04-11-2003, 10:01 PM   #3
Registered User
 
Join Date: Mar 2003
Posts: 102
Ill see what I can do when I get home

But what you gave should give him a good idea. For his HW
squid is offline   Reply With Quote
Old 04-11-2003, 10:13 PM   #4
Registered User
 
Codeplug's Avatar
 
Join Date: Mar 2003
Posts: 3,898
Code:
newt.c_cc[VQUIT]  = 0;
Does this disable the quit control character or set it to 0?

Can't you enter ascii-code 0 using alt and keypad? Or cntrl-@?

I currently don't have a linux box running to "see if I can break it". (Did I break it?)

You could disable the checking of control characters all together by by removing ISIG from c_lflag as well.

gg
Codeplug is offline   Reply With Quote
Old 04-11-2003, 10:44 PM   #5
Registered User
 
Join Date: Mar 2003
Posts: 102
vVv no I was not tyring to make you feel guily I though you didnt see it I'm my first post. sorry.
squid is offline   Reply With Quote
Old 04-11-2003, 10:51 PM   #6
Registered User
 
jacktibet's Avatar
 
Join Date: Mar 2003
Posts: 18
Unhappy

'vlock' utility can lock the terminal. but if i use it. It propmt to input the user's pin.If the user's pin is incorrect, it prompt to input the root's pin.So i cannot display any other information until i input the correct pin.
jacktibet is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to program in unix Cpro Linux Programming 21 02-12-2008 10:54 AM
Setting up a Unix box @nthony Tech Board 6 07-22-2007 10:22 PM
UNIX (Linux, BSD, etc) Programming :: UNIX kuphryn Linux Programming 6 04-01-2004 08:44 PM
Unix Sockets prvindia Linux Programming 5 03-11-2003 09:16 AM
About Unix Programming - Making a career desision null C Programming 0 10-14-2001 07:37 AM


All times are GMT -6. The time now is 06:28 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22