Skip to content

Commit cf8c18d

Browse files
author
Hans Zandbelt
committed
work around JSON timestamp print modifier issue (%lld)
occurs only on some platforms (Debian 8) thanks to @ralphvanetten closes #79
1 parent d704c27 commit cf8c18d

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
6/30/2015
22
- improve memcache logging: don't report cache misses as an error, thanks to @scottdear
3-
- bump to 1.8.4rc2
3+
- work around JSON timestamp print modifier issue (%lld) on some platforms, thanks to @ralphvanetten
4+
- bump to 1.8.4rc3
45

56
6/24/2015
67
- support passing claims as environment variables (OIDCPassClaimsAs)

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([mod_auth_openidc],[1.8.4rc2],[[email protected]])
1+
AC_INIT([mod_auth_openidc],[1.8.4rc3],[[email protected]])
22

33
AC_SUBST(NAMEVER, AC_PACKAGE_TARNAME()-AC_PACKAGE_VERSION())
44

src/oauth.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@ static apr_byte_t oidc_oauth_parse_and_cache_token_expiry(request_rec *r,
207207
json_int_t value = json_integer_value(expiry);
208208
if (value <= 0) {
209209
oidc_warn(r,
210-
"introspection response JSON object integer number value <= 0 (%" JSON_INTEGER_FORMAT "); introspection result will not be cached",
211-
value);
210+
"introspection response JSON object integer number value <= 0 (%ld); introspection result will not be cached",
211+
(long)value);
212212
return TRUE;
213213
}
214214

src/proto.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -388,14 +388,14 @@ static apr_byte_t oidc_proto_validate_iat(request_rec *r, apr_jwt_t *jwt,
388388
/* check if this id_token has been issued just now +- slack (default 10 minutes) */
389389
if ((now - slack) > jwt->payload.iat) {
390390
oidc_error(r,
391-
"\"iat\" validation failure (%" JSON_INTEGER_FORMAT "): JWT was issued more than %d seconds ago",
392-
jwt->payload.iat, slack);
391+
"\"iat\" validation failure (%ld): JWT was issued more than %d seconds ago",
392+
(long)jwt->payload.iat, slack);
393393
return FALSE;
394394
}
395395
if ((now + slack) < jwt->payload.iat) {
396396
oidc_error(r,
397-
"\"iat\" validation failure (%" JSON_INTEGER_FORMAT "): JWT was issued more than %d seconds in the future",
398-
jwt->payload.iat, slack);
397+
"\"iat\" validation failure (%ld): JWT was issued more than %d seconds in the future",
398+
(long)jwt->payload.iat, slack);
399399
return FALSE;
400400
}
401401

@@ -423,8 +423,8 @@ static apr_byte_t oidc_proto_validate_exp(request_rec *r, apr_jwt_t *jwt,
423423
/* see if now is beyond the JWT expiry timestamp */
424424
if (now > jwt->payload.exp) {
425425
oidc_error(r,
426-
"\"exp\" validation failure (%" JSON_INTEGER_FORMAT "): JWT expired %" JSON_INTEGER_FORMAT " seconds ago",
427-
jwt->payload.exp, now - jwt->payload.exp);
426+
"\"exp\" validation failure (%ld): JWT expired %ld seconds ago",
427+
(long)jwt->payload.exp, (long)(now - jwt->payload.exp));
428428
return FALSE;
429429
}
430430

@@ -759,9 +759,9 @@ apr_byte_t oidc_proto_parse_idtoken(request_rec *r, oidc_cfg *cfg,
759759

760760
apr_rfc822_date(buf, apr_time_from_sec((*jwt)->payload.exp));
761761
oidc_debug(r,
762-
"valid id_token for user \"%s\" expires: [%s], in %" JSON_INTEGER_FORMAT " secs from now)",
762+
"valid id_token for user \"%s\" expires: [%s], in %ld secs from now)",
763763
(*jwt)->payload.sub, buf,
764-
(*jwt)->payload.exp - apr_time_sec(apr_time_now()));
764+
(long)((*jwt)->payload.exp - apr_time_sec(apr_time_now())));
765765

766766
/* since we've made it so far, we may as well say it is a valid id_token */
767767
return TRUE;

src/util.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,8 +1232,8 @@ void oidc_util_set_app_infos(request_rec *r, const json_t *j_attrs,
12321232

12331233
} else if (json_is_integer(j_value)) {
12341234

1235-
if (sprintf(s_int, "%" JSON_INTEGER_FORMAT,
1236-
json_integer_value(j_value)) > 0) {
1235+
if (sprintf(s_int, "%ld",
1236+
(long)json_integer_value(j_value)) > 0) {
12371237
/* set long value in the application header whose name is based on the key and the prefix */
12381238
oidc_util_set_app_info(r, s_key, s_int, claim_prefix, as_header,
12391239
as_env_var);

0 commit comments

Comments
 (0)