﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
21	Incorrect error code returned by smbcd	Paul Smedley	Paul Smedley	"From Vitali:
I've found a bug in the smbcd.c. When it is unable to connect to a share
because it has no rights to access it (wrong login/pass, then the return 
code from smbcd was 7 (ERROR_ARENA_TRASHED). That is rather misleading  :) 

Further analysis showed that smbwrp_connect returned a non-0 value
as an error indicator. Values numbered 1 to 7 and are not related to OS/2 
error codes.

Here is a patch. I think returning ERROR_ACCESS_DENIED on the
smbwrp_failure is OK.

Please make a new build for me.

Thanks in advance,
Vitali.

Index: smbcd.c
===================================================================
--- smbcd.c	(revision 44)
+++ smbcd.c	(working copy)
@@ -311,7 +311,7 @@
 		if (res->rc)
 		{
 			debuglocal(1,""Client reconnect resprc %d\n"",  res->rc);
-			return NO_ERROR;
+			return ERROR_ACCESS_DENIED;
 		}
 		*reconnect = 1;
 	}
@@ -346,6 +346,10 @@
 				memcpy(srv, req->param, sizeof(smbwrp_server));
 				*reconnect = 1;
 			}
+			else
+			{
+				res->rc = ERROR_ACCESS_DENIED;
+			}
 		} break;
 		case SMBREQ_DISCONNECT :
 		{
"	defect	closed	minor	Netdrive plugin 1.0	Samba Client Plugin		fixed		
