0574adc sss_packet_grow: correctly pad packet length to 512B

1 file Authored by pbrezina 10 years ago, Committed by jhrozek 10 years ago,
    sss_packet_grow: correctly pad packet length to 512B
    
    https://fedorahosted.org/sssd/ticket/2059
    
    If len % SSSSRV_PACKET_MEM_SIZE == 0 or some low number,
    we can end up with totlen < len and return EINVAL.
    
    It also does not pad the length, but usually allocates
    much more memory than is desired.
    
    len = 1024
    n = 1024 % 512 + 1 = 0 + 1 = 1
    totlen = 1 * 512 = 512
    => totlen < len
    
    len = 511
    n = 511 % 512 + 1 = 511 + 1
    totlen = 512 * 512 = 262144
    totlen is way bigger than it was supposed to be