You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.3 KiB

diff -up Linux-PAM-1.1.8/modules/pam_succeed_if/pam_succeed_if.c.large-uid Linux-PAM-1.1.8/modules/pam_succeed_if/pam_succeed_if.c
--- Linux-PAM-1.1.8/modules/pam_succeed_if/pam_succeed_if.c.large-uid 2013-06-18 16:11:21.000000000 +0200
+++ Linux-PAM-1.1.8/modules/pam_succeed_if/pam_succeed_if.c 2016-07-19 15:00:57.366549150 +0200
@@ -68,20 +68,20 @@
* PAM_SERVICE_ERR if the arguments can't be parsed as numbers. */
static int
evaluate_num(const pam_handle_t *pamh, const char *left,
- const char *right, int (*cmp)(int, int))
+ const char *right, int (*cmp)(long long, long long))
{
- long l, r;
+ long long l, r;
char *p;
int ret = PAM_SUCCESS;
errno = 0;
- l = strtol(left, &p, 0);
+ l = strtoll(left, &p, 0);
if ((p == NULL) || (*p != '\0') || errno) {
pam_syslog(pamh, LOG_INFO, "\"%s\" is not a number", left);
ret = PAM_SERVICE_ERR;
}
- r = strtol(right, &p, 0);
+ r = strtoll(right, &p, 0);
if ((p == NULL) || (*p != '\0') || errno) {
pam_syslog(pamh, LOG_INFO, "\"%s\" is not a number", right);
ret = PAM_SERVICE_ERR;
@@ -96,32 +96,32 @@ evaluate_num(const pam_handle_t *pamh, c
/* Simple numeric comparison callbacks. */
static int
-eq(int i, int j)
+eq(long long i, long long j)
{
return i == j;
}
static int
-ne(int i, int j)
+ne(long long i, long long j)
{
return i != j;
}
static int
-lt(int i, int j)
+lt(long long i, long long j)
{
return i < j;
}
static int
-le(int i, int j)
+le(long long i, long long j)
{
return lt(i, j) || eq(i, j);
}
static int
-gt(int i, int j)
+gt(long long i, long long j)
{
return i > j;
}
static int
-ge(int i, int j)
+ge(long long i, long long j)
{
return gt(i, j) || eq(i, j);
}
@@ -298,7 +298,7 @@ evaluate(pam_handle_t *pamh, int debug,
}
if (strcasecmp(left, "rhost") == 0) {
const void *rhost;
- if (pam_get_item(pamh, PAM_SERVICE, &rhost) != PAM_SUCCESS ||
+ if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS ||
rhost == NULL)
rhost = "";
snprintf(buf, sizeof(buf), "%s", (const char *)rhost);
@@ -306,7 +306,7 @@ evaluate(pam_handle_t *pamh, int debug,
}
if (strcasecmp(left, "tty") == 0) {
const void *tty;
- if (pam_get_item(pamh, PAM_SERVICE, &tty) != PAM_SUCCESS ||
+ if (pam_get_item(pamh, PAM_TTY, &tty) != PAM_SUCCESS ||
tty == NULL)
tty = "";
snprintf(buf, sizeof(buf), "%s", (const char *)tty);