summaryrefslogtreecommitdiffstats
path: root/src/sss_client/sss_cli.h
diff options
context:
space:
mode:
authorGeorge McCollister <georgem@novatech-llc.com>2010-03-04 09:41:33 -0600
committerStephen Gallagher <sgallagh@redhat.com>2010-03-08 13:42:46 -0500
commit8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc (patch)
tree6e6e8d8a8ad4e6e4b185b1aeeff2fdce0d943b90 /src/sss_client/sss_cli.h
parent7d83d46ff9eb06b294c186a41ad9e7dbe648f5c3 (diff)
downloadsssd-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.tar.gz
sssd-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.tar.xz
sssd-8ad7891f28c0ffd991c51f2d64c32cf04c9ddbbc.zip
Fixed alignment problems in nss client/server
I fixed a handful of alignment problems in sss_client and nss responder. Enumerating group and passwd with getgrent and getpwent now works correctly on ARM. Signed-off-by: George McCollister <georgem@novatech-llc.com>
Diffstat (limited to 'src/sss_client/sss_cli.h')
-rw-r--r--src/sss_client/sss_cli.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sss_client/sss_cli.h b/src/sss_client/sss_cli.h
index 1953db2f4..2edd158db 100644
--- a/src/sss_client/sss_cli.h
+++ b/src/sss_client/sss_cli.h
@@ -408,6 +408,20 @@ int sss_pam_make_request(enum sss_cli_command cmd,
uint8_t **repbuf, size_t *replen,
int *errnop);
+#ifndef SAFEALIGN_COPY_UINT32
+static inline void
+safealign_memcpy(void *dest, const void *src, size_t n, size_t *counter)
+{
+ memcpy(dest, src, n);
+ if (counter) {
+ *counter += n;
+ }
+}
+
+#define SAFEALIGN_COPY_UINT32(dest, src, pctr) \
+ safealign_memcpy(dest, src, sizeof(uint32_t), pctr)
+#endif
+
#endif /* _SSSCLI_H */
#if 0