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 e7dd33b2f..359204fa7 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp-server.c,v 1.116 2019/06/28 13:35:04 deraadt Exp $ */ 1/* $OpenBSD: sftp-server.c,v 1.117 2019/07/05 04:55:40 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000-2004 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000-2004 Markus Friedl. All rights reserved.
4 * 4 *
@@ -51,6 +51,8 @@
51#include "sftp.h" 51#include "sftp.h"
52#include "sftp-common.h" 52#include "sftp-common.h"
53 53
54char *sftp_realpath(const char *, char *); /* sftp-realpath.c */
55
54/* Our verbosity */ 56/* Our verbosity */
55static LogLevel log_level = SYSLOG_LEVEL_ERROR; 57static LogLevel log_level = SYSLOG_LEVEL_ERROR;
56 58
@@ -1174,7 +1176,7 @@ process_realpath(u_int32_t id)
1174 } 1176 }
1175 debug3("request %u: realpath", id); 1177 debug3("request %u: realpath", id);
1176 verbose("realpath \"%s\"", path); 1178 verbose("realpath \"%s\"", path);
1177 if (realpath(path, resolvedname) == NULL) { 1179 if (sftp_realpath(path, resolvedname) == NULL) {
1178 send_status(id, errno_to_portable(errno)); 1180 send_status(id, errno_to_portable(errno));
1179 } else { 1181 } else {
1180 Stat s; 1182 Stat s;