aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sandbox-1.1/ChangeLog8
-rw-r--r--src/sandbox-1.1/libsandbox.c8
-rw-r--r--src/sandbox-1.1/sandbox.c3
3 files changed, 12 insertions, 7 deletions
diff --git a/src/sandbox-1.1/ChangeLog b/src/sandbox-1.1/ChangeLog
index f889a95..dc1c541 100644
--- a/src/sandbox-1.1/ChangeLog
+++ b/src/sandbox-1.1/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for Path Sandbox
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/sandbox-1.1/Attic/ChangeLog,v 1.33 2004/04/04 20:37:21 carpaski Exp $
+# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/sandbox-1.1/Attic/ChangeLog,v 1.34 2004/04/11 10:18:05 carpaski Exp $
+
+ 04 Apr 2004; Nicholas Jones <carpaski@gentoo.org> libsandbox.c, sandbox.c:
+ J. Stubbs tracked down a new bug where mkdir was failing to the patch on
+ the lstat in mkdir... it now only returns 0 or -1 as documented for mkdir.
+ Also remove the errno = ESUCCESS settings as documentation points out that
+ a library isn't allowed to do that.
04 Apr 2004; Nicholas Jones <carpaski@gentoo.org> libsandbox.c: Added a
file_security_check() function to check random potential exploits on files
diff --git a/src/sandbox-1.1/libsandbox.c b/src/sandbox-1.1/libsandbox.c
index 3b3259f..026fc1b 100644
--- a/src/sandbox-1.1/libsandbox.c
+++ b/src/sandbox-1.1/libsandbox.c
@@ -25,7 +25,7 @@
* as some of the InstallWatch code was used.
*
*
- * $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/sandbox-1.1/Attic/libsandbox.c,v 1.16 2004/03/22 01:40:58 carpaski Exp $
+ * $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/sandbox-1.1/Attic/libsandbox.c,v 1.17 2004/04/11 10:18:05 carpaski Exp $
*
*/
@@ -466,8 +466,9 @@ link(const char *oldpath, const char *newpath)
int
mkdir(const char *pathname, mode_t mode)
+// returns 0 success, or -1 if an error occurred
{
- int result = -1, my_errno = errno;
+ int result = -1;
char canonic[SB_PATH_MAX];
struct stat st;
@@ -476,9 +477,8 @@ mkdir(const char *pathname, mode_t mode)
/* Check if the directory exist, return EEXIST rather than failing */
if (0 == lstat(canonic, &st)) {
errno = EEXIST;
- return errno;
+ return -1;
}
- errno = my_errno;
if FUNCTION_SANDBOX_SAFE
("mkdir", canonic) {
diff --git a/src/sandbox-1.1/sandbox.c b/src/sandbox-1.1/sandbox.c
index 8664b72..ecbfd46 100644
--- a/src/sandbox-1.1/sandbox.c
+++ b/src/sandbox-1.1/sandbox.c
@@ -11,7 +11,7 @@
** Copyright (C) 2001 Geert Bevin, Uwyn, http://www.uwyn.com
** Distributed under the terms of the GNU General Public License, v2 or later
** Author : Geert Bevin <gbevin@uwyn.com>
-** $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/sandbox-1.1/Attic/sandbox.c,v 1.16 2004/04/04 20:37:21 carpaski Exp $
+** $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/src/sandbox-1.1/Attic/sandbox.c,v 1.17 2004/04/11 10:18:05 carpaski Exp $
*/
/* #define _GNU_SOURCE */
@@ -798,7 +798,6 @@ main(int argc, char **argv)
/* Load our PID into PIDs file */
success = 1;
- errno = 0;
if (file_exist(sandbox_pids_file, 1) < 0) {
success = 0;
fprintf(stderr, ">>> %s is not a regular file\n", sandbox_pids_file);