Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/openssh/dist fix unconst



details:   https://anonhg.NetBSD.org/src/rev/e651fcff5dc5
branches:  trunk
changeset: 321819:e651fcff5dc5
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Apr 07 00:36:55 2018 +0000

description:
fix unconst

diffstat:

 crypto/external/bsd/openssh/dist/readconf.c |   6 +++---
 crypto/external/bsd/openssh/dist/scp.c      |  25 ++++++++++++++-----------
 2 files changed, 17 insertions(+), 14 deletions(-)

diffs (115 lines):

diff -r 575fc7797e82 -r e651fcff5dc5 crypto/external/bsd/openssh/dist/readconf.c
--- a/crypto/external/bsd/openssh/dist/readconf.c       Sat Apr 07 00:26:12 2018 +0000
+++ b/crypto/external/bsd/openssh/dist/readconf.c       Sat Apr 07 00:36:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: readconf.c,v 1.23 2018/04/06 18:59:00 christos Exp $   */
+/*     $NetBSD: readconf.c,v 1.24 2018/04/07 00:36:55 christos Exp $   */
 /* $OpenBSD: readconf.c,v 1.283 2018/02/23 15:58:37 markus Exp $ */
 /*
  * Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
@@ -14,7 +14,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: readconf.c,v 1.23 2018/04/06 18:59:00 christos Exp $");
+__RCSID("$NetBSD: readconf.c,v 1.24 2018/04/07 00:36:55 christos Exp $");
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
@@ -2440,7 +2440,7 @@
 int
 parse_ssh_uri(const char *uri, char **userp, char **hostp, int *portp)
 {
-       char *path;
+       const char *path;
        int r;
 
        r = parse_uri("ssh", uri, userp, hostp, portp, &path);
diff -r 575fc7797e82 -r e651fcff5dc5 crypto/external/bsd/openssh/dist/scp.c
--- a/crypto/external/bsd/openssh/dist/scp.c    Sat Apr 07 00:26:12 2018 +0000
+++ b/crypto/external/bsd/openssh/dist/scp.c    Sat Apr 07 00:36:55 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scp.c,v 1.18 2018/04/06 18:59:00 christos Exp $        */
+/*     $NetBSD: scp.c,v 1.19 2018/04/07 00:36:55 christos Exp $        */
 /* $OpenBSD: scp.c,v 1.195 2018/02/10 06:15:12 djm Exp $ */
 /*
  * scp - secure remote copy.  This is basically patched BSD rcp which
@@ -73,7 +73,7 @@
  */
 
 #include "includes.h"
-__RCSID("$NetBSD: scp.c,v 1.18 2018/04/06 18:59:00 christos Exp $");
+__RCSID("$NetBSD: scp.c,v 1.19 2018/04/07 00:36:55 christos Exp $");
 
 #include <sys/param.h> /* roundup MAX */
 #include <sys/types.h>
@@ -600,7 +600,7 @@
 
 static int
 parse_scp_uri(const char *uri, char **userp, char **hostp, int *portp,
-     char **pathp)
+     const char **pathp)
 {
        int r;
 
@@ -613,8 +613,10 @@
 void
 toremote(int argc, char **argv)
 {
-       char *suser = NULL, *host = NULL, *src = NULL;
-       char *bp, *tuser, *thost, *targ;
+       char *suser = NULL, *host = NULL;
+       const char *src = NULL;
+       char *bp, *tuser, *thost;
+       const char *targ;
        int sport = -1, tport = -1;
        arglist alist;
        int i, r;
@@ -647,7 +649,7 @@
        for (i = 0; i < argc - 1; i++) {
                free(suser);
                free(host);
-               free(src);
+               free(__UNCONST(src));
                r = parse_scp_uri(argv[i], &suser, &host, &sport, &src);
                if (r == -1) {
                        fmprintf(stderr, "%s: invalid uri\n", argv[i]);
@@ -725,16 +727,17 @@
 out:
        free(tuser);
        free(thost);
-       free(targ);
+       free(__UNCONST(targ));
        free(suser);
        free(host);
-       free(src);
+       free(__UNCONST(src));
 }
 
 static void
 tolocal(int argc, char **argv)
 {
-       char *bp, *host = NULL, *src = NULL, *suser = NULL;
+       char *bp, *host = NULL, *suser = NULL;
+       const char *src = NULL;
        arglist alist;
        int i, r, sport = -1;
 
@@ -744,7 +747,7 @@
        for (i = 0; i < argc - 1; i++) {
                free(suser);
                free(host);
-               free(src);
+               free(__UNCONST(src));
                r = parse_scp_uri(argv[i], &suser, &host, &sport, &src);
                if (r == -1) {
                        fmprintf(stderr, "%s: invalid uri\n", argv[i]);
@@ -786,7 +789,7 @@
        }
        free(suser);
        free(host);
-       free(src);
+       free(__UNCONST(src));
 }
 
 void



Home | Main Index | Thread Index | Old Index