chiark / gitweb /
elogind.git
7 years agosd-bus: when connecting to a container, don't fall back to host bus
Lennart Poettering [Tue, 1 Sep 2015 18:38:37 +0000 (20:38 +0200)]
sd-bus: when connecting to a container, don't fall back to host bus

We should never connect to the host bus as fallback if connecting to a
container failed via one method. Otherwise connecting to a dbus1
container will always result in a connection to the host.

7 years agosd-bus: when connecting to a kdbus container bus pass error up
Lennart Poettering [Tue, 1 Sep 2015 18:36:52 +0000 (20:36 +0200)]
sd-bus: when connecting to a kdbus container bus pass error up

We rely on the correct error used when opening the kdbus device node,
hence let's make sure we pass it up from the namespaced child process to
the process which actually wants to connect.

7 years agocgroup: don't allow hidden cgroups
Lennart Poettering [Tue, 1 Sep 2015 15:54:17 +0000 (17:54 +0200)]
cgroup: don't allow hidden cgroups

We really should care for all cgroups, and not allow hidden ones.

7 years agocgroup: never migrate kernel threads out of the root cgroup
Lennart Poettering [Tue, 1 Sep 2015 15:53:14 +0000 (17:53 +0200)]
cgroup: never migrate kernel threads out of the root cgroup

It won't work anyway.

7 years agoset: return NULL on destructors
Lennart Poettering [Tue, 1 Sep 2015 15:13:53 +0000 (17:13 +0200)]
set: return NULL on destructors

Like we do it pretty much everywhere else.

7 years agologind: Listen to WMI hotkeys to catch SW_DOCK state/events
Martin Pitt [Tue, 1 Sep 2015 08:51:15 +0000 (10:51 +0200)]
logind: Listen to WMI hotkeys to catch SW_DOCK state/events

On Dell and HP laptops the dock state/events (SW_DOCK) come from the "{Dell,HP}
WMI hotkeys" input devices. Tag them as power-switch so that login actually
considers them. Use a general match in case this affects other vendors, too.

Thanks to Andreas Schultz for debugging this!

https://launchpad.net/bugs/1450009

7 years agosd-login: improve error handling
Lennart Poettering [Mon, 31 Aug 2015 22:40:20 +0000 (00:40 +0200)]
sd-login: improve error handling

let's return ENXIO whenever we don't know something rather than ENOENT.

ENOENT suggests this was really about a file or directory, while ENXIO
is a more generic "not found" indicator.

7 years agologin: support user-bus on dbus1
David Herrmann [Mon, 31 Aug 2015 16:07:46 +0000 (18:07 +0200)]
login: support user-bus on dbus1

dbus-1.10 was just released, including systemd units to run
`dbus-daemon --session` as systemd user unit. This allows using a
user-bus with dbus1, just like we do per default with kdbus.

All the dbus libraries have already been fixed long ago to use the
user-bus as default. Hence, there's no need to set
DBUS_SESSION_BUS_ADDRESS= if we use the user-bus. However, gdm and
friends continue to spawn a session bus if this variable is not set
(instead of checking for the existence of the user-bus). Hence, we force
the user-bus, if it is available, in pam_elogind. Once gdm and friends
are fixed, we can continue to drop this again. However, that might take
a while.

With this in place, all that is needed to make the user-bus work is:
    `systemctl --global enable dbus.socket`

If dbus.socket is not enabled, the legacy session-bus is still used.

Based on a patch by: Jan Alexander Steffens <jan.steffens@gmail.com>

7 years agosd-event: improve debug message when we fail to remove and fd from an epoll
Lennart Poettering [Mon, 31 Aug 2015 11:07:24 +0000 (13:07 +0200)]
sd-event: improve debug message when we fail to remove and fd from an epoll

Let's help users to debug issues with epoll fd removal by printing the
name of the event source.

7 years agoextract_first_word: Refactor EXTRACT_DONT_COALESCE_SEPARATORS handling
Filipe Brandenburger [Mon, 31 Aug 2015 02:40:44 +0000 (19:40 -0700)]
extract_first_word: Refactor EXTRACT_DONT_COALESCE_SEPARATORS handling

Refactor allocation of the result string to the top, since it is
currently done in both branches of the condition.

Remove unreachable code checking for EXTRACT_DONT_COALESCE_SEPARATORS
when state == SEPARATOR (the only place where SEPARATOR is assigned to
state follows a check for EXTRACT_DONT_COALESCE_SEPARATORS that jumps to
the end of the function.)

Tested by running test-util successfully.

Follow up to: 206644aedeb8859801051ac170ec562c6a113a79

7 years agoextract_first_word: Refactor allocation in empty argument case
Filipe Brandenburger [Mon, 31 Aug 2015 02:16:50 +0000 (19:16 -0700)]
extract_first_word: Refactor allocation in empty argument case

This covers the case where an argument is an empty string, such as ''.

Instead of allocating the empty string in the individual conditions when
state == VALUE, just always allocate it at the end of state == START, at
which point we know we will have an argument.

Tested that test-util keeps passing after the refactor.

Follow up to: 14e685c29d5b317b815e3e9f056648027852b07e

7 years agopo: update Polish translation
Piotr Drąg [Sat, 29 Aug 2015 18:33:02 +0000 (20:33 +0200)]
po: update Polish translation

7 years agoutil: make malloc0 ask calloc for one block of size n
Thomas Hindoe Paaboel Andersen [Fri, 28 Aug 2015 19:16:39 +0000 (21:16 +0200)]
util: make malloc0 ask calloc for one block of size n

... instead of an array of n individual bytes.

Silences a lot of warnings in smatch.

7 years agoprocess-util: trivial optimization
Lennart Poettering [Fri, 28 Aug 2015 17:29:03 +0000 (19:29 +0200)]
process-util: trivial optimization

7 years agoutil: treat 'C' and 'POSIX' locale identical
Lennart Poettering [Fri, 28 Aug 2015 16:22:14 +0000 (18:22 +0200)]
util: treat 'C' and 'POSIX' locale identical

7 years agopager: set $LESSCHARSET when we output UTF8 chars
Lennart Poettering [Fri, 28 Aug 2015 16:17:14 +0000 (18:17 +0200)]
pager: set $LESSCHARSET when we output UTF8 chars

This way we can be sure that less has the same idea of the terminal as
we do.

This solves issues in systems that have locale uninitalized, where
systemd would output UTF-8 but less wouldn't allow it and show them as
control characters.

7 years agopager: also redirect stderr
Lennart Poettering [Thu, 27 Aug 2015 22:13:34 +0000 (00:13 +0200)]
pager: also redirect stderr

It's really confusing if stdout goes to the pager, but stderr is written
directly to the screen. Hence, make sure both stdout and stderr are
passed to the pager when doing autopaging.

7 years agocgroup-show: unescape cgroups on presentation
Lennart Poettering [Thu, 27 Aug 2015 22:12:38 +0000 (00:12 +0200)]
cgroup-show: unescape cgroups on presentation

Let's unescape cgroups on presentation, so that we show literal unit
names.

7 years agopager: port fallback pager to use copy_bytes()
Lennart Poettering [Thu, 27 Aug 2015 22:11:49 +0000 (00:11 +0200)]
pager: port fallback pager to use copy_bytes()

7 years agosd-bus: it's not a user error to query the error contained in a bus message
Lennart Poettering [Thu, 27 Aug 2015 10:54:35 +0000 (12:54 +0200)]
sd-bus: it's not a user error to query the error contained in a bus message

It's an OK way to check whether a message contains an erro, let's not
consider this a loggable assertion event.

7 years agobasic: document that people shouldn't use refcnt.h without reason
Lennart Poettering [Wed, 26 Aug 2015 19:04:38 +0000 (21:04 +0200)]
basic: document that people shouldn't use refcnt.h without reason

refcnt.h only exists for cases where objects are simultaneously handled
by different threads. Otherwise it should not be used. The only case
where this applies is sd_bus, really, and pretty much none of our APIs,
since we do not claim thread-safety for them.

7 years agoPrep v225: Added needed udev support and re-enabled some masked cgroup functions.
Sven Eden [Wed, 4 Jan 2017 11:55:04 +0000 (12:55 +0100)]
Prep v225: Added needed udev support and re-enabled some masked cgroup functions.

7 years agoPrep v225: Applying various fixes and changes to src/systemd that got lost during...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/systemd that got lost during git am transfer.

7 years agoPrep v225: Applying various fixes and changes to src/shared that got lost during...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/shared that got lost during git am transfer.

7 years agoPrep v225: Applying various fixes and changes to src/login that got lost during git...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/login that got lost during git am transfer.

7 years agoPrep v225: Applying various fixes and changes to src/libelogind/sd-login that got...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/libelogind/sd-login that got lost during git am transfer.

7 years agoPrep v225: Applying various fixes and changes to src/libelogind/sd-event that got...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/libelogind/sd-event that got lost during git am transfer.

7 years agoPrep v225: Applying various fixes and changes to src/libelogind/sd-bus that got lost...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/libelogind/sd-bus that got lost during git am transfer.

7 years agoPrep v225: Applying various fixes and changes to src/cgroups-agent that got lost...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/cgroups-agent that got lost during git am transfer.

7 years agoPrep v225: Applying various fixes and changes to src/basic that got lost during git...
Sven Eden [Wed, 4 Jan 2017 05:40:46 +0000 (06:40 +0100)]
Prep v225: Applying various fixes and changes to src/basic that got lost during git am transfer.

7 years agoPrep v225: Regenerate Makefile-man.am
Sven Eden [Wed, 4 Jan 2017 05:39:53 +0000 (06:39 +0100)]
Prep v225: Regenerate Makefile-man.am

7 years agoPrep v225: Remove some orphaned files
Sven Eden [Wed, 4 Jan 2017 05:18:32 +0000 (06:18 +0100)]
Prep v225: Remove some orphaned files

7 years agoPrep v225: Sync build files with upstream
Sven Eden [Tue, 3 Jan 2017 11:52:57 +0000 (12:52 +0100)]
Prep v225: Sync build files with upstream

7 years agobus-util: make more properties settable in --property=
Lennart Poettering [Tue, 25 Aug 2015 16:39:50 +0000 (18:39 +0200)]
bus-util: make more properties settable in --property=

Add a couple of new properties to the supported set we can pass in
systemd-run's and systemd-nspawn's --property= switch.

7 years agosd-bus: don't list activators as proper peers
David Herrmann [Mon, 24 Aug 2015 11:41:03 +0000 (13:41 +0200)]
sd-bus: don't list activators as proper peers

If a connection passed KDBUS_HELLO_ACTIVATOR, it cannot do I/O on the
bus. Hence, we should not treat it as proper peer. To actually query it,
you have to explicitly ask for activators.

This makes kdbus in-line with what dbus-daemon does.

7 years agologind: get a fresh file descriptor to clean up a VT
Owen W. Taylor [Tue, 18 Aug 2015 19:19:05 +0000 (15:19 -0400)]
logind: get a fresh file descriptor to clean up a VT

When the controlling process exits, any existing file descriptors
for that FD will be marked as hung-up and ioctls on them will
file with EIO. To work around this, open a new file descriptor
for the VT we want to clean up.

Thanks to Ray Strode for help in sorting out the problem and
coming up with a fix!

https://github.com/systemd/systemd/issues/989

7 years agologind: use open_terminal() instead of open()
Owen W. Taylor [Tue, 18 Aug 2015 18:41:24 +0000 (14:41 -0400)]
logind: use open_terminal() instead of open()

The open_terminal() function adds retries in case a terminal
is in the process of being closed when we open it, and should
generally be used to open a terminal. We especially need it
for code that a subsequent commit adds that reopens the terminal
at session shut-down time; such races would be more likely in
that case.

Found by Ray Strode.

7 years agoBug #944: Replacement of a free() call by mfree()
Markus Elfring [Mon, 17 Aug 2015 07:10:56 +0000 (09:10 +0200)]
Bug #944: Replacement of a free() call by mfree()

The function "mfree" should be called instead of "free" at a specific
source code place.

7 years agologind: actually fail on OOM
Thomas Hindoe Paaboel Andersen [Thu, 13 Aug 2015 21:36:08 +0000 (23:36 +0200)]
logind: actually fail on OOM

Since dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 the two OOM's are
ignored as the value of r will be overwritten and we only log in
the fail section anyway.

This patch jumps to fail on OOM.

Note that this is different behavior compared to both the current
code and previous to dacd6cee76a08331b8c8616c5f30f70ee49aa2f9. Before
that commit we would log that saving the inhibit data failed, but
still write the file, though without the WHO/WHY section.

CID# 1313545

7 years agoCoverity #1299015
reverendhomer [Sat, 8 Aug 2015 06:49:39 +0000 (09:49 +0300)]
Coverity #1299015

bus can never be NULL due to assert

7 years agosd-daemon: return EBADF for invalid fd numbers
Zbigniew Jędrzejewski-Szmek [Fri, 7 Aug 2015 15:30:18 +0000 (11:30 -0400)]
sd-daemon: return EBADF for invalid fd numbers

This matches what open(2) and other system functions do.

7 years agosd-bus: ignore BLOOM_FILTER kdbus items
Lennart Poettering [Thu, 6 Aug 2015 12:48:33 +0000 (15:48 +0300)]
sd-bus: ignore BLOOM_FILTER kdbus items

The kernel nowadays sends these along, and that's OK, hence don't even
debug log about it, but completely ignore it.

7 years agoUse getxpid syscall on alpha for raw_getpid()
Matt Turner [Tue, 4 Aug 2015 21:47:01 +0000 (14:47 -0700)]
Use getxpid syscall on alpha for raw_getpid()

Alpha does not have a getpid syscall, but rather has getxpid to match
OSF/1.

7 years agobasic: add LIST_INSERT_BEFORE
Alex Crawford [Tue, 4 Aug 2015 06:11:53 +0000 (23:11 -0700)]
basic: add LIST_INSERT_BEFORE

Similar in function to LIST_INSERT_AFTER, this will insert a new element
into the list before the specified position. If the specified position
is NULL, the element is added as the tail of the list.

7 years agoterminal-util: no real reason to assert on O_CREAT
Lennart Poettering [Mon, 3 Aug 2015 17:06:01 +0000 (19:06 +0200)]
terminal-util: no real reason to assert on O_CREAT

That's just handle this as a normal error.

7 years agoterminal-util: when resetting terminals, don't wait for carrier
Lennart Poettering [Mon, 3 Aug 2015 17:04:08 +0000 (19:04 +0200)]
terminal-util: when resetting terminals, don't wait for carrier

In case of non-CLOCAL lines (i.e. those with carrier detect configured)
we shouldnt wait for a carrier if all we try to do is reset the TTY.
Hence, whenever we open such a TTY pass O_NONBLOCK.

Note that we continue to open ttys we intend to write to without
O_ONBLOCK, we only add it in cases we invoke ioctl()s or other terminal
operations without reading or writing to the device.

Fixes #835.

7 years agologind: add standard gpio power button support
Kefeng Wang [Mon, 3 Aug 2015 01:55:07 +0000 (09:55 +0800)]
logind: add standard gpio power button support

Many boards like hisilicon D02 board use standard gpio key to power down system.
A description of gpio-key in dts shown below,

gpio_keys {
compatible = "gpio-keys";
#address-cells = <1>;
#size-cells = <0>;

pwrbutton {
label = "Power Button";
gpios = <&porta 8 1>;
linux,code = <116>;  // KEY_POWER, used by SC System Power Down
};
};

-bash-4.3# udevadm info -a /dev/input/event3

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/gpio_keys/input/input3/event3':
    KERNEL=="event3"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/platform/gpio_keys/input/input3':
    KERNELS=="input3"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="gpio_keys"
    ATTRS{phys}=="gpio-keys/input0"
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/platform/gpio_keys':
    KERNELS=="gpio_keys"
    SUBSYSTEMS=="platform"
    DRIVERS=="gpio-keys"
    ATTRS{keys}=="116"
    ATTRS{switches}==""
    ATTRS{driver_override}=="(null)"
    ATTRS{disabled_keys}==""
    ATTRS{disabled_switches}==""

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

7 years agosd-bus: cleanup bus_reset_parsed_address()
Namhyung Kim [Sat, 1 Aug 2015 15:59:42 +0000 (00:59 +0900)]
sd-bus: cleanup bus_reset_parsed_address()

Both strv_free() and mfree() return NULL pointer after free.

7 years agosd-bus: use mfree() in bus_reset_queues()
Namhyung Kim [Sat, 1 Aug 2015 15:59:42 +0000 (00:59 +0900)]
sd-bus: use mfree() in bus_reset_queues()

Recently mfree() was introduced to reduce work of tedious free + reset
pointers.  Use it in bus_reset_queues() too.

7 years agosd-bus: cleanup bus_close_fds()
Namhyung Kim [Sat, 1 Aug 2015 15:35:22 +0000 (00:35 +0900)]
sd-bus: cleanup bus_close_fds()

The safe_close() already checks the fd and returns -1.

7 years agosmack-util: revise smack-util apis and add read smack attr apis
WaLyong Cho [Mon, 27 Jul 2015 17:43:55 +0000 (02:43 +0900)]
smack-util: revise smack-util apis and add read smack attr apis

- Add smack xattr lookup table
- Unify all of mac_smack_apply_xxx{_fd}() to mac_smack_apply() and
  mac_smack_apply_fd().
- Add smack xattr read apis similar with apply apis as
  mac_smack_read{_fd}().

7 years agoPrep v224: Major cleanup of unneeded functions and some source files.
Sven Eden [Tue, 3 Jan 2017 10:22:56 +0000 (11:22 +0100)]
Prep v224: Major cleanup of unneeded functions and some source files.

7 years agoPrep v224: Cleaned up src/basic/util.[ch]
Sven Eden [Tue, 3 Jan 2017 10:20:52 +0000 (11:20 +0100)]
Prep v224: Cleaned up src/basic/util.[ch]

This lead to the deletion of src/basic/device-nodes.h and
src/basic/env-util.h. Both are not needed by elogind.

Further removed the superfluous src/boot/efi/disk.[ch]

7 years agoPrep v224: Sync root build files with upstream
Sven Eden [Tue, 3 Jan 2017 09:08:11 +0000 (10:08 +0100)]
Prep v224: Sync root build files with upstream

7 years agoPrep v223: Remove superfluous src/resolve/resolved-llmnr.[hc]
Sven Eden [Tue, 3 Jan 2017 08:48:33 +0000 (09:48 +0100)]
Prep v223: Remove superfluous src/resolve/resolved-llmnr.[hc]

7 years agoPrep v220: Updated src/basic/missing.h to upstream version.
Sven Eden [Tue, 3 Jan 2017 08:41:39 +0000 (09:41 +0100)]
Prep v220: Updated src/basic/missing.h to upstream version.

7 years agoPrep v223: Sync basic build system with upstream.
Sven Eden [Tue, 3 Jan 2017 08:38:07 +0000 (09:38 +0100)]
Prep v223: Sync basic build system with upstream.

7 years agoPrep v222: Update build system:
Sven Eden [Fri, 30 Dec 2016 14:43:50 +0000 (15:43 +0100)]
Prep v222: Update build system:

- The content of the man pages directory has been overhauled
- Makefile-man.am was regenerated
- Makefile.am and configure.ac needed a few addtitions and fixes
- Some masked functions had to be unmasked
- Now superfluous files have been removed

7 years agoPrep v220: Update non-critical root files to the upstream versions.
Sven Eden [Fri, 30 Dec 2016 14:20:35 +0000 (15:20 +0100)]
Prep v220: Update non-critical root files to the upstream versions.

7 years agoPrep v221: Some more cleanup and a few fixes
Sven Eden [Fri, 30 Dec 2016 13:09:01 +0000 (14:09 +0100)]
Prep v221: Some more cleanup and a few fixes

The files
- src/core/org.freedesktop.systemd.policy.in.in and
- src/core/systemd.pc.in
have been deleted as they are not needed.

The other changes are some minor fixes.

7 years agoPrep v221: Update and clean up build system to sync with upstream
Sven Eden [Fri, 16 Dec 2016 11:09:41 +0000 (12:09 +0100)]
Prep v221: Update and clean up build system to sync with upstream

This commit replays the moving around of source files that have been
done between systemd-219 and systemd-221.

Further the Makefile.am is synchronized with the upstream version and
then "re-cleaned".

A lot of functions, that are not used anywhere in elogind have been
coated into #if 0/#endif directives to further shorten the list of
dependencies.

All unneeded files have been removed.

7 years agoPrep v220: Apply "Fixes to user and session saving"
Sven Eden [Mon, 5 Dec 2016 08:21:35 +0000 (09:21 +0100)]
Prep v220: Apply "Fixes to user and session saving"

7 years agoPrep v220: elogind does not need to register with systemd1.*
Sven Eden [Thu, 1 Dec 2016 08:33:44 +0000 (09:33 +0100)]
Prep v220: elogind does not need to register with systemd1.*

7 years agoPrep v220: Update src/login/org.freedesktop.login1.conf to the most recent version.
Sven Eden [Wed, 30 Nov 2016 12:28:38 +0000 (13:28 +0100)]
Prep v220: Update src/login/org.freedesktop.login1.conf to the most recent version.

7 years agoPrep v220: Remove all source files, taht are not needed to build elogind.
Sven Eden [Wed, 30 Nov 2016 08:44:44 +0000 (09:44 +0100)]
Prep v220: Remove all source files, taht are not needed to build elogind.
Prep v220: Remove not needed headers, round 1
Prep v220: Remove not needed headers, round 2
Prep v220: Remove not needed headers, round 3
Prep v220: Remove empty source directories
Prep v220: Remove non-empty source directories, that aren't needed by elogind
Prep v220: Remove all root directories that aren't referenced by the elogind build chain.
Prep v220: remove superfluous src/import directory and systemd configurations and policies.

7 years agoPrep v220: Use new cgroups functions
Sven Eden [Mon, 28 Nov 2016 03:53:40 +0000 (04:53 +0100)]
Prep v220: Use new cgroups functions
Prep v220: Update logind and loginctl to upstream version.
Prep v220: src/shared/rm-rf.c does not need to be able to handle btrfs subvolumes for elogind.

7 years agoMerge remaining elogind/master root files of the systemd upstream tag 'v220'
Sven Eden [Fri, 25 Nov 2016 07:49:28 +0000 (08:49 +0100)]
Merge remaining elogind/master root files of the systemd upstream tag 'v220'

7 years agoClassify processes from sessions into cgroups
Andy Wingo [Sun, 6 Mar 2016 15:02:31 +0000 (16:02 +0100)]
Classify processes from sessions into cgroups

Create a private cgroup tree associated with no controllers, and use it
to map PIDs to sessions.  Since we use our own path structure, remove
internal cgroup-related helpers that interpret the cgroup path structure
to pull out users, slices, and scopes.

7 years agoStop sessions on ReleaseSession
Andy Wingo [Tue, 1 Sep 2015 10:30:17 +0000 (12:30 +0200)]
Stop sessions on ReleaseSession

7 years agoFix the login monitor
Andy Wingo [Tue, 1 Sep 2015 09:54:25 +0000 (11:54 +0200)]
Fix the login monitor

* src/login/logind.c (main): Create /run/systemd/machines, so that the
  login monitor works.
* configure.ac: v219.10.

7 years agoHandle suspend/hibernate/hybrid-suspend/shutdown/reboot directly
Andy Wingo [Sun, 23 Aug 2015 12:54:39 +0000 (14:54 +0200)]
Handle suspend/hibernate/hybrid-suspend/shutdown/reboot directly

* configure.ac: Get paths of halt and reboot.
* Makefile.am (systemsleepdir, systemshutdowndir): New variables.  Look
  in them for hooks to run.

* src/login/logind-action.c: Inline the salient bits from systemd's
  system-sleep.c here.

* src/login/logind-dbus.c (execute_shutdown_or_sleep): Call our own
  shutdown_or_sleep helper instead of invoking a systemd method.

* src/login/logind.h: Declare shutdown_or_sleep.

7 years agoBeginnings of handling suspend/etc within logind
Andy Wingo [Sun, 23 Aug 2015 10:28:10 +0000 (12:28 +0200)]
Beginnings of handling suspend/etc within logind

Since we are catching the keys, we might as well just do
suspend/reboot/etc handling here.

7 years agoRemove systemd subscription and user/session units
Andy Wingo [Sun, 23 Aug 2015 09:50:26 +0000 (11:50 +0200)]
Remove systemd subscription and user/session units

This removes attempts by logind to listen to systemd messages over the
bus, and to start and/or manage units associated with sessions and
users.

7 years agoRemove support for auto-spawning VTs
Andy Wingo [Sun, 23 Aug 2015 09:17:14 +0000 (11:17 +0200)]
Remove support for auto-spawning VTs

Auto-spawning VTs requires systemd in practice.  If you're using systemd
you can just use its logind :)

7 years agoActually working with pam
Andy Wingo [Thu, 20 Aug 2015 08:53:41 +0000 (10:53 +0200)]
Actually working with pam

* src/login/logind-user.c (user_start): Don't start slices and
  systemd-user services.

* src/login/logind-dbus.c (method_create_session): Send a reply directly
  instead of waiting on systemd that isn't there.

* configure.ac: Bump version.

7 years agoCreate /run/systemd as needed
Andy Wingo [Thu, 20 Aug 2015 07:21:04 +0000 (09:21 +0200)]
Create /run/systemd as needed

* src/login/logind.c (main): Also create /run/systemd at startup.
* configure.ac: Bump to 219.3.

7 years agologind: release VT-positions when closing sessions
David Herrmann [Fri, 31 Jul 2015 14:52:29 +0000 (16:52 +0200)]
logind: release VT-positions when closing sessions

Make sure we release VT-positions when a session is closed. Otherwise,
lingering sessions will occupy VTs and prevent next logins from
succeeding.

Note that we already release session-devices when closing a session, so
there cannot be anyone using the VT anymore.

7 years agobus-proxy: make StartServiceByName synchronous
David Herrmann [Fri, 31 Jul 2015 11:25:04 +0000 (13:25 +0200)]
bus-proxy: make StartServiceByName synchronous

The StartServiceByName() call was provided by dbus-daemon to activate a
service without sending a message. On receiption, dbus-daemon schedules
an activation request (different modes are supported) and sends back the
reply once activation is done.

With kdbus, we marked StartServiceByName() as deprecated. There is no
real reason to start services explicitly. Instead, applications should
just *use* the service and rely on it being activated implicitly.
However, we provide compatibility with dbus-daemon and implement
StartServiceByName() on the proxy via a call to
org.freedesktop.DBus.Peer.Ping() on the destination. This will activate
the peer implicitly as part of the no-op Ping() method call (regardless
whether the peer actually implements that call).

Now, the problem is, StartServiceByName() was synchronous on dbus-daemon
but isn't on bus-proxy. Hence, on return, there is no guarantee that
ListNames includes the activated name. As this is required by some
applications, we need to make this synchronous.

This patch makes the proxy track the Ping() method call and send the
reply of StartServiceByName() only once Ping() returned. We do not look
at possible errors of Ping(), as there is no strict requirement for the
peer to implement org.freedesktop.DBus.Peer. Furthermore, any interesting
error should have already been caught by sd_bus_send() before.

Note:
        This race was triggered by gdbus. The gdbus-proxy implementation
        relies on a name to be available after StartServiceByName()
        returns. This is highly fragile and should be dropped by gdbus.
        Even if the call is synchronous, there is no reason whatsoever to
        assume the service did not exit-on-idle before ListNames()
        returns.
        However, this race is much less likely than the startup race, so
        we try to be compatible to dbus-daemon now.

7 years agosd-bus: fix parsing of KDBUS_CMD_LIST
David Herrmann [Thu, 30 Jul 2015 12:12:09 +0000 (14:12 +0200)]
sd-bus: fix parsing of KDBUS_CMD_LIST

We *must not* assume that an entry returned by KDBUS_CMD_LIST only
carries a single KDBUS_ITEM_OWNED_NAME. Similarly, we already parse
multiple such items for message-metadata, so make sure we support the
same on KDBUS_CMD_LIST.

By relying on the kernel to return all names separately, we limit the
kernel API significantly. Stop this and let the kernel decide how to
return its data.

7 years agosd-boot: stub - export LoaderDevicePartUUID
Kay Sievers [Wed, 29 Jul 2015 17:26:49 +0000 (19:26 +0200)]
sd-boot: stub - export LoaderDevicePartUUID

7 years agosd-bus: fix encoding/decoding gvariant root container
David Herrmann [Wed, 29 Jul 2015 13:58:25 +0000 (15:58 +0200)]
sd-bus: fix encoding/decoding gvariant root container

The gvariant root container contains a 'variant' at the end, which embeds
the whole message body. This variant *must* contain a structure so we are
compatible to dbus1. Otherwise, it could encode at most 1 type, instead
of a full signature.

Our gvariant message parser already parses the variant-content as a
structure, so we're mostly good. However, it does *not* include the
opening and closing parantheses, nor does it parse them.

This patch fixes the decoder to verify a message contains the
parantheses, and also make the encoder add those parantheses into the
marshaled message.

7 years agosocket-util: library calls shouldn't log on their own
Lennart Poettering [Wed, 29 Jul 2015 10:33:44 +0000 (12:33 +0200)]
socket-util: library calls shouldn't log on their own

Instead, make sure that all callers log properly.

7 years agoresolved: never attempt to resolve loopback addresses via DNS/LLMNR/mDNS
Lennart Poettering [Wed, 29 Jul 2015 10:22:55 +0000 (12:22 +0200)]
resolved: never attempt to resolve loopback addresses via DNS/LLMNR/mDNS

We already refuse to resolve "localhost", hence we should also refuse
resolving "127.0.0.1" and friends.

7 years agonetworkd: vxlan add support for GBP
Susant Sahani [Wed, 29 Jul 2015 08:35:34 +0000 (14:05 +0530)]
networkd: vxlan add support for GBP

This patch add support for vxlan  VXLAN Group Policy Option.

https://tools.ietf.org/html/draft-smith-vxlan-group-policy-00
http://lwn.net/Articles/628683/

7 years agosd-netlink: introduce api for new NL type NLA_FLAG
Susant Sahani [Wed, 29 Jul 2015 06:29:16 +0000 (11:59 +0530)]
sd-netlink: introduce api for new NL type NLA_FLAG

7 years agosd-netlink: add support for new type NETLINK_TYPE_FLAG
Susant Sahani [Wed, 29 Jul 2015 05:47:08 +0000 (11:17 +0530)]
sd-netlink: add support for new type NETLINK_TYPE_FLAG

NETLINK_TYPE_FLAG is NLA_FLAG.

This new type will be used in NLA_FLAG for example

IFLA_VXLAN_GBP  and IFLA_VXLAN_REMCSUM_NOPARTIAL

7 years agosd-netlink: add support for vxlan attributes
Susant Sahani [Wed, 29 Jul 2015 05:44:28 +0000 (11:14 +0530)]
sd-netlink: add support for vxlan attributes

7 years agosd-bus: fix marshaling of unary type
David Herrmann [Tue, 28 Jul 2015 16:16:16 +0000 (18:16 +0200)]
sd-bus: fix marshaling of unary type

The unary type has a fixed size of 1 in gvariant. Make sure we properly
encode it as such. Right now, we encode/decode it as empty sequence.

7 years agosd-bus: drop redundant code
David Herrmann [Tue, 28 Jul 2015 16:13:33 +0000 (18:13 +0200)]
sd-bus: drop redundant code

If c->item_size is 0, the next item to parse in a structure is empty.
However, this also implies that the signature must be empty. The latter
case is already handled just fine by enter_struct_or_dict_entry() so
there is no reason to handle the same case in the caller.

7 years agosd-bus: don't assert() on valid signatures
David Herrmann [Tue, 28 Jul 2015 14:46:51 +0000 (16:46 +0200)]
sd-bus: don't assert() on valid signatures

Right now sd_bus_message_skip() will abort execution if passed a
signature of the unary type "()". Regardless whether this should be
supported or not, we really must not abort. Drop the incorrect assertion
and add a test-case for this.

7 years agohwdb: add min/max/resolution override for Appletouch one-button touchpads
Peter Hutterer [Mon, 27 Jul 2015 22:17:04 +0000 (08:17 +1000)]
hwdb: add min/max/resolution override for Appletouch one-button touchpads

Macbook2,1, late 2006 model.

https://bugzilla.redhat.com/show_bug.cgi?id=1246651

7 years agohwdb: add resolution values for Asus K52JT touchpad
Peter Hutterer [Mon, 27 Jul 2015 10:04:25 +0000 (20:04 +1000)]
hwdb: add resolution values for Asus K52JT touchpad

https://bugs.freedesktop.org/show_bug.cgi?id=91364

7 years agosd-netlink: Add macvtap support
Susant Sahani [Mon, 27 Jul 2015 05:48:07 +0000 (11:18 +0530)]
sd-netlink: Add macvtap support

7 years agoman: typo fixes
Thomas Hindoe Paaboel Andersen [Sat, 25 Jul 2015 21:15:05 +0000 (23:15 +0200)]
man: typo fixes

7 years agonetlink-types: use consistent whitespace at EOL
Zbigniew Jędrzejewski-Szmek [Sat, 25 Jul 2015 01:41:35 +0000 (21:41 -0400)]
netlink-types: use consistent whitespace at EOL

Follow up for v222-124-g79e27dbcb1.

7 years agosd-bus: remove _VTABLE from new method vtable initialiser
daurnimator [Fri, 24 Jul 2015 12:59:19 +0000 (22:59 +1000)]
sd-bus: remove _VTABLE from new method vtable initialiser

7 years agosd-bus: add 'offset' member for vtable methods
daurnimator [Fri, 24 Jul 2015 12:22:54 +0000 (22:22 +1000)]
sd-bus: add 'offset' member for vtable methods

Defaults to zero, which retains the current behaviour.
Fixes #577

7 years agosd-bus: don't treat KDBUS_ITEM_TIMESTAMP as unknown item
David Herrmann [Fri, 24 Jul 2015 10:37:12 +0000 (12:37 +0200)]
sd-bus: don't treat KDBUS_ITEM_TIMESTAMP as unknown item

In bus_kernel_translate_message(), we print a DEBUG message on unknown
items. But right now, we also print this message for KDBUS_ITEM_TIMESTAMP
despite parsing it properly. Fix this!

7 years agotreewide: fix typos
Torstein Husebø [Fri, 24 Jul 2015 09:14:01 +0000 (11:14 +0200)]
treewide: fix typos

7 years agounits: order networkd after sysctl
Tom Gundersen [Thu, 23 Jul 2015 18:58:33 +0000 (20:58 +0200)]
units: order networkd after sysctl

This way networkd will correctly and race-freely inherit the default settings
applied by sysctl.

Suggested in issue #468.