[systemd-devel] [PATCH 12/12] connection: when freeing a connection purge its cached entries

2014-06-20 Thread Djalal Harouni
When freeing a connection remove also all the cached entries related to this connection, otherwise if we access this cached entry through another valid connection, we will hit memory corruption bugs. Signed-off-by: Djalal Harouni tix...@opendz.org --- connection.c | 4 +++- domain.h | 2

Re: [systemd-devel] [PATCH 07/12] policy: use the db-entries_hash to access the policy db entries

2014-06-20 Thread Djalal Harouni
On Fri, Jun 20, 2014 at 08:01:04PM +0200, Daniel Mack wrote: On 06/20/2014 07:28 PM, Daniel Mack wrote: On 06/20/2014 06:50 PM, Djalal Harouni wrote: Use the db-entries_hash to access the policy db entries instead of the db-send_access_hash which is just a cache for send entries. Ah

[systemd-devel] [PATCH 1/2] connection: fix cpu stall by checking kdbus item alignment

2014-06-11 Thread Djalal Harouni
[ 142.731011] [81252211] SyS_ioctl+0x81/0xa0 [ 142.731011] [817fe4e9] system_call_fastpath+0x16/0x1b Signed-off-by: Djalal Harouni tix...@opendz.org --- I've checked all the other calls, the remaining one is: connection.c:kdbus_conn_payload_add() it seems that it fakes the size

[systemd-devel] [PATCH 2/2] kdbus-test: fix kdbus item alignment in kdbus_hello_registrar()

2014-06-11 Thread Djalal Harouni
Currently running the test-kdbus-activator test will fail with -EINVAL To fix this, remove the redundant offsetof() macros since it is already handled. The KDBUS_ITEM_SIZE() will expand into KDBUS_ITEM_HEADER_SIZE() which expands into an offsetof() one. Signed-off-by: Djalal Harouni tix

Re: [systemd-devel] [PATCH 1/2] connection: fix cpu stall by checking kdbus item alignment

2014-06-11 Thread Djalal Harouni
Hi, The tests are not clean... just a copy/past if you want to confirm this one! they are attached. patch with policy-holder.patch then run: test-kdbus-policy-holder You should hit it! On Wed, Jun 11, 2014 at 05:27:58PM +0100, Djalal Harouni wrote: Fix the following stall triggered

[systemd-devel] [PATCH] policy: clean up headers and code documentation

2014-06-07 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- policy.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/policy.c b/policy.c index 5a9770d..6f2bb1f 100644 --- a/policy.c +++ b/policy.c @@ -10,11 +10,8 @@ * your option) any later version. */ -#include linux

Re: [systemd-devel] [PATCH] policy: clean up headers and code documentation

2014-06-07 Thread Djalal Harouni
the talk check! Thanks! On Sat, Jun 07, 2014 at 05:26:55PM +0100, Djalal Harouni wrote: Signed-off-by: Djalal Harouni tix...@opendz.org --- policy.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/policy.c b/policy.c index 5a9770d..6f2bb1f 100644 --- a/policy.c

Re: [systemd-devel] [PATCH] policy: clean up headers and code documentation

2014-06-07 Thread Djalal Harouni
On Sat, Jun 07, 2014 at 06:29:21PM +0200, Daniel Mack wrote: On 06/07/2014 06:26 PM, Djalal Harouni wrote: Signed-off-by: Djalal Harouni tix...@opendz.org Applied, thanks! Oh that was quick! This answers my first question of the other email! Thanks Daniel! --- policy.c | 9

Re: [systemd-devel] [PATCH] policy: clean up headers and code documentation

2014-06-07 Thread Djalal Harouni
On Sat, Jun 07, 2014 at 06:58:50PM +0200, Daniel Mack wrote: Hi Djalal, On 06/07/2014 06:47 PM, Djalal Harouni wrote: I'm sending this to have some updates on the policy! I did notice some issues and others still *to confirm*, so first I'm writing some policy tests to make sure we

Re: [systemd-devel] [PATCH] domain: fix a BUG_ON() when kdbus_domain_new() fails

2014-06-03 Thread Djalal Harouni
On Tue, Jun 03, 2014 at 12:55:54PM +0200, Kay Sievers wrote: On Mon, Jun 2, 2014 at 5:57 PM, Djalal Harouni tix...@opendz.org wrote: Currently just running: test/test-kdbus will trigger the BUG_ON() appended at the bottom. This is due to the test in check_domain_make() where we try

[systemd-devel] [PATCH v2] domain: rework kdbus_domain_new() error path to fix a BUG_ON()

2014-06-03 Thread Djalal Harouni
[kdbus] [16254.437815] ---[ end trace bb9a1036dec78fcc ]--- Signed-off-by: Djalal Harouni tix...@opendz.org --- domain.c | 22 -- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/domain.c b/domain.c index 4748a17..c4912fa 100644 --- a/domain.c +++ b/domain.c @@ -267,7

Re: [systemd-devel] Restarting from inside systemd-nspawn container results in deactivation

2014-06-02 Thread Djalal Harouni
___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- Djalal Harouni http://opendz.org ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http

Re: [systemd-devel] [PATCH v3 2/2] nspawn: make nspawn robust to container failure

2014-06-02 Thread Djalal Harouni
On Sun, May 25, 2014 at 05:28:13AM +0200, Lennart Poettering wrote: On Sat, 24.05.14 14:58, Djalal Harouni (tix...@opendz.org) wrote: Applied both. Thanks! Ok, thanks! However, I am not too convinced about the clone() thing in shared/eventfd-util.[ch]. That sounds too specific to be shared

Re: [systemd-devel] Restarting from inside systemd-nspawn container results in deactivation

2014-06-02 Thread Djalal Harouni
On Mon, Jun 02, 2014 at 10:04:43PM +1000, Jonathan Liu wrote: On 2/06/2014 8:51 PM, Djalal Harouni wrote: On Mon, Jun 02, 2014 at 11:47:39AM +1000, Jonathan Liu wrote: Hi, I am using systemd 212 on Arch Linux 64-bit with the following patch applied: http://cgit.freedesktop.org/systemd

[systemd-devel] [PATCH] domain: fix a BUG_ON() when kdbus_domain_new() fails

2014-06-02 Thread Djalal Harouni
[16254.398524] RIP [a031939b] __kdbus_domain_free+0x9b/0xa0 [kdbus] [16254.398524] RSP 880005959de8 [16254.437815] ---[ end trace bb9a1036dec78fcc ]--- Signed-off-by: Djalal Harouni tix...@opendz.org --- domain.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[systemd-devel] [PATCH] connection: pin the subjective cred for KDBUS_POLICY_OWN

2014-05-31 Thread Djalal Harouni
Make sure that the credentials of the connection at creation time will last so the kdbus_policy_check_own_access() will work as expected. Signed-off-by: Djalal Harouni tix...@opendz.org --- connection.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/connection.c b

Re: [systemd-devel] [PATCH 3/3] nspawn: allow to bind mount journal on top of a non empty container journal dentry

2014-05-24 Thread Djalal Harouni
On Thu, May 22, 2014 at 08:23:41AM +0200, Lennart Poettering wrote: On Tue, 29.04.14 00:15, Djalal Harouni (tix...@opendz.org) wrote: On Fri, Apr 25, 2014 at 08:30:36PM +0200, Tom Gundersen wrote: On Fri, Apr 11, 2014 at 2:45 AM, Djalal Harouni tix...@opendz.org wrote: Currently

[systemd-devel] [PATCH v3 2/2] nspawn: make nspawn robust to container failure

2014-05-24 Thread Djalal Harouni
@@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Djalal Harouni + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free

Re: [systemd-devel] [RFC] nspawn: make nspawn robust to container failure

2014-05-24 Thread Djalal Harouni
On Thu, May 22, 2014 at 02:52:08AM +0200, Lennart Poettering wrote: On Fri, 02.05.14 16:45, Djalal Harouni (tix...@opendz.org) wrote: nspawn and the container child use eventfd to wait and notify each other that they are ready so the container setup can be completed. Looks good

Re: [systemd-devel] [PATCH] Fix a few compiler warnings

2014-05-23 Thread Djalal Harouni
[-Wmaybe-uninitialized] if (lease-dns_size) { ^ src/network/sd-network.c:146:24: note: 'lease' was declared here sd_dhcp_lease *lease; ^ Thanks! -- Djalal Harouni http://opendz.org ___ systemd-devel

Re: [systemd-devel] [PATCH] Fix a few compiler warnings

2014-05-19 Thread Djalal Harouni
)? I guess this is reported by gcc -Wmaybe-uninitialized I've experienced these false positive warnings, with different gcc versions! the -Wmaybe-uninitialized is affected by the optimization flags and lto, I would say the warnings depend on the code path and how it's optimized... -- Djalal

Re: [systemd-devel] remounting root fs outside containers as MS_SHARED

2014-05-14 Thread Djalal Harouni
? Why pivot_root() fails ? I remember I've experienced something like this, I'm not sure if it's the same case, or if this will work for you: you could bind mount your new_root just before the pivot_root() -- Djalal Harouni http://opendz.org

Re: [systemd-devel] [PATCH v2 1/2] hostnamed: expose KernelVersion on the bus

2014-05-08 Thread Djalal Harouni
On Thu, Apr 24, 2014 at 11:45:24PM +0200, Zbigniew Jędrzejewski-Szmek wrote: On Thu, Apr 24, 2014 at 10:34:05PM +0100, Djalal Harouni wrote: On Thu, Apr 24, 2014 at 08:53:27AM +0200, Lennart Poettering wrote: On Wed, 23.04.14 23:03, Djalal Harouni (tix...@opendz.org) wrote

[systemd-devel] [PATCH v2] nspawn: move container wait logic into wait_for_container()

2014-05-02 Thread Djalal Harouni
Move the container wait logic into its own wait_for_container() function and add two status codes: CONTAINER_TERMINATED or CONTAINER_REBOOTED. These status codes are used to terminate nspawn or loop again in case of CONTAINER_REBOOTED. --- v1 - v2: Apply Tom Gundersen notes. src/nspawn/nspawn.c

Re: [systemd-devel] [PATCH 2/3] nspawn: make nspawn able to cleanly terminate on container errors

2014-05-02 Thread Djalal Harouni
On Fri, Apr 25, 2014 at 08:12:13PM +0200, Tom Gundersen wrote: On Fri, Apr 11, 2014 at 2:45 AM, Djalal Harouni tix...@opendz.org wrote: nspawn and the container child use eventfd to wait and notify each other that they are ready so the container setup can be completed. However in its

[systemd-devel] [RFC] nspawn: make nspawn robust to container failure

2014-05-02 Thread Djalal Harouni
/eventfd-util.c @@ -0,0 +1,144 @@ +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ + +/*** + This file is part of systemd. + + Copyright 2014 Djalal Harouni + + systemd is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License

Re: [systemd-devel] Blog on running systemd within a docker container.

2014-05-02 Thread Djalal Harouni
on host, and bind mounted into the container. Thanks for the blog! -- Djalal Harouni http://opendz.org ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] [PATCH 1/3] nspawn: move container wait logic into wait_for_container() function

2014-04-28 Thread Djalal Harouni
On Fri, Apr 25, 2014 at 08:07:29PM +0200, Tom Gundersen wrote: On Fri, Apr 11, 2014 at 2:45 AM, Djalal Harouni tix...@opendz.org wrote: Move the container wait logic into its own wait_for_container() function and add two status codes: CONTAINER_TERMINATED or CONTAINER_REBOOTED

Re: [systemd-devel] [PATCH 3/3] nspawn: allow to bind mount journal on top of a non empty container journal dentry

2014-04-28 Thread Djalal Harouni
On Fri, Apr 25, 2014 at 08:30:36PM +0200, Tom Gundersen wrote: On Fri, Apr 11, 2014 at 2:45 AM, Djalal Harouni tix...@opendz.org wrote: Currently if nspawn was called with --link-journal=host or --link-journal=auto and the right /var/log/journal/machine-id/ exists then the bind mount

Re: [systemd-devel] [PATCH v2 1/2] hostnamed: expose KernelVersion on the bus

2014-04-24 Thread Djalal Harouni
On Thu, Apr 24, 2014 at 08:53:27AM +0200, Lennart Poettering wrote: On Wed, 23.04.14 23:03, Djalal Harouni (tix...@opendz.org) wrote: This is needed to fix bug: https://bugs.freedesktop.org/show_bug.cgi?id=76498 Hmm, do we really want to expose the version here? I fail to see

Re: [systemd-devel] [PATCH 1/2] hostnamed: expose OperatingSystemName and OperatingSystemRelease on the bus

2014-04-23 Thread Djalal Harouni
On Wed, Apr 23, 2014 at 11:05:53PM +0200, Lennart Poettering wrote: On Thu, 27.03.14 19:48, Djalal Harouni (tix...@opendz.org) wrote: Hmm, thinking about this again, given that this is actually the kernel identity we return here we should really name those props KernelName and KernelRelease

[systemd-devel] [PATCH v2 1/2] hostnamed: expose KernelName and KernelRelease on the bus

2014-04-23 Thread Djalal Harouni
--- src/hostname/hostnamed.c | 12 1 file changed, 12 insertions(+) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 3b19d43..2be6dcd 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -23,6 +23,7 @@ #include string.h #include unistd.h

[systemd-devel] [PATCH v2 2/2] hostnamectl: read kernel name and release from remote

2014-04-23 Thread Djalal Harouni
--- src/hostname/hostnamectl.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index 326f371..70049d3 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -67,6 +67,8 @@ typedef struct

[systemd-devel] [PATCH v2 1/2] hostnamed: expose KernelVersion on the bus

2014-04-23 Thread Djalal Harouni
This is needed to fix bug: https://bugs.freedesktop.org/show_bug.cgi?id=76498 Reported-by: Zach zachcook1...@gmail.com --- src/hostname/hostnamed.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 2be6dcd..a798f16

[systemd-devel] [PATCH v2 2/2] analyze: read host and system information from remote

2014-04-23 Thread Djalal Harouni
This makes systemd-analyze plot read host information from remote. While we are it show if this is a virtualized system. https://bugs.freedesktop.org/show_bug.cgi?id=76498 Reported-by: Zach zachcook1...@gmail.com --- src/analyze/analyze.c | 109

Re: [systemd-devel] [PATCH] systemctl: allow to change the default target without the --force switch

2014-04-22 Thread Djalal Harouni
On Tue, Apr 22, 2014 at 08:01:43AM +0200, Lennart Poettering wrote: On Mon, 14.04.14 01:07, Djalal Harouni (tix...@opendz.org) wrote: Currently systemctl set-default will fail to change the default target due to the 'default.target' being a symlink which is always the case. Humm

Re: [systemd-devel] [PATCH] systemctl: systemctl --root=container/ set-default ... is totally borked.

2014-04-18 Thread Djalal Harouni
On Thu, Apr 17, 2014 at 01:42:23PM +0200, Zbigniew Jędrzejewski-Szmek wrote: On Thu, Apr 17, 2014 at 10:40:37AM +0200, Jan Chaloupka wrote: On 04/17/2014 04:59 AM, Zbigniew Je;drzejewski-Szmek wrote: On Thu, Apr 17, 2014 at 01:41:51AM +0100, Djalal Harouni wrote: BTW, I've a question, why

[systemd-devel] [PATCH] names: take the registry write lock in kdbus_name_release()

2014-04-17 Thread Djalal Harouni
advantage is that now kdbus_cmd_name_release() and kdbus_name_release() have the same semantic of kdbus_cmd_name_acquire() and kdbus_name_acquire() Signed-off-by: Djalal Harouni tix...@opendz.org --- names.c | 101 +--- 1 file changed, 52

Re: [systemd-devel] [PATCH] systemctl: allow to change the default target without the --force switch

2014-04-16 Thread Djalal Harouni
On Mon, Apr 14, 2014 at 01:07:52AM +0100, Djalal Harouni wrote: Currently systemctl set-default will fail to change the default target due to the 'default.target' being a symlink which is always the case. To work around this, the user must specify the --force switch to be able to overwrite

[systemd-devel] [PATCH] install: create_symlink() check unlink() return value

2014-04-16 Thread Djalal Harouni
create_symlink() do not check the return value of unlink(), this may confuse the user. Before the unlink() call we check the 'force' argument. If it is not set we fail with -EEXIST, otherwise we unlink() the file, therefore the next symlink() should not fail with -EEXIST (do not count races...).

[systemd-devel] [PATCH] systemctl: allow to change the default target without the --force switch

2014-04-13 Thread Djalal Harouni
Currently systemctl set-default will fail to change the default target due to the 'default.target' being a symlink which is always the case. To work around this, the user must specify the --force switch to be able to overwrite the existing symlink. This is clearly a regression that was

[systemd-devel] [PATCH 0/3] nspawn: make nspawn able to cleanly terminate - bug 76193

2014-04-10 Thread Djalal Harouni
Code cleaning and Fix bug: https://bugs.freedesktop.org/show_bug.cgi?id=76193 Thanks! ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] [PATCH 1/3] nspawn: move container wait logic into wait_for_container() function

2014-04-10 Thread Djalal Harouni
Move the container wait logic into its own wait_for_container() function and add two status codes: CONTAINER_TERMINATED or CONTAINER_REBOOTED These status codes are used to terminate nspawn or loop again in case of CONTAINER_REBOOTED. --- src/nspawn/nspawn.c | 114

[systemd-devel] [PATCH 2/3] nspawn: make nspawn able to cleanly terminate on container errors

2014-04-10 Thread Djalal Harouni
nspawn and the container child use eventfd to wait and notify each other that they are ready so the container setup can be completed. However in its current form the wait/notify event ignore errors that may especially affect the child (container). On errors the child will jump to the child_fail

[systemd-devel] [PATCH 3/3] nspawn: allow to bind mount journal on top of a non empty container journal dentry

2014-04-10 Thread Djalal Harouni
Currently if nspawn was called with --link-journal=host or --link-journal=auto and the right /var/log/journal/machine-id/ exists then the bind mount the subdirectory into the container might fail due to the ~/mycontainer/var/log/journal/machine-id/ of the container not being empty. There is no

Re: [systemd-devel] [PATCH] metadata: reflect change in task_cgroup_name

2014-04-09 Thread Djalal Harouni
! -- Djalal Harouni http://opendz.org ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] [PATCH 0/2] systemd-analyze: read info from remote - fix bug 76498

2014-04-07 Thread Djalal Harouni
Fix bug: https://bugs.freedesktop.org/show_bug.cgi?id=76498 First, please apply this series: http://lists.freedesktop.org/archives/systemd-devel/2014-March/018257.html The fix needs these patches too! I did make this information available on the bus of hostnamed, since Lennart suggested that

[systemd-devel] [PATCH 1/2] hostnamed: expose OperatingSystemVersion on the bus

2014-04-07 Thread Djalal Harouni
This is needed to fix bug: https://bugs.freedesktop.org/show_bug.cgi?id=76498 Reported-by: Zach zachcook1...@gmail.com --- src/hostname/hostnamed.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index abafa62..ca80d50

[systemd-devel] [PATCH 2/2] systemd-analyze: read host and system information from remote

2014-04-07 Thread Djalal Harouni
This makes systemd-analyze plot read host information from remote. While we are it show if this is a virtualized system. https://bugs.freedesktop.org/show_bug.cgi?id=76498 Reported-by: Zach zachcook1...@gmail.com --- src/analyze/analyze.c | 105

[systemd-devel] [PATCH 1/4] connection: remove useless kdbus_str_hash() call

2014-03-30 Thread Djalal Harouni
The hash is calculated internally in kdbus_name_lookup(), so just remove this useless kdbus_str_hash() call. It is not used. Signed-off-by: Djalal Harouni tix...@opendz.org --- connection.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/connection.c b/connection.c index 753903b..c623720

[systemd-devel] [PATCH 2/4] endpoint: protect the idr tree on release

2014-03-30 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- endpoint.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/endpoint.c b/endpoint.c index 66b4de5..f37b80a 100644 --- a/endpoint.c +++ b/endpoint.c @@ -104,7 +104,9 @@ void kdbus_ep_disconnect(struct kdbus_ep *ep) ep-dev

[systemd-devel] [PATCH 3/4] handle: change return value from -EFAULT to -EPERM

2014-03-30 Thread Djalal Harouni
Return -EPERM if current does not have the appropriate privileges to create custom endpoints. Signed-off-by: Djalal Harouni tix...@opendz.org --- handle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handle.c b/handle.c index 8082241..eda88c1 100644 --- a/handle.c +++ b

[systemd-devel] [PATCH 4/4] connection: unref ep and bus and free match_db on error path

2014-03-30 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- connection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connection.c b/connection.c index c623720..e01e0ab 100644 --- a/connection.c +++ b/connection.c @@ -2062,7 +2062,7 @@ int kdbus_conn_new(struct kdbus_ep *ep

[systemd-devel] [PATCH 2/2] kdbus: use kdbus_conn_find_peer() where appropriate

2014-03-30 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- connection.c | 7 ++- match.c | 14 ++ names.c | 5 + 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/connection.c b/connection.c index 97fde97..f14cedc 100644 --- a/connection.c +++ b/connection.c

[systemd-devel] [PATCH 1/2] hostnamed: expose OperatingSystemName and OperatingSystemRelease on the bus

2014-03-27 Thread Djalal Harouni
--- src/hostname/hostnamed.c | 12 1 file changed, 12 insertions(+) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 3b19d43..abafa62 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -23,6 +23,7 @@ #include string.h #include unistd.h

[systemd-devel] [PATCH 2/2] hostnamectl: read OS name and release from remote

2014-03-27 Thread Djalal Harouni
--- src/hostname/hostnamectl.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index 326f371..12ab8e2 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -67,6 +67,8 @@ typedef struct

[systemd-devel] [PATCH 1/2] endpoint: free the policy_db on error path

2014-03-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- endpoint.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/endpoint.c b/endpoint.c index 465ae31..5afabf9 100644 --- a/endpoint.c +++ b/endpoint.c @@ -236,7 +236,7 @@ int kdbus_ep_new(struct kdbus_bus *bus, const char

[systemd-devel] [PATCH 2/2] test-kdbus: rename check bus and domain functions

2014-03-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- test/test-kdbus.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/test-kdbus.c b/test/test-kdbus.c index 0427419..6f9b3e9 100644 --- a/test/test-kdbus.c +++ b/test/test-kdbus.c @@ -259,7 +259,7 @@ static int

[systemd-devel] [PATCH] handle: unref handle-ep and free handle-meta on error path

2014-03-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- handle.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/handle.c b/handle.c index 921faca..3af6119 100644 --- a/handle.c +++ b/handle.c @@ -130,7 +130,7 @@ static int kdbus_handle_open(struct inode *inode, struct

Re: [systemd-devel] [PATCH 2/2] domain: grab the domain's parent lock only when needed

2014-03-22 Thread Djalal Harouni
. Reviewing all these details is certainly much appreciated. I'll add a few more disconnected checks before we link into the parent objects. Yes, I've located some sites, and I'm trying to do more tests... I'll get back to you, Thanks Daniel, Kay! Kay -- Djalal Harouni http://opendz.org

Re: [systemd-devel] [PATCH 2/2] domain: grab the domain's parent lock only when needed

2014-03-22 Thread Djalal Harouni
On Sat, Mar 22, 2014 at 08:28:38PM +0100, Kay Sievers wrote: On Sat, Mar 22, 2014 at 7:56 PM, Djalal Harouni tix...@opendz.org wrote: On Sat, Mar 22, 2014 at 07:37:38PM +0100, Kay Sievers wrote: On Sat, Mar 22, 2014 at 3:43 PM, Daniel Mack dan...@zonque.org wrote: Also it seems that now

Re: [systemd-devel] [PATCH 1/2] domain: move compose logic on its own kdbus_domain_compose_path() function

2014-03-21 Thread Djalal Harouni
On Thu, Mar 20, 2014 at 11:01:35AM +0100, Daniel Mack wrote: Hi, On 03/19/2014 09:24 PM, Djalal Harouni wrote: Signed-off-by: Djalal Harouni tix...@opendz.org --- domain.c | 68 +++- 1 file changed, 37 insertions(+), 31

Re: [systemd-devel] [PATCH 2/2] domain: grab the domain's parent lock only when needed

2014-03-21 Thread Djalal Harouni
On Thu, Mar 20, 2014 at 10:58:21AM +0100, Daniel Mack wrote: On 03/19/2014 09:24 PM, Djalal Harouni wrote: Signed-off-by: Djalal Harouni tix...@opendz.org --- domain.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/domain.c b/domain.c index

[systemd-devel] [PATCH 1/2] domain: move compose logic on its own kdbus_domain_compose_path() function

2014-03-19 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- domain.c | 68 +++- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/domain.c b/domain.c index 2e05e90..d27cad2 100644 --- a/domain.c +++ b/domain.c @@ -223,12 +223,44

[systemd-devel] [PATCH 2/2] domain: grab the domain's parent lock only when needed

2014-03-19 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- domain.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/domain.c b/domain.c index d27cad2..554b4fe 100644 --- a/domain.c +++ b/domain.c @@ -183,12 +183,13 @@ struct kdbus_domain *kdbus_domain_unref(struct

[systemd-devel] [PATCH] endpoint: break if an endpoint was found

2014-03-19 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- endpoint.c | 1 + 1 file changed, 1 insertion(+) diff --git a/endpoint.c b/endpoint.c index 876e5e3..a6d9dfb 100644 --- a/endpoint.c +++ b/endpoint.c @@ -139,6 +139,7 @@ static struct kdbus_ep *kdbus_ep_find(struct kdbus_bus *bus, const char

[systemd-devel] [PATCH 1/2] kdbus: add kdbus_item_validate_name() to validate names

2014-03-17 Thread Djalal Harouni
Signed-off-by: Djalal Harouni tix...@opendz.org --- util.c | 22 ++ util.h | 2 ++ 2 files changed, 24 insertions(+) diff --git a/util.c b/util.c index 6dbcd8d..2e13f7c 100644 --- a/util.c +++ b/util.c @@ -14,6 +14,7 @@ #include linux/string.h #include util.h +#include

[systemd-devel] [PATCH 2/2] kdbus: use kdbus_item_validate_name() to validate names

2014-03-17 Thread Djalal Harouni
Use kdbus_item_validate_name() where appropriate. Signed-off-by: Djalal Harouni tix...@opendz.org --- bus.c| 11 +-- connection.c | 9 + domain.c | 15 +-- endpoint.c | 12 +--- handle.c | 18 +- 5 files changed, 5 insertions

Re: [systemd-devel] [PATCH 3/3] hostnamectl: read pretty_name and cpe_name from remote

2014-03-11 Thread Djalal Harouni
On Tue, Mar 11, 2014 at 05:01:33AM +0100, Lennart Poettering wrote: On Tue, 04.03.14 23:01, Djalal Harouni (tix...@opendz.org) wrote: The other two patches look fine (well, this one needs updating, if the prop names change as proposed in the other mail...) Please rebase, and repost

[systemd-devel] [PATCH v2 1/3] hostnamed: minor improvements in context_write_data_other()

2014-03-11 Thread Djalal Harouni
Prepare context_write_data_other() and rename it to context_write_data_machine_info() --- src/hostname/hostnamed.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index 6aa08ca..fab0601 100644 ---

[systemd-devel] [PATCH v2 2/3] hostnamed: expose OperatingSystemPrettyName and OperatingSystemCPEName on the bus

2014-03-11 Thread Djalal Harouni
--- src/hostname/hostnamed.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c index fab0601..3b19d43 100644 --- a/src/hostname/hostnamed.c +++ b/src/hostname/hostnamed.c @@ -40,6 +40,8 @@ enum { PROP_PRETTY_HOSTNAME,

[systemd-devel] [PATCH v2 3/3] hostnamectl: read OS pretty_name and cpe_name from remote

2014-03-11 Thread Djalal Harouni
--- src/hostname/hostnamectl.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index 94b4243..326f371 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -67,6 +67,8 @@

Re: [systemd-devel] [210] logind bypasses polkit? bug or new feature?

2014-03-10 Thread Djalal Harouni
confirm this, I'm attaching a patch that will just disable this, but I'm not sure about the inhibitor logic here did not have time to test it. -- Djalal Harouni http://opendz.org From: Djalal Harouni tix...@opendz.org Subject: [PATCH] logind: remove the SD_BUS_VTABLE_UNPRIVILEGED flag from sensitive

[systemd-devel] [PATCH 0/3] hostname: read pretty_name and cpe_name from remote

2014-03-04 Thread Djalal Harouni
Expose pretty_name and cpe_name in hostnamed and update hostnamectl to read from the remote. This series does not include code to update the '/etc/os-release' file and the related fields. If you think that we should do it, I can update the patch. Thanks!

[systemd-devel] [PATCH 3/3] hostnamectl: read pretty_name and cpe_name from remote

2014-03-04 Thread Djalal Harouni
--- src/hostname/hostnamectl.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c index 94b4243..ad359d6 100644 --- a/src/hostname/hostnamectl.c +++ b/src/hostname/hostnamectl.c @@ -67,6 +67,8 @@

[systemd-devel] [PATCH] metadata: use the subjective cred of current

2014-03-02 Thread Djalal Harouni
In kdbus_meta_append_*() we want to get the subjective context, so instead of using __task_cred() which reference the objective cred, use current_cred() to access the subjective cred. Signed-off-by: Djalal Harouni tix...@opendz.org --- Compile tested and make check metadata.c | 14

[systemd-devel] [PATCH resend] virt: detect_virtualization() do not abort on errors

2014-02-25 Thread Djalal Harouni
The detect_virtualization() logic is to test several mechanisms in order to detect if we are in a container or a virtual machine. This implies that these tests may fail at an undetermined point. An example: detect_container() needs privileges where detect_vm() does not, perhaps there are other

Re: [systemd-devel] [PATCH resend] virt: detect_virtualization() do not abort on errors

2014-02-25 Thread Djalal Harouni
On Tue, Feb 25, 2014 at 07:11:00PM +0100, Lennart Poettering wrote: On Tue, 25.02.14 18:29, Djalal Harouni (tix...@opendz.org) wrote: The detect_virtualization() logic is to test several mechanisms in order to detect if we are in a container or a virtual machine. This implies

[systemd-devel] [PATCH 1/2] dbus-timer: fix bus_timer_vtable to have the correct times

2014-02-23 Thread Djalal Harouni
next_elapse_monotonic() should map to the NextElapseUSecMonotonic property and next_elapse_realtime() to NextElapseUSecRealtime one. This makes systemctl list-timers compute and show the correct times. https://bugs.freedesktop.org/show_bug.cgi?id=75272 --- src/core/dbus-timer.c | 4 ++-- 1

[systemd-devel] [PATCH 2/2] systemctl: move next elapse calculation to its own function

2014-02-23 Thread Djalal Harouni
--- src/systemctl/systemctl.c | 42 +++--- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 3375bac..7a286ff 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@

[systemd-devel] [PATCH] logind: add a debug message in case the session already exists

2014-02-19 Thread Djalal Harouni
If the session already exists then the only way to log it is to set the debug option of pam_systemd. There are no debug messages in the login service that permits to log if the session already exists. So just add it, and while we are it add the uid field to the debug message that indicates that

Re: [systemd-devel] [HEADS-UP] It's release time!

2014-02-19 Thread Djalal Harouni
GCC __attribute__ ((cleanup)) (this is a new feature) IMHO we still need that flag. -- Djalal Harouni http://opendz.org ___ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel

[systemd-devel] [PATCH] build: add white space between _XZ_FEATURE_ and _SECCOMP_FEATURE_

2014-02-15 Thread Djalal Harouni
--- src/core/build.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/build.h b/src/core/build.h index f04f03f..c8117ed 100644 --- a/src/core/build.h +++ b/src/core/build.h @@ -87,4 +87,4 @@ #define _SECCOMP_FEATURE_ -SECCOMP #endif -#define SYSTEMD_FEATURES

[systemd-devel] [PATCH] nspawn: do not check audit if --boot argument is not set

2014-02-15 Thread Djalal Harouni
Currently systemd-nspawn will call reset_audit_loginuid() and check if audit is enabled in the kernel even if it was invoked without the --boot argument. This makes systemd-nspawn print the audit error message and sleep(5) on every execution. This was introduced by commit db999e0f923ca6. Fix it

[systemd-devel] [PATCH v3] logind: make sure to terminate systemd user on logouts

2014-02-13 Thread Djalal Harouni
Currently if the user logs out, the GC may never call user_stop(), this will not terminate the systemd user and (sd-pam) of that user. To fix this, remove the USER_CLOSING state check that is blocking the GC from calling user_stop(). Since if user_check_gc() returns false this means that all the

[systemd-devel] [PATCH] logind: close race on session state during logins

2014-02-13 Thread Djalal Harouni
At login there is a small race window where session_get_state() will return SESSION_ACTIVE instead of SESSION_OPENING. This must be fixed since during that time there are calls to session_save() to save session states and we want to write the correct state. When we queue the start scope and

Re: [systemd-devel] [PATCH 2/7] logind: close races on user and session states during login

2014-02-13 Thread Djalal Harouni
On Fri, Feb 07, 2014 at 04:48:39PM +0100, Lennart Poettering wrote: On Thu, 06.02.14 21:37, Djalal Harouni (tix...@opendz.org) wrote: I think this one I fixed by adding a new stopping variable. Could you check? Yes, the stopping variable caught most of the races, I've sent another patch

Re: [systemd-devel] [PATCH] logind: just call user_stop() if user_check_gc() returns false

2014-02-11 Thread Djalal Harouni
On Tue, Feb 11, 2014 at 08:38:48PM +0100, Lennart Poettering wrote: On Sat, 08.02.14 19:20, Djalal Harouni (tix...@opendz.org) wrote: Currently if the user logs out, the GC may never call user_stop(), this will not terminate the systemd user and (sd-pam) of that user. To fix

[systemd-devel] [PATCH v2] logind: make sure to terminate systemd user on logouts

2014-02-11 Thread Djalal Harouni
Currently if the user logs out, the GC may never call user_stop(), this will not terminate the systemd user and (sd-pam) of that user. To fix this, remove the USER_CLOSING state check that is blocking the GC from calling user_stop(). Since if user_check_gc() returns false this means that all the

Re: [systemd-devel] [PATCH v2 0/7] logind: close races on user and session states

2014-02-10 Thread Djalal Harouni
On Sat, Feb 08, 2014 at 05:00:57PM +0100, Djalal Harouni wrote: On Sat, Feb 08, 2014 at 12:39:25AM +0100, Zbigniew Jędrzejewski-Szmek wrote: On Thu, Feb 06, 2014 at 09:37:13PM +0100, Djalal Harouni wrote: Summary: Currently logind will not clear sessions on logout. The bug is confirmed

Re: [systemd-devel] [PATCH v2 0/7] logind: close races on user and session states

2014-02-08 Thread Djalal Harouni
On Sat, Feb 08, 2014 at 12:39:25AM +0100, Zbigniew Jędrzejewski-Szmek wrote: On Thu, Feb 06, 2014 at 09:37:13PM +0100, Djalal Harouni wrote: Summary: Currently logind will not clear sessions on logout. The bug is confirmed for getty and ssh logins. This series is preparation for next

[systemd-devel] [PATCH] logind: just call user_stop() if user_check_gc() returns false

2014-02-08 Thread Djalal Harouni
Currently if the user logs out, the GC may never call user_stop(), this will not terminate the systemd user and (sd-pam) of that user. To fix this, remove the USER_CLOSING state check that is blocking the GC from calling user_stop(). We do not need it since with the current logic we have: 1) if

[systemd-devel] [PATCH] logind: use session_get_state() to get sessions state of the user

2014-02-08 Thread Djalal Harouni
In function user_get_state() remove the session_is_active() check, just count on the session_get_state() function to get the correct session state. session_is_active() may return true before starting the session scope and user service, this means it will return true even before the creation of

Re: [systemd-devel] [PATCH] logind: use session_get_state() to get sessions state of the user

2014-02-08 Thread Djalal Harouni
On Sat, Feb 08, 2014 at 10:01:18PM +0100, Zbigniew Jędrzejewski-Szmek wrote: On Sat, Feb 08, 2014 at 08:51:57PM +0100, Djalal Harouni wrote: In function user_get_state() remove the session_is_active() check, just count on the session_get_state() function to get the correct session state

Re: [systemd-devel] [PATCH v2 0/7] logind: close races on user and session states

2014-02-07 Thread Djalal Harouni
On Fri, Feb 07, 2014 at 04:29:48PM +0100, Lennart Poettering wrote: On Thu, 06.02.14 21:37, Djalal Harouni (tix...@opendz.org) wrote: Heya! So, I was working on fixes for this in parallel which I have pushed earlier today, which change a couple of things around in more complex ways. Some

[systemd-devel] [PATCH 2/7] logind: close races on user and session states during login

2014-02-06 Thread Djalal Harouni
Currently the user and session states are not stable, they are affected by several races during login: 1) session state: To get the session state the function session_get_state() is used. Opening state: At login the D-Bus CreateSession() method will call session_start() which calls

[systemd-devel] [PATCH 1/7] logind: add function session_jobs_reply() to unify the create reply

2014-02-06 Thread Djalal Harouni
The session_send_create_reply() function which notifies clients about session creation is used for both session and user units. Unify the shared code in a new function session_jobs_reply(). The session_save() will be called unconditionally on sessions since it does not make sense to only call it

[systemd-devel] [PATCH v2 0/7] logind: close races on user and session states

2014-02-06 Thread Djalal Harouni
and session states. Djalal Harouni (7): 0001 logind: add function session_jobs_reply() to unify the create reply unify shared code in a single function. 0002 logind: close races on user and session states during login 0003 logind: close races on session state at logout 0004 logind: close races

[systemd-devel] [PATCH 3/7] logind: close races on session state at logout

2014-02-06 Thread Djalal Harouni
To get the state of the session, the session_get_state() is used. This function will check if the session-scope_job is set then it will automatically return SESSION_OPENING. This is buggy in the context of session closing: At logout or D-Bus TerminateSession() fifo_fd is removed: =

[systemd-devel] [PATCH 4/7] logind: close races on user state at logout

2014-02-06 Thread Djalal Harouni
To get the state of the user, the user_get_state() is used. This function will check if the user-slice_job or the user-service_job are set then it will automatically return USER_OPENING. This is buggy in the context of user closing: At logout or D-Bus TerminateUser() calls user_stop() user_stop()

<    1   2   3   >