MCPcopy Create free account
hub / github.com/ElementsProject/lightning / param_csv_filename

Function param_csv_filename

plugins/bkpr/bookkeeper.c:473–492  ·  view source on GitHub ↗

The CSV is written in our (network) directory, next to the node's own * files, so only allow a plain *.csv filename there: no directory, no * hidden name, nothing which could name one of those files. */

Source from the content-addressed store, hash-verified

471 * files, so only allow a plain *.csv filename there: no directory, no
472 * hidden name, nothing which could name one of those files. */
473static struct command_result *param_csv_filename(struct command *cmd,
474 const char *name,
475 const char *buffer,
476 const jsmntok_t *tok,
477 const char **filename)
478{
479 struct command_result *ret;
480 const char *f;
481
482 ret = param_string(cmd, name, buffer, tok, &f);
483 if (ret)
484 return ret;
485
486 if (strchr(f, '/') || f[0] == '.' || !strends(f, ".csv"))
487 return command_fail_badparam(cmd, name, buffer, tok,
488 "must be a filename ending in .csv,"
489 " without a directory");
490 *filename = f;
491 return NULL;
492}
493
494static struct command_result *json_dump_income(struct command *cmd,
495 const char *buf,

Callers

nothing calls this directly

Calls 3

param_stringFunction · 0.85
strendsFunction · 0.85
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected