Hi,
I have built libguac and libguac-client-rdp on Windows using MSYS64 MINGW64
with the help of
https://github.com/jmuehlner/guacamole-server/tree/refs/heads/GUACAMOLE-1841-mingw-build-clean
.
Yes, it isn't officially supported but I had to try out building on Windows
once.
Everything is working well, RDP sessions are proper, drive redirection and
clipboard are working fine.
But I am facing an issue when performing DELETE action on the server on the
redirected drive, UPLOAD and DOWNLOAD are working perfectly.
[image: image.png]
The error writing file occurs when SQL tries to save a file - it basically
first writes a few temporary files as an atomic write practice then
attempts to delete them and merge them to a single final file, but it fails
at the DELETE step, hence the overall operation fails.
[image: image.png]
>From what I was able to understand, it is failing at
unlink(file->real_path),
int guac_rdp_fs_delete(guac_rdp_fs* fs, int file_id) {
/* Get file */
guac_rdp_fs_file* file = guac_rdp_fs_get_file(fs, file_id);
if (file == NULL) {
guac_client_log(fs->client, GUAC_LOG_DEBUG,
"%s: Delete of bad file_id: %i", __func__, file_id);
return GUAC_RDP_FS_EINVAL;
}
/* If directory, attempt removal */
if (file->attributes & FILE_ATTRIBUTE_DIRECTORY) {
if (rmdir(file->real_path)) {
guac_client_log(fs->client, GUAC_LOG_DEBUG,
"%s: rmdir() failed: \"%s\"", __func__, file->real_path
);
return guac_rdp_fs_get_errorcode(errno);
}
}
/* Otherwise, attempt deletion */
else if (unlink(file->real_path)) {
guac_client_log(fs->client, GUAC_LOG_DEBUG,
"%s: unlink() failed: \"%s\"", __func__, file->real_path);
return guac_rdp_fs_get_errorcode(errno);
}
return 0;
}
Can you please guide me if I should try to fix the unlink function or if
this error is completely something else not in my control?
I have tried all possible ways, guacd is running under the user that has
complete control to the drive (that is redirected) on the server where it
is running but it still throws that error.
Since the DELETE functionality works properly on Linux and normal mstsc, it
most probably should be a bug in my code, if anyone can point that area
out, it'll be really helpful.
Please let me know if any more info is required.
- Palaash