[systemd-bugs] [Bug 82004] The tty-ask-password-agent does not use all devices of /dev/console

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Aug 3 10:10:45 PDT 2014


https://bugs.freedesktop.org/show_bug.cgi?id=82004

--- Comment #1 from Zbigniew Jedrzejewski-Szmek <zbyszek at in.waw.pl> ---
Looks reasonable.

I have some requests for changes in the implementation though:

1. Please make the list of 'consoles' simply an array. Then GREEDY_REALLOC will
be enough in a loop will be enough to initially allocate and add items to the
array, making everything a bit simpler.

Also, having the console name appended to the end of 'struct console' makes
things more complicated than need be. Please just strndup() the string.

2. 'consoles' global variable does not have to be global, and 'current_dev'
probably too. We usually only use global variables for commandline arguments.

3. The whole thing with 'usemask' is not going to work, because there's no
locking. And I don't see the need for it. Isn't it enough to
    a) in a loop: set index, launch child
    b) wait until no children are left
    c) quit
?

4. In collect consoles the block which adds a new 'struct console' entry is
repeated twice. Can you make this a separate function?

5. For consistency with other code: switch(fork) should be turned into an two
if's (e.g.
http://cgit.freedesktop.org/systemd/systemd/tree/src/core/execute.c#n797)

6. When log_oom() happens, just fail, do not continue.

7. Killing and waiting for child should (I think) use the same signal sequence
as wait_for_terminate(). If something different is needed, please add a
comment.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-bugs/attachments/20140803/dfb72111/attachment.html>


More information about the systemd-bugs mailing list