r23130: merge Derrell's change from SAMBA_3_0_25 svn r23120 release-3-0-25a
authorGerald Carter <jerry@samba.org>
Fri, 25 May 2007 04:02:25 +0000 (04:02 +0000)
committerGerald Carter <jerry@samba.org>
Fri, 25 May 2007 04:02:25 +0000 (04:02 +0000)
WHATSNEW.txt
source/include/nterr.h
source/libsmb/clierror.c
source/libsmb/clitrans.c

index 55dadc8cf2aa153dcae5494520ddb38d24fb2bb2..aa04c38d0f0e9e2d652ba4b096c7818a00c628ea 100644 (file)
@@ -98,7 +98,9 @@ o   Derrell Lipman <derrell@samba.org>
     * BUG 4599: Fix failure when setting attributes.
     * BUG 4634: Type of the size parameter to getpeername in
       libsmbclient code was wrong.
-
+    * Fix libsmbclient interaction with links on Vista and properly
+      detect non-NTSTATUS errors.
+    
 
 o   Jim McDonough <jmcd@us.ibm.com>
     * BUG 4630: Fix special case of unix_to_nt_time() for TIME_T_MAX
index 913ea5799e3bfd0f2b33a104d81c9091bc1983a2..8a667707c8cce1073d36c36875ee0294d368255e 100644 (file)
@@ -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)
index f85fc5c552237224087ec1e6b4a7b74bfeaee032..ff6fbf522fe01708a8753035c2dc9f45a8dca431 100644 (file)
@@ -380,6 +380,15 @@ int cli_errno(struct cli_state *cli)
                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;
 }
index 27207e72e2f53058fd846ea9d9735c0160f05188..f212f499940620110264aa97c6ebd4b1da57a0e5 100644 (file)
@@ -197,7 +197,9 @@ BOOL cli_receive_trans(struct cli_state *cli,int trans,
         */
        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;
        }