1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-04 22:21:55 +03:00
Commit Graph

24983 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
916a8d4341 udev-rules: fix querying of attributes
faccessat returns 0 on success.

A cosmetic fix is also included: the slash was doubled unnecessarily.
2016-02-22 13:21:32 -05:00
Zbigniew Jędrzejewski-Szmek
587751eb66 udev-test.pl: add --strace option
It's useful when trying to see what the tests are doing.
I hardcoded '-efile' as the option to strace, but in the future
it might be useful to make this configurable.
2016-02-22 13:21:32 -05:00
Lennart Poettering
a4ae7f1d73 Merge pull request #2695 from mustrumr/fix-calendarspec-skip
calendarspec: fix find_next skipping times
2016-02-22 16:16:05 +01:00
Zbigniew Jędrzejewski-Szmek
83ea2049fc Merge pull request #2692 from ssahani/tunnel
networkd: tunnel fix tunnel address
2016-02-22 08:59:39 -05:00
Lennart Poettering
3535ed5949 Merge pull request #2694 from zonque/proxyarp-missing
missing.h: Explicitly check for IFLA_BRPORT_PROXYARP
2016-02-22 14:33:27 +01:00
Hristo Venev
a022d76e6a calendarspec: fix find_next skipping times
reset usec when bumping hours/minutes
2016-02-22 08:02:48 -05:00
Daniel Mack
26c34ab4ee missing.h: Explicitly check for IFLA_BRPORT_PROXYARP
RHEL explicitly disables IFLA_BRPORT_PROXYARP by renaming the enum value.

In order to support unpatched builds, we have two options:

a) redefine the enum value through missing.h and ignore the fact that it
   is really unsupported, or

b) omit that enum value on rtnl_prot_info_bridge_port_types[]

As we are not actually using this netlink type anywhere, and because it
is only hooked up for the sake of completeness, this patch opts for the
former.
2016-02-22 13:22:30 +01:00
Daniel Mack
357726c8be Merge pull request #2687 from poettering/resolved-fix-2683
networkd: make sure we allocate the NTA set before we add items to it
2016-02-22 09:59:07 +01:00
Daniel Mack
2c0608a33d Merge pull request #2686 from poettering/github-templates
add github issue template
2016-02-22 09:58:23 +01:00
Zbigniew Jędrzejewski-Szmek
493070f3dc Merge pull request #2688 from poettering/calendar-fix-2678
A fix for #2678
2016-02-21 21:29:41 -05:00
Lennart Poettering
e308ddcae2 util-lib: fix returned error code
Make sure we propagate errors properly.
2016-02-21 23:27:20 +01:00
Lennart Poettering
ea3894c1ba util-lib: add (void) cast to indicate that we don't care about the normalization success
After all, we verify that every calendar part is not out of bounds later on,
and it's fully OK if the normalization has no effect.
2016-02-21 23:25:38 +01:00
Lennart Poettering
cbbf38aefc networkd: make sure we allocate the NTA set before we add items to it
See: #2683
2016-02-21 22:27:01 +01:00
Lennart Poettering
1f210bdbe6 Merge pull request #2650 from vcaputo/async_fsync
Perform journal offlines asynchronously when possible
2016-02-21 21:35:50 +01:00
Lennart Poettering
c7044f9ed2 Merge pull request #2681 from keszybz/udev-rules
udev-rules cleanup and coverity warning silencing
2016-02-21 21:22:55 +01:00
Lennart Poettering
67b56fb29e github: add a basic issue template
As documented here:

https://help.github.com/articles/creating-an-issue-template-for-your-repository/
2016-02-21 21:15:17 +01:00
Lennart Poettering
67bf157f38 github: move CONTRIBUTING.md into .github subdirectory
As suggested by:

https://github.com/blog/2111-issue-and-pull-request-templates
2016-02-21 21:05:02 +01:00
Zbigniew Jędrzejewski-Szmek
fdd21be6f5 udev-rules: use _cleanup_ for fclose 2016-02-21 11:05:13 -05:00
Zbigniew Jędrzejewski-Szmek
19a8e656a9 udev-rules: make error messages about rules more uniform
Also downgrade non-fatal warnings to log_warning.

Previously rule_add_key() would check the output array and log a cryptic
error and return -1. Most of the time the return value was ignored. This
does not seems right, because the buffer can overflow with enough rules.
It would also check if we have enough space for the *next* rule, even if
there might be not next rule, i.e. off-by-one.

Replace this with a check that we have enough space for a next rule before
we start parsing.

Normally using macros to alter flow is not allowed, but in this case I
think it is worth it, because it allows lots of boilerplate code to be
removed and hides repeated boring parameters, making function logic much
easier to follow.
2016-02-21 11:05:11 -05:00
Zbigniew Jędrzejewski-Szmek
f4850a1d95 udev-rules: rewrite function to avoid clobbering arguments
If the attribute wasn't found, the last filename looked at was returned in
the input/output argument. This just seems bad style.

The return value was ignored, so change function to return void.
2016-02-21 11:05:08 -05:00
Zbigniew Jędrzejewski-Szmek
99f16bb8d9 udev-rules: modernize syntax a bit 2016-02-21 11:05:06 -05:00
Zbigniew Jędrzejewski-Szmek
4fd6af76c4 udev-rules: log_oom() on memory error and abort processing of event
CID #1313566.

Also, change the return value to void, because it is ignored anyway.
2016-02-21 11:05:02 -05:00
Zbigniew Jędrzejewski-Szmek
bccfe92e46 sd-device: use (void) before set_iterate calls
set_iterate sets the output argument to NULL on error, and the return
value is not used in this case.

CID #1306804-09.
2016-02-20 19:37:10 -05:00
Zbigniew Jędrzejewski-Szmek
a2daa2f075 time-util: check for overflow in conversion from ts to nsec_t
CID #1320855.
2016-02-20 19:37:10 -05:00
Zbigniew Jędrzejewski-Szmek
56e3d0cf5d test-siphash24: add a test for concatenating very short buffers
coverity seems to think that our siphash code can read past the
end of a short buffer. Add a test which adds very short buffers
with different combinations of length to the hash. Hashing is done
twice, once with zeros following "data", and once with some other
bytes following "data". The two results are then compared to
verify that the result does not depend on bytes past the specified
data length.

(This test passes.)
2016-02-20 16:34:59 -05:00
Susant Sahani
07dcb08589 networkd: tunnel fix tunnel address
this fixes 2655
2016-02-20 18:03:31 +05:30
Daniel Mack
714c62b463 Merge pull request #2675 from samueltardieu/llmnr-typo
Fix typo on systemd-resolved log message
2016-02-20 12:27:48 +01:00
Samuel Tardieu
0ea929d52f systemd-resolved: fix typo on log message 2016-02-20 08:55:17 +01:00
Vito Caputo
b58c888f30 journal: defer journal closes on rotate
When we rotate journals, we must set offline and close the current one,
but don't generally need to wait for this to complete.

Instead, we'll initiate an asynchronous offline via
journal_file_set_offline(oldfile, false), and add the file to a
per-server set of deferred closes to be closed later when they
won't block.

There's one complication however; journal_file_open() via
journal_file_verify_header() assumes that any writable journal in the
online state is the product of an unclean shutdown or other form of
corruption.

Thus there's a need for journal_file_open() to be aware of deferred
closes and synchronize with their completion when opening preexisting
journals for writing.  To facilitate this the deferred closes set is
supplied to the journal_file_open() function where the deferred closes
may be closed synchronously before verifying the header in such
circumstances.
2016-02-19 18:50:20 -08:00
Vito Caputo
ac2e41f510 journal: asynchronous journal_file_set_offline()
This adds a wait flag to journal_file_set_offline(), when false the offline is
performed asynchronously in a separate thread.

When wait is true, if an asynchronous offline is already in-progress it is
restarted and waited for.  Otherwise the offline is performed synchronously
without the use of a thread.

journal_file_set_online() cancels or waits for the asynchronous offline to
complete if in-flight, depending on where in the offline process the thread
happens to be.  If the thread is in the fsync() phase, it is cancelled and
waiting is unnecessary.  Otherwise, the thread is joined before proceeding.

A new offline_state member is added to JournalFile which is used via
atomic operations for communicating between the offline thread and the
journal_file_set_{offline,online}() functions.
2016-02-19 18:50:20 -08:00
Vito Caputo
69a3a6fd3d journal: add void cast to journal_file_close() calls 2016-02-19 18:50:16 -08:00
Vito Caputo
fb42603752 journal: add void cast to fsync() calls 2016-02-19 16:54:19 -08:00
Zbigniew Jędrzejewski-Szmek
cde0cf28a2 Merge pull request #2666 from keszybz/coverity-fixes
Coverity fixes
2016-02-19 15:18:40 -05:00
Zbigniew Jędrzejewski-Szmek
0f5777cbd4 Merge pull request #2670 from hbrueckner/for-upstream
udev/path_id: correct segmentation fault due to missing NULL check
2016-02-19 15:13:03 -05:00
Daniel Mack
6f5ea43f9b Merge pull request #2668 from samueltardieu/systemd-resolve-manual-typo
Fix typo in systemd-resolve man page
2016-02-19 15:52:43 +01:00
Hendrik Brueckner
5181ab917d udev/path_id: correct segmentation fault due to missing NULL check
Running "udevadm test-builtin path_id /sys/devices/platform/" results
in a segmentation fault.

The problem is that udev_device_get_subsystem(dev) might return NULL
in a streq() call.  Solve this problem by using streq_ptr() instead.
2016-02-19 15:21:18 +01:00
Samuel Tardieu
de2645af05 systemd-resolve: fix typo in man page 2016-02-19 14:42:38 +01:00
Zbigniew Jędrzejewski-Szmek
79d6297252 Use (void) to silenc coverity on proc title changes
This is a cosmetic best-effort thing anyway.
2016-02-19 07:35:35 -05:00
Zbigniew Jędrzejewski-Szmek
18665d1f67 resolved: fix NULL dereference in debug stmt
CID #1351544, #1351545.
2016-02-19 07:27:43 -05:00
Daniel Mack
a972e1e0b3 Merge pull request #2661 from nwmcsween/nwmcsween
Include and internal struct member fixes.
2016-02-19 12:29:23 +01:00
Daniel Mack
dfec18925e Merge pull request #2660 from keszybz/memleaks-and-ubsan
Memleaks and ubsan
2016-02-19 12:23:43 +01:00
Daniel Mack
22b73e9cd7 Merge pull request #2662 from keszybz/activate-setenv
activate: fix -E option parsing
2016-02-19 12:19:18 +01:00
Martin Pitt
e4d86881d5 Merge pull request #2648 from keszybz/dnssec-work
Better support for DANE, shell completion
2016-02-19 07:50:50 +01:00
Zbigniew Jędrzejewski-Szmek
b722348d05 activate: fix -E option parsing
Fixes #2658.
2016-02-18 21:54:31 -05:00
Zbigniew Jędrzejewski-Szmek
240a7ba9d8 time-util: rewrite check in a way that does not confuse gcc
gcc thinks that multiplier might be unitialized. Split out the inner
loop to make the function easier to grok.
2016-02-18 19:39:10 -05:00
Zbigniew Jędrzejewski-Szmek
d09139e187 test-hashmap: fix undefined behaviour on string constants
The test was failing at -O2+ with gcc 5.3 and 6.0.
"val1" == "val1" and "val1" != "val1" are both valid.
http://stackoverflow.com/questions/4843640/why-is-a-a-in-c
2016-02-18 19:39:10 -05:00
Zbigniew Jędrzejewski-Szmek
06466a7f03 journal/catalog: fix memory leaks
Various buffers were lost because finish_item() either consumed
the buffer or allocated a new one (if an entry with the same key existed).
The caller would simply forget the buffer in either case.

Also add a check for the case when a valid identifier is followed by
an empty body. We should not allow this.

Also be more consistent in error handling and always print an error
message.
2016-02-18 19:39:09 -05:00
Zbigniew Jędrzejewski-Szmek
82501b3fc4 basic/strbuf: do not call bsearch with a null argument
Das ist verboten!

src/basic/strbuf.c:162:23: runtime error: null pointer passed as argument 2,
                           which is declared to never be null
2016-02-18 19:39:09 -05:00
Nathan McSween
3a43755733 Don't use internal struct member names 2016-02-18 23:35:22 +00:00
Nathan McSween
e306723ec4 Remove/add (un)needed includes 2016-02-18 23:34:30 +00:00