Merge pull request #1225 from savisko/devel

Fix crash of xrdp-chansrv process, issue #1202.
master
metalefty 6 years ago committed by GitHub
commit c2ade7a1f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1228,10 +1228,17 @@ xfuse_create_file_in_xrdp_fs(tui32 device_id, int pinode, const char *name,
{ {
XRDP_INODE *xinode; XRDP_INODE *xinode;
XRDP_INODE *xinodep; XRDP_INODE *xinodep;
time_t cur_time;
if ((name == NULL) || (strlen(name) == 0)) if ((name == NULL) || (strlen(name) == 0))
return NULL; return NULL;
/* Do we have an inode table yet? */
if (xfuse_init_xrdp_fs())
{
return NULL;
}
xinode = g_new0(XRDP_INODE, 1); xinode = g_new0(XRDP_INODE, 1);
if (xinode == NULL) if (xinode == NULL)
{ {
@ -1239,14 +1246,16 @@ xfuse_create_file_in_xrdp_fs(tui32 device_id, int pinode, const char *name,
return NULL; return NULL;
} }
cur_time = time(0);
xinode->parent_inode = pinode; xinode->parent_inode = pinode;
xinode->inode = g_xrdp_fs.next_node++; xinode->inode = g_xrdp_fs.next_node++;
xinode->nlink = 1; xinode->nlink = 1;
xinode->uid = getuid(); xinode->uid = getuid();
xinode->gid = getgid(); xinode->gid = getgid();
xinode->atime = time(0); xinode->atime = cur_time;
xinode->mtime = time(0); xinode->mtime = cur_time;
xinode->ctime = time(0); xinode->ctime = cur_time;
xinode->device_id = device_id; xinode->device_id = device_id;
xinode->is_synced = 1; xinode->is_synced = 1;
strcpy(xinode->name, name); strcpy(xinode->name, name);

Loading…
Cancel
Save