diff options
| author | jvoisin | 2017-11-06 14:24:24 +0100 |
|---|---|---|
| committer | blotus | 2017-11-06 14:24:24 +0100 |
| commit | 8070f622122344ae52b55c3f80e43a1733ae59e2 (patch) | |
| tree | c117f5a2a27efb04a4161c2809b26641a2fec0e4 /src/sp_config_keywords.c | |
| parent | 27876d63eecbac187921dcf9e8ab2b3341302c05 (diff) | |
53 absolute path (#62)
* Add error for relative path
Diffstat (limited to 'src/sp_config_keywords.c')
| -rw-r--r-- | src/sp_config_keywords.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index b1b22b5..34b855a 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -197,7 +197,7 @@ int parse_disabled_functions(char *line) { | |||
| 197 | MUTUALLY_EXCLUSIVE(df->ret, df->r_ret, "r_ret", "ret"); | 197 | MUTUALLY_EXCLUSIVE(df->ret, df->r_ret, "r_ret", "ret"); |
| 198 | #undef MUTUALLY_EXCLUSIVE | 198 | #undef MUTUALLY_EXCLUSIVE |
| 199 | 199 | ||
| 200 | if (1 < ((df->r_param?1:0) + (df->param?1:0) + ((-1 != df->pos)?1:0))) { | 200 | if (1 < ((df->r_param?1:0) + (df->param?1:0) + ((-1 != df->pos)?1:0))) { |
| 201 | sp_log_err("config", | 201 | sp_log_err("config", |
| 202 | "Invalid configuration line: 'sp.disabled_functions%s':" | 202 | "Invalid configuration line: 'sp.disabled_functions%s':" |
| 203 | "'.r_param', '.param' and '.pos' are mutually exclusive on line %zu.", | 203 | "'.r_param', '.param' and '.pos' are mutually exclusive on line %zu.", |
| @@ -215,6 +215,12 @@ int parse_disabled_functions(char *line) { | |||
| 215 | " must take a function name on line %zu.", | 215 | " must take a function name on line %zu.", |
| 216 | line, sp_line_no); | 216 | line, sp_line_no); |
| 217 | return -1; | 217 | return -1; |
| 218 | } else if (df->filename && *df->filename != '/') { | ||
| 219 | sp_log_err("config", | ||
| 220 | "Invalid configuration line: 'sp.disabled_functions%s':" | ||
| 221 | "'.filename' must be an absolute path on line %zu.", | ||
| 222 | line, sp_line_no); | ||
| 223 | return -1; | ||
| 218 | } else if (!(allow ^ drop)) { | 224 | } else if (!(allow ^ drop)) { |
| 219 | sp_log_err("config", | 225 | sp_log_err("config", |
| 220 | "Invalid configuration line: 'sp.disabled_functions%s': The " | 226 | "Invalid configuration line: 'sp.disabled_functions%s': The " |
| @@ -244,7 +250,6 @@ int parse_disabled_functions(char *line) { | |||
| 244 | return -1; | 250 | return -1; |
| 245 | } | 251 | } |
| 246 | } | 252 | } |
| 247 | |||
| 248 | df->allow = allow; | 253 | df->allow = allow; |
| 249 | 254 | ||
| 250 | if (df->function) { | 255 | if (df->function) { |
