diff options
Diffstat (limited to 'source4/ntvfs/posix/pvfs_resolve.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_resolve.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/ntvfs/posix/pvfs_resolve.c b/source4/ntvfs/posix/pvfs_resolve.c index 8e8da72e1f..8c5806d93f 100644 --- a/source4/ntvfs/posix/pvfs_resolve.c +++ b/source4/ntvfs/posix/pvfs_resolve.c @@ -498,13 +498,14 @@ static NTSTATUS pvfs_reduce_name(TALLOC_CTX *mem_ctx, TODO: ../ collapsing, and outside share checking */ -NTSTATUS pvfs_resolve_name(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx, +NTSTATUS pvfs_resolve_name(struct pvfs_state *pvfs, + struct ntvfs_request *req, const char *cifs_name, uint_t flags, struct pvfs_filename **name) { NTSTATUS status; - *name = talloc(mem_ctx, struct pvfs_filename); + *name = talloc(req, struct pvfs_filename); if (*name == NULL) { return NT_STATUS_NO_MEMORY; } @@ -516,6 +517,12 @@ NTSTATUS pvfs_resolve_name(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx, flags &= ~PVFS_RESOLVE_STREAMS; } + /* SMB2 doesn't allow a leading slash */ + if (req->ctx->protocol == PROTOCOL_SMB2 && + *cifs_name == '\\') { + return NT_STATUS_INVALID_PARAMETER; + } + /* do the basic conversion to a unix formatted path, also checking for allowable characters */ status = pvfs_unix_path(pvfs, cifs_name, flags, *name); |