autofs/autofs-5.0.4-srv-lookup-handle-endian.patch
Ian Kent 5d76ad9186 - fix incorrect dclist free.
- srv lookup handle endianness.
- fix bug introduced by library reload changes which causes autofs to not
    release mount thread resources when using submounts.
- fix notify mount message path.
- try harder to work out if we created mount point at remount.
- fix double free in do_sasl_bind().
- manual umount recovery fixes.
- fix map type info parse error.
2009-06-12 09:06:15 +00:00

38 lines
907 B
Diff

autofs-5.0.4 - srv lookup handle endianness
From: Ian Kent <raven@themaw.net>
---
modules/dclist.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/modules/dclist.c b/modules/dclist.c
index 5b0e577..967581c 100644
--- a/modules/dclist.c
+++ b/modules/dclist.c
@@ -34,6 +34,7 @@
#include <ldap.h>
#include <sys/param.h>
#include <errno.h>
+#include <endian.h>
#include "automount.h"
#include "dclist.h"
@@ -72,8 +73,13 @@
#define SVAL(buf, pos) (*(const uint16_t *)((const char *)(buf) + (pos)))
#define IVAL(buf, pos) (*(const uint32_t *)((const char *)(buf) + (pos)))
+#if __BYTE_ORDER == __LITTLE_ENDIAN
#define SREV(x) ((((x)&0xFF)<<8) | (((x)>>8)&0xFF))
#define IREV(x) ((SREV(x)<<16) | (SREV((x)>>16)))
+#else
+#define SREV(x) (x)
+#define IREV(x) (x)
+#endif
#define RSVAL(buf, pos) SREV(SVAL(buf, pos))
#define RIVAL(buf, pos) IREV(IVAL(buf, pos))