diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2001-07-31 12:42:51 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2001-07-31 12:42:51 +0000 |
commit | 82d4b55685adc1fdb428ccc384d132d945b269e3 (patch) | |
tree | 85365978ae970a8ff0a18e3e5155417b00f9273a /usr.bin/ssh/sftp-server.c | |
parent | d55e26f045f6680217a2a10abdf8f8c18e983f91 (diff) |
avoid paths beginning with "//"; <vinschen@redhat.com>
ok markus@
Diffstat (limited to 'usr.bin/ssh/sftp-server.c')
-rw-r--r-- | usr.bin/ssh/sftp-server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/sftp-server.c b/usr.bin/ssh/sftp-server.c index b8e0f842f31..7f442f86f07 100644 --- a/usr.bin/ssh/sftp-server.c +++ b/usr.bin/ssh/sftp-server.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: sftp-server.c,v 1.29 2001/06/25 08:25:40 markus Exp $"); +RCSID("$OpenBSD: sftp-server.c,v 1.30 2001/07/31 12:42:50 jakob Exp $"); #include "buffer.h" #include "bufaux.h" @@ -736,8 +736,8 @@ process_readdir(void) stats = xrealloc(stats, nstats * sizeof(Stat)); } /* XXX OVERFLOW ? */ - snprintf(pathname, sizeof pathname, - "%s/%s", path, dp->d_name); + snprintf(pathname, sizeof pathname, "%s%s%s", path, + strcmp(path, "/") ? "/" : "", dp->d_name); if (lstat(pathname, &st) < 0) continue; stat_to_attrib(&st, &(stats[count].attrib)); |