diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2005-07-10 14:04:45 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2005-07-10 14:04:45 +0000 |
commit | 66cbbff690b35cca85289fe934306353ca904189 (patch) | |
tree | d809bc68c81146044fa26526f327a413404e2c24 /sys-apps/sandbox/files | |
parent | change to wrapper script (diff) | |
download | gentoo-2-66cbbff690b35cca85289fe934306353ca904189.tar.gz gentoo-2-66cbbff690b35cca85289fe934306353ca904189.tar.bz2 gentoo-2-66cbbff690b35cca85289fe934306353ca904189.zip |
Add some fixes to the getcwd implementation, bug #98419.
(Portage version: 2.0.51.22-r1)
Diffstat (limited to 'sys-apps/sandbox/files')
-rw-r--r-- | sys-apps/sandbox/files/sandbox-1.2.10-uclibc-getcwd.patch | 30 | ||||
-rw-r--r-- | sys-apps/sandbox/files/sandbox-1.2.9-uclibc-getcwd.patch | 21 |
2 files changed, 51 insertions, 0 deletions
diff --git a/sys-apps/sandbox/files/sandbox-1.2.10-uclibc-getcwd.patch b/sys-apps/sandbox/files/sandbox-1.2.10-uclibc-getcwd.patch new file mode 100644 index 000000000000..2c538eec6f86 --- /dev/null +++ b/sys-apps/sandbox/files/sandbox-1.2.10-uclibc-getcwd.patch @@ -0,0 +1,30 @@ +Index: getcwd.c +=================================================================== +--- getcwd.c (revision 125) ++++ getcwd.c (working copy) +@@ -128,7 +128,7 @@ + if (strlen(path_buf) + 4 > path_size) { + goto oops; + } +- snprintf(path_buf, 4, "/.."); ++ snprintf(path_buf + strlen(path_buf), 4, "/.."); + if (recurser(path_buf, path_size, root_dev, root_ino) == 0) + return 0; + +@@ -146,6 +146,8 @@ + struct stat st; + size_t olderrno; + ++ if (lstat("/", &st) < 0) ++ return -1; + olderrno = errno; + len = -1; + cwd = recurser(buf, size, st.st_dev, st.st_ino); +@@ -175,6 +177,7 @@ + if (path == NULL) + return NULL; + } ++ snprintf(buf, 2, "."); + ret = __syscall_egetcwd(path, alloc_size); + if (ret >= 0) + { diff --git a/sys-apps/sandbox/files/sandbox-1.2.9-uclibc-getcwd.patch b/sys-apps/sandbox/files/sandbox-1.2.9-uclibc-getcwd.patch new file mode 100644 index 000000000000..8709d70d6d66 --- /dev/null +++ b/sys-apps/sandbox/files/sandbox-1.2.9-uclibc-getcwd.patch @@ -0,0 +1,21 @@ +Index: getcwd.c +=================================================================== +--- getcwd.c (revision 125) ++++ getcwd.c (working copy) +@@ -146,6 +146,8 @@ + struct stat st; + size_t olderrno; + ++ if (lstat("/", &st) < 0) ++ return -1; + olderrno = errno; + len = -1; + cwd = recurser(buf, size, st.st_dev, st.st_ino); +@@ -175,6 +177,7 @@ + if (path == NULL) + return NULL; + } ++ snprintf(buf, 2, "."); + ret = __syscall_egetcwd(path, alloc_size); + if (ret >= 0) + { |