Commit Graph
100 Commits
Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen f5a4b0d353 dropin: add format attribute and fix a wrong caller 2014-07-07 22:20:56 +02:00
Thomas Hindoe Paaboel Andersen cd4ba18a84 coredump: vacuum - fix calculation of 10% of fs size for MaxUse 2014-07-01 23:49:56 +02:00
Thomas Hindoe Paaboel Andersen 926695f1b5 sd-dhcp6-client: check return value
Checking the return values seems to have been forgotten in
ed6ee21953
2014-07-01 23:46:51 +02:00
Thomas Hindoe Paaboel Andersen ce1dde29b9 typo fixes 2014-07-01 21:12:05 +02:00
Thomas Hindoe Paaboel Andersen fcba63a846 man: file-hierarchy - typo fixes 2014-06-30 22:54:21 +02:00
Thomas Hindoe Paaboel Andersen 908c32e0f3 man: daemon - typo fix 2014-06-30 22:38:17 +02:00
Thomas Hindoe Paaboel Andersen d0c8806d4a coredumpctl: fix potential deref of null pointer 2014-06-27 00:17:58 +02:00
Thomas Hindoe Paaboel Andersen 7849c2acd4 coredump: make sure variable is set if uncompressed
reorder the code so the fstat is done before we can jump to
uncompressed
2014-06-27 00:17:58 +02:00
Thomas Hindoe Paaboel Andersen de8f6e5463 coredumpctl: remove unused variable 2014-06-26 23:16:58 +02:00
Thomas Hindoe Paaboel Andersen 2bb9a7a286 coredump: fix debug message
typo from 347272731e
2014-06-26 23:16:58 +02:00
Thomas Hindoe Paaboel Andersen 260ad50f5b sysv-generator: fix incorect ordering of Wants 2014-06-26 00:37:26 +02:00
Thomas Hindoe Paaboel Andersen d171ed1c50 sysv-generator: rename PidFile to PIDFile
Spotted by Alexey Shabalin
2014-06-24 23:07:48 +02:00
Thomas Hindoe Paaboel Andersen c8b32e11ee consistently order cleanup attribute before type 2014-06-22 00:45:15 +02:00
Thomas Hindoe Paaboel Andersen 88675ae97c sd-dhcp-server: remove unused cleanup function
Removes _cleanup_dhcp_lease_free_. While the automatic cleanup
functions are great to have this one is never used and causes
a warning in clang.
2014-06-20 19:32:51 +02:00
Thomas Hindoe Paaboel Andersen 8271bd16ce bootchart: add assert
since 376cd3b89c LIST_FIND_TAIL accepts
an empty list. That removed an assert in LIST_FIND_TAIL and we now
theoretically risk a null pointer deref. This adds the assert directly
to protect against that.
2014-06-19 00:18:05 +02:00
Thomas Hindoe Paaboel Andersen df9db010de TODO: update 2014-06-18 23:21:00 +02:00
Thomas Hindoe Paaboel Andersen cee288adf8 socket: check return from exec_spawn 2014-06-18 23:21:00 +02:00
Thomas Hindoe Paaboel Andersen f7926298e9 sd-dhcp-client: check return from dhcp_option_append 2014-06-18 23:21:00 +02:00
Thomas Hindoe Paaboel Andersen 02557f973a sd-dhcp-server: fix a leak
We must use free instead of dhcp_lease_free here to avoid freeing
client_id.data.
2014-06-18 23:21:00 +02:00
Thomas Hindoe Paaboel Andersen de228aabc8 install: remove unused variable 2014-06-17 21:22:01 +02:00
Thomas Hindoe Paaboel Andersen e94b5a7bc2 journal-remote: fix memleak 2014-06-16 23:51:34 +02:00
Thomas Hindoe Paaboel Andersen efdc73dae3 networkd: link - check returned value from set_lease_pool 2014-06-13 23:00:52 +02:00
Thomas Hindoe Paaboel Andersen f268f57f63 cryptsetup: check that password is not null
Beef up the assert to protect against passing null to strlen.

Found with scan-build.
2014-06-13 00:30:40 +02:00
Thomas Hindoe Paaboel Andersen 47a3fa0f76 udev: check the return value from udev_enumerate_scan_devices
The return value from udev_enumerate_scan_devices was stored but
never used. I assume this was meant to be checked.
2014-06-10 19:06:50 +02:00
Thomas Hindoe Paaboel Andersen 817e224bbc Remove sysv parser from service.c
Parsing sysv files was moved to the sysv-generator in the previous commit.
This patch removes the sysv parsing from serivce.c.

Note that this patch drops the following now unused sysv-specific info
from service dump:
"SysV Init Script has LSB Header: (yes/no)"
"SysVEnabled: (yes/no)"
"SysVRunLevels: (levels)"
2014-06-07 00:59:38 +02:00
Thomas Hindoe Paaboel Andersen 95ed3294c6 Move handling of sysv initscripts to a generator
Reuses logic from service.c and the rc-local generator.

Note that this drops reading of chkconfig entirely. It also drops reading
runlevels from the LSB headers. The runlevels were only used to check for
runlevels outside of the normal 1-5 range and then add special dependencies
and settings. Special runlevels were dropped in the past so it seemed to be
unused code.

The generator does not know about non-generated units with a value set with
SysVStartPriority=. These are therefor not taken into account when converting
start priority to before/after.
2014-06-07 00:59:32 +02:00
Thomas Hindoe Paaboel Andersen e5a1c18d70 fix warnings
Prevent use of uninitialized variable and removed a now unused
cleanup function for freeaddrinfo
2014-06-06 23:31:25 +02:00
Thomas Hindoe Paaboel Andersen 93f1a06374 util: ignore_file should not allow files ending with '~'
ignore_file currently allows any file ending with '~' while it
seems that the opposite was intended:
a228a22fda
2014-05-31 21:44:34 +02:00
Thomas Hindoe Paaboel Andersen bf9bead187 udev: avoid use of uninitialized err
After 1ea972174b err is no longer
set unless we hit a special case. Initialize it to 0 and remove
a check that will never fail.
2014-05-17 08:41:48 +02:00
Thomas Hindoe Paaboel Andersen 4723e4b2a4 systemctl: more cleanup
This is followup on 05cae7f343

I think the intention was to use the newly introduced 'path'
variable in the inner loop instead of p.
2014-05-17 08:41:37 +02:00
Thomas Hindoe Paaboel Andersen 24072d36bc journal-gatewayd: bugfix for invalid level case
introduced in cafc7f9130
2014-04-23 20:32:29 +02:00
Thomas Hindoe Paaboel Andersen 7c83910bb9 use new name DRAW_TREE_VERTICAL
Was renamed in 6b01f1d391
2014-04-23 19:22:39 +02:00
Thomas Hindoe Paaboel Andersen cc544d5fb4 networkd: link - add missing curly brackets
introduced in 1e9be60bba
2014-04-22 21:45:17 +02:00
Thomas Hindoe Paaboel Andersen 6e37cd2f4a silence warnings 2014-04-21 00:03:22 +02:00
Thomas Hindoe Paaboel Andersen 806a37e743 systemctl: add --recursive for list-timers 2014-04-16 23:51:27 +02:00
Thomas Hindoe Paaboel Andersen 0cfc352571 systemctl: add --recursive for list-sockets 2014-04-16 00:38:22 +02:00
Thomas Hindoe Paaboel Andersen b8ec9ba918 bus-proxy: remove unused variable 2014-04-14 21:02:25 +02:00
Thomas Hindoe Paaboel Andersen 5706b3e78d cgls: avoid writing an unused value
silences a build-scan warning for the unused value in r
2014-04-14 21:02:20 +02:00
Thomas Hindoe Paaboel Andersen 2667cc2589 timedatectl: avoid using uninitialized var
sec is not set if have_time is false so avoid using it. have_time
was introduced in 9ff09bcb86 but only
the first uses for sec were covered

Found with scan-build
2014-04-14 19:16:56 +02:00
Thomas Hindoe Paaboel Andersen a6ad1458e8 man: fix typos in sd_event_new 2014-04-14 19:12:59 +02:00
Thomas Hindoe Paaboel Andersen 5ba85788ab bash completion: add -i/--image to nspawn 2014-04-11 00:49:05 +02:00
Thomas Hindoe Paaboel Andersen 609211792b journal-remote-parse: avoid passing null to memchr
Found with scan-build
2014-04-06 11:55:20 +02:00
Thomas Hindoe Paaboel Andersen 085ebc1b22 bash completion: Add -r/--recursive to systemctl 2014-04-03 22:54:41 +02:00
Thomas Hindoe Paaboel Andersen 5985ea4d17 build-sys: no use for compat libs in the static analysis 2014-04-01 22:32:44 +02:00
Thomas Hindoe Paaboel Andersen 9f2a50a300 silence warnings 2014-03-27 20:16:49 +01:00
Thomas Hindoe Paaboel Andersen 761a7c71b6 systemd-run: extend bash completion
--system
-H --host
-M --machine
--service-type (options: simple forking oneshot dbus notify idle)
--uid
--gid
--nice
--setenv
-p --property (options read from bus_append_unit_property_assignment)
2014-03-17 22:02:21 +01:00
Thomas Hindoe Paaboel Andersen fd1e5b62e8 remove unused variable 2014-03-17 21:50:49 +01:00
Thomas Hindoe Paaboel Andersen 20e265d4bb strv: set _printf_ on strv_extendf 2014-03-06 20:29:40 +01:00
Thomas Hindoe Paaboel Andersen 207017017d add bash completion for systemd-cat 2014-03-04 23:17:07 +01:00
Thomas Hindoe Paaboel Andersen 4d46396131 silence warning 2014-03-03 22:39:55 +01:00
Thomas Hindoe Paaboel Andersen 3bfe58cbd4 add bash completion for systemd-detect-virt 2014-03-03 22:18:37 +01:00
Thomas Hindoe Paaboel Andersen 64ae7f1864 update bash completion for systemd-analyze 2014-03-03 22:18:32 +01:00
Thomas Hindoe Paaboel Andersen d9256bac4d add bash completion for systemd-cgtop 2014-03-02 23:07:35 +01:00
Thomas Hindoe Paaboel Andersen e1528e085c networkd-wait-online: use automatic cleanup 2014-03-01 23:16:55 +01:00
Thomas Hindoe Paaboel Andersen abdab4f602 add bash completion for systemd-cgls 2014-03-01 23:10:38 +01:00
Thomas Hindoe Paaboel Andersen 9319e46051 update TODO 2014-03-01 04:03:52 +01:00
Thomas Hindoe Paaboel Andersen 248fab742d virt: make Virtualization an anonymous enum
This makes llvm happy when we assign an error code to the variable.
2014-02-24 13:26:44 +01:00
Thomas Hindoe Paaboel Andersen 1620510ada update gitignore 2014-02-21 23:21:26 +01:00
Thomas Hindoe Paaboel Andersen f0329635f8 Makefile: fix build on clang
needed after libsystemd-daemon was merged into libsystemd in
0ebee88184
2014-02-21 22:24:47 +01:00
Thomas Hindoe Paaboel Andersen d7c9a162f1 man: networkd typo fixes 2014-02-21 21:00:39 +01:00
Thomas Hindoe Paaboel Andersen 95fe27d930 bootctl: add bash completion 2014-02-20 23:13:11 +01:00
Thomas Hindoe Paaboel Andersen 51f6888bfc busctl: install bash completion 2014-02-19 18:05:07 +01:00
Thomas Hindoe Paaboel Andersen 17d47d8d2d busctl: add --no-legend and use in bash completion 2014-02-19 17:35:35 +01:00
Thomas Hindoe Paaboel Andersen 8ec76163ff busctl: update bash completion 2014-02-19 17:12:17 +01:00
Thomas Hindoe Paaboel Andersen f5ca75f4a1 man: busctl typo fix 2014-02-19 17:02:45 +01:00
Thomas Hindoe Paaboel Andersen 0bc8e31b35 delta: add bash completion 2014-02-18 22:34:59 +01:00
Thomas Hindoe Paaboel Andersen 6bebb0add4 machinectl: remove unused --no-ask-password 2014-02-18 21:14:40 +01:00
Thomas Hindoe Paaboel Andersen e56056e93d machinectl: add bash completion 2014-02-18 21:14:30 +01:00
Thomas Hindoe Paaboel Andersen 773e264d13 man: machinectl: there is no command 'kill-machine' 2014-02-18 17:44:03 +01:00
Thomas Hindoe Paaboel Andersen 6cd6fdb228 TODO: remove done item
strv_append was removed in e3e45d4f82
2014-02-16 22:58:24 +01:00
Thomas Hindoe Paaboel Andersen 32457153f4 nspawn: typo fix in help 2014-02-16 22:15:24 +01:00
Thomas Hindoe Paaboel Andersen ecd2f2c594 remove unused variables 2014-02-07 23:09:40 +01:00
Thomas Hindoe Paaboel Andersen 1006a62d20 core: fix warning
introduced in c7040b5d1c
2014-02-07 00:01:19 +01:00
Thomas Hindoe Paaboel Andersen b5cfa7408c analyze: fix plot issues when using gummiboot
It would crash and the legend in the bottom followed the time 0.0.
2014-01-31 07:12:43 +01:00
Thomas Hindoe Paaboel Andersen 3563b896da man: typo fix 2014-01-04 23:21:13 +01:00
Thomas Hindoe Paaboel Andersen 39602c3905 systemctl: improve readability on failed commands
Not long ago a failed command would print:
"Failed to start something.service: ..."
regardless of whether the command was to start/stop/restart/etc.

With e3e0314 this was improved to print the method used. E.g. for stopping:
"Failed to StopUnit something.service: ..."

This patch matches the method to a more human readable word. E.g:
"Failed to stop something.service: ..."
2014-01-04 12:49:40 +01:00
Thomas Hindoe Paaboel Andersen a8c78decf0 autogen: add shortcut for running scan-build
scan-build is a static analyzer in llvm. As ususal static analyzers
tend to mostly find theoretical bugs in software that has been in
production for a while. For in-development code it can be useful to
check if new issues is added as there is a chance to spot real problems
before release. For systemd we are now down to 297 issues - the vast
majority are false positives because the tool does not understand the
cleanup attribute.

Running clang's static analyzer scan-build is a bit messy. You have to
run both configure and make "inside" the build-scan tool. To have an
easy shortcut from autogen.sh I thus call both directly from it. This
makes it different from the other options in autogen.sh. I chose 's'
for static analysis.

scan-build is in the package clang-analyzer on fedora.
2013-12-28 22:31:01 +01:00
Thomas Hindoe Paaboel Andersen bd3539b222 autogen: add shortcut for building with clang
For a while I have been cleaning up warnings when building with clang.
There are currently only two sources of warnings left: Wcast-align and Wgnu.
I am not convinced that fixing up those up is feasible so I run with them
disabled to spot regressions. E.g. clang is a bit more strict wrt to unused
variables with the cleanup attribute and I have fixed a number of those since.

Like the other options in autogen.sh I have a shortcut for clang as well. I use
'l' for llvm.
2013-12-28 21:24:25 +01:00
Thomas Hindoe Paaboel Andersen 984af580b3 systemctl: remove unused variable 2013-12-27 12:04:00 +01:00
Thomas Hindoe Paaboel Andersen f000939e3b bus: PORTING-DBUS1 typo fixes 2013-12-27 11:04:47 +01:00
Thomas Hindoe Paaboel Andersen 051dfe8708 remove unused variable 2013-12-19 22:06:47 +01:00
Thomas Hindoe Paaboel Andersen 2b49a47041 bus-util: return errors when encountered
Introduced in:
9f6eb1cd58
313333b403
2013-12-17 21:56:49 +01:00
Thomas Hindoe Paaboel Andersen 0d647f7f73 journal-file.c: remove redundant assignment of variable
we also do 'last_index = (uint64_t) -1;' at the end of the while
loop so there is no reason to also do it here.
2013-12-17 20:55:20 +01:00
Thomas Hindoe Paaboel Andersen 187dc6e554 udev link-config: add asserts to silence scan-build 2013-12-17 16:09:52 +01:00
Thomas Hindoe Paaboel Andersen 6a70535669 bus: removed unused variable in driverd
acked by Daniel Mack
2013-12-17 16:07:00 +01:00
Thomas Hindoe Paaboel Andersen 4faa70046c journal-file: protect against alloca(0) 2013-12-16 23:37:38 +01:00
Thomas Hindoe Paaboel Andersen bf1bc67015 network: more asserts to shut up scan-build 2013-12-16 18:55:59 +01:00
Thomas Hindoe Paaboel Andersen 899839b9f8 test-journal-syslog: use streq_ptr since we pass in NULL 2013-12-15 02:31:01 +01:00
Thomas Hindoe Paaboel Andersen 9091e686f4 Add more _printf_'s for format-nonliterals
Clang is a bit more strict wrt format-nonliterals:
http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking

Adding these extra printf attributes also makes gcc able to find more
problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c

Some parts looked intetional about breaking the format-nonliteral check.
I added some supression for warnings there.
2013-12-14 13:32:22 +01:00
Thomas Hindoe Paaboel Andersen 3fa5dd6de7 getty-generator: fix stripping /dev/ 2013-12-13 23:24:16 +01:00
Thomas Hindoe Paaboel Andersen 5fba7bbfa4 scan-build: silence some warnings
test-fileio/test-strv:
Use the streq_ptr to make build-scan not worry about passing in a null
to a nonnull function.

test-dhcp-option:
Prevent a theoretical null pointer dereference
2013-12-12 23:08:47 +01:00
Thomas Hindoe Paaboel Andersen d514feaa87 test-fileio: replace mktemp with mkstemp to avoid warnings
This is a fairly useless thing to do but it makes the compilers
and analyzers shut up about the use of mktemp.
2013-12-12 02:46:09 +01:00
Thomas Hindoe Paaboel Andersen 96115cdfe0 fix scan-build issues
The static analyzer scan-build had a few issues with analysing
parts of systemd.

gpt-auto-generator.c:
scan-build could not find blkid.h. Whether it should be blkid.h or
blkid/blkid.h seems to depend on the version used. We already use
blkid/blkid.h in udev-builtin-blkid.c so it seems safe to use that
here too.

Makefile.am:
Moved some -D's from CFLAGS to CPPFLAGS. I also simplified them a
bit and got rid of a left over DBUS_CFLAGS.

test-cgroup-mask.c/test-sched-prio.c
A variable was added to store the replaced TEST_DIR. When wrapped
in an assert_se TEST_DIR was not replaced in the logged error.
While not an issue introduced in this patch we might as well fix
it up while we are here.
2013-12-10 22:30:46 +01:00
Thomas Hindoe Paaboel Andersen 272bf69e98 bootchart: remove dead assignment 2013-12-08 22:28:37 +01:00
Thomas Hindoe Paaboel Andersen 4c49ab0e7a systemctl: fix and refactor wait_for_jobs
wait_for_jobs was ignoring the errors from the jobs stored in r.
It would only ever return whether the call to sd_bus_remove_filter
went ok. This patch changes it to return the first job related error
encountered. If a job related error is found, then the result of the
call to sd_bus_remove_filter is ignored.

wait_for_jobs was a bit hard to read so I split it up to avoid
the goto and deep nesting.
2013-12-07 22:39:46 +01:00
Thomas Hindoe Paaboel Andersen f433609894 systemctl: check the value from start_unit_one
introduced in f459b6025f
2013-12-06 21:13:46 +01:00
Thomas Hindoe Paaboel Andersen a809021a9c execute.h: remove redefinition of Unit
Unit is typedef'ed in both unit.h and execute.h. The typedef
existed first in unit.h and was later added to execute.h in
c17ec25e4d

It is no longer needed so let's just keep the one in unit.h to
avoid redefining it.
2013-12-05 22:35:11 +01:00
Thomas Hindoe Paaboel Andersen 8edb59a98b test-bus-gvariant: remove unused variable 2013-12-05 22:33:22 +01:00
Thomas Hindoe Paaboel Andersen a65c89bbb0 README: remove obsolete paragraph about D-Bus 2013-12-04 23:00:05 +01:00
Thomas Hindoe Paaboel Andersen 071066a5e5 systemctl: make an always true assert static
Silences a warning i clang
2013-12-04 22:29:58 +01:00