Re: [systemd-devel] Incorrect logic when /etc/machine-id is missing

2014-10-08 Thread Lennart Poettering
On Fri, 03.10.14 07:07, Jan Synacek (jsyna...@redhat.com) wrote: > >> Now I was determined to fix this bug, however I'm left clueless as to > >> how this is actually supposed to work. Is the entire logic in this piece > >> of code wrong, or am I missing something? How is the > >> (re)generating/mo

Re: [systemd-devel] Incorrect logic when /etc/machine-id is missing

2014-10-02 Thread Jan Synacek
Lennart Poettering writes: > On Mon, 22.09.14 11:27, Jan Synacek (jsyna...@redhat.com) wrote: > >> Hello, >> >> I believe that the following code is not correct: >> >> src/core/machine-id-setup.c:188-190: >> >> mkdir_parents(etc_machine_id, 0755); >> fd = open(etc_machine_id, O_RDWR|O_CREAT|O_C

Re: [systemd-devel] Incorrect logic when /etc/machine-id is missing

2014-10-02 Thread Lennart Poettering
On Tue, 23.09.14 09:09, Jan Synacek (jsyna...@redhat.com) wrote: > Simon McVittie writes: > > On 22/09/14 10:27, Jan Synacek wrote: > >> If /etc/machine-id is missing on the system, the first open() call > >> should probably handle that case. That's actually not true (at least on > >> my system),

Re: [systemd-devel] Incorrect logic when /etc/machine-id is missing

2014-10-02 Thread Lennart Poettering
On Mon, 22.09.14 11:27, Jan Synacek (jsyna...@redhat.com) wrote: > Hello, > > I believe that the following code is not correct: > > src/core/machine-id-setup.c:188-190: > > mkdir_parents(etc_machine_id, 0755); > fd = open(etc_machine_id, O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444); > if (fd >= 0)

Re: [systemd-devel] Incorrect logic when /etc/machine-id is missing

2014-09-23 Thread Jan Synacek
Simon McVittie writes: > On 22/09/14 10:27, Jan Synacek wrote: >> If /etc/machine-id is missing on the system, the first open() call >> should probably handle that case. That's actually not true (at least on >> my system), because the underlying filesystem is read-only at that >> time. > > *What*

Re: [systemd-devel] Incorrect logic when /etc/machine-id is missing

2014-09-22 Thread Simon McVittie
On 22/09/14 10:27, Jan Synacek wrote: > If /etc/machine-id is missing on the system, the first open() call > should probably handle that case. That's actually not true (at least on > my system), because the underlying filesystem is read-only at that > time. *What* is not true on your system? Are

[systemd-devel] Incorrect logic when /etc/machine-id is missing

2014-09-22 Thread Jan Synacek
Hello, I believe that the following code is not correct: src/core/machine-id-setup.c:188-190: mkdir_parents(etc_machine_id, 0755); fd = open(etc_machine_id, O_RDWR|O_CREAT|O_CLOEXEC|O_NOCTTY, 0444); if (fd >= 0) writable = true; else { fd = open(etc_machine_id, O_RDONLY|O_CLOEXEC