2007-11-11 05:16:11 +05:30
|
|
|
$Id$
|
2007-10-07 17:14:02 +05:30
|
|
|
|
|
|
|
Specification for console.c source file --
|
|
|
|
|
|
|
|
input values --
|
|
|
|
tty -- character pointer to device name with leading "/dev/"
|
|
|
|
removed.
|
|
|
|
|
|
|
|
return values --
|
|
|
|
0 -- false
|
|
|
|
1 -- true
|
|
|
|
|
|
|
|
int console (char * tty)
|
|
|
|
if "CONSOLE" string value is not present in login.defs
|
|
|
|
return true
|
|
|
|
|
|
|
|
if the first character of "CONSOLE" string value is not "/"
|
|
|
|
treat the string as a ":" delimited list of device
|
|
|
|
names and search for the value of tty in that
|
|
|
|
tokenized list.
|
|
|
|
|
|
|
|
if a match is found
|
|
|
|
return true
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
if the file named by "CONSOLE" cannot be opened
|
|
|
|
return true
|
|
|
|
|
|
|
|
scan the file looking for a match between the input line
|
|
|
|
and the value of tty
|
|
|
|
|
|
|
|
if a match is found
|
|
|
|
return true
|
|
|
|
|
|
|
|
return false
|