summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
AgeCommit message (Collapse)Author
2015-05-21util: introduce PERSONALITY_INVALID as macro for 0xffffffffLULennart Poettering
2015-05-16load-fragment: put quotes around iffy rvalueZbigniew Jędrzejewski-Szmek
2015-05-15socket-util: socket_address_parse() should not log errors on its ownLennart Poettering
Given that socket_address_parse() is mostly a "library" call it shouldn't log on its own, but leave that to its caller. This patch removes logging from the call in case IPv6 is not available but and IPv6 address shall be parsed. Instead a new call socket_address_parse_and_warn() is introduced which first invokes socket_address_parse() and then logs if necessary. This should fix "make check" on ipv6-less kernels: http://lists.freedesktop.org/archives/systemd-devel/2015-April/031385.html
2015-05-15core: Fix assertion with empty Exec*= pathsMartin Pitt
An Exec*= line with whitespace after modifiers, like ExecStart=- /bin/true is considered to have an empty command path. This is as specified, but causes systemd to crash with Assertion 'skip < l' failed at ../src/core/load-fragment.c:607, function config_parse_exec(). Aborting. Aborted (core dumped) Fix this by logging an error instead and ignoring the invalid line. Add corresponding test cases. Also add a test case for a completely empty value which resets the command list. https://launchpad.net/bugs/1454173
2015-05-11core: rename SystemdRunningAs to ManagerRunningAsLennart Poettering
It's primarily just a property of the Manager object after all, and we try to refer to PID 1 as "manager" instead of "systemd", hence let's to stick to this here too.
2015-05-05core: rework unit name validation and manipulation logicLennart Poettering
A variety of changes: - Make sure all our calls distuingish OOM from other errors if OOM is not the only error possible. - Be much stricter when parsing escaped paths, do not accept trailing or leading escaped slashes. - Change unit validation to take a bit mask for allowing plain names, instance names or template names or an combination thereof. - Refuse manipulating invalid unit name
2015-04-23core: fix parsing of mount flagsLennart Poettering
As reported my Maciej Wereski: http://lists.freedesktop.org/archives/systemd-devel/2015-February/028320.html
2015-04-10core: set_put never returns -EEXISTRonny Chevalier
When the value is already there it returns 0. Also add a test to ensure this
2015-04-08IndentationZbigniew Jędrzejewski-Szmek
2015-04-07util: rework cunescape(), improve error handlingLennart Poettering
Change cunescape() to return a normal error code, so that we can distuingish OOM errors from parse errors. This also adds a flags parameter to control whether "relaxed" or normal parsing shall be done. If set no parse failures are generated, and the only reason why cunescape() can fail is OOM.
2015-03-14core: remove left-over debug messageZbigniew Jędrzejewski-Szmek
2015-03-13tree-wide: there is no ENOTSUP on linuxDavid Herrmann
Replace ENOTSUP by EOPNOTSUPP as this is what linux actually uses.
2015-03-07core/load-fragment: safe_close() protects errnoZbigniew Jędrzejewski-Szmek
2015-02-23remove unused includesThomas Hindoe Paaboel Andersen
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.
2015-02-01config_parse_set_status: put signals in the correct setMichael Olbrich
This was broken when the code was rearranged in "1e2fd62d70ff core/load-fragment.c: correct argument sign and split up long lines"
2015-01-26treewide: fix multiple typosTorstein Husebø
2015-01-20util: make http url validity checks more generic, and move them to util.cLennart Poettering
2015-01-11core/load-fragment: avoid allocating 0 bytes when given an invalid commandZbigniew Jędrzejewski-Szmek
With a command line like "@/something" we would allocate an array with 0 elements. Avoid that, and add a test too.
2015-01-07conf-parse: don't accept invalid bus names as BusName= arguments in service ↵Lennart Poettering
units
2014-12-18load-fragment: allow quoting in command name and document allowed escapesZbigniew Jędrzejewski-Szmek
The handling of the command name and other arguments is unified. This simplifies things and should make them more predictable for users. Incidentally, this makes ExecStart handling match the .desktop file specification, apart for the requirment for an absolute path. https://bugs.freedesktop.org/show_bug.cgi?id=86171
2014-12-18tree-wide: make condition_free_list return NULLZbigniew Jędrzejewski-Szmek
2014-12-18core: make exec_command_free_list return NULLZbigniew Jędrzejewski-Szmek
2014-12-17load-fragment: properly unescape \;tomsod-m ya ru
https://bugs.freedesktop.org/show_bug.cgi?id=87393
2014-12-12wrap a few *_FOREACH macros in curly bracesThomas Hindoe Paaboel Andersen
cppcheck would give up with "syntax error" without them. This led to reports of syntax errors in unrelated locations and potentially hid other errors
2014-12-12util: when using basename() for creating temporary files, verify the ↵Lennart Poettering
resulting name is actually valid Also, rename filename_is_safe() to filename_is_valid(), since it actually does a full validation for what the kernel will accept as file name, it's not just a heuristic.
2014-12-10util: introduce our own gperf based capability listLennart Poettering
This way, we can ensure we have a more complete, up-to-date list of capabilities around, always.
2014-12-08load-fragment: remove wrong ifdef guardZbigniew Jędrzejewski-Szmek
config_parse_warn_compat is now always used for removed options. https://bugs.freedesktop.org/show_bug.cgi?id=87125
2014-11-30core: warn and ignore SysVStartPriority=Zbigniew Jędrzejewski-Szmek
Option was being parsed but not used for anything.
2014-11-30When warning about unsupported options, be more detailedZbigniew Jędrzejewski-Szmek
2014-11-30core: remove unused variablesRonny Chevalier
2014-11-24smack: introduce new SmackProcessLabel optionWaLyong Cho
In service file, if the file has some of special SMACK label in ExecStart= and systemd has no permission for the special SMACK label then permission error will occurred. To resolve this, systemd should be able to set its SMACK label to something accessible of ExecStart=. So introduce new SmackProcessLabel. If label is specified with SmackProcessLabel= then the child systemd will set its label to that. To successfully execute the ExecStart=, accessible label should be specified with SmackProcessLabel=. Additionally, by SMACK policy, if the file in ExecStart= has no SMACK64EXEC then the executed process will have given label by SmackProcessLabel=. But if the file has SMACK64EXEC then the SMACK64EXEC label will be overridden. [zj: reword man page]
2014-11-06core: introduce the concept of AssertXYZ= similar to ConditionXYZ=, but ↵Lennart Poettering
fatal for a start job if not met
2014-10-24calendar: make freeing a calendar spec object deal fine with NULLLennart Poettering
In order to make object destruction easier (in particular in combination with _cleanup_) we usually make destructors deal with NULL objects as NOPs. Change the calendar spec destructor to follow the same scheme.
2014-10-12ModernizationZbigniew Jędrzejewski-Szmek
2014-09-15hashmap: introduce hash_ops to make struct Hashmap smallerMichal Schmidt
It is redundant to store 'hash' and 'compare' function pointers in struct Hashmap separately. The functions always comprise a pair. Store a single pointer to struct hash_ops instead. systemd keeps hundreds of hashmaps, so this saves a little bit of memory.
2014-09-13core: use correct function to free CalendarSpecDave Reisner
2014-09-13core: fix a potential mem leakThomas Hindoe Paaboel Andersen
Found with Coverity. Fixes: CID#996438
2014-09-08bus: parse BusPolicy directive in service filesDaniel Mack
Add a new directive called BusPolicy to define custom endpoint policies. If one such directive is given, an endpoint object in the service's ExecContext is created and the given policy is added to it.
2014-09-08bus: factor out bus policy itemsDaniel Mack
In order to re-use the policy definitions, factor them out into their own files.
2014-07-31core/load-fragment.c: correct argument sign and split up long linesZbigniew Jędrzejewski-Szmek
With everything on one line they are just harder to read.
2014-07-31Properly report invalid quoted stringsZbigniew Jędrzejewski-Szmek
$ 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
2014-07-31Reject invalid quoted stringsZbigniew Jędrzejewski-Szmek
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
2014-07-29time-util: add and use USEC/NSEC_INFINIYKay Sievers
2014-07-16Let config_parse open file where applicableZbigniew Jędrzejewski-Szmek
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.
2014-07-15Constify ConfigTableItem tablesZbigniew Jędrzejewski-Szmek
2014-07-03exit-status: rename ExitStatusSet's "code" field to "status"Lennart Poettering
We should follow the naming scheme waitid() uses, not come up with our own reversed one...
2014-06-05kdbus: when uploading bus name policy, resolve users/groups out-of-processLennart Poettering
It's not safe invoking NSS from PID 1, hence fork off worker processes that upload the policy into the kernel for busnames.
2014-06-04core: rename ReadOnlySystem= to ProtectSystem= and add a third value for ↵Lennart Poettering
also mounting /etc read-only Also, rename ProtectedHome= to ProtectHome=, to simplify things a bit. With this in place we now have two neat options ProtectSystem= and ProtectHome= for protecting the OS itself (and optionally its configuration), and for protecting the user's data.
2014-06-04socket: add new Symlinks= option for socket unitsLennart Poettering
With Symlinks= we can manage one or more symlinks to AF_UNIX or FIFO nodes in the file system, with the same lifecycle as the socket itself. This has two benefits: first, this allows us to remove /dev/log and /dev/initctl from /dev, thus leaving only symlinks, device nodes and directories in the /dev tree. More importantly however, this allows us to move /dev/log out of /dev, while still making it accessible there, so that PrivateDevices= can provide /dev/log too.
2014-06-03core: add new ReadOnlySystem= and ProtectedHome= settings for service unitsLennart Poettering
ReadOnlySystem= uses fs namespaces to mount /usr and /boot read-only for a service. ProtectedHome= uses fs namespaces to mount /home and /run/user inaccessible or read-only for a service. This patch also enables these settings for all our long-running services. Together they should be good building block for a minimal service sandbox, removing the ability for services to modify the operating system or access the user's private data.