Problem:
/tmp/VMwareDnD is a staging directory used for DnD and CnP. It should be
a regular directory, but malicious code or user may create the /tmp/VMwareDnD
as a symbolic link which points to the home directory of the current desktop
user before the staging directory is created. Later when the desktop user
initiates a DnD or CnP operation, the permission of that user's home directory
will be changed allowing the malicious user full access to the desktop user's
home directory.
Solution:
Do not set the permission of the staging directory if that directory already
exists and has the wrong permission. The permission of the directory will
be 1777 if it is created by VMTools. If that is not the case, the directory
has been created or modified by malicious code or user; just cancel the host
to guest DnD or CnP operation.
}
if (File_Exists(root)) {
- if (!DnDRootDirUsable(root) &&
- !DnDSetPermissionsOnRootDir(root)) {
+ if (!DnDRootDirUsable(root)) {
/*
- * The directory already exists and its permissions are wrong and
- * cannot be set, so there's not much we can do.
+ * The directory already exists and its permissions are wrong.
*/
+ Log("%s: The root dir is not usable.\n", __FUNCTION__);
return NULL;
}
} else {
}
if (File_Exists(root)) {
- if ( !DnDRootDirUsable(root)
- && !DnDSetPermissionsOnRootDir(root)) {
+ if (!DnDRootDirUsable(root)) {
/*
- * The directory already exists and its permissions are wrong and
- * cannot be set, so there's not much we can do.
+ * The directory already exists and its permissions are wrong.
*/
+ Log_Trivia("dnd: The root dir is not usable.\n");
return NULL;
}
} else {