Use heredoc to write ldflags to temp file. This allows
passwords containing # (hash) characters to be embedded correctly.
Known limitation: Passwords with both spaces AND quotes together
may still fail. Most other special characters work fine.
The build script was using complex escaping mechanisms that were causing
linker failures with certain passwords.
Simplified to use the same approach as other Nextcloud tools:
- No temp files
- No escaping functions
- Direct variable substitution in ldflags
This matches the pattern used for nextcloud-client, nextcloud-contacts,
and nextcloud-calendar.
Known limitation: Passwords containing spaces, double quotes,
or $ characters may fail to build. Users with such passwords
should use a simpler password or manually modify the build command.
The build was failing with Go linker errors because special characters in
user-provided credentials (especially passwords) were not being properly escaped.
Added escape_ldflag() function to handle:
- Backslashes
- Double quotes
- Spaces
This ensures that any user input (including passwords with special characters)
is safely passed to Go's linker without breaking the build command.