[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-3282-g3f47eb7
Derrell Lipman
derrell at samba.org
Tue Dec 16 17:18:48 GMT 2008
The branch, v3-2-test has been updated
via 3f47eb787f5b8499e5580407dc84c904db70b725 (commit)
from cb036772d09227f870c2fec3ecd8c3f53787dfbc (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit 3f47eb787f5b8499e5580407dc84c904db70b725
Author: SATOH Fumiyasu <fumiyas at osstech.jp>
Date: Wed Dec 17 00:54:30 2008 +0900
commit b520befe6f51644d20434add9864d7a2fa30aa2e
Author: SATOH Fumiyasu <fumiyas at osstech.co.jp>
Date: Wed Dec 17 00:42:25 2008 +0900
libsmbclient: Fix SIGBUS on non-x86 CPUs
We must align the struct smbc_dirent in the struct
SMBC_internal_data because the struct smbc_dirent
has numeric values that require alignment.
Signed-off-by: Derrell Lipman <derrell.lipman at unwireduniverse.com>
-----------------------------------------------------------------------
Summary of changes:
source/include/libsmb_internal.h | 13 +++++++------
source/libsmb/libsmb_dir.c | 10 ++++------
2 files changed, 11 insertions(+), 12 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/include/libsmb_internal.h b/source/include/libsmb_internal.h
index 6930812..7cf0330 100644
--- a/source/include/libsmb_internal.h
+++ b/source/include/libsmb_internal.h
@@ -113,18 +113,19 @@ struct SMBC_internal_data {
/* True when this handle is initialized */
bool initialized;
- /* dirent pointer location
- *
+ /* dirent pointer location */
+ struct smbc_dirent dirent;
+ /*
* Leave room for any urlencoded filename and the comment field.
*
- * We really should use sizeof(struct smbc_dirent) plus (NAME_MAX * 3)
- * plus whatever the max length of a comment is, plus a couple of null
- * terminators (one after the filename, one after the comment).
+ * We use (NAME_MAX * 3) plus whatever the max length of a comment is,
+ * plus a couple of null terminators (one after the filename,
+ * one after the comment).
*
* According to <linux/limits.h>, NAME_MAX is 255. Is it longer
* anyplace else?
*/
- char dirent[1024];
+ char _dirent_name[1024];
/*
* server connection list
diff --git a/source/libsmb/libsmb_dir.c b/source/libsmb/libsmb_dir.c
index f836989..5fe2731 100644
--- a/source/libsmb/libsmb_dir.c
+++ b/source/libsmb/libsmb_dir.c
@@ -975,9 +975,8 @@ SMBC_readdir_ctx(SMBCCTX *context,
}
- dirp = (struct smbc_dirent *)context->internal->dirent;
- maxlen = (sizeof(context->internal->dirent) -
- sizeof(struct smbc_dirent));
+ dirp = &context->internal->dirent;
+ maxlen = sizeof(context->internal->_dirent_name);
smbc_readdir_internal(context, dirp, dirent, maxlen);
@@ -1048,9 +1047,8 @@ SMBC_getdents_ctx(SMBCCTX *context,
}
/* Do urlencoding of next entry, if so selected */
- dirent = (struct smbc_dirent *)context->internal->dirent;
- maxlen = (sizeof(context->internal->dirent) -
- sizeof(struct smbc_dirent));
+ dirent = &context->internal->dirent;
+ maxlen = sizeof(context->internal->_dirent_name);
smbc_readdir_internal(context, dirent,
dirlist->dirent, maxlen);
--
Samba Shared Repository
More information about the samba-cvs
mailing list