[OpenAFS-devel] Windows Patch: profile upload problem

Marc Dionne dionne@cs.wisc.edu
Thu, 25 Apr 2002 14:18:36 -0500


This problem was originally reported by Rodney Dyer a few months ago,
and was a show stopper for us to use OpenAFS on Windows since we store
our roaming profiles in AFS.  The symptom was a failure to upload the
profile at logout with the message "The specified server cannot perform
the requested operation".

Much poking revealed that Windows issues a "query file system info" SMB
call at that time, with the information level "allocation info".  The
returned structure is expected to be 18 bytes long, but at least under
my build environment it comes out as 20 bytes, and Windows marks this as
a bad reply and fails to continue with the upload.

The patch below fixes it for me; it requests an alignment to 2 bytes for
the smb_tran2QFSInfo structure (the Visual C++ default is 8).  I'm not
sure what the equivalent would be for DJGPP ( __attribute__ ((packed)) ?
), or if the problem even exists there.

Marc


=======================

diff -c openafs-1.2.3/src/WINNT/afsd smb3.h
*** openafs-1.2.3/src/WINNT/afsd/smb3.h    Mon Mar  4 14:45:05 2002
--- smb3.h      Thu Apr 25 13:43:46 2002
***************
*** 39,44 ****
--- 39,48 ----
          long flags;
  } smb_tran2Dispatch_t;
  
+ #ifndef DJGPP
+ #pragma pack(2)
+ #endif 
+ 
  typedef struct smb_tran2QFSInfo {
        union {
                struct {
***************
*** 78,83 ****
--- 82,91 ----
                } FSattributeInfo;
          } u;
  } smb_tran2QFSInfo_t;
+ 
+ #ifndef DJGPP
+ #pragma pack
+ #endif 
  
  /* more than enough opcodes for today, anyway */
  #define SMB_TRAN2_NOPCODES            20