Skip to content
Snippets Groups Projects
Commit 1e62752a authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Restore ability for MsgBase.open() to open an arbitrary SMB msgbase

Before commit 5da26eca, you could pass Msgbase() the path to an SMB
on the disk and open() it, no configuration needed. As of 2 years
ago, I broke that, and passing a path to an SMB would open the "mail" base
instead - most unexpected. This is a feature of smb_open_sub() which we
switched to using (from smb_open()), so go back to using smb_open() when
an unrecognized code is pass to the constructor.

This has the negative consequence that the "mail" base can't be created
via JS. Probably should fix that.
parent 6b36b379
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -93,7 +93,11 @@ js_open(JSContext *cx, uintN argc, jsval *arglist)
}
rc=JS_SUSPENDREQUEST(cx);
if((p->smb_result = smb_open_sub(scfg, &(p->smb), p->smb.subnum)) != SMB_SUCCESS) {
if(p->smb.subnum == INVALID_SUB)
p->smb_result = smb_open(&(p->smb));
else
p->smb_result = smb_open_sub(scfg, &(p->smb), p->smb.subnum);
if(p->smb_result != SMB_SUCCESS) {
JS_RESUMEREQUEST(cx, rc);
return JS_TRUE;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment