summaryrefslogtreecommitdiffstats
path: root/sesman/chansrv
diff options
context:
space:
mode:
authormatt335672 <30179339+matt335672@users.noreply.github.com>2017-07-31 11:06:49 +0100
committermetalefty <meta@vmeta.jp>2017-08-03 11:50:31 +0900
commit4023aa7f1c858e106610f4b2b12dec00d9fa9b01 (patch)
treefec4f3b5da296355c0d0d08d1ece1166132fdebe /sesman/chansrv
parent4d14f344fdd30ffe994066bfc34c11777309ab39 (diff)
downloadxrdp-proprietary-4023aa7f1c858e106610f4b2b12dec00d9fa9b01.tar.gz
xrdp-proprietary-4023aa7f1c858e106610f4b2b12dec00d9fa9b01.zip
xfuse_create_share() called before xfuse_init()
* Initialise inode table in `xfuse_create_share()` if necessary * Add guard to `xfuse_init_xrdp_fs()` to prevent double initialisation of the inode table
Diffstat (limited to 'sesman/chansrv')
-rw-r--r--sesman/chansrv/chansrv_fuse.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c
index 31353ee4..ff50f136 100644
--- a/sesman/chansrv/chansrv_fuse.c
+++ b/sesman/chansrv/chansrv_fuse.c
@@ -611,6 +611,12 @@ int xfuse_create_share(tui32 device_id, const char *dirname)
if (dirname == NULL || strlen(dirname) == 0)
return -1;
+ /* Do we have an inode table yet? */
+ if (xfuse_init_xrdp_fs())
+ {
+ return -1;
+ }
+
xinode = g_new0(struct xrdp_inode, 1);
if (xinode == NULL)
{
@@ -858,6 +864,12 @@ static int xfuse_init_xrdp_fs(void)
{
struct xrdp_inode *xino;
+ /* Already called? */
+ if (g_xrdp_fs.inode_table != NULL)
+ {
+ return 0;
+ }
+
g_xrdp_fs.inode_table = g_new0(struct xrdp_inode *, 4096);
if (g_xrdp_fs.inode_table == NULL)
{