]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-smb-alignment-20060825
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 25 Aug 2006 18:08:23 +0000 (18:08 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 25 Aug 2006 18:08:23 +0000 (18:08 +0000)
on the wire smb data structures should be byte aligned

(cherry picked from commit 5ba229419b3a699ec55c1be0198838c3499ca93f)

src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/smb.h
src/WINNT/afsd/smb3.h

index 5e52b5343599c902d2660c055e4656987387036e..07b88c26106f38dc1ea837c47482303761067309 100644 (file)
@@ -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,
index 6f49c52b567665c51ca733337671103112831cca..37798a34d29a8d2db1e0a272c3cf478a99cf3e98 100644 (file)
@@ -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
index 813c33a7aa5d4fcf4734cdeb7ce65be0bda12187..5a848dfda64cc55eded0ba4ba18ecbeb8df0334e 100644 (file)
@@ -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