Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Pavel Raiskup
On Wednesday 17 of September 2014 01:33:02 Zbigniew Jędrzejewski-Szmek wrote: > On Tue, Sep 16, 2014 at 05:07:06PM +0200, Pavel Raiskup wrote: > > > for example > > > tmpfiles.d/systemd.conf and tmpfiles.d/systemd-nologin.conf are split > > > exactly for the purpose of making it easier to override

Re: [systemd-devel] Suppressing automounting

2014-09-16 Thread Tobias Geerinckx-Rice
Hallo, On 14 September 2014 19:49, Andrei Borzenkov wrote: > В Thu, 11 Sep 2014 21:53:27 +0200 > Tobias Geerinckx-Rice пишет: >> >> From my reading of the thread, this is to emulate as closely ye olde >> initscripts' unreliable and flawed behaviour of attempting to mount >> one or more devices e

[systemd-devel] [PATCH 0/2] label: rearrange mandatory access control(MAC) apis

2014-09-16 Thread WaLyong Cho
rebased again. It make a conflict by long pending. WaLyong Cho (2): label: rearrange mandatory access control(MAC) apis udev: do NOT re-label smack src/core/main.c | 4 +- src/core/namespace.c | 4 +- src/core/selinux-setup.c | 4 +- src/core/socket.c

[systemd-devel] [PATCH 1/2] label: rearrange mandatory access control(MAC) apis

2014-09-16 Thread WaLyong Cho
move selinux label APIs to selinux-label.ch. And each security label apis have mac_{selinux/smack}_ prefix. --- src/core/main.c | 4 +- src/core/namespace.c | 4 +- src/core/selinux-setup.c | 4 +- src/core/socket.c | 24 +-- src/hostname/hostnamed.c

[systemd-devel] [PATCH 2/2] udev: do NOT re-label smack

2014-09-16 Thread WaLyong Cho
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. --- src/udev/udev-node.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c index f46638f..3c49482

[systemd-devel] [PATCH 2/2] test: Use 'CapBnd' string for capability bounding set

2014-09-16 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- test/kdbus-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/kdbus-util.c b/test/kdbus-util.c index fe4565c..b1c5864 100644 --- a/test/kdbus-util.c +++ b/test/kdbus-util.c @@ -569,7 +569,7 @@ void kdbus_msg_dump(const struct kdbus_co

[systemd-devel] [PATCH 1/2] test: some tests to enforce routing messages by connections ID

2014-09-16 Thread Djalal Harouni
Add kdbus_fork_test_by_id() to test connections by id under different uids. Currently we succeed at this test. Update: 1) kdbus_msg_recv() to get the offset of the slice, so we can release it later. 2) kdbus_msg_recv_poll() to pass the offset argument to kdbus_msg_recv(). We do this to follow be

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Sep 16, 2014 at 05:07:06PM +0200, Pavel Raiskup wrote: > > for example > > tmpfiles.d/systemd.conf and tmpfiles.d/systemd-nologin.conf are split > > exactly for the purpose of making it easier to override separately. The > > case of unit files is slightly different, but we really want to ha

Re: [systemd-devel] Should user mode linux register with machined?

2014-09-16 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Sep 16, 2014 at 05:31:05PM +0200, Thomas Meyer wrote: > Hi, > > I wrote a small patch for user-mode linux to register with machined by > calling "CreateMachine". Is this a good idea to do so? Yes, this sounds useful. After all is just another mechanism of virtualization, and in this case c

[systemd-devel] [PATCH] buildsys, missing: include linux/memfd.h if found

2014-09-16 Thread Cristian Rodríguez
That's in order to get the system 's definitions of memfd API flags instead of relying on the locally defined ones. --- configure.ac | 1 + src/shared/missing.h | 4 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index fb16904..5ebe6ae 100644 --- a/configur

Re: [systemd-devel] [PATCH 2/3] [RFC]sd-bus: remove some dead code

2014-09-16 Thread Philippe De Swert
Hi, On 17/09/14 00:49, David Herrmann wrote: > Hi > > On Tue, Sep 16, 2014 at 11:27 PM, wrote: >> From: Philippe De Swert >> >> The r < 0 test has been done before we reach it in the loop, and we returned >> out of the function. So this cannot be reached. But it could actually be that >> somet

Re: [systemd-devel] [PATCH 2/3] [RFC]sd-bus: remove some dead code

2014-09-16 Thread David Herrmann
Hi On Tue, Sep 16, 2014 at 11:27 PM, wrote: > From: Philippe De Swert > > The r < 0 test has been done before we reach it in the loop, and we returned > out of the function. So this cannot be reached. But it could actually be that > something is missing. > --- > src/libsystemd/sd-bus/bus-objec

Re: [systemd-devel] [PATCH 3/3] util : Remove dead code

2014-09-16 Thread Philippe De Swert
Hi Thomas, On 17/09/14 00:36, Thomas H.P. Andersen wrote: >> We only break out of the pre-ceding loop into the rest of the code >> if fd is actually >= 0. So the < 0 check will never be true and >> not necessary. >> >> Found with Coverity. Fixes: CID#1237577 > > I pushed a fix for this one 20 min

Re: [systemd-devel] [PATCH 3/3] util : Remove dead code

2014-09-16 Thread Thomas H.P. Andersen
On Tue, Sep 16, 2014 at 11:27 PM, wrote: > From: Philippe De Swert > > We only break out of the pre-ceding loop into the rest of the code > if fd is actually >= 0. So the < 0 check will never be true and > not necessary. > > Found with Coverity. Fixes: CID#1237577 I pushed a fix for this one 20

[systemd-devel] [PATCH 1/3] journal: Do not count on the compiler initializing found_last to false

2014-09-16 Thread philippedeswert
From: Philippe De Swert There is a very unlikely case where this can happen since gcc usually does the sane thing. But let's make sure found_last is initialized anyway. Fixes: CID#996386 --- src/journal/journal-verify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jou

[systemd-devel] [PATCH 3/3] util : Remove dead code

2014-09-16 Thread philippedeswert
From: Philippe De Swert We only break out of the pre-ceding loop into the rest of the code if fd is actually >= 0. So the < 0 check will never be true and not necessary. Found with Coverity. Fixes: CID#1237577 --- src/shared/util.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/share

[systemd-devel] [PATCH 2/3] [RFC]sd-bus: remove some dead code

2014-09-16 Thread philippedeswert
From: Philippe De Swert The r < 0 test has been done before we reach it in the loop, and we returned out of the function. So this cannot be reached. But it could actually be that something is missing. --- src/libsystemd/sd-bus/bus-objects.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sr

Re: [systemd-devel] [PATCH] sysv-generator: fix resource leak

2014-09-16 Thread Daniel Mack
On 09/16/2014 09:22 PM, Andreas Henriksson wrote: > The "unit" string allocation is not freed on either error or success path. > > Found by coverity. Fixes: CID#1237755 > --- > src/sysv-generator/sysv-generator.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/sysv-g

Re: [systemd-devel] [PATCH] shared: fix resource leak in config_parse_default_instance

2014-09-16 Thread Daniel Mack
On 09/16/2014 09:36 PM, Andreas Henriksson wrote: > The recently allocated "printed" is not freed on error path. > > Found by coverity. Fixes: CID#1237745 > --- > src/shared/install.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/src/shared/install.c b/src/shared/in

Re: [systemd-devel] [PATCH] core: fix resource leak in manager_environment_add

2014-09-16 Thread Daniel Mack
On 09/16/2014 09:11 PM, Andreas Henriksson wrote: > Second error path must free the (potentially) allocated memory in the > first code chunk before returning. > > Found by coverity. Fixes: CID#1237750 > --- > src/core/manager.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff

Re: [systemd-devel] [PATCH] missing: memfd_create takes unsigned int flags in final version

2014-09-16 Thread Daniel Mack
On 09/16/2014 07:17 PM, Cristian Rodríguez wrote: > --- > src/shared/missing.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/shared/missing.h b/src/shared/missing.h > index 023c680..b441149 100644 > --- a/src/shared/missing.h > +++ b/src/shared/missing.h > @@ -209,7

[systemd-devel] [PATCH] shared: fix resource leak in config_parse_default_instance

2014-09-16 Thread Andreas Henriksson
The recently allocated "printed" is not freed on error path. Found by coverity. Fixes: CID#1237745 --- src/shared/install.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/install.c b/src/shared/install.c index 5d3fcf5..61e572b 100644 --- a/src/shared/install.c +

[systemd-devel] [PATCH] sysv-generator: fix resource leak

2014-09-16 Thread Andreas Henriksson
The "unit" string allocation is not freed on either error or success path. Found by coverity. Fixes: CID#1237755 --- src/sysv-generator/sysv-generator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c i

[systemd-devel] [PATCH] core: fix resource leak in manager_environment_add

2014-09-16 Thread Andreas Henriksson
Second error path must free the (potentially) allocated memory in the first code chunk before returning. Found by coverity. Fixes: CID#1237750 --- src/core/manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/manager.c b/src/core/manager.c index 0770727..e0c1c

Re: [systemd-devel] [PATCH] bootchart: oom-check correct variable

2014-09-16 Thread Tom Gundersen
Applied. Thanks! Tom On Tue, Sep 16, 2014 at 7:40 PM, Andreas Henriksson wrote: > Coverity warned that we have already dereferenced ps->sample before > null-checking it. I suspect that's not really the issue and that > the check is checking the wrong variable. > Likely the oom-check should be o

[systemd-devel] [PATCH] bootchart: oom-check correct variable

2014-09-16 Thread Andreas Henriksson
Coverity warned that we have already dereferenced ps->sample before null-checking it. I suspect that's not really the issue and that the check is checking the wrong variable. Likely the oom-check should be on the just allocated ps->sample->next. Found by coverity. Fixes: CID#1237765 --- src/bootc

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Pavel Raiskup
On Tuesday 16 of September 2014 16:42:32 Jóhann B. Guðmundsson wrote: > On 09/16/2014 01:16 PM, Zbigniew Jędrzejewski-Szmek wrote: > > This would change the way that drop-ins work. Your model is not > > necessarily worse, but dropins have been the advertised way to do > > overiddes for a while, and

[systemd-devel] [PATCH] missing: memfd_create takes unsigned int flags in final version

2014-09-16 Thread Cristian Rodríguez
--- src/shared/missing.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/missing.h b/src/shared/missing.h index 023c680..b441149 100644 --- a/src/shared/missing.h +++ b/src/shared/missing.h @@ -209,7 +209,7 @@ static inline int fanotify_mark(int fanotify_fd, unsigned

Re: [systemd-devel] Should user mode linux register with machined?

2014-09-16 Thread Richard Weinberger
On Tue, Sep 16, 2014 at 5:31 PM, Thomas Meyer wrote: > Hi, > > I wrote a small patch for user-mode linux to register with machined by > calling "CreateMachine". Is this a good idea to do so? > > I think machined gives you a nice overview over all running UML > instances, also you get the scope uni

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Jóhann B. Guðmundsson
On 09/16/2014 01:16 PM, Zbigniew Jędrzejewski-Szmek wrote: On Tue, Sep 16, 2014 at 01:21:30PM +0200, Pavel Raiskup wrote: Hi, consider the situation that admin has /etc/systemd/system/a.service, which includes via .include the /usr/lib/systemd/system/a.service. Then in our case there exists a

[systemd-devel] Should user mode linux register with machined?

2014-09-16 Thread Thomas Meyer
Hi, I wrote a small patch for user-mode linux to register with machined by calling "CreateMachine". Is this a good idea to do so? I think machined gives you a nice overview over all running UML instances, also you get the scope unit and the control groups with above registration to machined. anyt

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Pavel Raiskup
On Tuesday 16 of September 2014 16:41:49 Zbigniew Jędrzejewski-Szmek wrote: > On Tue, Sep 16, 2014 at 04:35:50PM +0200, Pavel Raiskup wrote: > > This should not be a revert. Just make it properly defined? > > It was already properly defined, maybe just not explicitly documented > for this case. A

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Sep 16, 2014 at 04:35:50PM +0200, Pavel Raiskup wrote: > This is reply to both Tomasz and Zbigniew, thanks for reactions! > > On Tuesday 16 of September 2014 16:14:16 Tomasz Torcz wrote: > > On Tue, Sep 16, 2014 at 03:16:12PM +0200, Zbigniew Jędrzejewski-Szmek wrote: > > > On Tue, Sep 16,

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Pavel Raiskup
This is reply to both Tomasz and Zbigniew, thanks for reactions! On Tuesday 16 of September 2014 16:14:16 Tomasz Torcz wrote: > On Tue, Sep 16, 2014 at 03:16:12PM +0200, Zbigniew Jędrzejewski-Szmek wrote: > > On Tue, Sep 16, 2014 at 01:21:30PM +0200, Pavel Raiskup wrote: > > > I would expect that

Re: [systemd-devel] [PATCH] libsystemd-network: avoid double-free in error case

2014-09-16 Thread Tom Gundersen
Applied. Thanks! On Tue, Sep 16, 2014 at 3:50 PM, Andreas Henriksson wrote: > Don't manually free 'n' in error path as it's already tagged > _cleanup_free_ and will be freed once it goes out of scope, > leading to double-free in this case. > > Found with coverity. Fixes: CID#1237786 > > Signed-of

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Tomasz Torcz
On Tue, Sep 16, 2014 at 03:16:12PM +0200, Zbigniew Jędrzejewski-Szmek wrote: > On Tue, Sep 16, 2014 at 01:21:30PM +0200, Pavel Raiskup wrote: > > Hi, > > > > consider the situation that admin has /etc/systemd/system/a.service, which > > includes via .include the /usr/lib/systemd/system/a.service.

[systemd-devel] [PATCH] libsystemd-network: avoid double-free in error case

2014-09-16 Thread Andreas Henriksson
Don't manually free 'n' in error path as it's already tagged _cleanup_free_ and will be freed once it goes out of scope, leading to double-free in this case. Found with coverity. Fixes: CID#1237786 Signed-off-by: Andreas Henriksson --- src/libsystemd-network/network-internal.c | 1 - 1 file cha

Re: [systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Sep 16, 2014 at 01:21:30PM +0200, Pavel Raiskup wrote: > Hi, > > consider the situation that admin has /etc/systemd/system/a.service, which > includes via .include the /usr/lib/systemd/system/a.service. Then in our > case there exists also packaged /usr/lib/systemd/system/a.service.d/ wit

Re: [systemd-devel] instantiated services set up

2014-09-16 Thread Jan Včelák
Hi Colin, > This approach gives you nice flexibility and control over instance > units, but still gives you the ability to start/stop individual > instances and control all of them at once too! Yes, you are right. I tried this and it works pretty well. However, the knot.target can be used only f

[systemd-devel] Prioritize the /etc configuration over /usr/lib also with .include

2014-09-16 Thread Pavel Raiskup
Hi, consider the situation that admin has /etc/systemd/system/a.service, which includes via .include the /usr/lib/systemd/system/a.service. Then in our case there exists also packaged /usr/lib/systemd/system/a.service.d/ with existing drop-in. In this case - the setup from /etc/ is beaten by dro

Re: [systemd-devel] [systemd-commits] 5 commits - configure.ac Makefile.am src/analyze src/bus-proxyd src/cgtop src/core src/delta src/journal src/journal-remote src/libsystemd src/libsystemd-network

2014-09-16 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Sep 16, 2014 at 12:29:03PM +0200, Michal Schmidt wrote: > On 09/16/2014 12:07 PM, Zbigniew Jędrzejewski-Szmek wrote: > >> Rather than forcing gcc to always produce colorized error messages > >> whether on tty or not, enable automatic colorization by ensuring > >> GCC_COLORS is s

Re: [systemd-devel] [PATCH 1/2] sd-bus: sd_bus_message_get_errno should only return positive errno

2014-09-16 Thread David Herrmann
Hi On Mon, Sep 15, 2014 at 11:15 PM, Thomas H.P. Andersen wrote: > From: Thomas Hindoe Paaboel Andersen > > sd_bus_message_get_errno can currently return either a number of > different poitive errno values (from bus-error-mapping), or a negative > EINVAL if passed null as parameter. > > The chec

Re: [systemd-devel] [PATCH 0/5] Coverity fixes

2014-09-16 Thread Philippe De Swert
Hi Thomas, On 16/09/14 08:56, Thomas H.P. Andersen wrote: >> Yesterday I finally got to revive the systemd Coverity project on >> scan.coverity.org Unfortunately to see the errors reported you need >> to sign up, but I will make sure to approve requests for seeing the >> "bugs" whenever they show

Re: [systemd-devel] [PATCH] [RFC] [WIP] [kdbus] Attempt to recursively pass fd

2014-09-16 Thread David Herrmann
Hi On Mon, Sep 15, 2014 at 11:53 PM, Daniel Mack wrote: > We might eventually allow this once we have a generic GC implementation > for file descriptors (currently, there's only one, and that one only > works for unix domain sockets). For now, we'll also need something that > disallows passing kd

Re: [systemd-devel] [systemd-commits] 5 commits - configure.ac Makefile.am src/analyze src/bus-proxyd src/cgtop src/core src/delta src/journal src/journal-remote src/libsystemd src/libsystemd-network

2014-09-16 Thread Michal Schmidt
On 09/16/2014 12:07 PM, Zbigniew Jędrzejewski-Szmek wrote: >> Rather than forcing gcc to always produce colorized error messages >> whether on tty or not, enable automatic colorization by ensuring >> GCC_COLORS is set to a non-empty string. > Hi, > this idea was discussed and rejected b

Re: [systemd-devel] [systemd-commits] 5 commits - configure.ac Makefile.am src/analyze src/bus-proxyd src/cgtop src/core src/delta src/journal src/journal-remote src/libsystemd src/libsystemd-network

2014-09-16 Thread Zbigniew Jędrzejewski-Szmek
[sorry for the double post] On Mon, Sep 15, 2014 at 07:30:26AM -0700, Michal Schmidt wrote: > commit f44541bc934c6e2b0219e9eeb17a13a09558 > Author: Michal Schmidt > Date: Fri Aug 15 16:33:03 2014 +0200 > > build: colorize gcc only if on tty > > Rather than forcing gcc to alway

Re: [systemd-devel] [systemd-commits] 5 commits - configure.ac Makefile.am src/analyze src/bus-proxyd src/cgtop src/core src/delta src/journal src/journal-remote src/libsystemd src/libsystemd-network

2014-09-16 Thread Zbigniew Jędrzejewski-Szmek
On Mon, Sep 15, 2014 at 07:30:26AM -0700, Michal Schmidt wrote: > commit f44541bc934c6e2b0219e9eeb17a13a09558 > Author: Michal Schmidt > Date: Fri Aug 15 16:33:03 2014 +0200 > > build: colorize gcc only if on tty > > Rather than forcing gcc to always produce colorized error mes