Assignment 5, due Mar 2
Part of
the homework for 22C:169, Spring 2006
|
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated, and unless there is what insurance companies call "an act of God" - something outside your control; the only exceptions to this rule will be by advance arrangement.
http://users.actcom.co.il/~choo/lupg/tutorials/signals/
The signals-programming tutorial is good, and the get-passwd program is an interesting solution to part of the previous programming assignment.
a) What does sigaction() let you do that signal() does not.
b) Given what you know about trap handlers (from Chapter 5 in the text) and what you know about signals, from UNIX, what must the trap handler for the hardware bus-trap condition do in order to send a SIGBUS signal to the application program (indicating an illegal memory address). Note that the keyboard input handler does much the same in order to send a SIGINT signal when it sees a control-C character, and the illegal instruction trap handler does much the same to send a SIGILL trap.
c) What are the dangerous security consequences that would result if UNIX allowed application programs to handle all signals -- that is, what security problem led the designers of UNIX to provide uncatchable signals as well as the normal catchable ones. Consider, for example, the difference between SIGINT and SIGKILL.