Commit Graph

25808 Commits

Author SHA1 Message Date
Lennart Poettering e40a326cef NEWS: bring NEWS a bit up-to-date 2016-05-06 16:55:44 +02:00
Lennart Poettering b37bf74411 Merge pull request #3201 from ssahani/net-word
networkd lib: cleanup FOREACH_WORD
2016-05-06 11:57:12 +02:00
Susant Sahani 06976f5b2a networkd: route fix comment 2016-05-06 09:49:49 +05:30
Susant Sahani 93e2822684 networkd: cleanup FOREACH_WORD 2016-05-06 09:37:31 +05:30
Zbigniew Jędrzejewski-Szmek b920500ef1 Merge pull request #3190 from poettering/logind-fixes 2016-05-05 20:28:23 -04:00
Evgeny Vereshchagin 43039e4f05 Merge pull request #3198 from poettering/trigger-timeout-defaults
change trigger timeout defaults
2016-05-06 02:11:11 +03:00
Lennart Poettering 64b5689647 logind: drop pointless UINT64_C() macro use 2016-05-05 22:50:09 +02:00
Lennart Poettering c5a11ae268 logind: enforce a limit on inhibitors we hand out
For similar reasons as the recent addition of a limit on sessions.

Note that we don't enforce a limit on inhibitors per-user currently, but
there's an implicit one, since each inhibitor takes up one fd, and fds are
limited via RLIMIT_NOFILE, and the limit on the number of processes per user.
2016-05-05 22:50:09 +02:00
Lennart Poettering 6d97d3c648 logind: expose more configuration settings as bus properties 2016-05-05 22:50:09 +02:00
Lennart Poettering 91ab7b01f8 logind: don't include session lists in PropertyChanged messages
If we have a lot of simultaneous sessions we really shouldn't send the full
list of active sessions with each PropertyChanged message for user and seat
objects, as that can become quite substantial data, we probably shouldn't dump
on the bus on each login and logout.

Note that the global list of sessions doesn't send out changes like this
either, it only supports requesting the session list with ListSessions().

If cients want to get notified about sessions coming and going they should
subscribe to SessionNew and SessionRemoved signals, and clients generally do
that already.

This is kind of an API break, but then again the fact that this was included
was never documented.
2016-05-05 22:50:09 +02:00
Lennart Poettering e11544a830 logind: process session/inhibitor fds at higher priority
Let's make sure we process session and inhibitor pipe fds (that signal
sessions/inhibtors going away) at a higher priority
than new bus calls that might create new sessions or inhibitors. This helps
ensuring that the number of open sessions stays minimal.
2016-05-05 22:50:09 +02:00
Lennart Poettering 89f193fac8 update TODO 2016-05-05 22:50:09 +02:00
Lennart Poettering 183e073842 logind: enforce a limit on current user sessions
We really should put limits on all resources we manage, hence add one to the
number of concurrent sessions, too. This was previously unbounded, hence set a
relatively high limit of 8K by default.

Note that most PAM setups will actually invoke pam_systemd prefixed with "-",
so that the return code of pam_systemd is ignored, and the login attempt
succeeds anyway. On systems like this the session will be created but is not
tracked by systemd.
2016-05-05 22:50:09 +02:00
Lennart Poettering ed3902530e update TODO 2016-05-05 22:34:47 +02:00
Lennart Poettering d2a50e3b52 core: fix owner user/group output in socket dump
The unit file settings are called SocketUser= and SocketGroup= hence name these
fields that way in the "systemd-analyze dump" output too.

https://github.com/systemd/systemd/issues/3171#issuecomment-216216995
2016-05-05 22:34:47 +02:00
Lennart Poettering 1f15ce2846 core: change default trigger limits for socket units
Let's lower the default values a bit, and pick different defaults for
Accept=yes and Accept=no sockets.

Fixes: #3167
2016-05-05 22:34:47 +02:00
Zbigniew Jędrzejewski-Szmek 898a67bc2f Merge pull request #3197 from phomes/networkd-memleak
Fixes for memleaks in networkd and test
2016-05-05 08:08:16 -04:00
Thomas Hindoe Paaboel Andersen 3eb8326162 test-networkd-conf: fix memleak 2016-05-05 13:24:03 +02:00
Thomas Hindoe Paaboel Andersen 2679936e68 networkd: fix memleak in config_parse_duid_rawdata 2016-05-05 13:24:03 +02:00
Thomas H. P. Andersen 37818090c9 Trivial network cleanup (#3196)
* gitignore: typo fix for test-networkd-conf

* networkd: fix double include
2016-05-05 11:15:46 +02:00
Lennart Poettering 5119d304ff Merge pull request #3156 from keszybz/duid-settings
Rework DUID setting
2016-05-04 11:31:59 +02:00
Torstein Husebø f8e2f4d6a0 treewide: fix typos (#3187) 2016-05-04 11:26:17 +02:00
Lennart Poettering 1ed7ebcfca Merge pull request #3170 from poettering/v230-preparation-fixes
make virtualization detection quieter, rework unit start limit logic, detect unit file drop-in changes correctly, fix autofs state propagation
2016-05-04 10:46:13 +02:00
Franck Bui d428dd6ac9 tmpfiles: don't set the x bit for volatile system journal when ACL support is enabled (#3079)
When ACL support is enabled, systemd-tmpfiles-setup service sets the following
ACL entries to the volatile system journal:

   $ getfacl /run/log/journal/*/system.journal
   getfacl: Removing leading '/' from absolute path names
   # file: run/log/journal/xxx/system.journal
   # owner: root
   # group: systemd-journal
   user::rwx
   group::r--
   group🛞r-x
   group:adm:r-x
   mask::r-x
   other::---

This patch makes sure that the exec bit is not set anymore for the volatile
system journals.
2016-05-03 19:29:11 -04:00
Zbigniew Jędrzejewski-Szmek 98973d0eff Merge pull request #3185 from NetworkManager/lr/unhappy-trie
Fix incorrect string deduplication in udev
2016-05-03 19:22:22 -04:00
Lubomir Rintel c45606eb95 strbuf: set the proper character when creating new nodes
Commit 82501b3fc added an early break when a terminal node is found to
incorrect place -- before setting c. This caused trie to be built that
does not correspond to what it points to in buffer, causing incorrect
deduplications:

  # cat /etc/udev/rules.d/99-bug.rules
  ENV{FOO}=="0"
  ENV{xx0}=="BAR"
  ENV{BAZ}=="00"

  # udevadm test
  * RULE /etc/udev/rules.d/99-bug.rules:1, token: 0, count: 2, label: ''
  M ENV match 'FOO' '0'(plain)
  * RULE /etc/udev/rules.d/99-bug.rules:2, token: 2, count: 2, label: ''
  M ENV match 'xx0' 'BAR'(plain)
  * RULE /etc/udev/rules.d/99-bug.rules:3, token: 4, count: 2, label: ''
  M ENV match 'BAZ' 'x0'(plain)
  * END

The addition of "xx0" following "0" will cause a trie like this to be
created:

  c=\0
    c=0 "0"
      c=0 "xx0"  <-- note the c is incorrect here, causing "00" to be
    c=O "FOO"        deduplicated to it
    c=R "BAR"

This in effect caused the usb_modeswitch rule for Huawei modems to never
match and this never be switched to serial mode from mass storage.
2016-05-03 22:35:27 +02:00
Lubomir Rintel fa394301e2 udev: fix build with DEBUG=1
Alternatively, this could perhaps be removed since it was broken for a
long time and noone seemed to care.

But it was helpful for me today.
2016-05-03 22:35:27 +02:00
Zbigniew Jędrzejewski-Szmek 348dc14569 Merge pull request #3183 from crawford/preset-array
install: cache the presets before evaluating
2016-05-03 16:24:09 -04:00
Susant Sahani b5834a0b38 networkd: Add support to configure IPv6 preferred lifetime (#3102)
Closes #2166.

We only allow 0, infinity and forever.
infinity and forever is same.
2016-05-03 15:54:26 -04:00
Zbigniew Jędrzejewski-Szmek 6e2d0795b3 Merge pull request #3132 from ssahani/route-table
networkd: add support to set route table
2016-05-03 15:50:21 -04:00
Zbigniew Jędrzejewski-Szmek a819a985e0 Merge pull request #3173 from poettering/dnssec-incapdns-fix
Dnssec incapdns fix
2016-05-03 14:50:43 -04:00
Alex Crawford 8965d9f8b9 install: cache the presets before evaluating
The previous implementation traversed the various config directories,
walking the preset files and parsing each line to determine if a service
should be enabled or disabled. It did this for every service which
resulted in many more file operations than neccessary.

This approach parses each of the preset entries into an array which is
then used to check if each service should be enabled or disabled.
2016-05-03 11:46:14 -07:00
Lennart Poettering 9a0289a439 test-dnssec: drop unused variable
(zjs: the tree is now back to 0b2abe0f034f7f2d8654adb11b516d1090ec9a9c.)
2016-05-03 14:13:19 -04:00
Zbigniew Jędrzejewski-Szmek a82394c889 Merge pull request #2921 from keszybz/do-not-report-masked-units-as-changed 2016-05-03 14:08:39 -04:00
Zbigniew Jędrzejewski-Szmek d43bbb52de Revert "Do not report masked units as changed (#2921)"
This reverts commit 6d10d308c6.

It got squashed by mistake.
2016-05-03 14:08:23 -04:00
Zbigniew Jędrzejewski-Szmek 6254be5def Revert "test-dnssec: drop unused variable"
This reverts commit 0bed31c103.
2016-05-03 14:08:16 -04:00
Zbigniew Jędrzejewski-Szmek 5ab1cef0db Merge pull request #3111 from poettering/nspawn-remove-veth 2016-05-03 13:53:00 -04:00
Zbigniew Jędrzejewski-Szmek c29f959b44 Revert "nspawn: explicitly remove veth links after use (#3111)"
This reverts commit d2773e59de.

Merge got squashed by mistake.
2016-05-03 13:53:00 -04:00
Susant Sahani c953b24c65 networkd: add support to set route table
networkd: add support to set route table
1. add support to configure the table id.
   if id is less than 256 we can fit this in the header of route as
   netlink property is a char. But in kernel this proepty is a
   unsigned 32. Hence if greater that 256 add this as RTA_TABLE
attribute.

2. we are not setting the address family now. Now set this property.
2016-05-03 23:18:21 +05:30
Susant Sahani ec1bb27931 sd-netlink: introduce route attribute set API
Introduce
1. sd_rtnl_message_route_set_table to set table ID
2. sd_rtnl_message_route_set_family to set family

Both required to configure route properties.
2016-05-03 22:47:48 +05:30
Susant Sahani b8cc01a2db sd-netlink: fix sd_netlink_message_append_data
Also remove the braces add_rtattr not required.
2016-05-03 22:46:50 +05:30
Zbigniew Jędrzejewski-Szmek 7c285c7419 network: get rid of DUID_TYPE_RAW
It wasn't used for anything after the recent changes.
2016-05-03 12:26:43 -04:00
Zbigniew Jędrzejewski-Szmek e2e08e77cc man: add a description of DUIDType and DUIDRawData
This is essentially a revert of f38e0cce75 (which
removed the documentation of DUIDType on purpose). The description is heavily
updated for the new semantics.

This addresses #3127 § 4.
2016-05-03 12:26:43 -04:00
Zbigniew Jędrzejewski-Szmek 23caf9baf2 man: s/similar/similarly/ 2016-05-03 12:26:43 -04:00
Zbigniew Jędrzejewski-Szmek c41aa4b4da test-networkd-conf: add tests for the parsing functions 2016-05-03 12:26:42 -04:00
Zbigniew Jędrzejewski-Szmek 8341a5c381 networkd: rework duid_{type,duid_type,duid,duid_len} setting
Separate fields are replaced  with a struct.

Second second duid type field is removed. The first field was used to carry
the result of DUIDType= configuration, and the second was either a copy of
this, or contained the type extracted from DuidRawData. The semantics are changed
so that the type specified in DUIDType is always used. DUIDRawData= no longer
overrides the type setting.

The networkd code is now more constrained than the sd-dhcp code:
DUIDRawData cannot have 0 length, length 0 is treated the same as unsetting.
Likewise, it is not possible to set a DUIDType=0. If it ever becomes necessary
to set type=0 or a zero-length duid, the code can be changed to support that.
Nevertheless, I think that's unlikely.

This addresses #3127 § 1 and 3.

v2:
- rename DUID.duid, DUID.duid_len to DUID.raw_data, DUID.raw_data_len
2016-05-03 12:23:01 -04:00
Zbigniew Jędrzejewski-Szmek d7df2fd317 dh-dhcp{,6}-client: change the semantics of DUID setting
Both versions of the code are changed to allow the caller to override
DUID using simple rules: duid type and value may be specified, in
which case the caller is responsible to providing the contents,
or just duid type may be specified as DUID_TYPE_EN, in which case we
we fill in the values. In the future more support for other types may
be added, e.g. DUID_TYPE_LLT.

There still remains and ugly discrepancy between dhcp4 and dhcp6 code:
dhcp6 has sd_dhcp6_client_set_duid and sd_dhcp6_client_set_iaid and
requires client->state to be DHCP6_STATE_STOPPED, while dhcp4 has
sd_dhcp_client_set_iaid_duid and will reconfigure the client if it
is not stopped. This commit doesn't touch that part.

This addresses #3127 § 2.
2016-05-03 12:12:04 -04:00
Zbigniew Jędrzejewski-Szmek 3b6a4e97ea dhcp-identifier: un-inline dhcp_validate_duid_len
After all it is used in more than one place and is not that short.
Also tweak the test a bit:
- do not check that duid_len > 0, because we want to allow unknown
  duid types, and there might be some which are fine with 0 length data,
  (also assert should not be called from library code),
- always check that duid_len <= MAX_DUID_LEN, because we could overwrite
  available buffer space otherwise.
2016-05-03 12:09:38 -04:00
Zbigniew Jędrzejewski-Szmek f7a92d1a7e sd-dhcp: change uint8_t *duid to const void* 2016-05-03 12:08:56 -04:00
Zbigniew Jędrzejewski-Szmek 4b558378a7 sd-dhcp{,6}-client: use standard indentation for functions args 2016-05-03 11:52:44 -04:00