Skip to content

Commit 66342ec

Browse files
Impa10rclaude
andcommitted
Fix base64-encoded passwords truncated at "=" character
Use strings.SplitN(..., 2) instead of strings.Split to split only on the first "=" in config key-value pairs, preserving any "=" in the value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ac1f39c commit 66342ec

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 5.0.4
44

55
- Bypass Tor proxy for LAN calls to bitcoind
6+
- Fix base64-encoded passwords truncated at "=" character
67

78
## 5.0.3
89

cmd/psweb/config/cln.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func loadDefaults(home, dataDir, network string) {
5353
// ignore commented out lines
5454
continue
5555
}
56-
if parts := strings.Split(l, "="); len(parts) > 1 {
56+
if parts := strings.SplitN(l, "=", 2); len(parts) == 2 {
5757
if parts[0] == "wallet" {
5858
// ignore inline comments
5959
value := strings.TrimSpace(strings.Split(parts[1], "#")[0])
@@ -240,7 +240,7 @@ func GetPeerswapCLNSetting(section, searchVariable string) string {
240240
// end of section reached
241241
break
242242
}
243-
if parts := strings.Split(line, "="); len(parts) > 1 {
243+
if parts := strings.SplitN(line, "=", 2); len(parts) == 2 {
244244
if parts[0] == searchVariable {
245245
// ignore inline comments
246246
value := strings.TrimSpace(strings.Split(parts[1], "#")[0])

cmd/psweb/config/lnd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func getConfSetting(searchVariable, filePath string) string {
211211

212212
lines := strings.Split(string(content), "\n")
213213
for _, line := range lines {
214-
if parts := strings.Split(line, "="); len(parts) > 1 {
214+
if parts := strings.SplitN(line, "=", 2); len(parts) == 2 {
215215
if parts[0] == searchVariable {
216216
// ignore inline comments
217217
return strings.TrimSpace(strings.Split(parts[1], "#")[0])

0 commit comments

Comments
 (0)