summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
Commit message (Collapse)AuthorAge
...
* Prep v232: Mask new functions that are unneeded by elogindSven Eden2017-07-05
|
* shared/conf-parser: add config_parse_many which takes strv with dirsZbigniew Jędrzejewski-Szmek2017-07-05
| | | | This way we don't have to create a nulstr just to unpack it in a moment.
* tree-wide: rename config_parse_many to …_nulstrZbigniew Jędrzejewski-Szmek2017-07-05
| | | | In preparation for adding a version which takes a strv.
* networkd: add options to bridge (#4051)Tobias Jungel2017-07-05
| | | | | This patch allows to configure AgeingTimeSec, Priority and DefaultPVID for bridge interfaces.
* Use "return log_error_errno" in more places"Zbigniew Jędrzejewski-Szmek2017-06-16
|
* conf-parser: minor coding style improvementsLennart Poettering2017-06-16
|
* Prep v230: Apply missing upstream fixes and updates (7/8) src/shared.Sven Eden2017-06-16
|
* conf-parser: Set EXTRACT_RETAIN_ESCAPE when extracting words (#2917)Dan Nicholson2017-06-16
| | | | | | | | | | | | | | | | | | | | | | If you reference another unit with an escaped name, the escaped characters should remain in the extracted word. This used to work correctly prior to commit 34f253f0. The problem can be seen when units with escaped names are referenced. $ cat "/usr/lib/elogind/system/dev-disk-by\x2dlabel-eos\x2dswap.swap" [Swap] What=/dev/disk/by-label/eos-swap [Install] WantedBy=dev-disk-by\x2dlabel-eos\x2dswap.device $ systemctl enable "dev-disk-by\x2dlabel-eos\x2dswap.swap" Created symlink /etc/elogind/system/dev-disk-byx2dlabel-eosx2dswap.device.wants/dev-disk-by\x2dlabel-eos\x2dswap.swap, pointing to /usr/lib/elogind/system/dev-disk-by\x2dlabel-eos\x2dswap.swap. The wants directory should be created with the x2ds escaped with \.
* Ignore BOM in config filesZbigniew Jędrzejewski-Szmek2017-06-16
| | | | | | Fixes #2823. Also remove unnecessary feof check.
* Prep v229: Remove remaining emacs settings [5/6] src/sharedSven Eden2017-05-17
|
* shared: include what we useThomas Hindoe Paaboel Andersen2017-05-17
| | | | | The next step of a general cleanup of our includes. This one mostly adds missing includes but there are a few removals as well.
* Prep v228: Condense elogind source masks (5/5)Sven Eden2017-04-26
|
* Prep v228: Substitute declaration masks (4/4)Sven Eden2017-04-26
|
* Prep v228: Add remaining updates from upstream (3/3)Sven Eden2017-04-26
| | | | | Apply remaining fixes and the performed move of utility functions into their own foo-util.[hc] files on the rest of elogind.
* conf-parser: use extract_first_wordDavid Reynolds2017-04-26
|
* [5/5] Apply missing fixes from upstreamSven Eden2017-03-29
|
* Cleaned up more unneeded functions and types in:Sven Eden2017-03-14
| | | | | | | | | | | | | | | | | | | | - src/basic/ioprio.h - removed - src/basic/ring.h - removed - src/basic/capability.[hc] - cleaned - src/basic/cgroup-util.[hc] - cleaned - src/basic/hostname-util.[hc] - cleaned - src/basic/path-util.[hc] - cleaned - src/basic/socket-util.h - cleaned - src/basic/strv.[hc] - cleaned - src/basic/time-util.[hc] - cleaned - src/basic/unit-name.[hc] - cleaned - src/basic/util.[hc] - cleaned - src/libelogind/sd-bus/bus-introspect.c - cleaned - src/login/loginctl.c - cleaned - src/login/logind-dbus.c - cleaned - src/login/logind.h - cleaned - src/shared/conf-parser.[hc] - cleaned
* Prep v226: Mask all unneeded functionsSven Eden2017-03-14
|
* Prep v226: Apply missing fixes and changes to src/sharedSven Eden2017-03-14
|
* Prep v225: Applying various fixes and changes to src/shared that got lost ↵Sven Eden2017-03-14
| | | | during git am transfer.
* Prep v221: Update and clean up build system to sync with upstreamSven Eden2017-03-14
| | | | | | | | | | | | | | This commit replays the moving around of source files that have been done between systemd-219 and systemd-221. Further the Makefile.am is synchronized with the upstream version and then "re-cleaned". A lot of functions, that are not used anywhere in elogind have been coated into #if 0/#endif directives to further shorten the list of dependencies. All unneeded files have been removed.
* conf-parser: parsing error logs should show a type not a vartypeRonny Chevalier2017-03-14
| | | | | | | | Instead of this: [filename:1] Failed to parse nsec_t value, ignoring: garbage we show this: [filename:1] Failed to parse nsec value, ignoring: garbage
* log: move log_syntax() into src/shared/log.c, and make it more similar to ↵Lennart Poettering2017-03-14
| | | | the other log functions
* util: unify how we parse mode_t stringsLennart Poettering2017-03-14
|
* remove unused includesThomas Hindoe Paaboel Andersen2015-02-23
| | | | | | This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
* networkd: make IP forwarding for IPv4 and IPv6 individually configurableLennart Poettering2015-01-13
|
* conf-parse: make syntax logging functions behave more like other log functonsLennart Poettering2015-01-07
| | | | | | | In particular, don't patch the error number to EINVAL if 0, and don't negate it. (Also, add do {} while (false) around multi-line macro)
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-28
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: more log_*_errno() conversions, multiline callsMichal Schmidt2014-11-28
| | | | | | | | | | | | Basically: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/log_(debug|info|notice|warning|error|emergency)\("([^"]*)%s"([^;]*),\s*strerror\(-?([->a-zA-Z_]+)\)\);/log_\1_errno(\4, "\2%m"\3);/gms;print;' \ $f; done Plus manual indentation fixups.
* log: fix order of log_unit_struct() to match other logging callsLennart Poettering2014-11-28
| | | | | Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
* log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering2014-11-27
| | | | | | | | | | | | | | | | | | | | log_error_errno() as log calls that take error numbers This change has two benefits: - The format string %m will now resolve to the specified error (or to errno if the specified error is 0. This allows getting rid of a ton of strerror() invocations, a function that is not thread-safe. - The specified error can be passed to the journal in the ERRNO= field. Now of course, we just need somebody to convert all cases of this: log_error("Something happened: %s", strerror(-r)); into thus: log_error_errno(-r, "Something happened: %m");
* logind: Support logind.conf.d directories in the usual search pathsJosh Triplett2014-11-26
| | | | | | | | | | | This makes it possible to drop in logind configuration snippets from a package or other configuration management mechanism. Add documentation to the header of /etc/logind.conf pointing the user at /etc/logind.conf.d/*.conf. Introduce a new helper, conf_parse_many, to parse configuration files in a search path.
* config-parser: fix mem leakThomas Hindoe Paaboel Andersen2014-08-31
|
* Properly report invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-31
| | | | | | | | $ systemd-analyze verify trailing-g.service [./trailing-g.service:2] Trailing garbage, ignoring. trailing-g.service lacks ExecStart setting. Refusing. Error: org.freedesktop.systemd1.LoadFailed: Unit trailing-g.service failed to load: Invalid argument. Failed to create trailing-g.service/start: Invalid argument
* Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek2014-07-31
| | | | | | | | | | | | | | | | | | | | | | String which ended in an unfinished quote were accepted, potentially with bad memory accesses. Reject anything which ends in a unfished quote, or contains non-whitespace characters right after the closing quote. _FOREACH_WORD now returns the invalid character in *state. But this return value is not checked anywhere yet. Also, make 'word' and 'state' variables const pointers, and rename 'w' to 'word' in various places. Things are easier to read if the same name is used consistently. mbiebl_> am I correct that something like this doesn't work mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-passwd "Unlock EncFS"' mbiebl_> systemd seems to strip of the quotes mbiebl_> systemctl status shows mbiebl_> ExecStart=/usr/bin/encfs --extpass='/bin/systemd-ask-password Unlock EncFS $RootDir $MountPoint mbiebl_> which is pretty weird
* Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek2014-07-16
| | | | | | | | Special care is needed so that we get an error message if the file failed to parse, but not when it is missing. To avoid duplicating the same error check in every caller, add an additional 'warn' boolean to tell config_parse whether a message should be issued. This makes things both shorter and more robust wrt. to error reporting.
* Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek2014-07-15
|
* Do not unescape unit names in [Install] sectionMichal Sekletar2014-05-26
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=49316
* conf-parser: never consider it an error if we cannot load a drop-in file ↵Lennart Poettering2014-05-22
| | | | | | because it is missing After all, we want to be able to boot with /etc empty one day...
* conf-parser: silently ignore sections starting with "X-"Michael Marineau2014-05-17
| | | | | This allows external tools to keep additional unit information in a separate section without scaring users with a big warning.
* Do not print invalid UTF-8 in error messagesZbigniew Jędrzejewski-Szmek2014-03-04
| | | | | Inexplicably, 550a40ec ('core: do not print invalid utf-8 in error messages') only fixed two paths. Convert all of them now.
* Introduce strv_consume which takes ownershipZbigniew Jędrzejewski-Szmek2014-03-04
| | | | This mirrors set_consume and makes the common use a bit nicer.
* conf-parser: minor optimization in config_parse_string()Lennart Poettering2014-03-03
|
* conf-parser: drop special casing in config_parse_path()Lennart Poettering2014-03-03
| | | | | | The code checked for two lvalues that aren't even using config_parse_path(), so let's drop these checks and make the function completely generic again.
* conf-parser: config_parse_path_strv() is not generic, so let's move it into ↵Lennart Poettering2014-03-03
| | | | | | | load-fragment.c The parse code actually checked for specific lvalue names, which is really wrong for supposedly generic parsers...
* core: move config_parse_set_status() into load-fragment.cLennart Poettering2014-03-03
| | | | | Let's keep specific config parsers close to where they are needed. Only the really generic ones should be defined in conf-parser.[ch].
* core: move ShowStatus type into the coreLennart Poettering2014-03-03
| | | | | Let's make the scope of the show-status stuff a bit smaller, and make it private to the core, rather than shared API in shared/.
* conf-parse: rename config_parse_level() to config_parse_log_level()Lennart Poettering2014-03-03
| | | | | "level" is a bit too generic, let's clarify what kind of level we are referring to here.
* core: clean up some confusing regarding SI decimal and IEC binary suffixes ↵Lennart Poettering2014-02-23
| | | | | | | | | | | for sizes According to Wikipedia it is customary to specify hardware metrics and transfer speeds to the basis 1000 (SI decimal), while software metrics and physical volatile memory (RAM) sizes to the basis 1024 (IEC binary). So far we specified everything in IEC, let's fix that and be more true to what's otherwise customary. Since we don't want to parse "Mi" instead of "M" we document each time what the context used is.
* man: don't document ".include" in configuration files anymore as first step ↵Lennart Poettering2014-02-21
| | | | to deprecate them one day