[Bug 2681] postauth processes to log via monitor

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Fri Jun 23 17:28:45 AEST 2017


https://bugzilla.mindrot.org/show_bug.cgi?id=2681

--- Comment #2 from Jakub Jelen <jjelen at redhat.com> ---
(In reply to Damien Miller from comment #1)
> I think it's simpler to log via the monitor unconditionally. There
> are fewer paths to think about that way.

If we are logging using monitor, it significantly more complicated to
filter these logs afterward in syslog, because all of them will be
originating from the same process and from the same /dev/log.

On the other hand, logging using existing /dev/log in chroot makes it
very simple to filter the logs from different chroots for example to
different files (though it does not scale very well).

> >-	/*
> >-	 * Close any extra open file descriptors so that we don't have them
> >-	 * hanging around in clients.  Note that we want to do this after
> >-	 * initgroups, because at least on Solaris 2.3 it leaves file
> >-	 * descriptors open.
> >-	 */
> >-	closefrom(STDERR_FILENO + 1);
> 
> If you remove this then I think you need to add an explicit
> closefrom() before the do_pwchange() call in do_child().

That would probably make sense. Good catch.

> >-	closefrom(STDERR_FILENO + 1);
> 
> I don't think this one should be removed. IMO it would be better
> arrange for the log socket to be on fd=4 and closefrom(5) instead
> (with a comment explaining why).

Well ... this was moved after the internal-sftp call so we can "leak"
that file descriptor into the internal-sftp. This is executed in all
the other code paths (though possibly later).
I am not sure if there is sane portable way to ensure the log fd will
be 4.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list