summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-11-05 14:57:13 +0100
committerStephen Gallagher <sgallagh@redhat.com>2010-11-15 15:37:30 -0500
commit4b498111c49b254e9aa5e2b0d4fcc1ba24a04236 (patch)
tree475ee706a527c23ba502af6f820c2c83ba128eae /src
parentbe434625437ff3dd4cce83a655226c67943e5ceb (diff)
downloadsssd-4b498111c49b254e9aa5e2b0d4fcc1ba24a04236.tar.gz
sssd-4b498111c49b254e9aa5e2b0d4fcc1ba24a04236.tar.xz
sssd-4b498111c49b254e9aa5e2b0d4fcc1ba24a04236.zip
Avoid long long in messages to PAM client use int64_t
Diffstat (limited to 'src')
-rw-r--r--src/responder/pam/pamsrv_cmd.c14
-rw-r--r--src/sss_client/pam_sss.c12
-rw-r--r--src/sss_client/sss_cli.h6
3 files changed, 16 insertions, 16 deletions
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index 7bfd0f249..1ba6f17f7 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -507,21 +507,21 @@ static void pam_cache_auth_done(struct pam_auth_req *preq, int ret,
uint32_t resp_type;
size_t resp_len;
uint8_t *resp;
- long long dummy;
+ int64_t dummy;
switch (ret) {
case EOK:
preq->pd->pam_status = PAM_SUCCESS;
resp_type = SSS_PAM_USER_INFO_OFFLINE_AUTH;
- resp_len = sizeof(uint32_t) + sizeof(long long);
+ resp_len = sizeof(uint32_t) + sizeof(int64_t);
resp = talloc_size(preq->pd, resp_len);
if (resp == NULL) {
DEBUG(1, ("talloc_size failed, cannot prepare user info.\n"));
} else {
memcpy(resp, &resp_type, sizeof(uint32_t));
- dummy = (long long) expire_date;
- memcpy(resp+sizeof(uint32_t), &dummy, sizeof(long long));
+ dummy = (int64_t) expire_date;
+ memcpy(resp+sizeof(uint32_t), &dummy, sizeof(int64_t));
ret = pam_add_response(preq->pd, SSS_PAM_USER_INFO, resp_len,
(const uint8_t *) resp);
if (ret != EOK) {
@@ -539,14 +539,14 @@ static void pam_cache_auth_done(struct pam_auth_req *preq, int ret,
preq->pd->pam_status = PAM_PERM_DENIED;
if (delayed_until >= 0) {
resp_type = SSS_PAM_USER_INFO_OFFLINE_AUTH_DELAYED;
- resp_len = sizeof(uint32_t) + sizeof(long long);
+ resp_len = sizeof(uint32_t) + sizeof(int64_t);
resp = talloc_size(preq->pd, resp_len);
if (resp == NULL) {
DEBUG(1, ("talloc_size failed, cannot prepare user info.\n"));
} else {
memcpy(resp, &resp_type, sizeof(uint32_t));
- dummy = (long long) delayed_until;
- memcpy(resp+sizeof(uint32_t), &dummy, sizeof(long long));
+ dummy = (int64_t) delayed_until;
+ memcpy(resp+sizeof(uint32_t), &dummy, sizeof(int64_t));
ret = pam_add_response(preq->pd, SSS_PAM_USER_INFO, resp_len,
(const uint8_t *) resp);
if (ret != EOK) {
diff --git a/src/sss_client/pam_sss.c b/src/sss_client/pam_sss.c
index 644073f5b..f7876c220 100644
--- a/src/sss_client/pam_sss.c
+++ b/src/sss_client/pam_sss.c
@@ -567,19 +567,19 @@ static int user_info_offline_auth(pam_handle_t *pamh, size_t buflen,
uint8_t *buf)
{
int ret;
- long long expire_date;
+ int64_t expire_date;
struct tm tm;
char expire_str[128];
char user_msg[256];
expire_str[0] = '\0';
- if (buflen != sizeof(uint32_t) + sizeof(long long)) {
+ if (buflen != sizeof(uint32_t) + sizeof(int64_t)) {
D(("User info response data has the wrong size"));
return PAM_BUF_ERR;
}
- memcpy(&expire_date, buf + sizeof(uint32_t), sizeof(long long));
+ memcpy(&expire_date, buf + sizeof(uint32_t), sizeof(int64_t));
if (expire_date > 0) {
if (localtime_r((time_t *) &expire_date, &tm) != NULL) {
@@ -690,19 +690,19 @@ static int user_info_offline_auth_delayed(pam_handle_t *pamh, size_t buflen,
uint8_t *buf)
{
int ret;
- long long delayed_until;
+ int64_t delayed_until;
struct tm tm;
char delay_str[128];
char user_msg[256];
delay_str[0] = '\0';
- if (buflen != sizeof(uint32_t) + sizeof(long long)) {
+ if (buflen != sizeof(uint32_t) + sizeof(int64_t)) {
D(("User info response data has the wrong size"));
return PAM_BUF_ERR;
}
- memcpy(&delayed_until, buf + sizeof(uint32_t), sizeof(long long));
+ memcpy(&delayed_until, buf + sizeof(uint32_t), sizeof(int64_t));
if (delayed_until <= 0) {
D(("User info response data has an invalid value"));
diff --git a/src/sss_client/sss_cli.h b/src/sss_client/sss_cli.h
index fcea8e643..f8ccb4f5a 100644
--- a/src/sss_client/sss_cli.h
+++ b/src/sss_client/sss_cli.h
@@ -364,7 +364,7 @@ enum user_info_type {
* @param Time when the cached
* password will expire in seconds
* since the UNIX Epoch as returned
- * by time(2) as long long. A value
+ * by time(2) as int64_t. A value
* of zero indicates that the
* cached password will never
* expire. */
@@ -375,8 +375,8 @@ enum user_info_type {
* @param Time when an
* authentication is allowed again
* in seconds since the UNIX Epoch
- * as returned by time(2) as long
- * long. */
+ * as returned by time(2) as
+ * int64_t. */
SSS_PAM_USER_INFO_OFFLINE_CHPASS, /**< * Tell the user that it is not
* possible to change the password while
* the system is offline. This message