diff options
author | Ron <ron@debian.org> | 2009-06-27 04:44:26 +0930 |
---|---|---|
committer | Austin Foxley <austinf@cetoncorp.com> | 2009-07-09 01:36:03 -0700 |
commit | 8d2ed43af888c404e90bc94a3096194c86bc3dae (patch) | |
tree | 5d3ca9d8cc1b533930b4c2a5df83237f0b9c76e3 /utils/chroot_realpath.c | |
parent | 5e8589056d930ec9d80d60db1e05edee1eb01bde (diff) | |
download | uClibc-alpine-8d2ed43af888c404e90bc94a3096194c86bc3dae.tar.bz2 uClibc-alpine-8d2ed43af888c404e90bc94a3096194c86bc3dae.tar.xz |
Don't shadow the chroot global
Signed-off-by: Ron Lee <ron@debian.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'utils/chroot_realpath.c')
-rw-r--r-- | utils/chroot_realpath.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/utils/chroot_realpath.c b/utils/chroot_realpath.c index bee9c863c..87039724d 100644 --- a/utils/chroot_realpath.c +++ b/utils/chroot_realpath.c @@ -40,10 +40,10 @@ #define MAX_READLINKS 32 -char *chroot_realpath(const char *chroot, const char *path, +char *chroot_realpath(const char *root, const char *path, char resolved_path[]); -char *chroot_realpath(const char *chroot, const char *path, +char *chroot_realpath(const char *root, const char *path, char resolved_path[]) { char copy_path[PATH_MAX]; @@ -57,13 +57,13 @@ char *chroot_realpath(const char *chroot, const char *path, int chroot_len; /* Trivial case. */ - if (chroot == NULL || *chroot == '\0' || - (*chroot == '/' && chroot[1] == '\0')) { + if (root == NULL || *root == '\0' || + (*root == '/' && root[1] == '\0')) { strcpy(resolved_path, path); return resolved_path; } - chroot_len = strlen(chroot); + chroot_len = strlen(root); if (chroot_len + strlen(path) >= PATH_MAX - 3) { errno = ENAMETOOLONG; @@ -76,7 +76,7 @@ char *chroot_realpath(const char *chroot, const char *path, max_path = copy_path + PATH_MAX - chroot_len - 3; /* Start with the chroot path. */ - strcpy(new_path, chroot); + strcpy(new_path, root); new_path += chroot_len; while (*new_path == '/' && new_path > got_path) new_path--; |