1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-04 13:51:24 +03:00
Commit Graph

17589 Commits

Author SHA1 Message Date
Lennart Poettering
0b76b4d8c2 calendar: make freeing a calendar spec object deal fine with NULL
In order to make object destruction easier (in particular in combination
with _cleanup_) we usually make destructors deal with NULL objects as
NOPs. Change the calendar spec destructor to follow the same scheme.
2014-10-24 18:33:29 +02:00
Lennart Poettering
69f0081748 timesyncd: the IP_TOS sockopt is really just an optimization, we shouldn't fail if we can't set it
This partially undos 2f905e821e
2014-10-24 18:32:30 +02:00
Lennart Poettering
06cbf7f24e update TODO 2014-10-24 16:53:08 +02:00
Jan Janssen
ea7061e4d4 journalctl: Unify boot id lookup into common function get_boots 2014-10-24 08:50:45 -04:00
WaLyong Cho
2ec62d8e84 udev: do NOT re-label smack
If selinux is disabled and smack is only enabled, smack label is
relable-ed by label_fix. To avoid, make only be labeled for selinux.
2014-10-24 13:56:24 +02:00
Lennart Poettering
4dffec1459 manager: Linux on hppa has fewer rtsigs, hence avoid using the higher ones there
https://bugs.freedesktop.org/show_bug.cgi?id=84931
2014-10-24 13:45:24 +02:00
Klaus Purer
820c095831 man: remove another gendered pronoun 2014-10-24 13:32:16 +02:00
Klaus Purer
b26c631ac9 journald: removed gendered pronouns in comment 2014-10-24 13:32:16 +02:00
Lennart Poettering
5aaeda04a2 man: fix minor typo 2014-10-24 12:30:43 +02:00
Lennart Poettering
4a9dfff9bd man: add a link to the XDG basedir spec from the pam_sytemd man page 2014-10-24 12:07:05 +02:00
Lennart Poettering
c1405e4f31 man: avoid gendered singular pronouns
Using "their" as pronoun in these places is confusing since it is more
associated with plural rather than singular, and the sentence already
contains a plural. The word "her/his" apparently offends some people,
hence let's avoid the problem altogether and just name the noun again.
2014-10-24 12:02:44 +02:00
Lennart Poettering
08cb4bdd70 man: minor addition to coredumpctl example 2014-10-24 02:22:57 +02:00
Hugo Grostabussiat
a6fb0dc138 cryptsetup: Fix timeout on dm device.
Fix a bug in systemd-cryptsetup-generator which caused the drop-in
setting the job timeout for the dm device unit to be written with a
name different than the unit name.

https://bugs.freedesktop.org/show_bug.cgi?id=84409
2014-10-24 02:14:49 +02:00
Marius Tessmann
a2726e5ced shutdown: pass own argv to /run/initramfs/shutdown
Since commit b1e90ec515 systemd passes
its log settings to systemd-shutdown via command line parameters.
However, systemd-shutdown doesn't pass these parameters to
/run/initramfs/shutdown, causing it to fall back to the default log
settings.

This fixes the following bugs about the shutdown not being quiet
despite "quiet" being in the kernel parameters:

https://bugs.freedesktop.org/show_bug.cgi?id=79582
https://bugs.freedesktop.org/show_bug.cgi?id=57216
2014-10-24 01:36:07 +02:00
Lennart Poettering
a07e9cfb79 selinux: fix handling of relative paths when setting up create label 2014-10-24 01:15:53 +02:00
Lennart Poettering
989fc2c61c man: in pam_systemd, it must be "his" (or "her"), not their 2014-10-24 01:14:38 +02:00
Lennart Poettering
43b133b4e0 socket: properly label socket symlinks 2014-10-23 23:58:01 +02:00
Lennart Poettering
75514a707c socket: fix error comparison 2014-10-23 23:57:50 +02:00
Lennart Poettering
be57e297ac label: move is_dir() to util.c 2014-10-23 21:36:56 +02:00
Lennart Poettering
c34255bdb2 label: unify code to make directories, symlinks 2014-10-23 21:36:56 +02:00
Lennart Poettering
f3c80515c1 label: don't try to create labelled directories more than once 2014-10-23 21:36:56 +02:00
Lennart Poettering
ecabcf8b6e selinux: clean up selinux label function naming 2014-10-23 21:36:56 +02:00
Lennart Poettering
66cedb3078 selinux: simplify and unify logging
Normally we shouldn#t log from "library" functions, but SELinux is
weird, hence upgrade security messages uniformly to LOG_ERR when in
enforcing mode.
2014-10-23 21:36:56 +02:00
Lennart Poettering
7f416dae9b selinux: rework label query APIs
APIs that query and return something cannot silently fail, they must
either return something useful, or an error. Fix that.

Also, properly rollback socket unit fd creation when something goes
wrong with the security framework.
2014-10-23 21:36:56 +02:00
Lennart Poettering
376a298096 smack: we don't need the special labels exported, hence don't 2014-10-23 21:36:56 +02:00
Lennart Poettering
2962142175 selinux: drop 3 unused function prototypes 2014-10-23 21:36:56 +02:00
Lennart Poettering
5dfc54615a smack: rework SMACK label fixing code to follow more closely the semantics of the matching selinux code 2014-10-23 21:36:56 +02:00
Lennart Poettering
d1ce2089b4 smack: never follow symlinks when relabelling
previously mac_smack_apply(path, NULL) would operate on the symlink
itself while mac_smack_apply(path, "foo") would follow the symlink.
Let's clean this up an always operate on the symlink, which appears to
be the safer option.
2014-10-23 21:36:56 +02:00
Lennart Poettering
d53e386db6 smack: rework smack APIs a bit
a) always return negative errno error codes
b) always become a noop if smack is off
c) always take a NULL label as a request to remove it
2014-10-23 21:36:56 +02:00
Lennart Poettering
c80d766c80 mac: rename all calls that apply a label mac_{selinux|smack}_apply_xyz(), and all that reset it to defaults mac_{selinux|smack}_fix()
Let's clean up the naming schemes a bit and use the same one for SMACK
and for SELINUX.
2014-10-23 21:36:56 +02:00
Lennart Poettering
1ec220bcda selinux: make use of cleanup gcc magic 2014-10-23 21:36:56 +02:00
Tom Gundersen
157a180e4f TODO 2014-10-23 20:22:06 +02:00
Daniel Mack
af951ff5e9 man: pam_systemd: some typos fixed, some info added
Just some minor nits that I stumbled over when reading the man page.
2014-10-23 19:18:54 +02:00
Michal Schmidt
7c0b05e58b unit: adjust for the possibility of set_move() failing 2014-10-23 17:38:02 +02:00
Michal Schmidt
7ad63f57b6 hashmap: allow hashmap_move() to fail
It cannot fail in the current hashmap implementation, but it may fail in
alternative implementations (unless a sufficiently large reservation has
been placed beforehand).
2014-10-23 17:38:02 +02:00
Michal Schmidt
09a65f9299 unit: place reservations before merging other's dependencies
With the hashmap implementation that uses chaining the reservations
merely ensure that the merging won't result in long bucket chains.

With a future alternative implementation it will additionally reserve
memory to make sure the merging won't fail.
2014-10-23 17:38:02 +02:00
Michal Schmidt
2d5c93c7af install, cgtop: adjust hashmap_move_one() callers for -ENOMEM possibility
That hashmap_move_one() currently cannot fail with -ENOMEM is an
implementation detail, which is not possible to guarantee in general.
Hashmap implementations based on anything else than chaining of
individual entries may have to allocate.

hashmap_move_one will not fail with -ENOMEM if a proper reservation has
been made beforehand. Use reservations in install.c.

In cgtop.c simply propagate the error instead of asserting.
2014-10-23 17:38:02 +02:00
Michal Schmidt
8f88aed740 test: add test for hashmap_reserve() 2014-10-23 17:38:02 +02:00
Michal Schmidt
e4c691b59d hashmap: introduce hashmap_reserve()
With the current hashmap implementation that uses chaining, placing a
reservation can serve two purposes:
 - To optimize putting of entries if the number of entries to put is
   known. The reservation allocates buckets, so later resizing can be
   avoided.
 - To avoid having very long bucket chains after using
   hashmap_move(_one).

In an alternative hashmap implementation it will serve an additional
purpose:
 - To guarantee a subsequent hashmap_move(_one) will not fail with
   -ENOMEM (this never happens in the current implementation).
2014-10-23 17:38:02 +02:00
Michal Schmidt
9700d6980f hashmap: return more information from resize_buckets()
Return 0 if no resize was needed, 1 if successfully resized and
negative on error.
2014-10-23 17:38:02 +02:00
Michal Schmidt
b3dcf58e28 shared: split mempool implementation from hashmaps 2014-10-23 17:38:02 +02:00
Michal Schmidt
1e43061b67 resolve: make DnsScope::conflict_queue an OrderedHashmap
on_conflict_dispatch() uses hashmap_steal_first() and then does
something non-trivial with it. It may care about the order.
2014-10-23 17:38:02 +02:00
Michal Schmidt
c9fe4af70d sd-bus: make sd_bus::reply_callbacks a OrderedHashmap
The way process_closing() picks the first entry from reply_callbacks
and works with it makes it likely that it cares about the order.
2014-10-23 17:38:02 +02:00
Michal Schmidt
c1f906bd91 journal: make sd_journal::files a OrderedHashmap
Anything that uses hashmap_next() almost certainly cares about the order
and needs to be an OrderedHashmap.
2014-10-23 17:38:02 +02:00
Michal Schmidt
43cf8388ea journal: make Server::user_journals an OrderedHashmap
Order matters here. It replaces oldest entries first when
USER_JOURNALS_MAX is reached.
2014-10-23 17:38:02 +02:00
Michal Schmidt
4743015db6 journal: make JournalFile::chain_cache an OrderedHashmap
The order of entries may matter here. Oldest entries are evicted first
when the cache is full.

(Though I don't see anything to rejuvenate entries on cache hits.)
2014-10-23 17:38:02 +02:00
Michal Schmidt
9f03ee51a2 install: make InstallContext::{will_install,have_installed} OrderedHashmaps
It appears order may matter here. Use OrderedHashmaps to be safe.
2014-10-23 17:38:02 +02:00
Michal Schmidt
dd0124f6cb hashmap: drop assert(h) from hashmap_next()
It's handled just fine by returning NULL.
2014-10-23 17:38:02 +02:00
Michal Schmidt
bf3d3e2bb7 hashmap: hashmap_move_one() should return -ENOENT when 'other' is NULL
-ENOENT is the same return value as if 'other' were an allocated hashmap
that does not contain the key. A NULL hashmap is a possible way of
expressing a hashmap that contains no key.
2014-10-23 17:38:02 +02:00
Michal Schmidt
9ba81d5a61 test: add and improve hashmap tests
Test more corner cases and error states in several tests.

Add new tests for:
  hashmap_move
  hashmap_remove
  hashmap_remove2
  hashmap_remove_value
  hashmap_remove_and_replace
  hashmap_get2
  hashmap_first

In test_hashmap_many additionally test with an intentionally bad hash
function.
2014-10-23 17:38:02 +02:00