diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-16 09:25:58 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-16 15:31:48 +0100 |
commit | 1cde5866227feccf482f82c112c352c103afbc59 (patch) | |
tree | f994dcc9d31dae240b1c115487e6883a0bbee4e1 /src/sss_client | |
parent | 06d5f27d9f7e211a9316f7f3d3706d99f378acfe (diff) | |
download | sssd-1cde5866227feccf482f82c112c352c103afbc59.tar.gz sssd-1cde5866227feccf482f82c112c352c103afbc59.tar.bz2 sssd-1cde5866227feccf482f82c112c352c103afbc59.zip |
autofs: Use SAFEALIGN_SET_UINT32 instead of SAFEALIGN_COPY_UINT32
Diffstat (limited to 'src/sss_client')
-rw-r--r-- | src/sss_client/autofs/sss_autofs.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/sss_client/autofs/sss_autofs.c b/src/sss_client/autofs/sss_autofs.c index e87ef4fd..435cafe2 100644 --- a/src/sss_client/autofs/sss_autofs.c +++ b/src/sss_client/autofs/sss_autofs.c @@ -254,7 +254,6 @@ _sss_getautomntent_r(char **key, char **value, void *context) size_t ctr = 0; size_t data_len = 0; uint8_t *data; - uint32_t v; sss_nss_lock(); @@ -292,14 +291,13 @@ _sss_getautomntent_r(char **key, char **value, void *context) goto out; } - SAFEALIGN_COPY_UINT32(data, &name_len, &ctr); + SAFEALIGN_SET_UINT32(data, name_len, &ctr); safealign_memcpy(data+ctr, ctx->mapname, name_len + 1, &ctr); - SAFEALIGN_COPY_UINT32(data+ctr, &ctx->cursor, &ctr); + SAFEALIGN_SET_UINT32(data+ctr, ctx->cursor, &ctr); - v = GETAUTOMNTENT_MAX_ENTRIES; - SAFEALIGN_COPY_UINT32(data+ctr, &v, &ctr); + SAFEALIGN_SET_UINT32(data+ctr, GETAUTOMNTENT_MAX_ENTRIES, &ctr); rd.data = data; rd.len = data_len; @@ -348,7 +346,6 @@ _sss_getautomntbyname_r(const char *key, char **value, void *context) size_t name_len; size_t data_len = 0; uint8_t *data; - uint32_t v; size_t ctr = 0; struct sss_cli_req_data rd; uint8_t *repbuf = NULL; @@ -392,13 +389,11 @@ _sss_getautomntbyname_r(const char *key, char **value, void *context) goto out; } - v = name_len; - SAFEALIGN_COPY_UINT32(data, &v, &ctr); + SAFEALIGN_SET_UINT32(data, name_len, &ctr); safealign_memcpy(data+ctr, ctx->mapname, name_len + 1, &ctr); - v = key_len; - SAFEALIGN_COPY_UINT32(data+ctr, &v, &ctr); + SAFEALIGN_SET_UINT32(data+ctr, key_len, &ctr); safealign_memcpy(data+ctr, key, key_len + 1, &ctr); |