From: Jeffrey Altman Date: Fri, 25 Aug 2006 18:08:23 +0000 (+0000) Subject: DEVEL15-windows-smb-alignment-20060825 X-Git-Tag: openafs-devel-1_5_8~36 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=df310be1bf99bfd2cfe6533ff39c34c2c5ae535d;p=packages%2Fo%2Fopenafs.git DEVEL15-windows-smb-alignment-20060825 on the wire smb data structures should be byte aligned (cherry picked from commit 5ba229419b3a699ec55c1be0198838c3499ca93f) --- diff --git a/src/WINNT/afsd/cm_callback.c b/src/WINNT/afsd/cm_callback.c index 5e52b5343..07b88c261 100644 --- a/src/WINNT/afsd/cm_callback.c +++ b/src/WINNT/afsd/cm_callback.c @@ -125,7 +125,7 @@ void cm_CallbackNotifyChange(cm_scache_t *scp) Sleep(dwDelay); /* for directories, this sends a change notification on the dir itself */ - if (scp->fileType == CM_SCACHETYPE_DIRECTORY) { + if (scp->fileType == CM_SCACHETYPE_DIRECTORY) { #ifndef AFSIFS if (scp->flags & CM_SCACHEFLAG_ANYWATCH) smb_NotifyChange(0, diff --git a/src/WINNT/afsd/smb.h b/src/WINNT/afsd/smb.h index 6f49c52b5..37798a34d 100644 --- a/src/WINNT/afsd/smb.h +++ b/src/WINNT/afsd/smb.h @@ -20,6 +20,7 @@ #define AFS_LARGEFILES /* basic core protocol SMB structure */ +#pragma pack(push, 1) typedef struct smb { unsigned char id[4]; unsigned char com; @@ -37,7 +38,7 @@ typedef struct smb { unsigned char wct; unsigned char vdata[1]; } smb_t; - +#pragma pack(pop) /* reb values */ #define SMB_FLAGS_SUPPORT_LOCKREAD 0x01 diff --git a/src/WINNT/afsd/smb3.h b/src/WINNT/afsd/smb3.h index 813c33a7a..5a848dfda 100644 --- a/src/WINNT/afsd/smb3.h +++ b/src/WINNT/afsd/smb3.h @@ -40,9 +40,12 @@ typedef struct smb_tran2Dispatch { long flags; } smb_tran2Dispatch_t; +/* Data Structures that are written to or read from the wire directly + * must be byte aligned (no padding). + */ +#pragma pack(push, 1) typedef struct smb_tran2QFSInfo { union { -#pragma pack(push, 2) struct { unsigned long FSID; /* file system ID */ unsigned long sectorsPerAllocUnit; @@ -50,7 +53,6 @@ typedef struct smb_tran2QFSInfo { unsigned long availAllocUnits; /* free blocks */ unsigned short bytesPerSector; /* bytes per sector */ } allocInfo; -#pragma pack(pop) struct { unsigned long vsn; /* volume serial number */ char vnCount; /* count of chars in label, incl null */ @@ -205,6 +207,7 @@ typedef struct { } QFfileNameInfo; } u; } smb_tran2QFileInfo_t; +#pragma pack(pop) /* more than enough opcodes for today, anyway */ #define SMB_TRAN2_NOPCODES 20