[systemd-devel] [PATCH 7/7] connection: fix user quota accounting corruption

2014-07-23 Thread Djalal Harouni
First use kzalloc to allocate the users array, so we do not reference unintialized values. And free the old conn->msg_users array not the newly allocated 'users' one. Patch tested, and users will hit the KDBUS_CONN_MAX_MSGS_PER_USER limit and fail with -ENOBUFS Signed-off-by: Djalal Harouni ---

[systemd-devel] [PATCH 6/7] bus: call __kdbus_domain_user_account() and avoid an extra domain lock

2014-07-23 Thread Djalal Harouni
kdbus_bus_new() worst case will take the domain lock 3 times: kdbus_bus_new() => kdbus_domain_user_find_or_new(): will take it 2 times + kdbus_bus_new(): will take it an extra time to account the user and link the bus into the domain bus_list. We can reduce the worst case to take the domain lock

[systemd-devel] [PATCH 5/7] kdbus: improve user domain accounting

2014-07-23 Thread Djalal Harouni
Currently kdbus_domain_user_find_or_new() is used to find a user domain or create a new one and link it into the domain. kdbus_domain_user_find_or_new() may fail due to memory allocation errors or if the domain was shutdown, but since callers will receive only a NULL pointer on failure, they assum

[systemd-devel] [PATCH 4/7] domain: add kdbus_domain_user_find()

2014-07-23 Thread Djalal Harouni
Add kdbus_domain_user_find() to look up domain users Signed-off-by: Djalal Harouni --- domain.c | 32 1 file changed, 32 insertions(+) diff --git a/domain.c b/domain.c index 18dc2a7..a5abb2d 100644 --- a/domain.c +++ b/domain.c @@ -446,6 +446,38 @@ kdbus_domain_

[systemd-devel] [PATCH 3/7] domain: add kdbus_domain_user_new()

2014-07-23 Thread Djalal Harouni
Add kdbus_domain_user_new() to allocate kdbus_domain_user objects. Signed-off-by: Djalal Harouni --- domain.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/domain.c b/domain.c index 86fde55..18dc2a7 100644 --- a/domain.c +++ b/domain.c @@ -419,6 +419,33 @@ int

[systemd-devel] [PATCH 2/7] domain: add the lock protected version of user accounting

2014-07-23 Thread Djalal Harouni
Add the lock protected version of __kdbus_domain_user_account(). It will check if the domain is still active before linking users. Signed-off-by: Djalal Harouni --- domain.c | 24 1 file changed, 24 insertions(+) diff --git a/domain.c b/domain.c index a321f31..86fde55 1

[systemd-devel] [PATCH 1/7] domain: add __kdbus_domain_user_account() to account and link users

2014-07-23 Thread Djalal Harouni
Add __kdbus_domain_user_account() to account and link users into a domain. Signed-off-by: Djalal Harouni --- domain.c | 32 1 file changed, 32 insertions(+) diff --git a/domain.c b/domain.c index c4912fa..a321f31 100644 --- a/domain.c +++ b/domain.c @@ -419,6 +4

[systemd-devel] [PATCH 0/7] kdbus: improve user domain accounting

2014-07-23 Thread Djalal Harouni
Hi, This series improves user domain accounting and fixes some bugs. On top of the "kdbus: allow multiple policies" series: http://lists.freedesktop.org/archives/systemd-devel/2014-July/021514.html Patches 1, 2, 3 and 4 are preparation patches to improve the code. Patch 5 fixes kdbus_domain_us

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Colin Guthrie
Lennart Poettering wrote on 23/07/14 18:31: > On Tue, 22.07.14 18:35, Colin Guthrie (gm...@colin.guthr.ie) wrote: > >> >> 'Twas brillig, and Lennart Poettering at 22/07/14 12:10 did gyre and gimble: > I guess it's OK to do this kind of user lookup stuff from the journal > code (i.e. server

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Simon McVittie
On 23/07/14 19:50, Zbigniew Jędrzejewski-Szmek wrote: >> As a side effect this would actually even allow us to be closer to >> FEdora's current bheaviour, since it reserves UIDs < 200 for static >> assignment, which we could then easily exclude from theis logic, too. > In practice this might not be

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Simon McVittie
On 23/07/14 18:31, Lennart Poettering wrote: > As a side effect this would actually even allow us to be closer to > FEdora's current bheaviour, since it reserves UIDs < 200 for static > assignment, which we could then easily exclude from theis logic, too. Debian's uid/gid ranges for comparison, if

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 07:31:31PM +0200, Lennart Poettering wrote: [snip] > Now, this alone wouldn't provide compatibility with the dreaded > login.defs file. For that we'd then employ a postinst script that reads > the range from the file, and then automatically generates a sysuers.d > drop-in

Re: [systemd-devel] Changing configurations with networkd

2014-07-23 Thread poma
On 23.07.2014 16:46, Marcel Holtmann wrote: Hi Michael, I think the lease should be remembered and reused in this case. Hm, this sounds like a bug somewhere. When the new discover is sent out it should send the same identifying information to the server, and hence be given the same lease back

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Lennart Poettering
On Tue, 22.07.14 18:35, Colin Guthrie (gm...@colin.guthr.ie) wrote: > > 'Twas brillig, and Lennart Poettering at 22/07/14 12:10 did gyre and gimble: > >> > I guess it's OK to do this kind of user lookup stuff from the journal > >> > code (i.e. server_fix_perms())? > > Hmm, yuck. Actually it is re

[systemd-devel] [PATCH 5/5] connection: allow policy holders to install multiple names

2014-07-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- connection.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/connection.c b/connection.c index 85ffa5a..1658a92 100644 --- a/connection.c +++ b/connection.c @@ -1905,7 +1905,11 @@ int kdbus_conn_new(struct kdbus_ep *ep,

[systemd-devel] [PATCH 4/5] test: register multiple policies

2014-07-23 Thread Djalal Harouni
Update the policy test in order to register multiple policies Signed-off-by: Djalal Harouni --- test/test-kdbus-policy.c | 57 +--- 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/test/test-kdbus-policy.c b/test/test-kdbus-policy.c inde

[systemd-devel] [PATCH 3/5] test: add infrastructure to allow multiple policies per connection

2014-07-23 Thread Djalal Harouni
A policy holder should be able to upload multiple policies, so add the test infrastructure for it. Convert kdbus_hello_registrar() to allow an array of 'struct kdbus_policy_entry' and add the following helpers: kdbus_policy_entries_size() to calculate the KDBUS_ITEM policies size kdbus_policy_ma

[systemd-devel] [PATCH 2/5] test: add the struct kdbus_policy_entry to be used for tests

2014-07-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- test/kdbus-util.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/test/kdbus-util.h b/test/kdbus-util.h index 0fcfb72..39d7bb5 100644 --- a/test/kdbus-util.h +++ b/test/kdbus-util.h @@ -36,6 +36,12 @@ struct conn { size_t size; }; +struct kdb

[systemd-devel] [PATCH 1/5] test: correctly set the 'ret' variable

2014-07-23 Thread Djalal Harouni
Signed-off-by: Djalal Harouni --- test/test-kdbus-policy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test-kdbus-policy.c b/test/test-kdbus-policy.c index 6099087..de725e9 100644 --- a/test/test-kdbus-policy.c +++ b/test/test-kdbus-policy.c @@ -200,7 +200,7 @@ stat

[systemd-devel] [PATCH 0/5] kdbus: allow multiple policies

2014-07-23 Thread Djalal Harouni
This series adds the infrastructure to test and upload multiple policies. The last #5 patch allows to upload multiple policies per connection The todo for the policy holders is: * Should we set a maximum value for how many names/policies a policy holder is allowed to upload. This is needed sin

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 05:30:53PM +0200, Kay Sievers wrote: > On Wed, Jul 23, 2014 at 5:17 PM, Zbigniew Jędrzejewski-Szmek > wrote: > > On Wed, Jul 23, 2014 at 04:55:59PM +0200, Kay Sievers wrote: > >> On Wed, Jul 23, 2014 at 4:28 PM, Zbigniew Jędrzejewski-Szmek > >> wrote: > >> > >> > Anyway, I

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Kay Sievers
On Wed, Jul 23, 2014 at 5:17 PM, Zbigniew Jędrzejewski-Szmek wrote: > On Wed, Jul 23, 2014 at 04:55:59PM +0200, Kay Sievers wrote: >> On Wed, Jul 23, 2014 at 4:28 PM, Zbigniew Jędrzejewski-Szmek >> wrote: >> >> > Anyway, I think that /etc/login.defs support is made out to be something >> > much m

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 04:55:59PM +0200, Kay Sievers wrote: > On Wed, Jul 23, 2014 at 4:28 PM, Zbigniew Jędrzejewski-Szmek > wrote: > > > Anyway, I think that /etc/login.defs support is made out to be something > > much more complicated than it really is. IMHO we should: > > > > - read /etc/logi

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Kay Sievers
On Wed, Jul 23, 2014 at 4:28 PM, Zbigniew Jędrzejewski-Szmek wrote: > Anyway, I think that /etc/login.defs support is made out to be something > much more complicated than it really is. IMHO we should: > > - read /etc/login.defs and fall back to the compiled in value > - use whatever result we ge

Re: [systemd-devel] [PATCH 1/2] tools: add script to detect repeating words in docs

2014-07-23 Thread Karel Zak
On Wed, Jul 23, 2014 at 02:59:26PM +0200, Zbigniew Jędrzejewski-Szmek wrote: > On Wed, Jul 23, 2014 at 02:57:10PM +0200, Zbigniew Jędrzejewski-Szmek wrote: > > On Wed, Jul 23, 2014 at 12:40:06PM +0200, Karel Zak wrote: > > > - all sections from input files are ignored > > > - it's possible to wh

Re: [systemd-devel] Changing configurations with networkd

2014-07-23 Thread Marcel Holtmann
Hi Michael, >>> I think the lease should be remembered and reused in this case. >> >> Hm, this sounds like a bug somewhere. When the new discover is sent >> out it should send the same identifying information to the server, and >> hence be given the same lease back again. Wireshark should tell yo

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 11:29:20AM +0100, Colin Guthrie wrote: > 'Twas brillig, and Colin Walters at 22/07/14 21:47 did gyre and gimble: > > On Mon, Jul 21, 2014, at 09:43 AM, Lennart Poettering wrote: > >> > >> I am pretty strongly against this. Making this administrator > >> configurable apepars

Re: [systemd-devel] [PATCH 1/2] tools: add script to detect repeating words in docs

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 02:57:10PM +0200, Zbigniew Jędrzejewski-Szmek wrote: > On Wed, Jul 23, 2014 at 12:40:06PM +0200, Karel Zak wrote: > > - all sections from input files are ignored > > - it's possible to white-list wanted repeats by KNOWN_REPEATS[] in the > > script > > - the script is ba

Re: [systemd-devel] [PATCH 1/2] tools: add script to detect repeating words in docs

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 12:40:06PM +0200, Karel Zak wrote: > - all sections from input files are ignored > - it's possible to white-list wanted repeats by KNOWN_REPEATS[] in the script > - the script is based on checkmans.sh from util-linux project > - it's integrated to build-sys, just type "

Re: [systemd-devel] [PATCH 2/2] docs: remove repeating words from man/*xml

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 12:40:07PM +0200, Karel Zak wrote: > --- > man/coredump.conf.xml | 2 +- > man/sd_bus_message_append_array.xml | 2 +- > man/systemctl.xml | 2 +- > man/systemd-journal-remote.xml | 2 +- > man/systemd.journal-fields.xml | 2 +- > m

Re: [systemd-devel] Changing configurations with networkd

2014-07-23 Thread Michael Olbrich
On Wed, Jul 23, 2014 at 12:47:37PM +0200, Tom Gundersen wrote: > On Wed, Jul 23, 2014 at 9:50 AM, Michael Olbrich > wrote: > > I've been experimenting with systemd-networkd to see where it fits my > > use-cases. I'm looking for some insight if the issues I'm seeing are bugs, > > features just not

Re: [systemd-devel] systemd-socket-proxyd & slapd

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 11:13:50AM +0300, Suvendu Mitra wrote: > Thanks now it works, But does it mandatory to start slapd on same port as > "ListenStream=" of socket file of systemd-socket-proxyd. e.g in following > example port 400. Maybe the protocol embeds the port number in the stream? That wo

Re: [systemd-devel] [PATCH] coredump: suppress uninitialized sz warning

2014-07-23 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Jul 23, 2014 at 10:02:57AM +0200, Daniel Buch wrote: > Its false positive but lets make gcc happy We have approximately a million of those... If you compile with -O2 or -O3 they really multiply. I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61846, so let's wait for the upstream respo

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Kay Sievers
On Wed, Jul 23, 2014 at 1:49 PM, Colin Guthrie wrote: > Kay Sievers wrote on 23/07/14 12:36: >> I don't see the rather artificially constructed case of an >> /usr/share/factory/etc/login.defs + tmpfiles snippet to copy to /etc >> as a valid argument for reading login.defs. > > Well, my point was t

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Colin Guthrie
Kay Sievers wrote on 23/07/14 12:36: > I don't see the rather artificially constructed case of an > /usr/share/factory/etc/login.defs + tmpfiles snippet to copy to /etc > as a valid argument for reading login.defs. Well, my point was that one of Lennart's original arguments for NOT reading login.d

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Kay Sievers
On Wed, Jul 23, 2014 at 1:11 PM, Colin Guthrie wrote: > 'Twas brillig, and Colin Guthrie at 23/07/14 11:29 did gyre and gimble: >> If there was a /usr/share/factory/etc/login.defs with e.g. 500 boundary >> point, then this file would presumably be copied in by tmpfiles to >> populate /etc/login.de

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Colin Guthrie
'Twas brillig, and Colin Guthrie at 23/07/14 11:29 did gyre and gimble: > If there was a /usr/share/factory/etc/login.defs with e.g. 500 boundary > point, then this file would presumably be copied in by tmpfiles to > populate /etc/login.defs Of course one thing that makes this argument slightly in

[systemd-devel] [PATCH] sysv: order initscripts which provide $network before network.target

2014-07-23 Thread Lukas Nykryn
Due to recent changes where $network "maps" to network-online.target it is not guaranteed that initscript which provides networking will be terminated after network.target during shutdown which is against LSB. --- src/sysv-generator/sysv-generator.c | 5 + 1 file changed, 5 insertions(+) diff

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Reindl Harald
Am 22.07.2014 22:47, schrieb Colin Walters: > On Mon, Jul 21, 2014, at 09:43 AM, Lennart Poettering wrote: >> >> I am pretty strongly against this. Making this administrator >> configurable apepars very wrong, this really should be a decision for >> the distribution vendor, and that's it. > > You

Re: [systemd-devel] Changing configurations with networkd

2014-07-23 Thread Reindl Harald
Am 23.07.2014 12:47, schrieb Tom Gundersen: >> I think the lease should be remembered and reused in this case. > In general, saving the lease to disk is probably not a good idea. We > would need to store it on /var, and we may need to start the DHCP > server before /var has been mounted. To the ex

Re: [systemd-devel] Changing configurations with networkd

2014-07-23 Thread Tom Gundersen
On Wed, Jul 23, 2014 at 9:50 AM, Michael Olbrich wrote: > I've been experimenting with systemd-networkd to see where it fits my > use-cases. I'm looking for some insight if the issues I'm seeing are bugs, > features just not implemented yet or if my use-case is out of scope for > networkd. > The m

[systemd-devel] [PATCH 1/2] tools: add script to detect repeating words in docs

2014-07-23 Thread Karel Zak
- all sections from input files are ignored - it's possible to white-list wanted repeats by KNOWN_REPEATS[] in the script - the script is based on checkmans.sh from util-linux project - it's integrated to build-sys, just type "make check-repwords", for example: $ make check-repwords GEN

[systemd-devel] repeating words

2014-07-23 Thread Karel Zak
Not sure if the script from the first patch is wanted, but at least the second patch that fix typos in man/*.xml files should be applied. [PATCH 1/2] tools: add script to detect repeating words in docs [PATCH 2/2] docs: remove repeating words from man/*xml Karel __

[systemd-devel] [PATCH 2/2] docs: remove repeating words from man/*xml

2014-07-23 Thread Karel Zak
--- man/coredump.conf.xml | 2 +- man/sd_bus_message_append_array.xml | 2 +- man/systemctl.xml | 2 +- man/systemd-journal-remote.xml | 2 +- man/systemd.journal-fields.xml | 2 +- man/sysusers.d.xml | 2 +- 6 files changed, 6 insertions(

Re: [systemd-devel] sysusers and login.defs checks

2014-07-23 Thread Colin Guthrie
'Twas brillig, and Colin Walters at 22/07/14 21:47 did gyre and gimble: > On Mon, Jul 21, 2014, at 09:43 AM, Lennart Poettering wrote: >> >> I am pretty strongly against this. Making this administrator >> configurable apepars very wrong, this really should be a decision for >> the distribution vend

Re: [systemd-devel] improve lid switch event handling

2014-07-23 Thread Lennart Poettering
On Tue, 22.07.14 12:35, Thomas Blume (thomas.bl...@suse.com) wrote: > If so, we could record a previous lid open event e.g. in a status file. > We could then inhibit the suspend if there was no previous lid open event or > allow it without timeout, if there was one. Not following here... Note th

Re: [systemd-devel] systemd-socket-proxyd & slapd

2014-07-23 Thread Suvendu Mitra
Thanks now it works, But does it mandatory to start slapd on same port as "ListenStream=" of socket file of systemd-socket-proxyd. e.g in following example port 400. # cat proxy-to-directory-400.service [Unit] Requires=master-ldap-400.service After=master-ldap-400.service [Service] ExecStart=/usr

[systemd-devel] [PATCH] coredump: suppress uninitialized sz warning

2014-07-23 Thread Daniel Buch
Its false positive but lets make gcc happy --- src/journal/coredump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/journal/coredump.c b/src/journal/coredump.c index 182c2b1..a361a51 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -700,7 +700,7 @@ log:

Re: [systemd-devel] crypttab automount

2014-07-23 Thread Jan
Ralf Jung ralfj.de> writes: > Essentially, I want a proper mount with the usual RequiredBy and > WantedBy - but without the Before that makes others wait on this disk. > So, the concurrency part of automount is exactly what I want, but > without the on-demand part. Is that possible? You're looki

[systemd-devel] Changing configurations with networkd

2014-07-23 Thread Michael Olbrich
Hi, I've been experimenting with systemd-networkd to see where it fits my use-cases. I'm looking for some insight if the issues I'm seeing are bugs, features just not implemented yet or if my use-case is out of scope for networkd. The most common use-case I have is rather simple: One ethernet inte

Re: [systemd-devel] [PATCH] dhcp-network: remove unused DHCP6_STATE_RS

2014-07-23 Thread Tom Gundersen
Good catch. Applied. Thanks. Tom On Wed, Jul 23, 2014 at 12:18 AM, Dan Williams wrote: > Probably a left-over from when router solicitations were > requested in the DHCP6 code. But since they are now separate, > this state is no longer needed. > > Signed-off-by: Dan Williams > --- > src/lib

Re: [systemd-devel] [PATCH v2] networkd: set route protocol

2014-07-23 Thread Tom Gundersen
On Tue, Jul 22, 2014 at 11:54 PM, Dan Williams wrote: > All routes added by networkd are currently set RTPROT_BOOT, which according > to the kernel means "Route installed during boot" (rtnetlink.h). But this > is not always the case as networkd changes routing after boot too. Since > the kernel