summaryrefslogtreecommitdiff
path: root/sftp-server.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2019-07-05 04:55:40 +0000
committerDamien Miller <djm@mindrot.org>2019-07-08 11:44:49 +1000
commit569b650f93b561c09c655f83f128e1dfffe74101 (patch)
treef40a1711f9f0cfa063a8acbb70870cdaf1b3d49f /sftp-server.c
parentb8e2b797362526437e0642a6c2f2970d794f2561 (diff)
upstream: add a local implementation of BSD realpath() for
sftp-server use ahead of OpenBSD's realpath changing to match POSIX; ok deraadt@ (thanks for snaps testing) OpenBSD-Commit-ID: 4f8cbf7ed8679f6237264301d104ecec64885d55
Diffstat (limited to 'sftp-server.c')
-rw-r--r--sftp-server.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sftp-server.c b/sftp-server.c
index e7dd33b2..359204fa 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-server.c,v 1.116 2019/06/28 13:35:04 deraadt Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.117 2019/07/05 04:55:40 djm Exp $ */
/*
* Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
*
@@ -51,6 +51,8 @@
#include "sftp.h"
#include "sftp-common.h"
+char *sftp_realpath(const char *, char *); /* sftp-realpath.c */
+
/* Our verbosity */
static LogLevel log_level = SYSLOG_LEVEL_ERROR;
@@ -1174,7 +1176,7 @@ process_realpath(u_int32_t id)
}
debug3("request %u: realpath", id);
verbose("realpath \"%s\"", path);
- if (realpath(path, resolvedname) == NULL) {
+ if (sftp_realpath(path, resolvedname) == NULL) {
send_status(id, errno_to_portable(errno));
} else {
Stat s;