mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
mdssvc: chdir() to the conn of the RPC request
In preperation of calling VFS functions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14740 Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
8b681cfb5d
commit
6de3a88494
@ -1674,11 +1674,15 @@ bool mds_dispatch(struct mds_ctx *mds_ctx,
|
||||
struct mdssvc_blob *response_blob)
|
||||
{
|
||||
bool ok;
|
||||
int ret;
|
||||
ssize_t len;
|
||||
DALLOC_CTX *query = NULL;
|
||||
DALLOC_CTX *reply = NULL;
|
||||
char *rpccmd;
|
||||
const struct slrpc_cmd *slcmd;
|
||||
const struct smb_filename conn_basedir = {
|
||||
.base_name = mds_ctx->conn->connectpath,
|
||||
};
|
||||
|
||||
if (CHECK_DEBUGLVL(10)) {
|
||||
const struct sl_query *slq;
|
||||
@ -1730,6 +1734,14 @@ bool mds_dispatch(struct mds_ctx *mds_ctx,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ret = vfs_ChDir(mds_ctx->conn, &conn_basedir);
|
||||
if (ret != 0) {
|
||||
DBG_ERR("vfs_ChDir [%s] failed: %s\n",
|
||||
conn_basedir.base_name, strerror(errno));
|
||||
ok = false;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
ok = slcmd->function(mds_ctx, query, reply);
|
||||
if (ok) {
|
||||
DBG_DEBUG("%s", dalloc_dump(reply, 0));
|
||||
|
Loading…
Reference in New Issue
Block a user