summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2022-02-01 23:32:52 +0000
committerDamien Miller <djm@cvs.openbsd.org>2022-02-01 23:32:52 +0000
commit7146816f625e1234e6b34f72720fd9e40dfab7af (patch)
tree79e3ed441326ff73fb0a226f3fba49cbece9b1be
parentf64043743859c59026ca06b86bb35e654c39d2cc (diff)
mark const string array contents const too, i.e.
static const char *array => static const char * const array from Mike Frysinger
-rw-r--r--usr.bin/ssh/auth-rhosts.c4
-rw-r--r--usr.bin/ssh/dns.c4
-rw-r--r--usr.bin/ssh/kex.c4
-rw-r--r--usr.bin/ssh/nchan.c10
-rw-r--r--usr.bin/ssh/sftp-server.c4
-rw-r--r--usr.bin/ssh/ssh-keygen.c4
-rw-r--r--usr.bin/ssh/sshconnect2.c4
7 files changed, 19 insertions, 15 deletions
diff --git a/usr.bin/ssh/auth-rhosts.c b/usr.bin/ssh/auth-rhosts.c
index f78f519bde1..999703c77d4 100644
--- a/usr.bin/ssh/auth-rhosts.c
+++ b/usr.bin/ssh/auth-rhosts.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-rhosts.c,v 1.53 2020/10/18 11:32:01 djm Exp $ */
+/* $OpenBSD: auth-rhosts.c,v 1.54 2022/02/01 23:32:51 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -187,7 +187,7 @@ auth_rhosts2(struct passwd *pw, const char *client_user, const char *hostname,
{
char buf[1024];
struct stat st;
- static const char *rhosts_files[] = {".shosts", ".rhosts", NULL};
+ static const char * const rhosts_files[] = {".shosts", ".rhosts", NULL};
u_int rhosts_file_index;
debug2("auth_rhosts2: clientuser %s hostname %s ipaddr %s",
diff --git a/usr.bin/ssh/dns.c b/usr.bin/ssh/dns.c
index 8e393fa006c..3218abc5493 100644
--- a/usr.bin/ssh/dns.c
+++ b/usr.bin/ssh/dns.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dns.c,v 1.41 2021/07/19 03:13:28 dtucker Exp $ */
+/* $OpenBSD: dns.c,v 1.42 2022/02/01 23:32:51 djm Exp $ */
/*
* Copyright (c) 2003 Wesley Griffin. All rights reserved.
@@ -41,7 +41,7 @@
#include "log.h"
#include "digest.h"
-static const char *errset_text[] = {
+static const char * const errset_text[] = {
"success", /* 0 ERRSET_SUCCESS */
"out of memory", /* 1 ERRSET_NOMEMORY */
"general failure", /* 2 ERRSET_FAIL */
diff --git a/usr.bin/ssh/kex.c b/usr.bin/ssh/kex.c
index c3e13fe56a5..88cb950ddb6 100644
--- a/usr.bin/ssh/kex.c
+++ b/usr.bin/ssh/kex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kex.c,v 1.171 2022/01/06 21:55:23 djm Exp $ */
+/* $OpenBSD: kex.c,v 1.172 2022/02/01 23:32:51 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
*
@@ -61,7 +61,7 @@
static int kex_choose_conf(struct ssh *);
static int kex_input_newkeys(int, u_int32_t, struct ssh *);
-static const char *proposal_names[PROPOSAL_MAX] = {
+static const char * const proposal_names[PROPOSAL_MAX] = {
"KEX algorithms",
"host key algorithms",
"ciphers ctos",
diff --git a/usr.bin/ssh/nchan.c b/usr.bin/ssh/nchan.c
index 4c465e491ab..d6bad10bde4 100644
--- a/usr.bin/ssh/nchan.c
+++ b/usr.bin/ssh/nchan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nchan.c,v 1.73 2021/05/19 01:24:05 djm Exp $ */
+/* $OpenBSD: nchan.c,v 1.74 2022/02/01 23:32:51 djm Exp $ */
/*
* Copyright (c) 1999, 2000, 2001, 2002 Markus Friedl. All rights reserved.
*
@@ -80,8 +80,12 @@ static void chan_shutdown_write(struct ssh *, Channel *);
static void chan_shutdown_read(struct ssh *, Channel *);
static void chan_shutdown_extended_read(struct ssh *, Channel *);
-static const char *ostates[] = { "open", "drain", "wait_ieof", "closed" };
-static const char *istates[] = { "open", "drain", "wait_oclose", "closed" };
+static const char * const ostates[] = {
+ "open", "drain", "wait_ieof", "closed",
+};
+static const char * const istates[] = {
+ "open", "drain", "wait_oclose", "closed",
+};
static void
chan_set_istate(Channel *c, u_int next)
diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c
index 973ed542e9b..1e2adbe689e 100644
--- a/usr.bin/ssh/sftp-server.c
+++ b/usr.bin/ssh/sftp-server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-server.c,v 1.138 2022/01/14 03:31:52 djm Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.139 2022/02/01 23:32:51 djm Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
@@ -510,7 +510,7 @@ send_msg(struct sshbuf *m)
static const char *
status_to_message(u_int32_t status)
{
- const char *status_messages[] = {
+ static const char * const status_messages[] = {
"Success", /* SSH_FX_OK */
"End of file", /* SSH_FX_EOF */
"No such file", /* SSH_FX_NO_SUCH_FILE */
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 5c9034e4aff..70a2a735bb9 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.447 2022/01/05 21:54:37 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.448 2022/02/01 23:32:51 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -2437,7 +2437,7 @@ load_sign_key(const char *keypath, const struct sshkey *pubkey)
{
size_t i, slen, plen = strlen(keypath);
char *privpath = xstrdup(keypath);
- const char *suffixes[] = { "-cert.pub", ".pub", NULL };
+ static const char * const suffixes[] = { "-cert.pub", ".pub", NULL };
struct sshkey *ret = NULL, *privkey = NULL;
int r;
diff --git a/usr.bin/ssh/sshconnect2.c b/usr.bin/ssh/sshconnect2.c
index ce0f77e851a..1171e5a08ce 100644
--- a/usr.bin/ssh/sshconnect2.c
+++ b/usr.bin/ssh/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.355 2022/01/06 22:06:51 djm Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.356 2022/02/01 23:32:51 djm Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1311,7 +1311,7 @@ identity_sign(struct identity *id, u_char **sigp, size_t *lenp,
static int
id_filename_matches(Identity *id, Identity *private_id)
{
- const char *suffixes[] = { ".pub", "-cert.pub", NULL };
+ static const char * const suffixes[] = { ".pub", "-cert.pub", NULL };
size_t len = strlen(id->filename), plen = strlen(private_id->filename);
size_t i, slen;