mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 23:40:13 +00:00
Windows: Only mask Delete permission for SMB reqs
For SMB requests the Delete permission is masked if the readonly attribute is set on the file. Do not apply this heuristic to non-SMB requests. Change-Id: I6617e935cb32796e4a95b4eac0bec9519bd3e937 Reviewed-on: http://gerrit.openafs.org/5342 Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
parent
7dcc476637
commit
6aeab6595e
@ -33,7 +33,8 @@ int cm_accessPerFileCheck = 0;
|
||||
* can't be locked. Thus, this must always be called in a while loop to stabilize
|
||||
* things, since we can always lose the race condition getting to the parent vnode.
|
||||
*/
|
||||
int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *userp, afs_uint32 rights,
|
||||
int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *userp, cm_req_t *reqp,
|
||||
afs_uint32 rights,
|
||||
afs_uint32 *outRightsp)
|
||||
{
|
||||
cm_scache_t *aclScp;
|
||||
@ -106,7 +107,7 @@ int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *userp, afs_uint32
|
||||
scp, scp->unixModeBits);
|
||||
*outRightsp &= ~PRSFS_WRITE;
|
||||
}
|
||||
if ((scp->unixModeBits & 0200) == 0 && !cm_deleteReadOnly) {
|
||||
if ((scp->unixModeBits & 0200) == 0 && !cm_deleteReadOnly && (reqp->flags & CM_REQ_SOURCE_SMB)) {
|
||||
osi_Log2(afsd_logp,"cm_HaveAccessRights UnixMode removing DELETE scp 0x%p unix 0%o",
|
||||
scp, scp->unixModeBits);
|
||||
*outRightsp &= ~PRSFS_DELETE;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "cm_user.h"
|
||||
|
||||
extern int cm_HaveAccessRights(struct cm_scache *scp, struct cm_user *up,
|
||||
afs_uint32 rights, afs_uint32 *outRights);
|
||||
struct cm_req *reqp, afs_uint32 rights, afs_uint32 *outRights);
|
||||
|
||||
extern long cm_GetAccessRights(struct cm_scache *scp, struct cm_user *up,
|
||||
struct cm_req *reqp);
|
||||
|
@ -1293,7 +1293,7 @@ long cm_SyncOp(cm_scache_t *scp, cm_buf_t *bufp, cm_user_t *userp, cm_req_t *req
|
||||
if ((rights & (PRSFS_WRITE|PRSFS_DELETE)) && (scp->flags & CM_SCACHEFLAG_RO))
|
||||
return CM_ERROR_READONLY;
|
||||
|
||||
if (cm_HaveAccessRights(scp, userp, rights, &outRights)) {
|
||||
if (cm_HaveAccessRights(scp, userp, reqp, rights, &outRights)) {
|
||||
if (~outRights & rights)
|
||||
return CM_ERROR_NOACCESS;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user