summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/sftp-server.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2019-01-01 23:10:53 +0000
committerdjm <djm@openbsd.org>2019-01-01 23:10:53 +0000
commit3756733c7afef278c59954c708c7a6baf8a824e4 (patch)
treea86609949060e902ecba2a6cb320b2a897199d85 /usr.bin/ssh/sftp-server.c
parentregress bits for banner processing refactor (this test was depending (diff)
downloadwireguard-openbsd-3756733c7afef278c59954c708c7a6baf8a824e4.tar.xz
wireguard-openbsd-3756733c7afef278c59954c708c7a6baf8a824e4.zip
static on global vars, const on handler tables that contain function
pointers; from Mike Frysinger
Diffstat (limited to 'usr.bin/ssh/sftp-server.c')
-rw-r--r--usr.bin/ssh/sftp-server.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c
index 8351944a098..b48a5801326 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.112 2018/06/01 03:33:53 djm Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.113 2019/01/01 23:10:53 djm Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
@@ -109,7 +109,7 @@ struct sftp_handler {
int does_write; /* if nonzero, banned for readonly mode */
};
-struct sftp_handler handlers[] = {
+static const struct sftp_handler handlers[] = {
/* NB. SSH2_FXP_OPEN does the readonly check in the handler itself */
{ "open", NULL, SSH2_FXP_OPEN, process_open, 0 },
{ "close", NULL, SSH2_FXP_CLOSE, process_close, 0 },
@@ -133,7 +133,7 @@ struct sftp_handler handlers[] = {
};
/* SSH2_FXP_EXTENDED submessages */
-struct sftp_handler extended_handlers[] = {
+static const struct sftp_handler extended_handlers[] = {
{ "posix-rename", "posix-rename@openssh.com", 0,
process_extended_posix_rename, 1 },
{ "statvfs", "statvfs@openssh.com", 0, process_extended_statvfs, 0 },
@@ -144,7 +144,7 @@ struct sftp_handler extended_handlers[] = {
};
static int
-request_permitted(struct sftp_handler *h)
+request_permitted(const struct sftp_handler *h)
{
char *result;
@@ -277,9 +277,9 @@ enum {
HANDLE_FILE
};
-Handle *handles = NULL;
-u_int num_handles = 0;
-int first_unused_handle = -1;
+static Handle *handles = NULL;
+static u_int num_handles = 0;
+static int first_unused_handle = -1;
static void handle_unused(int i)
{