+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/.
+
2005-11-21 Thorsten Kukuk <kukuk@thkukuk.de>
* release version 0.99.2.0
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();
#define XAUTHTMP ".xauthXXXXXX"
/* Possible paths to xauth executable */
-static const char * const xauthpaths[] = {
+static const char * const xauthpaths[] = {
#ifdef PAM_PATH_XAUTH
PAM_PATH_XAUTH,
#endif
pam_syslog(pamh, LOG_WARNING, "unrecognized option `%s'",
argv[i]);
}
-
+
if (xauth == NULL) {
- for (i = 0; i < sizeof(xauthpaths)/sizeof(xauthpaths[0]); i++) {
- if (access(xauthpaths[i], X_OK) == 0) {
- xauth = xauthpaths[i];
+ size_t j;
+ for (j = 0; j < sizeof(xauthpaths)/sizeof(xauthpaths[0]); j++) {
+ if (access(xauthpaths[j], X_OK) == 0) {
+ xauth = xauthpaths[j];
break;
}
}