- djm@cvs.openbsd.org 2008/10/08 23:34:03

[ssh.1 ssh.c]
     Add -y option to force logging via syslog rather than stderr.
     Useful for daemonised ssh connection (ssh -f). Patch originally from
     and ok'd by markus@
This commit is contained in:
Damien Miller 2008-11-03 19:22:37 +11:00
parent c4d1b36cc2
commit e272a5bb29
3 changed files with 23 additions and 9 deletions

View File

@ -47,6 +47,11 @@
and (as is fairly typical) did not report the problem to us. But this fix and (as is fairly typical) did not report the problem to us. But this fix
is correct. is correct.
ok djm ok djm
- djm@cvs.openbsd.org 2008/10/08 23:34:03
[ssh.1 ssh.c]
Add -y option to force logging via syslog rather than stderr.
Useful for daemonised ssh connection (ssh -f). Patch originally from
and ok'd by markus@
20080906 20080906
- (dtucker) [config.guess config.sub] Update to latest versions from - (dtucker) [config.guess config.sub] Update to latest versions from
@ -4781,4 +4786,4 @@
OpenServer 6 and add osr5bigcrypt support so when someone migrates OpenServer 6 and add osr5bigcrypt support so when someone migrates
passwords between UnixWare and OpenServer they will still work. OK dtucker@ passwords between UnixWare and OpenServer they will still work. OK dtucker@
$Id: ChangeLog,v 1.5109 2008/11/03 08:22:09 djm Exp $ $Id: ChangeLog,v 1.5110 2008/11/03 08:22:37 djm Exp $

11
ssh.1
View File

@ -34,8 +34,8 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.\" $OpenBSD: ssh.1,v 1.277 2008/07/02 13:47:39 djm Exp $ .\" $OpenBSD: ssh.1,v 1.278 2008/10/08 23:34:03 djm Exp $
.Dd $Mdocdate: July 2 2008 $ .Dd $Mdocdate: October 8 2008 $
.Dt SSH 1 .Dt SSH 1
.Os .Os
.Sh NAME .Sh NAME
@ -43,7 +43,7 @@
.Nd OpenSSH SSH client (remote login program) .Nd OpenSSH SSH client (remote login program)
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm ssh .Nm ssh
.Op Fl 1246AaCfgKkMNnqsTtVvXxY .Op Fl 1246AaCfgKkMNnqsTtVvXxYy
.Op Fl b Ar bind_address .Op Fl b Ar bind_address
.Op Fl c Ar cipher_spec .Op Fl c Ar cipher_spec
.Oo Fl D\ \& .Oo Fl D\ \&
@ -658,6 +658,11 @@ Disables X11 forwarding.
Enables trusted X11 forwarding. Enables trusted X11 forwarding.
Trusted X11 forwardings are not subjected to the X11 SECURITY extension Trusted X11 forwardings are not subjected to the X11 SECURITY extension
controls. controls.
.It Fl y
Send log information using the
.Xr syslog 3
system module.
By default this information is sent to stderr.
.El .El
.Pp .Pp
.Nm .Nm

14
ssh.c
View File

@ -1,4 +1,4 @@
/* $OpenBSD: ssh.c,v 1.319 2008/09/11 14:22:37 markus Exp $ */ /* $OpenBSD: ssh.c,v 1.320 2008/10/08 23:34:03 djm Exp $ */
/* /*
* Author: Tatu Ylonen <ylo@cs.hut.fi> * Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -203,7 +203,7 @@ void muxserver_listen(void);
int int
main(int ac, char **av) main(int ac, char **av)
{ {
int i, opt, exit_status; int i, opt, exit_status, use_syslog;
char *p, *cp, *line, buf[256]; char *p, *cp, *line, buf[256];
struct stat st; struct stat st;
struct passwd *pw; struct passwd *pw;
@ -269,10 +269,11 @@ main(int ac, char **av)
/* Parse command-line arguments. */ /* Parse command-line arguments. */
host = NULL; host = NULL;
use_syslog = 0;
again: again:
while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx"
"ACD:F:I:KL:MNO:PR:S:TVw:XY")) != -1) { "ACD:F:I:KL:MNO:PR:S:TVw:XYy")) != -1) {
switch (opt) { switch (opt) {
case '1': case '1':
options.protocol = SSH_PROTO_1; options.protocol = SSH_PROTO_1;
@ -299,6 +300,9 @@ main(int ac, char **av)
case 'X': case 'X':
options.forward_x11 = 1; options.forward_x11 = 1;
break; break;
case 'y':
use_syslog = 1;
break;
case 'Y': case 'Y':
options.forward_x11 = 1; options.forward_x11 = 1;
options.forward_x11_trusted = 1; options.forward_x11_trusted = 1;
@ -614,7 +618,7 @@ main(int ac, char **av)
*/ */
log_init(av[0], log_init(av[0],
options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,
SYSLOG_FACILITY_USER, 1); SYSLOG_FACILITY_USER, !use_syslog);
/* /*
* Read per-user configuration file. Ignore the system wide config * Read per-user configuration file. Ignore the system wide config
@ -640,7 +644,7 @@ main(int ac, char **av)
channel_set_af(options.address_family); channel_set_af(options.address_family);
/* reinit */ /* reinit */
log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1); log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, !use_syslog);
seed_rng(); seed_rng();