Author: derrell Date: 2007-05-24 18:12:32 +0000 (Thu, 24 May 2007) New Revision: 23120
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23120 Log: Crap. This patch was applied to the other two Samba3 branches just prior to the 3.0.25 release, but was only in my local tree for SAMBA_3_0_25. Jerry, please apply this to 3.0.25a. - Testing of libsmbclient against Vista revealed what is likely a bug in Vista. Vista provides a plethora of kludges to simulate older versions of Windows. The kludges are in the form of shortcuts (or more likely symbolic links, but I don't know enough about Vista to determine that definitively) and in most cases, attempts to access them get back an "access denied" error. On one particular folder, however, "<share>/Users/All Users", it returns an unknown (to ethereal and the Samba3 code) NT status code: 0x8000002d. Although this code does not have a high byte of 0xc0 indicating that it is an error, it appears to be an alternate form of "access denied". Without this patch, libsmbclient times out on an attempt to enumerate that folder rather than returning an error to the caller. This patch corrects that problem. Modified: branches/SAMBA_3_0_25/source/include/nterr.h branches/SAMBA_3_0_25/source/libsmb/clierror.c branches/SAMBA_3_0_25/source/libsmb/clitrans.c Changeset: Modified: branches/SAMBA_3_0_25/source/include/nterr.h =================================================================== --- branches/SAMBA_3_0_25/source/include/nterr.h 2007-05-24 16:16:01 UTC (rev 23119) +++ branches/SAMBA_3_0_25/source/include/nterr.h 2007-05-24 18:12:32 UTC (rev 23120) @@ -30,6 +30,9 @@ #define STATUS_NO_MORE_FILES NT_STATUS(0x80000006) #define NT_STATUS_NO_MORE_ENTRIES NT_STATUS(0x8000001a) +/* Vista Status codes. */ +#define STATUS_INACCESSIBLE_SYSTEM_SHORTCUT NT_STATUS(0x8000002d) + #define STATUS_MORE_ENTRIES NT_STATUS(0x0105) #define STATUS_SOME_UNMAPPED NT_STATUS(0x0107) #define ERROR_INVALID_PARAMETER NT_STATUS(0x0057) Modified: branches/SAMBA_3_0_25/source/libsmb/clierror.c =================================================================== --- branches/SAMBA_3_0_25/source/libsmb/clierror.c 2007-05-24 16:16:01 UTC (rev 23119) +++ branches/SAMBA_3_0_25/source/libsmb/clierror.c 2007-05-24 18:12:32 UTC (rev 23120) @@ -380,6 +380,15 @@ return cli_errno_from_nt(status); } + /* + * Yuck! A special case for this Vista error. Since its high-order + * byte isn't 0xc0, it doesn't match cli_is_nt_error() above. + */ + status = cli_nt_error(cli); + if (NT_STATUS_V(status) == NT_STATUS_V(STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) { + return EACCES; + } + /* for other cases */ return EINVAL; } Modified: branches/SAMBA_3_0_25/source/libsmb/clitrans.c =================================================================== --- branches/SAMBA_3_0_25/source/libsmb/clitrans.c 2007-05-24 16:16:01 UTC (rev 23119) +++ branches/SAMBA_3_0_25/source/libsmb/clitrans.c 2007-05-24 18:12:32 UTC (rev 23120) @@ -197,7 +197,9 @@ */ status = cli_nt_error(cli); - if (NT_STATUS_IS_ERR(status) || NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES)) { + if (NT_STATUS_IS_ERR(status) || + NT_STATUS_EQUAL(status,STATUS_NO_MORE_FILES) || + NT_STATUS_EQUAL(status,STATUS_INACCESSIBLE_SYSTEM_SHORTCUT)) { goto out; }
