summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-09-19socket: introduce SELinuxContextFromNet optionMichal Sekletar
This makes possible to spawn service instances triggered by socket with MLS/MCS SELinux labels which are created based on information provided by connected peer. Implementation of label_get_child_mls_label derived from xinetd. Reviewed-by: Paul Moore <pmoore@redhat.com>
2014-09-19shared: wtmp-utmp - don't clear store_wtmp in utmp_put_dead_process()Tom Gundersen
Also modernize a few other things and add comments to explain CID #1237503 and CID #1237504.
2014-09-19test: warn if we could not parse the loop count argumentThomas Hindoe Paaboel Andersen
Found by coverity. Fixes: CID#1237512
2014-09-19shared/sparse-endian.h: add missing byteswap.h includeEmil Renner Berthing
2014-09-19shared/label.h: add missing stdio.h includeEmil Renner Berthing
2014-09-19pty: include linux/ioctl.h for TIOCSIGDavid Herrmann
TIOCSIG is linux specific, so include the linux ioctl header to make sure it's defined. We currently rely on some rather non-obvious recursive includes. Make sure its always defined regardless of the system headers.
2014-09-19nss: remove dead codeThomas Hindoe Paaboel Andersen
c > 0 is already guaranteed from earlier checks. We go from ms = ALIGN(l+1) + sizeof(char*) + (c > 0 ? c : 1) * ALIGN(alen) + (c > 0 ? c+1 : 2) * sizeof(char*); to ms = ALIGN(l+1) + sizeof(char*) + c * ALIGN(alen) + (c+1) * sizeof(char*); to ms = ALIGN(l+1) + c * ALIGN(alen) + (c+2) * sizeof(char*); Found by coverity. Fixes: CID#1237570 and CID#1237610
2014-09-18timesyncd: check return of setting IP_TOSTom Gundersen
Fonud by Coverity. Fixes CID #1237534.
2014-09-18udevd: don't fail if /run/udev existsTom Gundersen
2014-09-18udev: fix typosTom Gundersen
Spotted by Andreas Henriksson.
2014-09-18udev: ctrl - log if setting SO_PASSCRED failsTom Gundersen
No functional change. Found by Coverity. Fixes CID #1237533.
2014-09-18udev: node - warn if chmod/chown failsTom Gundersen
No functional change, just log the warning. Fonud by Coverity. Fixes CID #1237544.
2014-09-18udevadm: hwdb - check return value of fseeko()Tom Gundersen
Fonud by Coverity. Fixes CID #996255.
2014-09-18udevd: check return of various functionsTom Gundersen
One reported by Coverity. Fixes CID #996252.
2014-09-18udevd: parse_argv - warn if argumens are invalidTom Gundersen
Found by Coverity. Fixes CID #1238780.
2014-09-18journal-remote: check return code of sd_event_defaultAndreas Henriksson
Handle sd_event_default returning error and bail out properly as done in every other caller of this function. Found by coverity. Fixes: CID#1238957
2014-09-18sysusers: Remove some gcc warnings about uninitialized variablesPhilippe De Swert
Gcc is spewing some warnings about uninitialized variables. Let's get rid of the noise.
2014-09-18core: Remove uninitialized warnings from bus-endpoint.cPhilippe De Swert
Gcc is spewing some warnings about uninitialized variables. Let's get rid of the noise.
2014-09-18journal-upload: Remove compilation warningPhilippe De Swert
When compiling we see this curl warning popping up: src/journal-remote/journal-upload.c:194:17: warning: call to ‘_curl_easy_setopt_err_error_buffer’ declared with attribute warning: curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option [enabled by default] This patch removes the warning (which occurs twice).
2014-09-18mount: order options before other arguments to mountEmil Renner Berthing
2014-09-18include fcntl.h rather than sys/fcntl.hEmil Renner Berthing
2014-09-18sd-rtnl: rtnl-message: remove unneeded linux includesEmil Renner Berthing
2014-09-18udev: link-config: remove unneded linux/netdevice.h includeEmil Renner Berthing
2014-09-18journal: Do not count on the compiler initializing found_last to falsePhilippe De Swert
There is a very unlikely case where this can happen since gcc usually does the sane thing. But let's make sure found_last is initialized anyway. Fixes: CID#996386
2014-09-18man: use the escape for "-" in example instead of space.Michael Marineau
This sentence can be misread to mean that "\x20" is the escape code for "-" which is the only character explicitly mentioned. This lead to at least one user loosing hair over why a mount unit for "/foo/bar-baz" didn't work. The example escape is arbitrary so lets prevent hair loss.
2014-09-18udev: fix path for database names on 'change' eventRobert Milasan
If a device does not have a major/minor number attached, we use different database names than if it does. On "change" events, we didn't copy the devnum over, therefore, we used different paths than on 'add' or 'remove' events (where devnum was properly copied). Fix this by always copying the devnum into the udev-device. (David: added commit-log from email)
2014-09-18bus: fix bus_print_property() to use "int" for booleansDavid Herrmann
We always use "int" if we retrieve boolean values from sd-bus, as "bool" is only a single byte, but full int on va-args. Thanks to Werner Fink for the report!
2014-09-18shared: conf-parser - don't leak memory on error in DEFINE_CONFIG_PARSE_ENUMVTom Gundersen
Found by Coverity. Fixes CID #1237746.
2014-09-18libudev: monitor - warn if we fail to request SO_PASSCREDTom Gundersen
The function still succeeds, so there is no functional change. This fixes CID #996288.
2014-09-18tests: fix resource & mem leaksRonny Chevalier
2014-09-18sd-bus: sync kdbus.hDaniel Mack
(no API/ABI break this time)
2014-09-18systemctl: fix resource leak CID #1237747Cristian Rodríguez
..by simply moving the declaration of "unit" into the STRV_FOREACH loop as suggested by Andreas.
2014-09-18Fix resource leak (coverity CID 1237760)Cristian Rodríguez
2014-09-17sysv-generator: don't check first if hashmap contains the service nameThomas Hindoe Paaboel Andersen
Just test if hashmap_get returns null. hashmap_contains does exactly same thing internally so this is slightly more efficient for the true case. Silences a coverity warning too. CID#1237648
2014-09-17logind: fix typoRonny Chevalier
2014-09-17shared: conf-parserTom Gundersen
Check memory allocation. Found by Coverity. Fixes CID #1237644.
2014-09-17udev: event - modernize spawn_exec()Tom Gundersen
2014-09-17udev: event - explicitly don't read() from invalid fdTom Gundersen
This fixes CID #1237641.
2014-09-17udev: event - modernize spawn_read()Tom Gundersen
2014-09-17nss-resolve: remove dead codeThomas Hindoe Paaboel Andersen
ifindex < 0 was already checked before entering the loop Found by coverity. Fixes: CID#1237609
2014-09-17udev: rules - close empty fileTom Gundersen
If the file is found to be empty, we exit early without closing the file first. Found by coverity. Fixes CID #1237759.
2014-09-17libsystemd-network: dhcp-test - assert that malloc0 succeedsTom Gundersen
Otherwise we would get a nullptr dereference later on. Found by coverity. Fixes CID #1237655.
2014-09-17networkd: dhcp4 - fix unchecked return valueTom Gundersen
Found by coverity. CID #1237529 and #1237528.
2014-09-17bus: fix error leak in bus_node_exists()David Herrmann
If we call into user callbacks, we must always propagate possible errors. Fix bus_node_exists() to do that and adjust the callers (which already partially propagated the error). Also speed up that function by first checking for registered enumerators and/or object-managers.
2014-09-17bus: never respond to GetManagedObjects() on sub-pathsDavid Herrmann
The dbus-spec clearly specifies that GetManagedObjects() should only work on the root-path of an object-tree. But on that path, it works regardless whether there are any objects available or not. We could, technically, define all sub-paths as a root-path of its own sub-tree. However, if we do that, we enter undefined territory: Imagine only a fallback vtable is registered. We want GetManagedObjects() to *NOT* fail with UNKNOWN_METHOD if it is called on a valid sub-tree of the fallback. On the other hand, we don't want it to work on arbitrary sub-tree. Something like: /path/to/fallback/foobar/foobar/foobar/invalid/foobar should not work. However, there is no way to know which paths on a fallback are valid without looking at there registered objects. If no objects are registered, we have no way to figure it out. Therefore, we now try to follow the dbus spec by only returning valid data on registered root-paths. We treat each path as root which was registered an object-manager on via add_object_manager(). So applications can now directly control which paths to place an object-manager on. We also fix the introspection to not return object-manager interfaces on non-root paths. Also fixes some dead-code paths initially reported by Philippe De Swert.
2014-09-17sysctl: make --prefix allow all kinds of sysctl pathsDavid Herrmann
Currently, we save arguments passed as --prefix directly and compare them later to absolute sysctl file-system paths. That is, you are required to specify arguments to --prefix with leading /proc/sys/. This is kinda uselesss. Furthermore, we replace dots by slashes in the name, which makes it impossible to match on specific sysfs paths that have dots in their name (like netdev names). The intention of this argument is clear, but it never worked as expected. This patch modifies --prefix to accept any kind of sysctl paths. It supports paths prefixed with /proc/sys for compatibility (but drops the erroneous dot->slash conversion), but instead applies normalize_sysctl() which turns any name or path into a proper path. It then appends /proc/sys/ so we can properly use it in matches. Thanks to Jan Synacek <jsynacek@redhat.com> for catching this!
2014-09-16util: remove a unnecessary checkThomas Hindoe Paaboel Andersen
We only break out of the previous loop if fd >= 0 so there is no use in checking it again. Found by coverity. Fixes: CID#1237577
2014-09-16terminal: remove dead code checking O_WRONLYDavid Herrmann
We only reject evdev FDs that are O_WRONLY as they're currently pretty useless. The following check for O_WRONLY is thus never excercised so drop it. Thanks to Thomas Andersen (via coverity)!
2014-09-16test: silence a coverity reportThomas Hindoe Paaboel Andersen
We check the actual contents of the file on the line after but we might as well also check the number of bytes read here. Found by coverity. Fixes: CID#1237521
2014-09-16shared: fix resource leak in config_parse_default_instanceAndreas Henriksson
The recently allocated "printed" is not freed on error path. Found by coverity. Fixes: CID#1237745