summaryrefslogtreecommitdiff
path: root/libpam
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2005-11-23 16:42:39 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2005-11-23 16:42:39 +0000
commitdc1ef1998cff01323a93ee312f638cf4ba45c794 (patch)
treedb6b0d9b81db1894b206778f941f2747283b586c /libpam
parent85defa52f249728c26961febff913e45a64a57ef (diff)
Relevant BUGIDs: none
Purpose of commit: bugfix Commit summary: --------------- 2005-11-23 Thorsten Kukuk <kukuk@suse.de> * modules/pam_xauth/pam_xauth.c (pam_sm_open_session): Introduce new variable to fix compiler warning. * libpam/pam_modutil_getlogin.c (pam_modutil_getlogin): PAM_TTY don't need to start with /dev/.
Diffstat (limited to 'libpam')
-rw-r--r--libpam/pam_modutil_getlogin.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libpam/pam_modutil_getlogin.c b/libpam/pam_modutil_getlogin.c
index d30f1dfa..04a20fd8 100644
--- a/libpam/pam_modutil_getlogin.c
+++ b/libpam/pam_modutil_getlogin.c
@@ -35,11 +35,17 @@ pam_modutil_getlogin(pam_handle_t *pamh)
else
curr_tty = (const char*)void_curr_tty;
- if ((curr_tty == NULL) || memcmp(curr_tty, "/dev/", 5)) {
+ if (curr_tty == NULL) {
return NULL;
}
- curr_tty += 5; /* strlen("/dev/") */
+ if (curr_tty[0] == '/') { /* full path */
+ const char *t;
+ curr_tty++;
+ if ((t = strchr(curr_tty, '/')) != NULL) {
+ curr_tty = t + 1;
+ }
+ }
logname = NULL;
setutent();