Bug 6875 - trans2 FIND_FIRST2 response --> FIND_FIRST2 Data -> Fille Attributes are returned as 0x220 for LANMAN2.1 dialect
trans2 FIND_FIRST2 response --> FIND_FIRST2 Data -> Fille Attributes are retu...
Status: RESOLVED FIXED
Product: Samba 3.4
Classification: Unclassified
Component: File services
unspecified
All Linux
: P3 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-11-06 14:39 UTC by Jeremy Allison
Modified: 2009-12-16 09:36 UTC (History)
1 user (show)

See Also:
vl: review+
jra: review? (metze)


Attachments
git-am patch for 3.4.4. (1.46 KB, patch)
2009-11-06 16:09 UTC, Jeremy Allison
no flags Details
git-am format patch for 3.3.10. (1.46 KB, patch)
2009-11-06 16:12 UTC, Jeremy Allison
no flags Details
git-am format patch for 3.4.4 - second part of fix (5.25 KB, patch)
2009-12-15 20:40 UTC, Jeremy Allison
metze: review+
Details
git-am format patch for 3.3.x - second part of fix. (5.17 KB, patch)
2009-12-15 20:42 UTC, Jeremy Allison
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Allison 2009-11-06 14:39:23 UTC
OS/2 clients can't cope with DOS attribute flags greater than 0xff (sparse flags etc.). It causes operations to fail.
Reported by Guenter Kukkukk <linux@kukkukk.com>.
Comment 1 Jeremy Allison 2009-11-06 16:09:43 UTC
Created attachment 4923 [details]
git-am patch for 3.4.4.
Comment 2 Jeremy Allison 2009-11-06 16:12:17 UTC
Created attachment 4924 [details]
git-am format patch for 3.3.10.
Comment 3 Jeremy Allison 2009-11-06 16:12:57 UTC
Re-assigning to Karolin for inclusion in 3.4.4 and 3.3.10. Fix already tested in 3.5.0 and master.
Jeremy.
Comment 4 Karolin Seeger 2009-11-10 04:10:01 UTC
Pushed to v3-3-test and v3-4-test.
Closing out bug report.

Thanks!
Comment 5 Jeremy Allison 2009-12-15 20:09:52 UTC
Hi Jeremy,

http://git.samba.org/?p=samba.git;a=commitdiff;h=f44d3754eeefb1a0d0282a424ae9901d72301766

when these changes were done, I had no access to our os/2 warpserver, where
all my os/2 build environment, the whole IBM docu, my own written test
programs and other stuff is stored.
One scsi harddisk went nuts - we have a tape backup - but til know i was
not able to replace that anchient harddisk, Ebay might help here ....

Was now able to install at least the IBM docu onto another box.

Btw - did you open a bug for this? Sorry, I can't remember.

Masking the dos attributes with 0xff is fine with native os/2 - but os/2 also
has a real DOS box and that one seems to be even more picky.

The IBM docu states that only bits 5 ... 0 are allowed (bits 31 ... 6 must be
set to zero), errors in the DOS box tell the same.
So we must apply mask 0x3f instead of 0xff.

From smb.h:
/* FileAttributesField */
#define FILE_ATTRIBUTE_READONLY        0x001L
#define FILE_ATTRIBUTE_HIDDEN            0x002L
#define FILE_ATTRIBUTE_SYSTEM            0x004L
#define FILE_ATTRIBUTE_DIRECTORY       0x010L
#define FILE_ATTRIBUTE_ARCHIVE           0x020L
#define FILE_ATTRIBUTE_NORMAL            0x080L      !!! atm this one irritates the DOS box !!!
#define FILE_ATTRIBUTE_TEMPORARY       0x100L
#define FILE_ATTRIBUTE_SPARSE             0x200L
#define FILE_ATTRIBUTE_REPARSE_POINT 0x400L
#define FILE_ATTRIBUTE_COMPRESSED     0x800L
#define FILE_ATTRIBUTE_OFFLINE             0x1000L
#define FILE_ATTRIBUTE_NONINDEXED      0x2000L
#define FILE_ATTRIBUTE_ENCRYPTED        0x4000L
#define SAMBA_ATTRIBUTES_MASK           0x7F

Do you remember for what purpose SAMBA_ATTRIBUTES_MASK was introduced
and is used now?
Bit 0x40 isn't used at all, so it would also be save to apply SAMBA_ATTRIBUTES_MASK
instead of hardcoded 0x3f.

When i had rebuild with the new mask, xcopy inside the DOS box was still failing for some
files - those which had not set any standard attribute.

A network sniff  showed, that querypathinfo returned the dos attributes 0x80 (FILE_ATTRIBUTE_NORMAL):

NTSTATUS smbd_do_qfilepathinfo()
....
        if (ms_dfs_link) {
                mode = dos_mode_msdfs(conn, smb_fname);
        } else {
                mode = dos_mode(conn, smb_fname);
        }
        if (!mode)
                mode = FILE_ATTRIBUTE_NORMAL;
....
For a very first test I just removed that setting of FILE_ATTRIBUTE_NORMAL
and the DOS box error was no longer seen.  :-)

Cheers, Günter
Comment 6 Jeremy Allison 2009-12-15 20:40:23 UTC
Created attachment 5088 [details]
git-am format patch for 3.4.4 - second part of fix

Second part of the fix (for 3.4.x branch).
Jeremy.
Comment 7 Jeremy Allison 2009-12-15 20:42:30 UTC
Created attachment 5089 [details]
git-am format patch for 3.3.x - second part of fix.

Second part of the fix (for 3.3.x branch).
Jeremy.
Comment 8 Stefan Metzmacher 2009-12-16 01:31:28 UTC
Comment on attachment 5089 [details]
git-am format patch for 3.3.x - second part of fix.

looks good
Comment 9 Stefan Metzmacher 2009-12-16 01:31:35 UTC
Comment on attachment 5088 [details]
git-am format patch for 3.4.4 - second part of fix

looks good
Comment 10 Karolin Seeger 2009-12-16 09:36:07 UTC
(In reply to comment #8)
> (From update of attachment 5089 [details])
> looks good
> 

Pushed.
Comment 11 Karolin Seeger 2009-12-16 09:36:22 UTC
(In reply to comment #9)
> (From update of attachment 5088 [details])
> looks good
> 

Pushed.
Comment 12 Karolin Seeger 2009-12-16 09:36:52 UTC
Closing out bug report.
Please reopen, if it's still an issue.

Thanks!