diff options
author | 2000-12-12 22:30:01 +0000 | |
---|---|---|
committer | 2000-12-12 22:30:01 +0000 | |
commit | 745f949311e92e880a8e88a4590cbfcc01b379ef (patch) | |
tree | 61133cece4fe405a4118a564a3507fa2c5123ee1 /usr.bin/ssh/ssh.c | |
parent | source port < 1024 is no longer required for rhosts-rsa since it (diff) | |
download | wireguard-openbsd-745f949311e92e880a8e88a4590cbfcc01b379ef.tar.xz wireguard-openbsd-745f949311e92e880a8e88a4590cbfcc01b379ef.zip |
consistently use __progname; from stevesk@pobox.com
Diffstat (limited to 'usr.bin/ssh/ssh.c')
-rw-r--r-- | usr.bin/ssh/ssh.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index a1e9846c5fc..7c8dd17fffa 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.75 2000/11/30 07:02:35 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.76 2000/12/12 22:30:01 markus Exp $"); #include <openssl/evp.h> #include <openssl/dsa.h> @@ -113,9 +113,6 @@ struct sockaddr_storage hostaddr; */ volatile int received_window_change_signal = 0; -/* Value of argv[0] (set in the main program). */ -char *av0; - /* Flag indicating whether we have a valid host private key loaded. */ int host_private_key_loaded = 0; @@ -133,7 +130,7 @@ Buffer command; void usage() { - fprintf(stderr, "Usage: %s [options] host [command]\n", av0); + fprintf(stderr, "Usage: %s [options] host [command]\n", __progname); fprintf(stderr, "Options:\n"); fprintf(stderr, " -l user Log in using this user name.\n"); fprintf(stderr, " -n Redirect input from /dev/null.\n"); @@ -161,7 +158,7 @@ usage() fprintf(stderr, " -p port Connect to this port. Server must be on the same port.\n"); fprintf(stderr, " -L listen-port:host:port Forward local port to remote address\n"); fprintf(stderr, " -R listen-port:host:port Forward remote port to local address\n"); - fprintf(stderr, " These cause %s to listen for connections on a port, and\n", av0); + fprintf(stderr, " These cause %s to listen for connections on a port, and\n", __progname); fprintf(stderr, " forward them to the other side by connecting to host:port.\n"); fprintf(stderr, " -C Enable compression.\n"); fprintf(stderr, " -N Do not execute a shell or command.\n"); @@ -260,9 +257,6 @@ main(int ac, char **av) */ umask(022); - /* Save our own name. */ - av0 = av[0]; - /* Initialize option structure to indicate that no values have been set. */ initialize_options(&options); @@ -270,10 +264,7 @@ main(int ac, char **av) host = NULL; /* If program name is not one of the standard names, use it as host name. */ - if (strchr(av0, '/')) - cp = strrchr(av0, '/') + 1; - else - cp = av0; + cp = __progname; if (strcmp(cp, "rsh") && strcmp(cp, "ssh") && strcmp(cp, "rlogin") && strcmp(cp, "slogin") && strcmp(cp, "remsh")) host = cp; |