diff options
author | Damien Miller <djm@mindrot.org> | 2008-11-03 19:22:37 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2008-11-03 19:22:37 +1100 |
commit | e272a5bb2937f1a8297c412c9312c38133f829c1 (patch) | |
tree | 2e169ea656fa0775c69935c8818cbde3fd3e2de9 | |
parent | c4d1b36cc2fb89566fe01b990abf8b635e0dce74 (diff) |
- 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@
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ssh.1 | 11 | ||||
-rw-r--r-- | ssh.c | 14 |
3 files changed, 23 insertions, 9 deletions
@@ -47,6 +47,11 @@ | |||
47 | and (as is fairly typical) did not report the problem to us. But this fix | 47 | and (as is fairly typical) did not report the problem to us. But this fix |
48 | is correct. | 48 | is correct. |
49 | ok djm | 49 | ok djm |
50 | - djm@cvs.openbsd.org 2008/10/08 23:34:03 | ||
51 | [ssh.1 ssh.c] | ||
52 | Add -y option to force logging via syslog rather than stderr. | ||
53 | Useful for daemonised ssh connection (ssh -f). Patch originally from | ||
54 | and ok'd by markus@ | ||
50 | 55 | ||
51 | 20080906 | 56 | 20080906 |
52 | - (dtucker) [config.guess config.sub] Update to latest versions from | 57 | - (dtucker) [config.guess config.sub] Update to latest versions from |
@@ -4781,4 +4786,4 @@ | |||
4781 | OpenServer 6 and add osr5bigcrypt support so when someone migrates | 4786 | OpenServer 6 and add osr5bigcrypt support so when someone migrates |
4782 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ | 4787 | passwords between UnixWare and OpenServer they will still work. OK dtucker@ |
4783 | 4788 | ||
4784 | $Id: ChangeLog,v 1.5109 2008/11/03 08:22:09 djm Exp $ | 4789 | $Id: ChangeLog,v 1.5110 2008/11/03 08:22:37 djm Exp $ |
@@ -34,8 +34,8 @@ | |||
34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
36 | .\" | 36 | .\" |
37 | .\" $OpenBSD: ssh.1,v 1.277 2008/07/02 13:47:39 djm Exp $ | 37 | .\" $OpenBSD: ssh.1,v 1.278 2008/10/08 23:34:03 djm Exp $ |
38 | .Dd $Mdocdate: July 2 2008 $ | 38 | .Dd $Mdocdate: October 8 2008 $ |
39 | .Dt SSH 1 | 39 | .Dt SSH 1 |
40 | .Os | 40 | .Os |
41 | .Sh NAME | 41 | .Sh NAME |
@@ -43,7 +43,7 @@ | |||
43 | .Nd OpenSSH SSH client (remote login program) | 43 | .Nd OpenSSH SSH client (remote login program) |
44 | .Sh SYNOPSIS | 44 | .Sh SYNOPSIS |
45 | .Nm ssh | 45 | .Nm ssh |
46 | .Op Fl 1246AaCfgKkMNnqsTtVvXxY | 46 | .Op Fl 1246AaCfgKkMNnqsTtVvXxYy |
47 | .Op Fl b Ar bind_address | 47 | .Op Fl b Ar bind_address |
48 | .Op Fl c Ar cipher_spec | 48 | .Op Fl c Ar cipher_spec |
49 | .Oo Fl D\ \& | 49 | .Oo Fl D\ \& |
@@ -658,6 +658,11 @@ Disables X11 forwarding. | |||
658 | Enables trusted X11 forwarding. | 658 | Enables trusted X11 forwarding. |
659 | Trusted X11 forwardings are not subjected to the X11 SECURITY extension | 659 | Trusted X11 forwardings are not subjected to the X11 SECURITY extension |
660 | controls. | 660 | controls. |
661 | .It Fl y | ||
662 | Send log information using the | ||
663 | .Xr syslog 3 | ||
664 | system module. | ||
665 | By default this information is sent to stderr. | ||
661 | .El | 666 | .El |
662 | .Pp | 667 | .Pp |
663 | .Nm | 668 | .Nm |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.319 2008/09/11 14:22:37 markus Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.320 2008/10/08 23:34:03 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -203,7 +203,7 @@ void muxserver_listen(void); | |||
203 | int | 203 | int |
204 | main(int ac, char **av) | 204 | main(int ac, char **av) |
205 | { | 205 | { |
206 | int i, opt, exit_status; | 206 | int i, opt, exit_status, use_syslog; |
207 | char *p, *cp, *line, buf[256]; | 207 | char *p, *cp, *line, buf[256]; |
208 | struct stat st; | 208 | struct stat st; |
209 | struct passwd *pw; | 209 | struct passwd *pw; |
@@ -269,10 +269,11 @@ main(int ac, char **av) | |||
269 | 269 | ||
270 | /* Parse command-line arguments. */ | 270 | /* Parse command-line arguments. */ |
271 | host = NULL; | 271 | host = NULL; |
272 | use_syslog = 0; | ||
272 | 273 | ||
273 | again: | 274 | again: |
274 | while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" | 275 | while ((opt = getopt(ac, av, "1246ab:c:e:fgi:kl:m:no:p:qstvx" |
275 | "ACD:F:I:KL:MNO:PR:S:TVw:XY")) != -1) { | 276 | "ACD:F:I:KL:MNO:PR:S:TVw:XYy")) != -1) { |
276 | switch (opt) { | 277 | switch (opt) { |
277 | case '1': | 278 | case '1': |
278 | options.protocol = SSH_PROTO_1; | 279 | options.protocol = SSH_PROTO_1; |
@@ -299,6 +300,9 @@ main(int ac, char **av) | |||
299 | case 'X': | 300 | case 'X': |
300 | options.forward_x11 = 1; | 301 | options.forward_x11 = 1; |
301 | break; | 302 | break; |
303 | case 'y': | ||
304 | use_syslog = 1; | ||
305 | break; | ||
302 | case 'Y': | 306 | case 'Y': |
303 | options.forward_x11 = 1; | 307 | options.forward_x11 = 1; |
304 | options.forward_x11_trusted = 1; | 308 | options.forward_x11_trusted = 1; |
@@ -614,7 +618,7 @@ main(int ac, char **av) | |||
614 | */ | 618 | */ |
615 | log_init(av[0], | 619 | log_init(av[0], |
616 | options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, | 620 | options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level, |
617 | SYSLOG_FACILITY_USER, 1); | 621 | SYSLOG_FACILITY_USER, !use_syslog); |
618 | 622 | ||
619 | /* | 623 | /* |
620 | * Read per-user configuration file. Ignore the system wide config | 624 | * Read per-user configuration file. Ignore the system wide config |
@@ -640,7 +644,7 @@ main(int ac, char **av) | |||
640 | channel_set_af(options.address_family); | 644 | channel_set_af(options.address_family); |
641 | 645 | ||
642 | /* reinit */ | 646 | /* reinit */ |
643 | log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1); | 647 | log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, !use_syslog); |
644 | 648 | ||
645 | seed_rng(); | 649 | seed_rng(); |
646 | 650 | ||