[systemd-devel] [PATCH] journal/compress: use LZ4_compress_continue()

2014-08-30 Thread Evangelos Foutras
We can't use LZ4_compress_limitedOutput_continue() because in the
worst-case scenario the compressed output can be slightly bigger than
the input block. This generally affects very few blocks and is no reason
to abort the compression process.

I ran into this when I noticed that Chromium core dumps weren't being
compressed. After switching to LZ4_compress_continue() a ~330MB Chromium
core dump gets compressed to ~17M.
---
 src/journal/compress.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/journal/compress.c b/src/journal/compress.c
index 52a4c10..c4c715b 100644
--- a/src/journal/compress.c
+++ b/src/journal/compress.c
@@ -460,10 +460,10 @@ int compress_stream_lz4(int fdf, int fdt, off_t 
max_bytes) {
 
 total_in += n;
 
-r = LZ4_compress_limitedOutput_continue(lz4_data, buf, out, 
n, n);
+r = LZ4_compress_continue(lz4_data, buf, out, n);
 if (r == 0) {
-log_debug(Compressed size exceeds original, aborting 
compression.);
-return -ENOBUFS;
+log_error(LZ4 compression failed.);
+return -EBADMSG;
 }
 
 header = htole32(r);
-- 
2.1.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] missing: add BPF_XOR

2014-08-30 Thread Kay Sievers
On Tue, Aug 26, 2014 at 7:31 PM, Lennart Poettering
lenn...@poettering.net wrote:

 Actually we try to be compatible with kernels from the last 2y, which
 would mean 3.5 as minimum version. (though we will make an exception
 when we adopt kdbus...)

 The README currently even states 3.0 was supported... Maybe we should
 drop that claim though, and update it to 3.5.

I bumped the requirement to 3.7 now, which covers the BPF and the
in-kernel firmware loading.

Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH v2] libudev: fix symbol version for udev_queue_flush() and udev_queue_get_fd()

2014-08-30 Thread Kay Sievers
On Sat, Aug 30, 2014 at 2:09 AM, Michael Biebl mbi...@gmail.com wrote:
 Updated patch which the correct version information.

Applied.

Thanks,
Kay
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] test-ipv4ll never finishes

2014-08-30 Thread Jan Janssen
Hi,

on my system, test-ipv4ll waits forever on an epoll:

$ strace ./test-ipv4ll 
execve(./test-ipv4ll, [./test-ipv4ll], [/* 64 vars */]) = 0
brk(0)  = 0x7f387087e000
access(/etc/ld.so.preload, R_OK)  = -1 ENOENT (No such file or directory)
open(/etc/ld.so.cache, O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=231109, ...}) = 0
mmap(NULL, 231109, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f386f85e000
close(3)= 0
open(/usr/lib/librt.so.1, O_RDONLY|O_CLOEXEC) = 3
read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\360\\0\0\0\0\0\0..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=31760, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f386f85d000
mmap(NULL, 2128912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f386f46f000
mprotect(0x7f386f476000, 2093056, PROT_NONE) = 0
mmap(0x7f386f675000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f386f675000
close(3)= 0
open(/usr/lib/libpthread.so.0, O_RDONLY|O_CLOEXEC) = 3
read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\`\0\0\0\0\0\0..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=149301, ...}) = 0
mmap(NULL, 2217104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f386f251000
mprotect(0x7f386f269000, 2097152, PROT_NONE) = 0
mmap(0x7f386f469000, 8192, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f386f469000
mmap(0x7f386f46b000, 13456, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f46b000
close(3)= 0
open(/usr/lib/libc.so.6, O_RDONLY|O_CLOEXEC) = 3
read(3, \177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\20\1\2\0\0\0\0\0..., 
832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=2047384, ...}) = 0
mmap(NULL, 3858192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x7f386eea3000
mprotect(0x7f386f047000, 2097152, PROT_NONE) = 0
mmap(0x7f386f247000, 24576, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a4000) = 0x7f386f247000
mmap(0x7f386f24d000, 16144, PROT_READ|PROT_WRITE, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f24d000
close(3)= 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f386f85c000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x7f386f85a000
arch_prctl(ARCH_SET_FS, 0x7f386f85a740) = 0
mprotect(0x7f386f247000, 16384, PROT_READ) = 0
mprotect(0x7f386f469000, 4096, PROT_READ) = 0
mprotect(0x7f386f675000, 4096, PROT_READ) = 0
mprotect(0x7f386f8ab000, 4096, PROT_READ) = 0
mprotect(0x7f386f897000, 4096, PROT_READ) = 0
munmap(0x7f386f85e000, 231109)  = 0
set_tid_address(0x7f386f85aa10) = 30468
set_robust_list(0x7f386f85aa20, 24) = 0
rt_sigaction(SIGRTMIN, {0x7f386f256b10, [], SA_RESTORER|SA_SIGINFO, 
0x7f386f2604b0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x7f386f256ba0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 
0x7f386f2604b0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(0)  = 0x7f387087e000
brk(0x7f387089f000) = 0x7f387089f000
epoll_create1(EPOLL_CLOEXEC)= 3
socketpair(PF_LOCAL, SOCK_DGRAM|SOCK_NONBLOCK, 0, [4, 5]) = 0
epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=1887953936, 
u64=139880382850064}}) = 0
epoll_ctl(3, EPOLL_CTL_DEL, 4, NULL)= 0
close(4)= 0
epoll_wait(3,
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] journalctl: Allow to disable line cap with --pager-end

2014-08-30 Thread Jan Janssen
--lines=0 hardly makes sense with --pager-end, so give it some
new meaning.
---
 man/journalctl.xml   |  6 +++---
 src/journal/journalctl.c | 12 
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/man/journalctl.xml b/man/journalctl.xml
index d4e0316..5c8d78c 100644
--- a/man/journalctl.xml
+++ b/man/journalctl.xml
@@ -189,9 +189,9 @@
 that the pager will not buffer logs of
 unbounded size. This may be overridden
 with an explicit option-n/option
-with some other numeric value on the
-command line. Note that this option is
-only supported for the
+with some other numeric value while
+option-n0/option will disable this cap.
+Note that this option is only supported for the
 citerefentry 
project='man-pages'refentrytitleless/refentrytitlemanvolnum1/manvolnum/citerefentry
 pager./para/listitem
 /varlistentry
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 0aec5fb..49a6c23 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -326,10 +326,6 @@ static int parse_argv(int argc, char *argv[]) {
 
 case 'e':
 arg_pager_end = true;
-
-if (arg_lines  0)
-arg_lines = 1000;
-
 break;
 
 case 'f':
@@ -642,6 +638,14 @@ static int parse_argv(int argc, char *argv[]) {
 assert_not_reached(Unhandled option);
 }
 
+
+if (arg_pager_end) {
+if (arg_lines  0)
+arg_lines = 1000;
+else if (arg_lines == 0)
+arg_lines = -1;
+}
+
 if (arg_follow  !arg_no_tail  arg_lines  0)
 arg_lines = 10;
 
-- 
2.1.0

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Update french translation

2014-08-30 Thread Sylvain Plantefève
---
 po/fr.po | 28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/po/fr.po b/po/fr.po
index ed8a686..7240cc5 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgstr 
 Project-Id-Version: systemd\n
 Report-Msgid-Bugs-To: \n
 POT-Creation-Date: 2013-11-14 17:49+0100\n
-PO-Revision-Date: 2013-11-14 17:57+0100\n
+PO-Revision-Date: 2014-04-29 09:17+0300\n
 Last-Translator: Sylvain Plantefève sylvain.plantef...@gmail.com\n
 Language-Team: French\n
 Language: fr\n
@@ -395,3 +395,29 @@ msgid Authentication is required to access the system and 
service manager.
 msgstr 
 Authentification requise pour accéder au gestionnaire du système et des 
 services.
+
+#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:5
+msgid Manage system services or units
+msgstr Gérer les services système ou les unités
+
+#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:6
+msgid Authentication is required to manage system services or units.
+msgstr 
+Authentification requise pour gérer les services système ou les unités.
+
+#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:7
+msgid Manage system service or unit files
+msgstr Gérer le service système ou ses fichiers unités
+
+#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:8
+msgid Authentication is required to manage system service or unit files.
+msgstr 
+Authentification requise pour gérer le service système ou ses fichiers 
unités.
+
+#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:9
+msgid Reload the systemd state
+msgstr Recharger l'état de systemd
+
+#: ../src/core/org.freedesktop.systemd1.policy.in.in.h:10
+msgid Authentication is required to reload the systemd state.
+msgstr Authentification requise pour recharger l'état de systemd
-- 
1.9.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Fix a few more typos

2014-08-30 Thread Ruben Kerkhof
From d0d74a761ef6833a7efc291a613853e3a4212a02 Mon Sep 17 00:00:00 2001
From: Ruben Kerkhof ru...@rubenkerkhof.com
Date: Sat, 30 Aug 2014 17:09:23 +0200
Subject: [PATCH] Fix a few more typos

---
 CODING_STYLE   | 2 +-
 NEWS   | 2 +-
 man/file-hierarchy.xml | 2 +-
 man/kernel-command-line.xml| 2 +-
 man/sd_bus_creds_get_pid.xml   | 2 +-
 man/sd_bus_creds_new_from_pid.xml  | 4 ++--
 man/sd_bus_error.xml   | 2 +-
 man/sd_bus_message_append_basic.xml| 4 ++--
 man/systemd-hibernate-resume-generator.xml | 2 +-
 man/systemd-nspawn.xml | 2 +-
 man/systemd.exec.xml   | 2 +-
 man/systemd.socket.xml | 2 +-
 src/core/unit.c| 2 +-
 src/journal/test-compress-benchmark.c  | 2 +-
 src/libsystemd-network/sd-icmp6-nd.c   | 2 +-
 src/libsystemd-terminal/term-page.c| 4 ++--
 src/libsystemd-terminal/term-screen.c  | 4 ++--
 src/libsystemd-terminal/test-term-page.c   | 2 +-
 src/libsystemd/sd-bus/kdbus.h  | 2 +-
 src/shared/architecture.h  | 2 +-
 20 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/CODING_STYLE b/CODING_STYLE
index a3fc26c..05b5ecf 100644
--- a/CODING_STYLE
+++ b/CODING_STYLE
@@ -155,7 +155,7 @@
   function or a non-logging function. Logging functions do logging
   on their own, non-logging function never log on their own and
   expect their callers to log. All functions in library code,
-  i.e. in src/shared/ and suchlike must be non-logging. Everytime a
+  i.e. in src/shared/ and suchlike must be non-logging. Every time a
   logging function calls a non-logging function, it should log
   about the resulting errors. If a logging function calls another
   logging function, then it should not generate log messages, so
diff --git a/NEWS b/NEWS
index 2fca2cd..f52ee02 100644
--- a/NEWS
+++ b/NEWS
@@ -1613,7 +1613,7 @@ CHANGES WITH 208:
   kernel, and on seats that are not seat0.
 
 * A new kernel command line option luks.options= is understood
-  now which allows specifiying LUKS options for usage for LUKS
+  now which allows specifying LUKS options for usage for LUKS
   encrypted partitions specified with luks.uuid=.
 
 * tmpfiles.d(5) snippets may now use specifier expansion in
diff --git a/man/file-hierarchy.xml b/man/file-hierarchy.xml
index 523846b..9d96cff 100644
--- a/man/file-hierarchy.xml
+++ b/man/file-hierarchy.xml
@@ -914,7 +914,7 @@
   /row
   row
 
entryfilename~/.local/lib/replaceablepackage/replaceable/filename/entry
-entryPrivate, static vendor resources of the 
package, compatible wih any architecture, or any other kind of read-only vendor 
data./entry
+entryPrivate, static vendor resources of the 
package, compatible with any architecture, or any other kind of read-only 
vendor data./entry
   /row
   row
 
entryfilename~/.local/lib/replaceablearch-id/replaceable/replaceablepackage/replaceable/filename/entry
diff --git a/man/kernel-command-line.xml b/man/kernel-command-line.xml
index d872e6d..3263b77 100644
--- a/man/kernel-command-line.xml
+++ b/man/kernel-command-line.xml
@@ -358,7 +358,7 @@
 paraEnables resume from hibernation
 using the specified device.
 All 
citerefentryrefentrytitlefstab/refentrytitlemanvolnum5/manvolnum/citerefentry-like
-pathes are supported. For details, see
+paths are supported. For details, see
 
citerefentryrefentrytitlesystemd-hibernate-resume-generator/refentrytitlemanvolnum8/manvolnum/citerefentry./para
 /listitem
 /varlistentry
diff --git a/man/sd_bus_creds_get_pid.xml b/man/sd_bus_creds_get_pid.xml
index 5a84857..40ed81e 100644
--- a/man/sd_bus_creds_get_pid.xml
+++ b/man/sd_bus_creds_get_pid.xml
@@ -405,7 +405,7 @@ along with systemd; If not, see 
http://www.gnu.org/licenses/.
   varlistentry
 termvarname-ENXIO/varname/term
 
-listitemparaAn error occured in parsing cgroup paths.
+listitemparaAn error occurred in parsing cgroup paths.
 filenamelibsystemd/filename might be out of sync with
 the running systemd version./para/listitem
   /varlistentry
diff --git a/man/sd_bus_creds_new_from_pid.xml 
b/man/sd_bus_creds_new_from_pid.xml
index 406769b..bc94c44 100644
--- a/man/sd_bus_creds_new_from_pid.xml
+++ b/man/sd_bus_creds_new_from_pid.xml
@@ -149,7 +149,7 @@ along with systemd; If not, see 

Re: [systemd-devel] [PATCH] journalctl: Allow to disable line cap with --pager-end

2014-08-30 Thread Zbigniew Jędrzejewski-Szmek
On Sat, Aug 30, 2014 at 03:26:05PM +0200, Jan Janssen wrote:
 --lines=0 hardly makes sense with --pager-end, so give it some
 new meaning.
I'm don't think this overloading is a good idea. --lines=0 is meaningful
with -f, and it is possible that we'll implement -f in a pager when
pagers get support for such things. What about using something like 'all',
as in -nall ?

Zbyszek

 ---
  man/journalctl.xml   |  6 +++---
  src/journal/journalctl.c | 12 
  2 files changed, 11 insertions(+), 7 deletions(-)
 
 diff --git a/man/journalctl.xml b/man/journalctl.xml
 index d4e0316..5c8d78c 100644
 --- a/man/journalctl.xml
 +++ b/man/journalctl.xml
 @@ -189,9 +189,9 @@
  that the pager will not buffer logs of
  unbounded size. This may be overridden
  with an explicit option-n/option
 -with some other numeric value on the
 -command line. Note that this option is
 -only supported for the
 +with some other numeric value while
 +option-n0/option will disable this cap.
 +Note that this option is only supported for 
 the
  citerefentry 
 project='man-pages'refentrytitleless/refentrytitlemanvolnum1/manvolnum/citerefentry
  pager./para/listitem
  /varlistentry
 diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
 index 0aec5fb..49a6c23 100644
 --- a/src/journal/journalctl.c
 +++ b/src/journal/journalctl.c
 @@ -326,10 +326,6 @@ static int parse_argv(int argc, char *argv[]) {
  
  case 'e':
  arg_pager_end = true;
 -
 -if (arg_lines  0)
 -arg_lines = 1000;
 -
  break;
  
  case 'f':
 @@ -642,6 +638,14 @@ static int parse_argv(int argc, char *argv[]) {
  assert_not_reached(Unhandled option);
  }
  
 +
 +if (arg_pager_end) {
 +if (arg_lines  0)
 +arg_lines = 1000;
 +else if (arg_lines == 0)
 +arg_lines = -1;
 +}
 +
  if (arg_follow  !arg_no_tail  arg_lines  0)
  arg_lines = 10;
  
 -- 
 2.1.0
 
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Update french translation

2014-08-30 Thread Zbigniew Jędrzejewski-Szmek
On Sat, Aug 30, 2014 at 04:25:59PM +0200, Sylvain Plantefève wrote:
 ---
  po/fr.po | 28 +++-
  1 file changed, 27 insertions(+), 1 deletion(-)
Applied.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] Fix a few more typos

2014-08-30 Thread Zbigniew Jędrzejewski-Szmek
On Sat, Aug 30, 2014 at 05:13:16PM +0200, Ruben Kerkhof wrote:
 From d0d74a761ef6833a7efc291a613853e3a4212a02 Mon Sep 17 00:00:00 2001
 From: Ruben Kerkhof ru...@rubenkerkhof.com
 Date: Sat, 30 Aug 2014 17:09:23 +0200
 Subject: [PATCH] Fix a few more typos
Applied.

Zbyszek
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-ipv4ll never finishes

2014-08-30 Thread Umut Tezduyar
Thanks. I will take a look at it.

 On Aug 30, 2014, at 3:08 PM, Jan Janssen medhe...@web.de wrote:
 
 Hi,
 
 on my system, test-ipv4ll waits forever on an epoll:
 
 $ strace ./test-ipv4ll 
 execve(./test-ipv4ll, [./test-ipv4ll], [/* 64 vars */]) = 0
 brk(0)  = 0x7f387087e000
 access(/etc/ld.so.preload, R_OK)  = -1 ENOENT (No such file or 
 directory)
 open(/etc/ld.so.cache, O_RDONLY|O_CLOEXEC) = 3
 fstat(3, {st_mode=S_IFREG|0644, st_size=231109, ...}) = 0
 mmap(NULL, 231109, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f386f85e000
 close(3)= 0
 open(/usr/lib/librt.so.1, O_RDONLY|O_CLOEXEC) = 3
 read(3, 
 \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\360\\0\0\0\0\0\0..., 832) = 
 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=31760, ...}) = 0
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85d000
 mmap(NULL, 2128912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386f46f000
 mprotect(0x7f386f476000, 2093056, PROT_NONE) = 0
 mmap(0x7f386f675000, 8192, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f386f675000
 close(3)= 0
 open(/usr/lib/libpthread.so.0, O_RDONLY|O_CLOEXEC) = 3
 read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\`\0\0\0\0\0\0..., 
 832) = 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=149301, ...}) = 0
 mmap(NULL, 2217104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386f251000
 mprotect(0x7f386f269000, 2097152, PROT_NONE) = 0
 mmap(0x7f386f469000, 8192, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f386f469000
 mmap(0x7f386f46b000, 13456, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f46b000
 close(3)= 0
 open(/usr/lib/libc.so.6, O_RDONLY|O_CLOEXEC) = 3
 read(3, \177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\20\1\2\0\0\0\0\0..., 
 832) = 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=2047384, ...}) = 0
 mmap(NULL, 3858192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386eea3000
 mprotect(0x7f386f047000, 2097152, PROT_NONE) = 0
 mmap(0x7f386f247000, 24576, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a4000) = 0x7f386f247000
 mmap(0x7f386f24d000, 16144, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f24d000
 close(3)= 0
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85c000
 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85a000
 arch_prctl(ARCH_SET_FS, 0x7f386f85a740) = 0
 mprotect(0x7f386f247000, 16384, PROT_READ) = 0
 mprotect(0x7f386f469000, 4096, PROT_READ) = 0
 mprotect(0x7f386f675000, 4096, PROT_READ) = 0
 mprotect(0x7f386f8ab000, 4096, PROT_READ) = 0
 mprotect(0x7f386f897000, 4096, PROT_READ) = 0
 munmap(0x7f386f85e000, 231109)  = 0
 set_tid_address(0x7f386f85aa10) = 30468
 set_robust_list(0x7f386f85aa20, 24) = 0
 rt_sigaction(SIGRTMIN, {0x7f386f256b10, [], SA_RESTORER|SA_SIGINFO, 
 0x7f386f2604b0}, NULL, 8) = 0
 rt_sigaction(SIGRT_1, {0x7f386f256ba0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 
 0x7f386f2604b0}, NULL, 8) = 0
 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
 brk(0)  = 0x7f387087e000
 brk(0x7f387089f000) = 0x7f387089f000
 epoll_create1(EPOLL_CLOEXEC)= 3
 socketpair(PF_LOCAL, SOCK_DGRAM|SOCK_NONBLOCK, 0, [4, 5]) = 0
 epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=1887953936, 
 u64=139880382850064}}) = 0
 epoll_ctl(3, EPOLL_CTL_DEL, 4, NULL)= 0
 close(4)= 0
 epoll_wait(3,
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] container login

2014-08-30 Thread Ruben Kerkhof
Hi all,

I'm playing around a bit with systemd-nspawn, and the new --volatile option.
I've got it mostly working so far, except for loggin in to the container as 
root.

Looking at the code, IIUC systemd-firstboot is supposed to prompt for the root 
password, but it doesn't do this if /etc/shadow exists.
systemd-sysusers creates the root account, and, since 9ab315ccf22a, also 
creates a (locked) entry in /etc/shadow.

Now the obvious question is, how do I get into my volatile container?

Kind regards,

Ruben Kerkhof
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] ipv4ll: use correct event for setting name

2014-08-30 Thread Umut Tezduyar Lindskog
---
 src/libsystemd-network/sd-ipv4ll.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libsystemd-network/sd-ipv4ll.c 
b/src/libsystemd-network/sd-ipv4ll.c
index 3d15fc8..8b24331 100644
--- a/src/libsystemd-network/sd-ipv4ll.c
+++ b/src/libsystemd-network/sd-ipv4ll.c
@@ -564,7 +564,7 @@ int sd_ipv4ll_start (sd_ipv4ll *ll) {
 if (r  0)
 goto out;
 
-r = sd_event_source_set_name(ll-timer, ipv4ll-receive-message);
+r = sd_event_source_set_name(ll-receive_message, 
ipv4ll-receive-message);
 if (r  0)
 goto out;
 
-- 
1.7.10.4

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-ipv4ll never finishes

2014-08-30 Thread Umut Tezduyar Lindskog
I think 
http://lists.freedesktop.org/archives/systemd-devel/2014-August/022787.html
should do it! Thanks.

On Sat, Aug 30, 2014 at 8:23 PM, Umut Tezduyar u...@tezduyar.com wrote:
 Thanks. I will take a look at it.

 On Aug 30, 2014, at 3:08 PM, Jan Janssen medhe...@web.de wrote:

 Hi,

 on my system, test-ipv4ll waits forever on an epoll:

 $ strace ./test-ipv4ll
 execve(./test-ipv4ll, [./test-ipv4ll], [/* 64 vars */]) = 0
 brk(0)  = 0x7f387087e000
 access(/etc/ld.so.preload, R_OK)  = -1 ENOENT (No such file or 
 directory)
 open(/etc/ld.so.cache, O_RDONLY|O_CLOEXEC) = 3
 fstat(3, {st_mode=S_IFREG|0644, st_size=231109, ...}) = 0
 mmap(NULL, 231109, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f386f85e000
 close(3)= 0
 open(/usr/lib/librt.so.1, O_RDONLY|O_CLOEXEC) = 3
 read(3, 
 \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\360\\0\0\0\0\0\0..., 832) 
 = 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=31760, ...}) = 0
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85d000
 mmap(NULL, 2128912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386f46f000
 mprotect(0x7f386f476000, 2093056, PROT_NONE) = 0
 mmap(0x7f386f675000, 8192, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f386f675000
 close(3)= 0
 open(/usr/lib/libpthread.so.0, O_RDONLY|O_CLOEXEC) = 3
 read(3, \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\`\0\0\0\0\0\0..., 
 832) = 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=149301, ...}) = 0
 mmap(NULL, 2217104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386f251000
 mprotect(0x7f386f269000, 2097152, PROT_NONE) = 0
 mmap(0x7f386f469000, 8192, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f386f469000
 mmap(0x7f386f46b000, 13456, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f46b000
 close(3)= 0
 open(/usr/lib/libc.so.6, O_RDONLY|O_CLOEXEC) = 3
 read(3, 
 \177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\20\1\2\0\0\0\0\0..., 832) = 
 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=2047384, ...}) = 0
 mmap(NULL, 3858192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386eea3000
 mprotect(0x7f386f047000, 2097152, PROT_NONE) = 0
 mmap(0x7f386f247000, 24576, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a4000) = 0x7f386f247000
 mmap(0x7f386f24d000, 16144, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f24d000
 close(3)= 0
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85c000
 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85a000
 arch_prctl(ARCH_SET_FS, 0x7f386f85a740) = 0
 mprotect(0x7f386f247000, 16384, PROT_READ) = 0
 mprotect(0x7f386f469000, 4096, PROT_READ) = 0
 mprotect(0x7f386f675000, 4096, PROT_READ) = 0
 mprotect(0x7f386f8ab000, 4096, PROT_READ) = 0
 mprotect(0x7f386f897000, 4096, PROT_READ) = 0
 munmap(0x7f386f85e000, 231109)  = 0
 set_tid_address(0x7f386f85aa10) = 30468
 set_robust_list(0x7f386f85aa20, 24) = 0
 rt_sigaction(SIGRTMIN, {0x7f386f256b10, [], SA_RESTORER|SA_SIGINFO, 
 0x7f386f2604b0}, NULL, 8) = 0
 rt_sigaction(SIGRT_1, {0x7f386f256ba0, [], 
 SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f386f2604b0}, NULL, 8) = 0
 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
 brk(0)  = 0x7f387087e000
 brk(0x7f387089f000) = 0x7f387089f000
 epoll_create1(EPOLL_CLOEXEC)= 3
 socketpair(PF_LOCAL, SOCK_DGRAM|SOCK_NONBLOCK, 0, [4, 5]) = 0
 epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=1887953936, 
 u64=139880382850064}}) = 0
 epoll_ctl(3, EPOLL_CTL_DEL, 4, NULL)= 0
 close(4)= 0
 epoll_wait(3,
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] test-ipv4ll never finishes

2014-08-30 Thread Tom Gundersen
Thanks for the report, and to Umut for following up.

Please let us know if there is still a problem with current git.

Cheers,

Tom

On Sat, Aug 30, 2014 at 9:46 PM, Umut Tezduyar Lindskog
u...@tezduyar.com wrote:
 I think 
 http://lists.freedesktop.org/archives/systemd-devel/2014-August/022787.html
 should do it! Thanks.

 On Sat, Aug 30, 2014 at 8:23 PM, Umut Tezduyar u...@tezduyar.com wrote:
 Thanks. I will take a look at it.

 On Aug 30, 2014, at 3:08 PM, Jan Janssen medhe...@web.de wrote:

 Hi,

 on my system, test-ipv4ll waits forever on an epoll:

 $ strace ./test-ipv4ll
 execve(./test-ipv4ll, [./test-ipv4ll], [/* 64 vars */]) = 0
 brk(0)  = 0x7f387087e000
 access(/etc/ld.so.preload, R_OK)  = -1 ENOENT (No such file or 
 directory)
 open(/etc/ld.so.cache, O_RDONLY|O_CLOEXEC) = 3
 fstat(3, {st_mode=S_IFREG|0644, st_size=231109, ...}) = 0
 mmap(NULL, 231109, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f386f85e000
 close(3)= 0
 open(/usr/lib/librt.so.1, O_RDONLY|O_CLOEXEC) = 3
 read(3, 
 \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\360\\0\0\0\0\0\0..., 832) 
 = 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=31760, ...}) = 0
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85d000
 mmap(NULL, 2128912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386f46f000
 mprotect(0x7f386f476000, 2093056, PROT_NONE) = 0
 mmap(0x7f386f675000, 8192, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f386f675000
 close(3)= 0
 open(/usr/lib/libpthread.so.0, O_RDONLY|O_CLOEXEC) = 3
 read(3, 
 \177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0\0\1\0\0\`\0\0\0\0\0\0..., 832) = 
 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=149301, ...}) = 0
 mmap(NULL, 2217104, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386f251000
 mprotect(0x7f386f269000, 2097152, PROT_NONE) = 0
 mmap(0x7f386f469000, 8192, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f386f469000
 mmap(0x7f386f46b000, 13456, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f46b000
 close(3)= 0
 open(/usr/lib/libc.so.6, O_RDONLY|O_CLOEXEC) = 3
 read(3, 
 \177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0\0\1\0\0\0\20\1\2\0\0\0\0\0..., 832) 
 = 832
 fstat(3, {st_mode=S_IFREG|0755, st_size=2047384, ...}) = 0
 mmap(NULL, 3858192, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
 0x7f386eea3000
 mprotect(0x7f386f047000, 2097152, PROT_NONE) = 0
 mmap(0x7f386f247000, 24576, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1a4000) = 0x7f386f247000
 mmap(0x7f386f24d000, 16144, PROT_READ|PROT_WRITE, 
 MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f386f24d000
 close(3)= 0
 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85c000
 mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
 0x7f386f85a000
 arch_prctl(ARCH_SET_FS, 0x7f386f85a740) = 0
 mprotect(0x7f386f247000, 16384, PROT_READ) = 0
 mprotect(0x7f386f469000, 4096, PROT_READ) = 0
 mprotect(0x7f386f675000, 4096, PROT_READ) = 0
 mprotect(0x7f386f8ab000, 4096, PROT_READ) = 0
 mprotect(0x7f386f897000, 4096, PROT_READ) = 0
 munmap(0x7f386f85e000, 231109)  = 0
 set_tid_address(0x7f386f85aa10) = 30468
 set_robust_list(0x7f386f85aa20, 24) = 0
 rt_sigaction(SIGRTMIN, {0x7f386f256b10, [], SA_RESTORER|SA_SIGINFO, 
 0x7f386f2604b0}, NULL, 8) = 0
 rt_sigaction(SIGRT_1, {0x7f386f256ba0, [], 
 SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f386f2604b0}, NULL, 8) = 0
 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
 brk(0)  = 0x7f387087e000
 brk(0x7f387089f000) = 0x7f387089f000
 epoll_create1(EPOLL_CLOEXEC)= 3
 socketpair(PF_LOCAL, SOCK_DGRAM|SOCK_NONBLOCK, 0, [4, 5]) = 0
 epoll_ctl(3, EPOLL_CTL_ADD, 4, {EPOLLIN, {u32=1887953936, 
 u64=139880382850064}}) = 0
 epoll_ctl(3, EPOLL_CTL_DEL, 4, NULL)= 0
 close(4)= 0
 epoll_wait(3,
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] ipv4ll: use correct event for setting name

2014-08-30 Thread Tom Gundersen
Thanks for the patch reminder, I already had the same fix in my queue,
but forgot to push.
 Pushed it now.

Cheers,

Tom

2014-08-30 21:33 GMT+02:00 Umut Tezduyar Lindskog umut.tezdu...@axis.com:
 ---
  src/libsystemd-network/sd-ipv4ll.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/src/libsystemd-network/sd-ipv4ll.c 
 b/src/libsystemd-network/sd-ipv4ll.c
 index 3d15fc8..8b24331 100644
 --- a/src/libsystemd-network/sd-ipv4ll.c
 +++ b/src/libsystemd-network/sd-ipv4ll.c
 @@ -564,7 +564,7 @@ int sd_ipv4ll_start (sd_ipv4ll *ll) {
  if (r  0)
  goto out;

 -r = sd_event_source_set_name(ll-timer, ipv4ll-receive-message);
 +r = sd_event_source_set_name(ll-receive_message, 
 ipv4ll-receive-message);
  if (r  0)
  goto out;

 --
 1.7.10.4

 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] journal/compress: use LZ4_compress_continue()

2014-08-30 Thread Zbigniew Jędrzejewski-Szmek
On Sat, Aug 30, 2014 at 10:13:43AM +0300, Evangelos Foutras wrote:
 We can't use LZ4_compress_limitedOutput_continue() because in the
 worst-case scenario the compressed output can be slightly bigger than
 the input block. This generally affects very few blocks and is no reason
 to abort the compression process.
Applied.

We should probably do the same for XZ.

Zbyszek

 I ran into this when I noticed that Chromium core dumps weren't being
 compressed. After switching to LZ4_compress_continue() a ~330MB Chromium
 core dump gets compressed to ~17M.
 ---
  src/journal/compress.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/src/journal/compress.c b/src/journal/compress.c
 index 52a4c10..c4c715b 100644
 --- a/src/journal/compress.c
 +++ b/src/journal/compress.c
 @@ -460,10 +460,10 @@ int compress_stream_lz4(int fdf, int fdt, off_t 
 max_bytes) {
  
  total_in += n;
  
 -r = LZ4_compress_limitedOutput_continue(lz4_data, buf, out, 
 n, n);
 +r = LZ4_compress_continue(lz4_data, buf, out, n);
  if (r == 0) {
 -log_debug(Compressed size exceeds original, 
 aborting compression.);
 -return -ENOBUFS;
 +log_error(LZ4 compression failed.);
 +return -EBADMSG;
  }
  
  header = htole32(r);
 -- 
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] journalctl: Fix --list-boots and --boot

2014-08-30 Thread Zbigniew Jędrzejewski-Szmek
On Fri, Aug 29, 2014 at 06:11:35PM +0200, Jan Janssen wrote:
 For some reason, sd_journal_query_unique() and sd_journal_add_match() don't
 work as they used to. There's a chance boots will be skipped; in my
 case only 60 of 393 boots show up. Therefore, do sd_journal_query_unique() 
 first
 and then iterate over those to query their timespec.
We should fix the underlying problem, since query_unique and add_match weren't
supposed to change at all. Looking at the journal client code has been on my
TODO list for a long while...

Zbyszek

  https://bugs.freedesktop.org/show_bug.cgi?id=79380
 ---
  src/journal/journalctl.c | 124 
 ---
  1 file changed, 53 insertions(+), 71 deletions(-)
 
 diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
 index f3680d1..0aec5fb 100644
 --- a/src/journal/journalctl.c
 +++ b/src/journal/journalctl.c
 @@ -804,33 +804,45 @@ static int boot_id_cmp(const void *a, const void *b) {
  return _a  _b ? -1 : (_a  _b ? 1 : 0);
  }
  
 -static int list_boots(sd_journal *j) {
 +static int get_boots(sd_journal *j, boot_id_t **boot_ids, unsigned int 
 *count, boot_id_t *query_ref_boot_id) {
  int r;
 +boot_id_t *id;
  const void *data;
 -unsigned int count = 0;
 -int w, i;
  size_t length, allocated = 0;
 -boot_id_t *id;
 -_cleanup_free_ boot_id_t *all_ids = NULL;
 +
 +assert(j);
 +assert(boot_ids);
 +assert(count);
  
  r = sd_journal_query_unique(j, _BOOT_ID);
  if (r  0)
  return r;
  
 +*count = 0;
  SD_JOURNAL_FOREACH_UNIQUE(j, data, length) {
  if (length  strlen(_BOOT_ID=))
  continue;
  
 -if (!GREEDY_REALLOC(all_ids, allocated, count + 1))
 +if (!GREEDY_REALLOC(*boot_ids, allocated, *count + 1))
  return log_oom();
  
 -id = all_ids[count];
 +id = *boot_ids + *count;
  
  r = sd_id128_from_string(((const char *)data) + 
 strlen(_BOOT_ID=), id-id);
  if (r  0)
  continue;
  
 -r = sd_journal_add_match(j, data, length);
 +(*count)++;
 +id-first = id-last = 0;
 +}
 +
 +for (id = *boot_ids; id  *boot_ids + *count; id++) {
 +char boot_id_str[9+32+1] = _BOOT_ID=;
 +
 +sd_journal_flush_matches(j);
 +sd_id128_to_string(id-id, boot_id_str + 9);
 +
 +r = sd_journal_add_match(j, boot_id_str, 
 strlen(boot_id_str));
  if (r  0)
  return r;
  
 @@ -839,35 +851,47 @@ static int list_boots(sd_journal *j) {
  return r;
  
  r = sd_journal_next(j);
 -if (r  0)
 +if (r = 0)
  return r;
 -else if (r == 0)
 -goto flush;
  
  r = sd_journal_get_realtime_usec(j, id-first);
  if (r  0)
  return r;
  
 +if (query_ref_boot_id) {
 +if (sd_id128_equal(id-id, query_ref_boot_id-id))
 +*query_ref_boot_id = *id;
 +continue;
 +}
 +
  r = sd_journal_seek_tail(j);
  if (r  0)
  return r;
  
  r = sd_journal_previous(j);
 -if (r  0)
 +if (r = 0)
  return r;
 -else if (r == 0)
 -goto flush;
  
  r = sd_journal_get_realtime_usec(j, id-last);
  if (r  0)
  return r;
 -
 -count++;
 -flush:
 -sd_journal_flush_matches(j);
  }
  
 -qsort_safe(all_ids, count, sizeof(boot_id_t), boot_id_cmp);
 +sd_journal_flush_matches(j);
 +qsort_safe(*boot_ids, *count, sizeof(boot_id_t), boot_id_cmp);
 +
 +return 0;
 +}
 +
 +static int list_boots(sd_journal *j) {
 +int r, w, i;
 +unsigned int count = 0;
 +boot_id_t *id;
 +_cleanup_free_ boot_id_t *all_ids = NULL;
 +
 +r = get_boots(j, all_ids, count, NULL);
 +if (r  0)
 +return r;
  
  /* numbers are one less, but we need an extra char for the sign */
  w = DECIMAL_STR_WIDTH(count - 1) + 1;
 @@ -885,76 +909,34 @@ static int list_boots(sd_journal *j) {
  return 0;
  }
  
 -static int get_relative_boot_id(sd_journal *j, sd_id128_t *boot_id, int 
 relative) {
 +static int get_boot_id_by_offset(sd_journal *j, sd_id128_t *boot_id, int 
 offset) {
  int r;
 -const void *data;
  unsigned int count = 0;
 -size_t length, allocated = 0;
 -  

Re: [systemd-devel] [PATCH] journal/compress: use LZ4_compress_continue()

2014-08-30 Thread Evangelos Foutras
On 31 August 2014 00:39, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote:
 On Sat, Aug 30, 2014 at 10:13:43AM +0300, Evangelos Foutras wrote:
 We can't use LZ4_compress_limitedOutput_continue() because in the
 worst-case scenario the compressed output can be slightly bigger than
 the input block. This generally affects very few blocks and is no reason
 to abort the compression process.
 Applied.

 We should probably do the same for XZ.

I don't believe compress_stream_xz() has this problem, or at least I
didn't notice any issues with Chromium core dumps; they were
successfully stored as .xz files.

(Sorry for the duplicate email, I failed to reply to the list in my
earlier response.)
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] test-dhcp6-client: Fix option length

2014-08-30 Thread Zbigniew Jędrzejewski-Szmek
Hi,
I now pushed your patch along with another one, very similar, with
a fix for the second problem. test-dhcp6-client now runs fine under asan.

test-network doesn't, but that's another story.

Zbyszek

On Fri, Aug 29, 2014 at 02:58:54PM +0200, Zbigniew Jędrzejewski-Szmek wrote:
 On Fri, Aug 29, 2014 at 09:20:46AM +0300, Patrik Flykt wrote:
  The whole DHCPv6 test message length was incorrectly used as the length
  of DHCPv6 options causing the following bad memory access:
  
  $ build/test-dhcp6-client
  Assertion 'interface_index = -1' failed at 
  ../src/libsystemd-network/sd-dhcp6-client.c:129, function 
  sd_dhcp6_client_set_index(). Ignoring.
  =
  ==29135==ERROR: AddressSanitizer: global-buffer-overflow on address 
  0x7fe204aa9148 at pc 0x7fe204a5958f bp 0x7fff3e47d470 sp 0x7fff3e47d460
  READ of size 1 at 0x7fe204aa9148 thread T0
  #0 0x7fe204a5958e in option_parse_hdr 
  ../src/libsystemd-network/dhcp6-option.c:145
  #1 0x7fe204a59884 in dhcp6_option_parse 
  ../src/libsystemd-network/dhcp6-option.c:165
  #2 0x7fe204a4eb9c in test_advertise_option 
  ../src/libsystemd-network/test-dhcp6-client.c:227
  #3 0x7fe204a51c58 in main 
  ../src/libsystemd-network/test-dhcp6-client.c:584
  #4 0x7fe2031590df in __libc_start_main (/lib64/libc.so.6+0x200df)
  #5 0x7fe204a4cc5b (/home/test/systemd/build/test-dhcp6-client+0x25c5b)
  
  0x7fe204aa9148 is located 2 bytes to the right of global variable 
  'msg_advertise' from '../src/libsystemd-network/test-dhcp6-client.c' 
  (0x7fe204aa9080) of size 198
  0x7fe204aa9148 is located 56 bytes to the left of global variable 
  'msg_reply' from '../src/libsystemd-network/test-dhcp6-client.c' 
  (0x7fe204aa9180) of size 173
  SUMMARY: AddressSanitizer: global-buffer-overflow 
  ../src/libsystemd-network/dhcp6-option.c:145 option_parse_hdr
  ---
  
  This seems to be the cause of the bad memory access, please test.
 Hm, I thiink it helps, but there's another one:
 
 $ build/test-dhcp6-client 
 Assertion 'interface_index = -1' failed at 
 ../src/libsystemd-network/sd-dhcp6-client.c:129, function 
 sd_dhcp6_client_set_index(). Ignoring.
 DHCPv6 CLIENT: Sent SOLICIT
 DHCPv6 CLIENT: Next retransmission in 1.049185s
 =
 ==29571==ERROR: AddressSanitizer: heap-buffer-overflow on address 
 0x61109708 at pc 0x7fd00190458f bp 0x7fff287de8d0 sp 0x7fff287de8c0
 READ of size 1 at 0x61109708 thread T0
 #0 0x7fd00190458e in option_parse_hdr 
 ../src/libsystemd-network/dhcp6-option.c:145
 #1 0x7fd001904884 in dhcp6_option_parse 
 ../src/libsystemd-network/dhcp6-option.c:165
 #2 0x7fd0019008ff in client_parse_message 
 ../src/libsystemd-network/sd-dhcp6-client.c:582
 #3 0x7fd001901078 in client_receive_advertise 
 ../src/libsystemd-network/sd-dhcp6-client.c:732
 #4 0x7fd001901822 in client_receive_message 
 ../src/libsystemd-network/sd-dhcp6-client.c:809
 #5 0x7fd001918c77 in source_dispatch 
 ../src/libsystemd/sd-event/sd-event.c:2035
 #6 0x7fd00191b7f1 in sd_event_dispatch 
 ../src/libsystemd/sd-event/sd-event.c:2384
 #7 0x7fd00191bad4 in sd_event_run 
 ../src/libsystemd/sd-event/sd-event.c:2413
 #8 0x7fd00191bc1d in sd_event_loop 
 ../src/libsystemd/sd-event/sd-event.c:2428
 #9 0x7fd0018fca81 in test_client_solicit 
 ../src/libsystemd-network/test-dhcp6-client.c:562
 #10 0x7fd0018fcc65 in main 
 ../src/libsystemd-network/test-dhcp6-client.c:585
 #11 0x7fd040df in __libc_start_main (/lib64/libc.so.6+0x200df)
 #12 0x7fd0018f7c5b (/home/test/systemd/build/test-dhcp6-client+0x25c5b)
 
 0x61109708 is located 2 bytes to the right of 198-byte region 
 [0x61109640,0x61109706)
 allocated by thread T0 here:
 #0 0x7fd000827cf5 in calloc (/lib64/libasan.so.1+0x57cf5)
 #1 0x7fd00190152b in client_receive_message 
 ../src/libsystemd-network/sd-dhcp6-client.c:769
 #2 0x7fd001918c77 in source_dispatch 
 ../src/libsystemd/sd-event/sd-event.c:2035
 #3 0x7fd00191b7f1 in sd_event_dispatch 
 ../src/libsystemd/sd-event/sd-event.c:2384
 #4 0x7fd00191bad4 in sd_event_run 
 ../src/libsystemd/sd-event/sd-event.c:2413
 #5 0x7fd00191bc1d in sd_event_loop 
 ../src/libsystemd/sd-event/sd-event.c:2428
 #6 0x7fd0018fca81 in test_client_solicit 
 ../src/libsystemd-network/test-dhcp6-client.c:562
 #7 0x7fd0018fcc65 in main 
 ../src/libsystemd-network/test-dhcp6-client.c:585
 #8 0x7fd040df in __libc_start_main (/lib64/libc.so.6+0x200df)
 
 SUMMARY: AddressSanitizer: heap-buffer-overflow 
 ../src/libsystemd-network/dhcp6-option.c:145 option_parse_hdr
 Shadow bytes around the buggy address:
   0x0c227fff9290: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
   0x0c227fff92a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
   0x0c227fff92b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
   0x0c227fff92c0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00

[systemd-devel] You are invited to give your thoughts on some async-signal-safety issues.

2014-08-30 Thread Steven Stewart-Gallus
Hello,

I understand that systemd uses sandboxing and multithreading.  After a
fork, many things are messed up so it's only practical to use
async-signal-safe functions after a fork from a threaded program.  If
you have ideas on what sort of functionality GLibc needs to change to
make systemd more async-signal-safe after a fork you are invited to
give your thoughts on the GLibc mailing list in the thread at
https://sourceware.org/ml/libc-help/2014-08/msg00039.html.

Thank you,
Steven Stewart-Gallus
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel