* XXX Note that this assumes we only support dropping files, based on the
* definition of the macro that is used.
*/
+
nameStart = &uriList[*index];
if (strncmp(nameStart,
sizeof DND_URI_LIST_PRE_KDE - 1) == 0) {
nameStart += sizeof DND_URI_LIST_PRE_KDE - 1;
} else {
- Warning("DnDUriListGetFile: the URI list did not begin with %s or %s\n",
+ Warning("%s: the URI list did not begin with %s or %s\n", __func__,
DND_URI_LIST_PRE, DND_URI_LIST_PRE_KDE);
+
return NULL;
}
*index = curr - uriList;
*length = nameEnd - nameStart + 1;
+
return (char *)nameStart;
}
* Retrieve an allocated, unescaped name. This undoes the ' ' -> "%20"
* escaping as required by RFC 1630 for entries in a uri-list.
*/
+
unescapedName = Escape_Undo('%', file, fileLength, &unescapedLength);
if (!unescapedName) {
Warning("%s: error unescaping filename\n", __func__);
+
return NULL;
}
if (length) {
*length = unescapedLength;
}
+
return unescapedName;
}
if (VMBLOCK_CONTROL(blockFd, VMBLOCK_ADD_FILEBLOCK, blockPath) != 0) {
LOG(1, ("%s: Cannot add block on %s (%s)\n",
__func__, blockPath, strerror(errno)));
+
return FALSE;
}
if (VMBLOCK_CONTROL(blockFd, VMBLOCK_DEL_FILEBLOCK, blockedPath) != 0) {
Log("%s: Cannot delete block on %s (%s)\n",
__func__, blockedPath, strerror(errno));
+
return FALSE;
}
} else {
LOG(4, ("%s: Could not remove block on %s: "
"fd to vmblock no longer exists.\n", __func__, blockedPath));
}
+
return TRUE;
}
blockPath) != 0) {
LOG(1, ("%s: Cannot add block on %s (%s)\n",
__func__, blockPath, strerror(errno)));
+
return FALSE;
}
blockedPath) != 0) {
Log("%s: Cannot delete block on %s (%s)\n",
__func__, blockedPath, strerror(errno));
+
return FALSE;
}
} else {
if (size < 0) {
LOG(4, ("%s: read failed, error %s.\n",
__func__, strerror(errno)));
+
return FALSE;
}
if (size != sizeof(VMBLOCK_FUSE_READ_RESPONSE)) {
LOG(4, ("%s: Response too short (%"FMTSZ"d vs. %"FMTSZ"u).\n",
__func__, size, sizeof(VMBLOCK_FUSE_READ_RESPONSE)));
+
return FALSE;
}
sizeof(VMBLOCK_FUSE_READ_RESPONSE))) {
LOG(4, ("%s: Invalid response %.*s",
__func__, (int)sizeof(VMBLOCK_FUSE_READ_RESPONSE) - 1, buf));
+
return FALSE;
}
fp = OPEN_MNTFILE("r");
if (fp == NULL) {
LOG(1, ("%s: could not open mount file\n", __func__));
+
return -1;
}
* In the future we can publish the mount point in VMDB so that the UI
* can use it rather than enforcing the VMBLOCK_MOUNT_POINT check here.
*/
+
if (strcmp(MNTINFO_FSTYPE(mnt), vmbFsName) == 0 &&
strcmp(MNTINFO_MNTPT(mnt), vmbMntPoint) == 0) {
found = TRUE;
blkCtrl->RemoveBlock = DnD_RemoveBlockLegacy;
} else {
Log("%s: Can't determine block type.\n", __func__);
+
return FALSE;
}