From fc270baf264248c3ee3050b13a6c8c0919e6559f Mon Sep 17 00:00:00 2001 From: "djm@openbsd.org" Date: Mon, 22 Jun 2020 05:52:05 +0000 Subject: upstream: better terminology for permissions; feedback & ok markus@ OpenBSD-Commit-ID: ffb220b435610741dcb4de0e7fc68cbbdc876d2c --- sftp-server.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'sftp-server.c') diff --git a/sftp-server.c b/sftp-server.c index 359204fa7..b1d8c88cb 100644 --- a/sftp-server.c +++ b/sftp-server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sftp-server.c,v 1.117 2019/07/05 04:55:40 djm Exp $ */ +/* $OpenBSD: sftp-server.c,v 1.118 2020/06/22 05:52:05 djm Exp $ */ /* * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. * @@ -74,7 +74,7 @@ static int init_done; static int readonly; /* Requests that are allowed/denied */ -static char *request_whitelist, *request_blacklist; +static char *request_allowlist, *request_denylist; /* portable attributes, etc. */ typedef struct Stat Stat; @@ -164,20 +164,20 @@ request_permitted(const struct sftp_handler *h) verbose("Refusing %s request in read-only mode", h->name); return 0; } - if (request_blacklist != NULL && - ((result = match_list(h->name, request_blacklist, NULL))) != NULL) { + if (request_denylist != NULL && + ((result = match_list(h->name, request_denylist, NULL))) != NULL) { free(result); - verbose("Refusing blacklisted %s request", h->name); + verbose("Refusing denylisted %s request", h->name); return 0; } - if (request_whitelist != NULL && - ((result = match_list(h->name, request_whitelist, NULL))) != NULL) { + if (request_allowlist != NULL && + ((result = match_list(h->name, request_allowlist, NULL))) != NULL) { free(result); - debug2("Permitting whitelisted %s request", h->name); + debug2("Permitting allowlisted %s request", h->name); return 1; } - if (request_whitelist != NULL) { - verbose("Refusing non-whitelisted %s request", h->name); + if (request_allowlist != NULL) { + verbose("Refusing non-allowlisted %s request", h->name); return 0; } return 1; @@ -1556,8 +1556,8 @@ sftp_server_usage(void) fprintf(stderr, "usage: %s [-ehR] [-d start_directory] [-f log_facility] " - "[-l log_level]\n\t[-P blacklisted_requests] " - "[-p whitelisted_requests] [-u umask]\n" + "[-l log_level]\n\t[-P denied_requests] " + "[-p allowed_requests] [-u umask]\n" " %s -Q protocol_feature\n", __progname, __progname); exit(1); @@ -1627,14 +1627,14 @@ sftp_server_main(int argc, char **argv, struct passwd *user_pw) free(cp); break; case 'p': - if (request_whitelist != NULL) + if (request_allowlist != NULL) fatal("Permitted requests already set"); - request_whitelist = xstrdup(optarg); + request_allowlist = xstrdup(optarg); break; case 'P': - if (request_blacklist != NULL) + if (request_denylist != NULL) fatal("Refused requests already set"); - request_blacklist = xstrdup(optarg); + request_denylist = xstrdup(optarg); break; case 'u': errno = 0; -- cgit v1.2.3