summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
24fe021)
This allows external tools to keep additional unit information in a
separate section without scaring users with a big warning.
bool allow_include,
char **section,
unsigned *section_line,
bool allow_include,
char **section,
unsigned *section_line,
char *l,
void *userdata) {
char *l,
void *userdata) {
if (sections && !nulstr_contains(sections, n)) {
if (sections && !nulstr_contains(sections, n)) {
+ if (!relaxed && !startswith(n, "X-"))
log_syntax(unit, LOG_WARNING, filename, line, EINVAL,
"Unknown section '%s'. Ignoring.", n);
log_syntax(unit, LOG_WARNING, filename, line, EINVAL,
"Unknown section '%s'. Ignoring.", n);
free(*section);
*section = NULL;
*section_line = 0;
free(*section);
*section = NULL;
*section_line = 0;
+ *section_ignored = true;
} else {
free(*section);
*section = n;
*section_line = line;
} else {
free(*section);
*section = n;
*section_line = line;
+ *section_ignored = false;
if (sections && !*section) {
if (sections && !*section) {
+ if (!relaxed && !*section_ignored)
log_syntax(unit, LOG_WARNING, filename, line, EINVAL,
"Assignment outside of section. Ignoring.");
log_syntax(unit, LOG_WARNING, filename, line, EINVAL,
"Assignment outside of section. Ignoring.");
_cleanup_free_ char *section = NULL, *continuation = NULL;
_cleanup_fclose_ FILE *ours = NULL;
unsigned line = 0, section_line = 0;
_cleanup_free_ char *section = NULL, *continuation = NULL;
_cleanup_fclose_ FILE *ours = NULL;
unsigned line = 0, section_line = 0;
+ bool section_ignored = false;
allow_include,
§ion,
§ion_line,
allow_include,
§ion,
§ion_line,