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

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

index 1793306986469e8bc39590d1b3da96e587cbce4d..df53cfdde14b8f97e256298642595a9876bcfa7b 100644 (file)
@@ -121,7 +121,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 c4296b2705c82ab1b1ea041580b1f556edd1e338..b14053965d01413da8b3a1cb062dbec755de163f 100644 (file)
@@ -16,6 +16,7 @@
 #define AFS_LARGEFILES
 
 /* basic core protocol SMB structure */
+#pragma pack(push, 1)
 typedef struct smb {
     unsigned char id[4];
     unsigned char com;
@@ -33,7 +34,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 836fe40c4c3bb624d3e5d0ed412bcea4aad7ed86..23bfa98fc5a9823eb602d18ad7c933445d0965d2 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