Commit [d850a8] Maximize Restore History

Prevent from grace period overflow in RPC transport

The RPC transports grace time as unsigned int, but the value stored
there and retrivedd from is treated as singed difference against current time.

This leads to overflow after expiring the grace time which is
presented as an enourmously large grace time instead of "none" in the
quota(1) output.

There also possible an overflow when the time difference is still
bigger than an int can represent.

This first issue is solved by explicit type cast to/from int32_t, the
second issue is fixes by limiting the value into int32_t range.

<https://sourceforge.net/p/linuxquota/bugs/115/>

Signed-off-by: Petr Písař <ppisar@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>

Petr Písař Petr Písař 2014-02-24

Jan Kara Jan Kara 2014-05-01

changed quotasys.c
changed quotasys.h
changed rquota_client.c
changed rquota_server.c
quotasys.c Diff Switch to side-by-side view
Loading...
quotasys.h Diff Switch to side-by-side view
Loading...
rquota_client.c Diff Switch to side-by-side view
Loading...
rquota_server.c Diff Switch to side-by-side view
Loading...