Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
guacamole-server patches
These patches are applied to the apache/guacamole-server source tree before building guacd. They fix compilation and runtime issues when building against FreeRDP 3.x on Debian 13 (Trixie).
001-freerdp3-debian13.patch
Problem: guacamole-server 1.6.1 fails to compile against FreeRDP 3.15+ (as shipped in Debian 13) due to:
-
Autoconf feature detection failure — FreeRDP 3.15 marks
codecs_free()as deprecated. The-Werrorflag inconfigure.accauses all compile-time feature-detection tests to fail, cascading into 10+ undefined macros and wrong#ifdefcode paths. -
Deprecated function pointer API — FreeRDP 3.x deprecates direct struct member access for
->input->KeyboardEvent(),->input->MouseEvent(), etc. behindWITH_FREERDP_DEPRECATED. The safe replacement functions arefreerdp_input_send_keyboard_event(),freerdp_input_send_mouse_event(), etc. -
NULL pointer dereference in display channel — FreeRDP 3.x fires PubSub
ChannelConnectedevents beforeguac_rdp_dispis allocated, causing a segfault when the callback writes todisp->requested_width(offset 0x18 of NULL).
Files patched:
| File | Fix |
|---|---|
configure.ac |
Add -Wno-error=deprecated-declarations to both FreeRDP 2.x and 3.x PKG_CHECK_MODULES blocks so autoconf feature detection works |
src/protocols/rdp/Makefile.am |
Add -Wno-error=deprecated-declarations to all three CFLAGS targets |
src/protocols/rdp/tests/Makefile.am |
Same for test CFLAGS |
src/protocols/rdp/keyboard.c |
Replace ->input->KeyboardEvent(), ->input->UnicodeKeyboardEvent(), ->input->SynchronizeEvent() with safe API functions |
src/protocols/rdp/input-queue.c |
Replace all ->input->MouseEvent() calls with freerdp_input_send_mouse_event() |
src/protocols/rdp/channels/disp.c |
Add NULL guards in guac_rdp_disp_channel_connected() and guac_rdp_disp_channel_disconnected() |
Applying patches
Patches are applied automatically by all build scripts (build-deb.sh, build-rpm.sh, install.sh, dev.sh, Dockerfile). To apply manually:
cd ../guacamole-server
git apply ../rustguac/patches/001-freerdp3-debian13.patch
To check if patches are already applied:
cd ../guacamole-server
git apply --check ../rustguac/patches/001-freerdp3-debian13.patch 2>&1 || echo "Already applied or conflict"
Adding new patches
- Make changes in the
../guacamole-serverworking tree - Export:
cd ../guacamole-server && git diff > ../rustguac/patches/NNN-description.patch - Patches are applied in numeric order by the build scripts