summaryrefslogtreecommitdiff
path: root/sftp-server.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-08-06 21:30:53 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-08-06 21:30:53 +0000
commit95148e3de293052afa4cc7708bc1547c697903cc (patch)
treee57e64ddd5813b7e5ec6979b5aec0529eab77274 /sftp-server.c
parentae996bf7d1967c83a0e0d71e9e89fa9a27d839f9 (diff)
- 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.c6
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 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: sftp-server.c,v 1.29 2001/06/25 08:25:40 markus Exp $"); 25RCSID("$OpenBSD: sftp-server.c,v 1.30 2001/07/31 12:42:50 jakob Exp $");
26 26
27#include "buffer.h" 27#include "buffer.h"
28#include "bufaux.h" 28#include "bufaux.h"
@@ -756,8 +756,8 @@ process_readdir(void)
756 stats = xrealloc(stats, nstats * sizeof(Stat)); 756 stats = xrealloc(stats, nstats * sizeof(Stat));
757 } 757 }
758/* XXX OVERFLOW ? */ 758/* XXX OVERFLOW ? */
759 snprintf(pathname, sizeof pathname, 759 snprintf(pathname, sizeof pathname, "%s%s%s", path,
760 "%s/%s", path, dp->d_name); 760 strcmp(path, "/") ? "/" : "", dp->d_name);
761 if (lstat(pathname, &st) < 0) 761 if (lstat(pathname, &st) < 0)
762 continue; 762 continue;
763 stat_to_attrib(&st, &(stats[count].attrib)); 763 stat_to_attrib(&st, &(stats[count].attrib));