Browse Source

Remove Sensitive RPC Data from Logs (#2520)

Fixes: #2424
pr-2587
Jeff Vandrew Jr 6 years ago
committed by Rusty Russell
parent
commit
1130100f67
  1. 10
      lightningd/bitcoind.c

10
lightningd/bitcoind.c

@ -117,8 +117,14 @@ static char *bcli_args(const tal_t *ctx, struct bitcoin_cli *bcli)
char *ret = tal_strdup(ctx, bcli->args[0]);
for (i = 1; bcli->args[i]; i++) {
ret = tal_strcat(ctx, take(ret), " ");
ret = tal_strcat(ctx, take(ret), bcli->args[i]);
ret = tal_strcat(ctx, take(ret), " ");
if (strstarts(bcli->args[i], "-rpcpassword")) {
ret = tal_strcat(ctx, take(ret), "-rpcpassword=...");
} else if (strstarts(bcli->args[i], "-rpcuser")) {
ret = tal_strcat(ctx, take(ret), "-rpcuser=...");
} else {
ret = tal_strcat(ctx, take(ret), bcli->args[i]);
}
}
return ret;
}

Loading…
Cancel
Save