* libmisc/console.c (console): Remove the leading /dev/ from the
tty before comparing with the lines specified by CONSOLE. * src/su.c: Do not remove the /dev/ prefix since it is done by console().
This commit is contained in:
parent
8eaa6f8b4c
commit
f634cd3e2c
@ -1,3 +1,10 @@
|
|||||||
|
2009-05-16 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* libmisc/console.c (console): Remove the leading /dev/ from the
|
||||||
|
tty before comparing with the lines specified by CONSOLE.
|
||||||
|
* src/su.c: Do not remove the /dev/ prefix since it is done by
|
||||||
|
console().
|
||||||
|
|
||||||
2009-05-16 Nicolas François <nicolas.francois@centraliens.net>
|
2009-05-16 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* man/login.defs.d/CONSOLE.xml: Document the format of the CONSOLE
|
* man/login.defs.d/CONSOLE.xml: Document the format of the CONSOLE
|
||||||
|
@ -121,6 +121,10 @@ static bool is_listed (const char *cfgin, const char *tty, bool def)
|
|||||||
|
|
||||||
bool console (const char *tty)
|
bool console (const char *tty)
|
||||||
{
|
{
|
||||||
|
if (strncmp (tty, "/dev/", 5) == 0) {
|
||||||
|
tty += 5;
|
||||||
|
}
|
||||||
|
|
||||||
return is_listed ("CONSOLE", tty, true);
|
return is_listed ("CONSOLE", tty, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
src/su.c
9
src/su.c
@ -425,13 +425,8 @@ int main (int argc, char **argv)
|
|||||||
* Get the tty name. Entries will be logged indicating that the user
|
* Get the tty name. Entries will be logged indicating that the user
|
||||||
* tried to change to the named new user from the current terminal.
|
* tried to change to the named new user from the current terminal.
|
||||||
*/
|
*/
|
||||||
cp = ttyname (0);
|
tty = ttyname (0);
|
||||||
if ((isatty (0) != 0) && (NULL != cp)) {
|
if ((isatty (0) != 0) && (NULL != tty)) {
|
||||||
if (strncmp (cp, "/dev/", 5) == 0) {
|
|
||||||
tty = cp + 5;
|
|
||||||
} else {
|
|
||||||
tty = cp;
|
|
||||||
}
|
|
||||||
#ifndef USE_PAM
|
#ifndef USE_PAM
|
||||||
is_console = console (tty);
|
is_console = console (tty);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user