sshd's -e doesn't work as expected
Julio M. Merino Vidal
jmmv84 at gmail.com
Fri Dec 28 20:05:32 EST 2007
On 28/12/2007, at 0:31, Jim Knoble wrote:
> If you need the PID of the sshd process, you can get it without a race
> using (for example):
>
> #!/bin/sh
> /usr/local/sbin/sshd -D &
> SSHD_PID="$!"
>
> The shell knows the process ID of the child it spawns to run sshd.
Ah, cool. I didn't know of that variable. Thank you.
> : So, OK. If -e is always supposed to be used alongside with -D, then
> : the daemon should complain about that situation.
>
> Perhaps you could generate a patch and attach it to your bug report.
Here it goes:
Index: sshd.8
===================================================================
RCS file: /cvsroot/src/crypto/dist/ssh/sshd.8,v
retrieving revision 1.38
diff -u -p -r1.38 sshd.8
--- sshd.8 18 Dec 2007 02:35:32 -0000 1.38
+++ sshd.8 28 Dec 2007 09:03:53 -0000
@@ -36,7 +36,7 @@
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: sshd.8,v 1.237 2007/06/07 19:37:34 pvalchev Exp $
-.Dd $Mdocdate: June 7 2007 $
+.Dd $Mdocdate: December 28 2007 $
.Dt SSHD 8
.Os
.Sh NAME
@@ -121,6 +121,8 @@ Maximum is 3.
When this option is specified,
.Nm
will send the output to the standard error instead of the system log.
+This option requires
+.Fl D .
.It Fl f Ar config_file
Specifies the name of the configuration file.
The default is
Index: sshd.c
===================================================================
RCS file: /cvsroot/src/crypto/dist/ssh/sshd.c,v
retrieving revision 1.42
diff -u -p -r1.42 sshd.c
--- sshd.c 18 Dec 2007 02:35:33 -0000 1.42
+++ sshd.c 28 Dec 2007 09:03:53 -0000
@@ -1330,6 +1330,8 @@ main(int ac, char **av)
closefrom(REEXEC_MIN_FREE_FD);
else
closefrom(REEXEC_DEVCRYPTO_RESERVED_FD);
+ if (log_stderr && !no_daemon_flag)
+ fatal("The -e option also requires -D");
SSLeay_add_all_algorithms();
--
Julio M. Merino Vidal <jmmv84 at gmail.com>
More information about the openssh-unix-dev
mailing list