1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

21473 Commits

Author SHA1 Message Date
Lennart Poettering
8dc37a8525 journal: when verifying journal files, handle empty ones nicely
A journal file that carries no objects should be considered valid.
2015-07-24 02:00:43 +02:00
Lennart Poettering
dade37d403 journal: avoid mapping empty data and field hash tables
When a new journal file is created we write the header first, then sync
and only then create the data and field hash tables in them. That means
to other processes it might appear that the files have a valid header
but not data and field hash tables. Our reader code should be able to
deal with this.

With this change we'll not map the two hash tables right-away after
opening a file for reading anymore (because that will of course fail if
the objects are missing), but delay this until the first time we access
them. On top of that, when we want to look something up in the hash
tables and we notice they aren't initialized yet, we consider them
empty.

This improves handling of some journal files reported in #487.
2015-07-24 01:55:45 +02:00
Lennart Poettering
45c047b227 journal-verify: don't hit SIGFPE when determining progress
If we determine the progress based on a number of objects available,
don't blindly devide by the number of objects, given that it might be 0.
2015-07-24 01:40:44 +02:00
Daniel Mack
43472ac4cc Merge pull request #539 from poettering/tmpfiles-journal-acl
tmpfiles: don't recursively descend into journal directories in /var
2015-07-24 00:22:56 +02:00
Daniel Mack
39109ec08d Merge pull request #694 from poettering/fileio-fixes
Fileio fixes
2015-07-24 00:04:49 +02:00
Lennart Poettering
03c55bc0b9 process: an empty environment block should be returned as such
An empty env block is completely valid, hence return it as such, and
don't turn it into an error.
2015-07-23 23:47:54 +02:00
Lennart Poettering
a644184a17 process: return ESRCH when a PID is not valid anymore
so far, when we read something from /proc/$PID we would pass on the
ENOENT from the kernel as error, if the process was missing. With this
change we systematically convert this to ESRCH, which is the more
appropriate error code, and what all the other glibc/syscalls like
kill() use.

All code that calls these functions should be fine with this change. In
fact, one invocation of get_process_exe() in bus-creds.c already assumed
ESRCH would be returned if a process is missing, and this assumption is
now validated after the change.
2015-07-23 23:44:40 +02:00
Lennart Poettering
901108257e fileio: get_status_field() don't clobber arg on OOM
According to our coding style guidelines we shouldn't clobber
pass-by-ref arguments on failure, hence don't do so here either.
2015-07-23 23:36:36 +02:00
Daniel Mack
6fa7ec3b6b Merge pull request #692 from poettering/fd-copy-directory-all
copy: when we recursively copy a directory tree, copy everything
2015-07-23 23:20:18 +02:00
Lennart Poettering
8420fa3acf copy: when we recursively copy a directory tree, copy everything
Don't ignore hidden files and directories.

Fixes #386
2015-07-23 23:09:34 +02:00
Tom Gundersen
37b4859186 Merge pull request #683 from ssahani/tun1
networkd: ip6gre add support for flowlabel
2015-07-23 22:46:07 +02:00
Lennart Poettering
0ed5c799a6 Merge pull request #670 from floppym/ptsuid
nspawn: Don't pass uid mount option for devpts
2015-07-23 21:56:09 +02:00
Lennart Poettering
c5f44880ca Merge pull request #678 from eworm-de/oracle-kvm
Oracle kvm
2015-07-23 21:38:01 +02:00
Daniel Mack
bd5ecd55c8 Merge pull request #691 from teg/networkd-after-sysctl
units: order networkd after sysctl
2015-07-23 21:23:49 +02:00
Christian Hesse
e32886e010 virt: handle Virtualbox 5.0 with kvm hypervisor
Virtualbox 5.0 now supports kvm hypervisor. In this case cpuid
identidies as "kvm", which breaks units depending on
ConditionVirtualization=oracle.
So return "oracle" even with kvm hypervisor.
2015-07-23 21:18:55 +02:00
Lennart Poettering
28a5679cdc Merge pull request #682 from ssahani/bridge
networkd: add bridge link properties
2015-07-23 21:07:57 +02:00
Tom Gundersen
d2d1e36bee units: order networkd after sysctl
This way networkd will correctly and race-freely inherit the default settings
applied by sysctl.

Suggested in issue #468.
2015-07-23 21:04:58 +02:00
Susant Sahani
165c41a99a man: add man for bridge params 2015-07-23 23:33:40 +05:30
Susant Sahani
eb7ff4dd5f networkd: add bridge link properties
new bridge properties

br.network

[Match]
Name=enp0s25

[Network]
Bridge=br-test

[Bridge]
Cost=332
BPDUGuard = true
HairPin = true
FastLeave = true
RootBlock = true
UnicastFlood = true
2015-07-23 23:31:58 +05:30
Lennart Poettering
3964118f5a Merge pull request #604 from heftig/master
build-sys: Use slim LTO objects if possible
2015-07-23 19:02:34 +02:00
Lennart Poettering
f252ccdb9e Merge pull request #690 from teg/resolved-fixes-2
resolved: assorted fixes v2
2015-07-23 18:48:25 +02:00
Tom Gundersen
6709eb94f9 resolve: transaction - stop processing packet when found to be invalid
We were stopping the transaction, but we need to stop processing the packet alltogether.
2015-07-23 18:06:50 +02:00
Tom Gundersen
0e03ade57e resolved: packet - fix segfault in truncate()
A size_t was being accessed as a char* due to the order of arguments being inverted.
2015-07-23 18:06:50 +02:00
Tom Gundersen
8e6edc490c resolved: rr - ignore pseudo types in NSEC(3) bitmaps 2015-07-23 18:06:50 +02:00
Tom Gundersen
0bbd72b2f3 resolved: rr - fix parsing of NSEC3
We were appending rather than reading the bitmap.
2015-07-23 18:06:50 +02:00
Tom Gundersen
89492aaf99 resolved: rr - don't read past end of RR when parsing NSEC(3)
We can never read past the end of the packet, so this seems impossible
to exploit, but let's error out early as reading past the end of the
current RR is clearly an error.

Found by Lennart, based on patch by Daniel.
2015-07-23 18:06:50 +02:00
Tom Gundersen
549c1a2564 resolved: rr - SSHFP contains the fingerprint, not the key
Rename the field to make this clearer.
2015-07-23 18:01:50 +02:00
Tom Gundersen
f1d178cce1 resolved: packet - fail on invalid zero-length data
Most blobs (keys, signatures, ...) should have a specific size given by
the relevant algorithm. However, as we don't use/verify the algorithms
yet, let's just ensure that we don't read out zero-length data in cases
where this does not make sense.

The only exceptions, where zero-length data is allowed are in the NSEC3
salt field, and the generic data (which we don't know anything about,
so  better not make any assumptions).
2015-07-23 18:01:17 +02:00
Daniel Mack
20330324e3 Merge pull request #687 from poettering/bitmap-fixes
bitmap: various clean-ups
2015-07-23 16:13:51 +02:00
Lennart Poettering
370a2172ac bitmap: various clean-ups
a) use memcmp() to compare bitmaps efficiently

b) use UINT64_C() macro instead of ULL suffixes to get right suffix for
   uint64_t constants

c) add a few assert()s

d) when comparing integers with 0 we generally try to make this explicit
   with "!= 0".

e) remove redundant bitmap_isset() if check, as we don't have it in
   bitmap_isset() either.

f) It should be fine to invoke bitmap_unset() on a NULL bitmap
2015-07-23 15:57:54 +02:00
Tom Gundersen
b96c778a00 Merge pull request #669 from poettering/dns-rr-memdup
resolve: unify memdup() code when parsing RRs
2015-07-23 12:34:34 +02:00
Susant Sahani
54a9d20c47 networkd: ip6gre add support for flowlabel 2015-07-23 15:45:38 +05:30
Susant Sahani
0c1f248ef6 sd-netlink: add bridge NL params 2015-07-23 15:06:03 +05:30
Susant Sahani
38a0245fb2 Add bridge NL params to missing.h 2015-07-23 15:06:03 +05:30
Tom Gundersen
f4955d321e Merge pull request #677 from zonque/bitmap2
basic: bitmap: use uint64_t instead if long long unsigned
2015-07-23 11:35:55 +02:00
Daniel Mack
56511eca83 Merge pull request #674 from ssahani/tunnel
ip6 tunnel: add support for DSCP
2015-07-23 11:00:15 +02:00
Susant Sahani
9b0ca30a91 man: add man for DSCP 2015-07-23 13:38:26 +05:30
David Herrmann
8cd4eb791a Merge pull request #537 from poettering/nss-mymachines-userns
Hook up container userns with nss-mymachines
2015-07-23 09:53:47 +02:00
Daniel Mack
e25aa3453b Merge pull request #663 from poettering/tmpfiles-chattr-enotty
tmpfiles: downgrade errors when a file system does not support file a…
2015-07-23 09:12:43 +02:00
Daniel Mack
33b63dd732 Merge pull request #673 from poettering/dns-packet-append-type-window
resolved: make sure we alway initialize *start in dns_packet_append_t…
2015-07-23 08:53:36 +02:00
Daniel Mack
848d08b74e basic: bitmap: use uint64_t instead if long long unsigned
long long unsigned is always 64 bit wide, so use a more readable type.
2015-07-23 08:49:58 +02:00
Daniel Mack
2d3102cc40 Merge pull request #672 from poettering/bitmap-isclear
bitmap: bitmap_clear()
2015-07-23 08:49:14 +02:00
Susant Sahani
ec2a3e3af2 networkd: ip6 tunnel add DSCP
This patch adds support for setting the
DSCP field in the ip6 tunnel.

when set it inherits DSCP field between inner and outer header.
2015-07-23 09:52:24 +05:30
Lennart Poettering
6fa919016a resolved: make sure we alway initialize *start in dns_packet_append_type_window() 2015-07-23 04:54:35 +02:00
Lennart Poettering
05fb03beee bitmap: bitmap_clear()
No need to actually reset the bitmap, we can just truncate it back zero
size. That not only makes bitmap_clear() quicker, but also subsequent
bitmap_isclear().
2015-07-23 04:51:57 +02:00
Lennart Poettering
f5430a3ef3 resolve: unify memdup() code when parsing RRs
Let's make dns_packet_read_public_key() more generic by renaming it to
dns_packet_read_memdup() (which more accurately describes what it
does...). Then, patch all cases where we memdup() RR data to use this
new call.

This specifically checks for zero-length objects, and handles them
gracefully. It will set zero length payload fields as a result.

Special care should be taken to ensure that any code using this call
can handle the returned allocated field to be NULL if the size is
specified as 0!
2015-07-23 04:50:19 +02:00
Mike Gilbert
3dce891505 nspawn: Don't pass uid mount option for devpts
Mounting devpts with a uid breaks pty allocation with recent glibc
versions, which expect that the kernel will set the correct owner for
user-allocated ptys.

The kernel seems to be smart enough to use the correct uid for root when
we switch to a user namespace.

This resolves #337.
2015-07-22 22:34:57 -04:00
Tom Gundersen
f7d51e1c19 Merge pull request #667 from poettering/dns-rr-memleak
resolve: fix two minor memory leaks
2015-07-23 03:58:47 +02:00
Tom Gundersen
ef9132b77e Merge pull request #666 from poettering/drop-good-dns-server
resolve: drop dns_scope_good_dns_server()
2015-07-23 03:57:10 +02:00
Lennart Poettering
2c1fb4f712 resolve: fix two minor memory leaks
strv_extend() already strdup()s internally, no need to to this twice.
(Also, was missing OOM check...).

Use strv_consume() when we already have a string allocated whose
ownership we want to pass to the strv.

This fixes 50f1e641a9.
2015-07-23 03:26:01 +02:00