summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2014-11-28treewide: introduce UID_INVALID (and friends) as macro for (uid_t) -1Lennart Poettering
2014-11-28mount: constify MountParametersZbigniew Jędrzejewski-Szmek
2014-11-28mount: deal with inotify queue overflowZbigniew Jędrzejewski-Szmek
Overflow is very unlikely, since we are watching a privileged directory, but could be triggered if thousands of mounts are suddently executed.
2014-11-28mount: create directory before adding watches on itZbigniew Jędrzejewski-Szmek
2014-11-28mount: be more careful about errors when parsing mtabZbigniew Jędrzejewski-Szmek
Fixup for 4a3a9ef610.
2014-11-28mount: simplify mount_needs_network checkZbigniew Jędrzejewski-Szmek
2014-11-28mount: check options as well as fstype for network mountsChris Leech
When creating a new mount unit after an event on /proc/self/mountinfo, check the mount options as well as the fstype to determine if this is a remote mount that requires network access.
2014-11-28mount: add remote-fs dependencies if needed after changeChris Leech
This is an attempt to add it the remote-fs dependencies to a mount unit if the options change, like when the utab options are picked up after mountinfo has already been processed. It just adds the remote-fs dependencies, leaving the local-fs ones in place. With this change I always get mount units with proper remote-fs dependencies when mounted with the _netdev option.
2014-11-28mount: monitor for utab changes with inotifyChris Leech
Parsing the mount table with libmount races against the mount command, which will handle the actual mounting before updating utab. This means the poll event on /proc/self/mountinfo can kick of a reparse in systemd before the utab information is available. This change adds in an additional event source using inotify to watch for changes to utab. It only watches for IN_MOVED_TO events, matching libmount behavior of always overwriting this file using rename(2). This does add a second pass through the mount table parsing when utab is updated.
2014-11-28mount: use libmount to enumerate /proc/self/mountinfoChris Leech
This lets libmount add in user options from /run/mount/utab, like _netdev which is needed to get proper ordering against remote-fs.target
2014-11-28treewide: another round of simplificationsMichal Schmidt
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
2014-11-28treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt
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.
2014-11-28core: fix return value in error path after sd_event_add_io() failureMichal Schmidt
sd_event_add_io() does not set errno, it returns negative errno. Noticed during log_*_errno conversions.
2014-11-28treewide: more log_*_errno + return simplificationsMichal Schmidt
2014-11-28treewide: simplify log_*_errno(r,...) immediately followed by "return r"Michal Schmidt
2014-11-28treewide: more log_*_errno() conversions, multiline callsMichal Schmidt
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.
2014-11-28treewide: more log_*_errno() conversionsMichal Schmidt
2014-11-28core: two more log_unit_*_errno() conversionsMichal Schmidt
2014-11-28core: convert log_unit_*() to log_unit_*_errno()Michal Schmidt
Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_unit_(debug|info|notice|warning|error|emergency)\(([^"]+), "(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_unit_\1_errno(\2, \5, "\3%m"\4);/'
2014-11-28core: add log_unit_*_errno() macrosMichal Schmidt
2014-11-28treewide: no need to negate errno for log_*_errno()Michal Schmidt
It corrrectly handles both positive and negative errno values.
2014-11-28treewide: auto-convert the simple cases to log_*_errno()Michal Schmidt
As a followup to 086891e5c1 "log: add an "error" parameter to all low-level logging calls and intrdouce log_error_errno() as log calls that take error numbers", use sed to convert the simple cases to use the new macros: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\("(.*)%s"(.*), strerror\(-([a-zA-Z_]+)\)\);/log_\1_errno(-\4, "\2%m"\3);/' Multi-line log_*() invocations are not covered. And we also should add log_unit_*_errno().
2014-11-28core: only override kdbus attach mask when running as PID 1Lennart Poettering
2014-11-28log: fix order of log_unit_struct() to match other logging callsLennart Poettering
Also, while we are at it, introduce some syntactic sugar for creating ERRNO= and MESSAGE= structured logging fields.
2014-11-27kmod-setup: simplify kernel command line parsingLennart Poettering
2014-11-27kdbus: set kernel attach mask before creating the first busLennart Poettering
2014-11-27selinux: log selinux log messages with LOG_AUTH facilityLennart Poettering
2014-11-27log: rearrange log function namingLennart Poettering
- Rename log_meta() → log_internal(), to follow naming scheme of most other log functions that are usually invoked through macros, but never directly. - Rename log_info_object() to log_object_info(), simply because the object should be before any other parameters, to follow OO-style programming style.
2014-11-27log: add an "error" parameter to all low-level logging calls and intrdouce ↵Lennart Poettering
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");
2014-11-27core: fix transaction destructiveness check once moreMichal Schmidt
The previous fix e0312f4db "core: fix check for transaction destructiveness" broke test-engine (noticed by Zbyszek). Apparently I had a wrong idea of the intended semantics of --fail. The manpage says the operation should fail if it "conflicts with a pending job (more specifically: causes an already pending start job to be reversed into a stop job or vice versa)". So let's check job_type_is_conflicting, instead of !is_superset. This makes both test-engine and TEST-03-JOBS pass again.
2014-11-26swap: restore support for nofailZbigniew Jędrzejewski-Szmek
systemd stops adding automatic dependencies on swap.target to swap units. If a dependency is required, it has to be added by unit configuration. fstab-generator did that already, except that now it is modified to create a Requires or Wants type dependency, depending on whether nofail is specified in /etc/fstab. This makes .swap units obey the nofail/noauto options more or less the same as .mount units. Documentation is extended to clarify that, and to make systemd.mount(5) and system.swap(5) more similar. The gist is not changed, because current behaviour actually matches existing documentation. https://bugs.freedesktop.org/show_bug.cgi?id=86488
2014-11-26manager: print fatal errors on the console tooZbigniew Jędrzejewski-Szmek
When booting in quiet mode, fatal messages would not be shown at all to the user. https://bugzilla.redhat.com/show_bug.cgi?id=1155468
2014-11-26manager: log some fatal errors at emergency levelZbigniew Jędrzejewski-Szmek
This adds a new log_emergency() function, which is equivalent to log_error() for non-PID-1, and logs at the highest priority for PID 1. Some messages which occur before freezing are converted to use it.
2014-11-26core: make sure we have enough information when doing selinux decisionsLennart Poettering
Let's ask for the security relevant bits in a race-free way, and augment the rest from /proc.
2014-11-26sd-bus: update peeking into receieved messages, with recent kernel change we ↵Lennart Poettering
need to FREE them after all
2014-11-26core: fix check for transaction destructivenessMichal Schmidt
When checking if the transaction is destructive, we need to check if the previously installed job is a superset of the new job (and hence the new job will fold into the installed one without changing it), not the other way around.
2014-11-26core: drop now-redundant special-casing of JOB_NOPMichal Schmidt
job_type_is_conflicting(X, JOB_NOP) correctly gives: false. job_type_allows_late_merge(JOB_NOP) && job_type_is_superset(X, JOB_NOP) correctly gives: true.
2014-11-26core: fix assertion failure in checking a transaction with a JOB_NOPMichal Schmidt
Several functions called from transaction_activate() need to correctly handle the case where a JOB_NOP job is being checked against a unit's pending job. The assumption that JOB_NOP never merges with other job types was correct, but since the job_type_is_*() functions are implemented using the merge lookup, they need to special-case JOB_NOP to avoid hitting assertion failures.
2014-11-26core: reindent mount/kmod tablesLennart Poettering
2014-11-25core: show log message about process triggering kdbus service activationLennart Poettering
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-23manager: only issue overmount warning when the check succeededZbigniew Jędrzejewski-Szmek
If for any reason the check failed (selinux?), we would still issue the warning. Check the return status.
2014-11-23manager: let manager_free() handle NULLsZbigniew Jędrzejewski-Szmek
This makes the calling code a bit simpler.
2014-11-23dbus: return non-zero return value in the case that prefix won't matchLukas Nykryn
strv_extend returns 0 in the case of success which means that else if (bus_track_deserialize_item(&m->deserialized_subscribed, l) == 0) log_warning("Unknown serialization item '%s'", l); will be printed when value is added correctly.
2014-11-21selinux-access: fix broken ternary operatorLukas Nykryn
it seems to be a typo introduced by ebcf1f97de4f6b1580ae55eb56b1a3939fe6b602 - _r = selinux_access_check(_b, _m, _u->source_path ?:_u->fragment_path, (permission), &_error); \ + ({ Unit *_unit = (unit); selinux_generic_access_check(bus,message, _unit->fragment_path ?: _unit->fragment_path, permission,error); })
2014-11-21build: avoid trailing whitespace in feature stringLennart Poettering
2014-11-20core: watchdog bus properties cannot be both writable and constantLennart Poettering
2014-11-17namespace: unchecked return value from librarySusant Sahani
fix: CID 1237553 (#1 of 6): Unchecked return value from library (CHECKED_RETURN CID 1237553 (#3 of 6): Unchecked return value from library (CHECKED_RETURN) CID 1237553 (#4 of 6): Unchecked return value from library (CHECKED_RETURN) CID 1237553 (#5 of 6): Unchecked return value from library (CHECKED_RETURN CID 1237553 (#6 of 6): Unchecked return value from library (CHECKED_RETURN)
2014-11-14kmod-setup: improve for "kdbus" word on the kernel cmdlineLennart Poettering
We really shouldn't check for words with "strstr()"...
2014-11-14kmod: move #ifdef checks for kmod-setup out of main.c into kmod-setup.cLennart Poettering