If a request is received to create the root directory of a device,
return CM_ERROR_EXISTS instead of CM_ERROR_NOTFOUND for the nul-string
file name.
(cherry picked from commit
47cc7643e1b04bacd858a3893accab8c377b34ac)
osi_LogSaveString(smb_logp, treeStartp));
openAction = 2; /* created directory */
+ /* if the request is to create the root directory
+ * it will appear as a directory name of the nul-string
+ * and a code of CM_ERROR_NOSUCHFILE
+ */
+ if ( !*treeStartp && code == CM_ERROR_NOSUCHFILE)
+ code = CM_ERROR_EXISTS;
+
setAttr.mask = CM_ATTRMASK_CLIENTMODTIME;
setAttr.clientModTime = time(NULL);