diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2013-09-19 09:33:00 +0000 |
---|---|---|
committer | <> | 2014-11-13 09:36:22 +0000 |
commit | b1521c97e73b10469f7b34c0571d51c647eca83c (patch) | |
tree | 212a6a00baa11e9d0ca7bc27b12420d1dce6f07c /modules/pam_succeed_if/pam_succeed_if.c | |
parent | 6e36ca00ed774a7c5b2f2322c96b023999b733a4 (diff) | |
download | linux-pam-b1521c97e73b10469f7b34c0571d51c647eca83c.tar.gz |
Imported from /home/lorry/working-area/delta_linux-pam/Linux-PAM-1.1.8.tar.bz2.HEADLinux-PAM-1.1.8master
Diffstat (limited to 'modules/pam_succeed_if/pam_succeed_if.c')
-rw-r--r-- | modules/pam_succeed_if/pam_succeed_if.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/modules/pam_succeed_if/pam_succeed_if.c b/modules/pam_succeed_if/pam_succeed_if.c index 2670c25..32a7373 100644 --- a/modules/pam_succeed_if/pam_succeed_if.c +++ b/modules/pam_succeed_if/pam_succeed_if.c @@ -281,11 +281,37 @@ evaluate(pam_handle_t *pamh, int debug, } if (strcasecmp(left, "service") == 0) { const void *svc; - if (pam_get_item(pamh, PAM_SERVICE, &svc) != PAM_SUCCESS) + if (pam_get_item(pamh, PAM_SERVICE, &svc) != PAM_SUCCESS || + svc == NULL) svc = ""; snprintf(buf, sizeof(buf), "%s", (const char *)svc); left = buf; } + if (strcasecmp(left, "ruser") == 0) { + const void *ruser; + if (pam_get_item(pamh, PAM_RUSER, &ruser) != PAM_SUCCESS || + ruser == NULL) + ruser = ""; + snprintf(buf, sizeof(buf), "%s", (const char *)ruser); + left = buf; + user = buf; + } + if (strcasecmp(left, "rhost") == 0) { + const void *rhost; + if (pam_get_item(pamh, PAM_SERVICE, &rhost) != PAM_SUCCESS || + rhost == NULL) + rhost = ""; + snprintf(buf, sizeof(buf), "%s", (const char *)rhost); + left = buf; + } + if (strcasecmp(left, "tty") == 0) { + const void *tty; + if (pam_get_item(pamh, PAM_SERVICE, &tty) != PAM_SUCCESS || + tty == NULL) + tty = ""; + snprintf(buf, sizeof(buf), "%s", (const char *)tty); + left = buf; + } /* If we have no idea what's going on, return an error. */ if (left != buf) { pam_syslog(pamh, LOG_CRIT, "unknown attribute \"%s\"", left); |