STABLE14-windows-links-20040921

FIXES 915
FIXES 15250

  * smb_ReceiveCoreRename() was factored to produce smb_Rename()
    which is used by both the original function and the new
    smb_ReceiveNTRename().  smb_ReceiveNTRename() supports the
    creation of HardLinks in addition to Renaming.  smb_Link()
    is a new function which creates HardLinks via cm_Link().
    cm_Link() is a new vnodeops function which creates links
    using RXAFS_Link().

    smb_ReceiveNTRename() does not support the File Copy and
    Move Cluster Information operations described in its interface.
    ReceiveNTRename is under documented in CIFS-TR-1p00_FINAL.pdf.

  * When opening files via symlinks, we should follow the symlinks
    until we reach the actual file stat cache entry.  The stat cache
    entry of the file should then be stored in the FID instead of
    stat scache entry of the symlink.

  * return bad operation errors for all unimplemented functions
    even if we do not know the functions exist.

  * Log bad packets and unknown operation packets to the trace log

  * Map CM_ERROR_BADOP to STATUS_NOT_SUPPORTED instead of
    0xC09820FF

  * Update list of known CIFS operations to include all those listed
    in CIFS-TR-1p00_FINAL.pdf.


(cherry picked from commit e07406e551)
This commit is contained in:
Jeffrey Altman 2004-09-21 15:07:12 +00:00 committed by Jeffrey Altman
parent 0b68a11a93
commit 02368492c4
11 changed files with 2241 additions and 1747 deletions

View File

@ -1,3 +1,32 @@
Since 1.3.71:
* smb_ReceiveCoreRename() was factored to produce smb_Rename()
which is used by both the original function and the new
smb_ReceiveNTRename(). smb_ReceiveNTRename() supports the
creation of HardLinks in addition to Renaming. smb_Link()
is a new function which creates HardLinks via cm_Link().
cm_Link() is a new vnodeops function which creates links
using RXAFS_Link().
smb_ReceiveNTRename() does not support the File Copy and
Move Cluster Information operations described in its interface.
ReceiveNTRename is under documented in CIFS-TR-1p00_FINAL.pdf.
* When opening files via symlinks, we should follow the symlinks
until we reach the actual file stat cache entry. The stat cache
entry of the file should then be stored in the FID instead of
stat scache entry of the symlink.
* return bad operation errors for all unimplemented functions
even if we do not know the functions exist.
* Log bad packets and unknown operation packets to the trace log
* Map CM_ERROR_BADOP to STATUS_NOT_SUPPORTED instead of
0xC09820FF
* Update list of known CIFS operations to include all those listed
in CIFS-TR-1p00_FINAL.pdf.
Since 1.3.70:
* A new Windows authorization group "AFS Client Admins" is now
created and populated with the members of the "Administrators"

View File

@ -196,3 +196,18 @@ List of unfunded projects:
afsmap.exe <drive> /DELETE
22. Write-through caching appears to be unsupported. Files copied to AFS
do not end up in the local cache.
23. The Win32 API CreateHardLink() is not properly supported by the SMB/CIFS
server. It neither returns a valid error nor does it perform the
operation.
24. Missing SMB/CIFS functions:
Find
FindUnique
FindClose
ReadBulk
WriteBulk
WriteBulkData
Tran2::SessionSetup

View File

@ -30,41 +30,52 @@ cm_space_t *cm_spaceListp;
long cm_MapRPCError(long error, cm_req_t *reqp)
{
if (error == 0) return 0;
if (error == 0)
return 0;
/* If we had to stop retrying, report our saved error code. */
if (reqp && error == CM_ERROR_TIMEDOUT) {
if (reqp->accessError)
return reqp->accessError;
if (reqp->volumeError)
return reqp->volumeError;
if (reqp->rpcError)
return reqp->rpcError;
return error;
}
if (error < 0) error = CM_ERROR_TIMEDOUT;
else if (error == 30) error = CM_ERROR_READONLY;
else if (error == 13) error = CM_ERROR_NOACCESS;
else if (error == 18) error = CM_ERROR_CROSSDEVLINK;
else if (error == 17) error = CM_ERROR_EXISTS;
else if (error == 20) error = CM_ERROR_NOTDIR;
else if (error == 2) error = CM_ERROR_NOSUCHFILE;
else if (error == 11 /* EAGAIN, most servers */
|| error == 35) /* EAGAIN, Digital UNIX */
error = CM_ERROR_WOULDBLOCK;
else if (error == VDISKFULL
|| error == 28) /* ENOSPC */
error = CM_ERROR_SPACE;
else if (error == VOVERQUOTA
|| error == 49 /* EDQUOT on Solaris */
|| error == 88 /* EDQUOT on AIX */
|| error == 69 /* EDQUOT on Digital UNIX and HPUX */
|| error == 122 /* EDQUOT on Linux */
|| error == 1133) /* EDQUOT on Irix */
error = CM_ERROR_QUOTA;
else if (error == VNOVNODE) error = CM_ERROR_BADFD;
/* If we had to stop retrying, report our saved error code. */
if (reqp && error == CM_ERROR_TIMEDOUT) {
if (reqp->accessError)
return reqp->accessError;
if (reqp->volumeError)
return reqp->volumeError;
if (reqp->rpcError)
return reqp->rpcError;
return error;
}
if (error < 0)
error = CM_ERROR_TIMEDOUT;
else if (error == 30)
error = CM_ERROR_READONLY;
else if (error == 13)
error = CM_ERROR_NOACCESS;
else if (error == 18)
error = CM_ERROR_CROSSDEVLINK;
else if (error == 17)
error = CM_ERROR_EXISTS;
else if (error == 20)
error = CM_ERROR_NOTDIR;
else if (error == 2)
error = CM_ERROR_NOSUCHFILE;
else if (error == 11 /* EAGAIN, most servers */
|| error == 35) /* EAGAIN, Digital UNIX */
error = CM_ERROR_WOULDBLOCK;
else if (error == VDISKFULL
|| error == 28) /* ENOSPC */
error = CM_ERROR_SPACE;
else if (error == VOVERQUOTA
|| error == 49 /* EDQUOT on Solaris */
|| error == 88 /* EDQUOT on AIX */
|| error == 69 /* EDQUOT on Digital UNIX and HPUX */
|| error == 122 /* EDQUOT on Linux */
|| error == 1133) /* EDQUOT on Irix */
error = CM_ERROR_QUOTA;
else if (error == VNOVNODE)
error = CM_ERROR_BADFD;
else if (error == 21)
return CM_ERROR_ISDIR;
return error;
}
long cm_MapRPCErrorRmdir(long error, cm_req_t *reqp)

View File

@ -2082,6 +2082,60 @@ long cm_MakeDir(cm_scache_t *dscp, char *namep, long flags, cm_attr_t *attrp,
return code;
}
long cm_Link(cm_scache_t *dscp, char *namep, cm_scache_t *sscp, long flags,
cm_user_t *userp, cm_req_t *reqp)
{
cm_conn_t *connp;
long code = 0;
AFSFid dirAFSFid;
AFSFid existingAFSFid;
AFSFetchStatus updatedDirStatus;
AFSFetchStatus newLinkStatus;
AFSVolSync volSync;
if (dscp->fid.cell != sscp->fid.cell ||
dscp->fid.volume != sscp->fid.volume) {
return CM_ERROR_CROSSDEVLINK;
}
lock_ObtainMutex(&dscp->mx);
code = cm_SyncOp(dscp, NULL, userp, reqp, 0, CM_SCACHESYNC_STOREDATA);
lock_ReleaseMutex(&dscp->mx);
if (code)
return code;
do {
code = cm_Conn(&dscp->fid, userp, reqp, &connp);
if (code) continue;
dirAFSFid.Volume = dscp->fid.volume;
dirAFSFid.Vnode = dscp->fid.vnode;
dirAFSFid.Unique = dscp->fid.unique;
existingAFSFid.Volume = sscp->fid.volume;
existingAFSFid.Vnode = sscp->fid.vnode;
existingAFSFid.Unique = sscp->fid.unique;
code = RXAFS_Link(connp->callp, &dirAFSFid, namep, &existingAFSFid,
&newLinkStatus, &updatedDirStatus, &volSync);
osi_Log1(smb_logp," RXAFS_Link returns %d", code);
} while (cm_Analyze(connp, userp, reqp,
&dscp->fid, &volSync, NULL, NULL, code));
code = cm_MapRPCError(code, reqp);
lock_ObtainMutex(&dscp->mx);
cm_SyncOpDone(dscp, NULL, CM_SCACHESYNC_STOREDATA);
if (code == 0) {
cm_MergeStatus(dscp, &updatedDirStatus, &volSync, userp, 0);
}
lock_ReleaseMutex(&dscp->mx);
return code;
}
long cm_SymLink(cm_scache_t *dscp, char *namep, char *contentsp, long flags,
cm_attr_t *attrp, cm_user_t *userp, cm_req_t *reqp)
{

View File

@ -104,6 +104,9 @@ extern long cm_Rename(cm_scache_t *oldDscp, char *oldLastNamep,
extern long cm_HandleLink(cm_scache_t *linkScp, struct cm_user *userp,
cm_req_t *reqp);
extern long cm_Link(cm_scache_t *dscp, char *namep, cm_scache_t *sscp,
long flags, cm_user_t *userp, cm_req_t *reqp);
extern long cm_SymLink(cm_scache_t *dscp, char *namep, char *contentsp,
long flags, cm_attr_t *attrp, cm_user_t *userp, cm_req_t *reqp);

File diff suppressed because it is too large Load Diff

View File

@ -561,6 +561,10 @@ extern long smb_ReadData(smb_fid_t *fidp, osi_hyper_t *offsetp, long count,
char *op, cm_user_t *userp, long *readp, int dosflag);
#endif /* !DJGPP */
extern long smb_Rename(smb_vc_t *vcp, smb_packet_t *inp, char *oldPathp, char *newPathp, int attrs);
extern long smb_Link(smb_vc_t *vcp, smb_packet_t *inp, char *oldPathp, char *newPathp);
extern BOOL smb_IsLegalFilename(char *filename);
extern char *smb_GetSharename(void);

File diff suppressed because it is too large Load Diff

View File

@ -149,7 +149,16 @@ extern long smb_ReceiveTran2FindNotifyFirst(smb_vc_t *vcp, smb_tran2Packet_t *p,
extern long smb_ReceiveTran2FindNotifyNext(smb_vc_t *vcp, smb_tran2Packet_t *p,
smb_packet_t *outp);
extern long smb_ReceiveTran2MKDir(smb_vc_t *vcp, smb_tran2Packet_t *p,
extern long smb_ReceiveTran2CreateDirectory(smb_vc_t *vcp, smb_tran2Packet_t *p,
smb_packet_t *outp);
extern long smb_ReceiveTran2SessionSetup(smb_vc_t *vcp, smb_tran2Packet_t *p,
smb_packet_t *outp);
extern long smb_ReceiveTran2GetDFSReferral(smb_vc_t *vcp, smb_tran2Packet_t *p,
smb_packet_t *outp);
extern long smb_ReceiveTran2ReportDFSInconsistency(smb_vc_t *vcp, smb_tran2Packet_t *p,
smb_packet_t *outp);
extern long smb_ReceiveV3FindClose(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
@ -178,6 +187,8 @@ extern void smb_NotifyChange(DWORD action, DWORD notifyFilter,
extern long smb_ReceiveNTCancel(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
extern long smb_ReceiveNTRename(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp);
extern int smb_V3MatchMask(char *namep, char *maskp, int flags);
extern void smb3_Init();

View File

@ -30,7 +30,7 @@ languages:
# )
$(MAKE) /f NTMakefile /nologo LANG=en_US lang
lang:: $(MSIFILE)
lang:: lang_clean $(MSIFILE)
customactions:
$(CD) custom

View File

@ -80,7 +80,7 @@ LIB = $(AFSDEV_LIB)
#define used in WinNT/2000 installation and program version display
AFSPRODUCT_VER_MAJOR=1
AFSPRODUCT_VER_MINOR=3
AFSPRODUCT_VER_PATCH=7100
AFSPRODUCT_VER_PATCH=7101
AFSPRODUCT_VER_BUILD=0
# For MSI installer, each major release should have a different GUID