summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-07-07 22:07:10 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-07-07 22:07:10 +0000
commit8abe736dd7a27e4c2a42351287bacfd80ec42a7c (patch)
tree5fc92aa71f92f5d768ed11880f08ea3a31b9bd77
parente475a3cf3b18ce1c22529fdf2d531beee5ea8f25 (diff)
- (bal) [realpath.c] Updated with OpenBSD tree.
-rw-r--r--ChangeLog3
-rw-r--r--openbsd-compat/realpath.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 27d77d90..18a764e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
s/BROKEN_FD_PASSING/DISABLE_FD_PASSING/
- (tim) [contrib/cygwin/ssh-host-config] sshd account creation fixes
patch from vinschen@redhat.com
+ - (bal) [realpath.c] Updated with OpenBSD tree.
20020705
- (tim) [configure.ac] AIX 4.2.1 has authenticate() in libs.
@@ -1287,4 +1288,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
-$Id: ChangeLog,v 1.2340 2002/07/07 21:07:46 tim Exp $
+$Id: ChangeLog,v 1.2341 2002/07/07 22:07:10 mouring Exp $
diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c
index b4a05db9..b9035ca2 100644
--- a/openbsd-compat/realpath.c
+++ b/openbsd-compat/realpath.c
@@ -32,7 +32,7 @@
#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: realpath.c,v 1.6 2002/01/12 16:24:35 millert Exp $";
+static char *rcsid = "$OpenBSD: realpath.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -69,7 +69,7 @@ realpath(const char *path, char *resolved)
/* Save the starting point. */
getcwd(start,MAXPATHLEN);
if ((fd = open(".", O_RDONLY)) < 0) {
- (void)strcpy(resolved, ".");
+ (void)strlcpy(resolved, ".", MAXPATHLEN);
return (NULL);
}
close(fd);
@@ -129,7 +129,7 @@ loop:
* Save the last component name and get the full pathname of
* the current directory.
*/
- (void)strcpy(wbuf, p);
+ (void)strlcpy(wbuf, p, sizeof wbuf);
if (getcwd(resolved, MAXPATHLEN) == 0)
goto err1;