From: Jeffrey Altman Date: Sun, 23 Oct 2005 01:32:52 +0000 (+0000) Subject: STABLE14-windows-mkdir-root-exists-20051021 X-Git-Tag: openafs-stable-1_4_1-rc2~45 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=5dbd32c49ac4d38466a3a874a23519366c363352;p=packages%2Fo%2Fopenafs.git STABLE14-windows-mkdir-root-exists-20051021 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) --- diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 3e91c6fdf..2154cbadb 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -5804,6 +5804,13 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp) 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);