From 270840801ae194be578c7657dec87447b02b1d85 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sat, 8 Nov 2025 07:52:19 +0000 Subject: [PATCH] Fix setup script fmt.Sprintf argument misalignment (related to #663) The setup script template had 44 %s placeholders, but the fmt.Sprintf call arguments were out of order starting at position 15. This caused the Pulse URL to be inserted where the token name should be, resulting in errors like: Token ID: pulse-monitor@pam!http://192.168.0.44:7655 Instead of the correct format: Token ID: pulse-monitor@pam!pulse-192-168-0-44-1762545916 Changes: - Escaped %s in printf helper (line 3949) so it doesn't consume arguments - Reordered fmt.Sprintf arguments (lines 4727-4732) to match template order - Removed 2 extra pulseURL arguments that were causing the shift This fix ensures all 44 placeholders receive the correct values in order. --- internal/api/config_handlers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/api/config_handlers.go b/internal/api/config_handlers.go index 08d13ce..403ef84 100644 --- a/internal/api/config_handlers.go +++ b/internal/api/config_handlers.go @@ -3946,7 +3946,7 @@ version_ge() { return $? fi if command -v sort >/dev/null 2>&1; then - [ "$(printf '%s\n%s\n' "$1" "$2" | sort -V | tail -n1)" = "$1" ] + [ "$(printf '%%s\n%%s\n' "$1" "$2" | sort -V | tail -n1)" = "$1" ] return $? fi [ "$1" = "$2" ] @@ -4724,11 +4724,12 @@ fi `, serverName, time.Now().Format("2006-01-02 15:04:05"), tokenName, pulseURL, pulseURL, pulseURL, serverHost, pulseURL, pulseURL, serverHost, pulseURL, tokenName, pulseURL, pulseURL, + pulseURL, pulseURL, pulseIP, tokenName, tokenName, tokenName, tokenName, tokenName, tokenName, authToken, pulseURL, serverHost, tokenName, tokenName, storagePerms, sshKeys.ProxyPublicKey, sshKeys.SensorsPublicKey, minProxyReadyVersion, - pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, authToken, pulseURL, authToken, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, tokenName) + pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, pulseURL, authToken, pulseURL, authToken, pulseURL, pulseURL, tokenName) } else { // PBS script = fmt.Sprintf(`#!/bin/bash