]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: mark const string array contents const too, i.e. static
authordjm@openbsd.org <djm@openbsd.org>
Tue, 1 Feb 2022 23:32:51 +0000 (23:32 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 1 Feb 2022 23:38:59 +0000 (10:38 +1100)
const char *array => static const char * const array from Mike Frysinger

OpenBSD-Commit-ID: a664e31ea6a795d7c81153274a5f47b22bdc9bc1

auth-rhosts.c
dns.c
kex.c
nchan.c
sftp-server.c
ssh-keygen.c
sshconnect2.c

index 0bc4d424c78127c9caf8779faf5facdb83adec04..c055b14f38b66b2af7166adc199b40df186d468d 100644 (file)
@@ -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
@@ -191,7 +191,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/dns.c b/dns.c
index 1cfc38e7cc43680193eb5b57fdb779ec06fb8153..f2310bec2b08865ef14dd2f334ec5f96ecc8d71b 100644 (file)
--- a/dns.c
+++ b/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.
@@ -43,7 +43,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/kex.c b/kex.c
index 2636909795a75731e618aa9c00edc827f7b40321..0bcd27dc5825c41a0ad4a1139d519bb2e7b9b1e3 100644 (file)
--- a/kex.c
+++ b/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.
  *
@@ -66,7 +66,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/nchan.c b/nchan.c
index 7ef3a350b79a9e6768d08efe5b215a7096374e47..d33426fedf91f139c1788290e1b64d7bc01ab4c8 100644 (file)
--- a/nchan.c
+++ b/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.
  *
@@ -82,8 +82,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)
index 528cef68219ff0a0e05a2abd78260f81d27b0d42..d4c6a3b4c39a6b72fe3e0de02886bad79172b7f0 100644 (file)
@@ -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.
  *
@@ -520,7 +520,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 */
index 05901cb025e61f7287ac2c73eeae6e1d16630192..d4b7f4dcf800510fae48586ff678ac3e2faafaee 100644 (file)
@@ -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
@@ -2460,7 +2460,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;
 
index 6b884831e8d365599bb5a19acdc925d98c09d2c1..b25225e645cb80349e4d4029da9d8945d2c69f30 100644 (file)
@@ -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.
@@ -1318,7 +1318,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;