From: Christos Zoulas Date: Tue, 30 Aug 2022 15:16:34 +0000 (-0400) Subject: Change times in amq RPCs to be longlong_t instead X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=aa708ec1f6661dbbd51398adfe752558901017b5;p=am-utils-6.2.git Change times in amq RPCs to be longlong_t instead of long, to avoid 2038 issue on 32 bit machines. This makes the amq RPC incompatible with older versions of amd. It is too much work to provide backwards compatibility for little benefit, but it can be done. Fix core-dump in amq -i. --- diff --git a/ChangeLog b/ChangeLog index b09dc8a1..ee736350 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2022-08-30 Christos Zoulas + + * Change times in amq RPCs to be longlong_t instead + of long, to avoid 2038 issue on 32 bit machines. + This makes the amq RPC incompatible with older versions + of amd. It is too much work to provide backwards compatibility + for little benefit, but it can be done. + Fix core-dump in amq -i. + 2016-04-08 Christos Zoulas * Make hasmntval() return an 0 on error, 1 on success and diff --git a/amd/amq_subr.c b/amd/amq_subr.c index 86f03518..31f32eab 100644 --- a/amd/amq_subr.c +++ b/amd/amq_subr.c @@ -329,7 +329,7 @@ bool_t xdr_amq_mount_tree_node(XDR *xdrs, amq_mount_tree *objp) { am_node *mp = (am_node *) objp; - long mtime; + longlong_t mtime; if (!xdr_amq_string(xdrs, &mp->am_al->al_mnt->mf_info)) { return (FALSE); @@ -344,7 +344,7 @@ xdr_amq_mount_tree_node(XDR *xdrs, amq_mount_tree *objp) return (FALSE); } mtime = mp->am_stats.s_mtime; - if (!xdr_long(xdrs, &mtime)) { + if (!xdr_longlong_t(xdrs, &mtime)) { return (FALSE); } if (!xdr_u_short(xdrs, &mp->am_stats.s_uid)) { @@ -528,7 +528,7 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem *qhead) u_int len = 0; int x; char *n; - long modify; + longlong_t modify; /* * Compute length of list @@ -553,8 +553,8 @@ xdr_amq_map_info_qelem(XDR *xdrs, qelem *qhead) return (FALSE); } - modify = (long)m->modify; - if (!xdr_long(xdrs, &modify)) { + modify = m->modify; + if (!xdr_longlong_t(xdrs, &modify)) { return (FALSE); } diff --git a/amq/amq_xdr.c b/amq/amq_xdr.c index b9a1c20f..9409b8e3 100644 --- a/amq/amq_xdr.c +++ b/amq/amq_xdr.c @@ -47,7 +47,7 @@ bool_t xdr_time_type(XDR *xdrs, time_type *objp) { - if (!xdr_long(xdrs, (long *) objp)) { + if (!xdr_longlong_t(xdrs, (longlong_t *) objp)) { return (FALSE); } return (TRUE); diff --git a/include/amq_defs.h b/include/amq_defs.h index 89f61805..ef4fd206 100644 --- a/include/amq_defs.h +++ b/include/amq_defs.h @@ -66,7 +66,7 @@ /* * TYPEDEFS */ -typedef long *time_type; +typedef long long time_type; typedef struct amq_mount_info amq_mount_info; typedef struct amq_map_info amq_map_info; typedef struct amq_mount_stats amq_mount_stats;