diff options
author | millert@openbsd.org <millert@openbsd.org> | 2023-01-18 02:50:21 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2023-01-18 03:21:00 +0100 |
commit | 7d17ea151c0b2519f023bd9cc7f141128833ac47 (patch) | |
tree | 86eef75ffda6fd1853471fd1d89ac3c89f5ce2c9 /sshd.c | |
parent | upstream: For "ssh -V" always exit 0, there is no need to check opt (diff) | |
download | openssh-7d17ea151c0b2519f023bd9cc7f141128833ac47.tar.xz openssh-7d17ea151c0b2519f023bd9cc7f141128833ac47.zip |
upstream: Add a -V (version) option to sshd like the ssh client
has. OK markus@ deraadt@
OpenBSD-Commit-ID: abe990ec3e636fb040132aab8cbbede98f0c413e
Diffstat (limited to 'sshd.c')
-rw-r--r-- | sshd.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.595 2023/01/06 02:47:19 djm Exp $ */ +/* $OpenBSD: sshd.c,v 1.596 2023/01/18 01:50:21 millert Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -901,7 +901,7 @@ usage(void) { fprintf(stderr, "%s, %s\n", SSH_RELEASE, SSH_OPENSSL_VERSION); fprintf(stderr, -"usage: sshd [-46DdeiqTt] [-C connection_spec] [-c host_cert_file]\n" +"usage: sshd [-46DdeiqTtV] [-C connection_spec] [-c host_cert_file]\n" " [-E log_file] [-f config_file] [-g login_grace_time]\n" " [-h host_key_file] [-o option] [-p port] [-u len]\n" ); @@ -1581,7 +1581,7 @@ main(int ac, char **av) /* Parse command-line arguments. */ while ((opt = getopt(ac, av, - "C:E:b:c:f:g:h:k:o:p:u:46DQRTdeiqrt")) != -1) { + "C:E:b:c:f:g:h:k:o:p:u:46DQRTdeiqrtV")) != -1) { switch (opt) { case '4': options.address_family = AF_INET; @@ -1682,6 +1682,10 @@ main(int ac, char **av) exit(1); free(line); break; + case 'V': + fprintf(stderr, "%s, %s\n", + SSH_VERSION, SSH_OPENSSL_VERSION); + exit(0); default: usage(); break; |