diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-08-06 23:30:53 +0200 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-08-06 23:30:53 +0200 |
commit | 95148e3de293052afa4cc7708bc1547c697903cc (patch) | |
tree | e57e64ddd5813b7e5ec6979b5aec0529eab77274 /sftp-server.c | |
parent | - jakob@cvs.openbsd.org 2001/07/31 09:28:44 (diff) | |
download | openssh-95148e3de293052afa4cc7708bc1547c697903cc.tar.xz openssh-95148e3de293052afa4cc7708bc1547c697903cc.zip |
- jakob@cvs.openbsd.org 2001/07/31 12:42:50
[sftp-int.c sftp-server.c]
avoid paths beginning with "//"; <vinschen@redhat.com>
ok markus@
Diffstat (limited to 'sftp-server.c')
-rw-r--r-- | sftp-server.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sftp-server.c b/sftp-server.c index 5f1b37b01..2ef9753bf 100644 --- a/sftp-server.c +++ b/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" @@ -756,8 +756,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)); |