summaryrefslogtreecommitdiffstats
path: root/source3/smbd/service.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-09-12 11:39:37 -0700
committerJeremy Allison <jra@samba.org>2012-09-12 22:06:06 +0200
commitb6636affaf4d475487e49ed8d5a31b94b82ae6d0 (patch)
tree8845f985f34468bf49e77fd800d2b9987c4f8b45 /source3/smbd/service.c
parenta8676e69a636648d8a309e8e000dcd62d38bfa06 (diff)
downloadsamba-b6636affaf4d475487e49ed8d5a31b94b82ae6d0.tar.gz
samba-b6636affaf4d475487e49ed8d5a31b94b82ae6d0.tar.xz
samba-b6636affaf4d475487e49ed8d5a31b94b82ae6d0.zip
Move cached cwd onto conn struct.
This enables us to make VFS modules safe for use in root called code when we've changed directory under conn->connectpath.
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r--source3/smbd/service.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 0cd48f89504..b2d3d4ddc16 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -164,6 +164,12 @@ bool set_conn_connectpath(connection_struct *conn, const char *connectpath)
talloc_free(conn->connectpath);
conn->connectpath = destname;
+ /* Ensure conn->cwd is initialized - start as conn->connectpath. */
+ TALLOC_FREE(conn->cwd);
+ conn->cwd = talloc_strdup(conn, conn->connectpath);
+ if (!conn->cwd) {
+ return false;
+ }
return true;
}