aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schlemmer <azarah@gentoo.org>2005-03-21 23:30:13 +0000
committerMartin Schlemmer <azarah@gentoo.org>2005-03-21 23:30:13 +0000
commit34214c6c62bafca64f50921b867e9e9883e59251 (patch)
treebdd4bf502ec0587c417fdf2788b14e7a2cad674d
parentshow resolved symlinks in log (diff)
downloadsandbox-34214c6c62bafca64f50921b867e9e9883e59251.tar.gz
sandbox-34214c6c62bafca64f50921b867e9e9883e59251.tar.bz2
sandbox-34214c6c62bafca64f50921b867e9e9883e59251.zip
Allow lchown a symlink in write-allowed path pointing to write-denied target.
Signed-off-by: Martin Schlemmer <azarah@gentoo.org>
-rw-r--r--ChangeLog4
-rw-r--r--libsandbox.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 7013241..7327221 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,10 @@
# Copyright 1999-2004 Gentoo Foundation; Distributed under the GPL v2
# $Header$
+ 22 Mar 2005; Martin Schlemmer <azarah@gentoo.org> libsandbox.c:
+ Allow lchown a symlink in write-allowed path pointing to write-denied
+ target.
+
21 Mar 2005; Marius Mauch <genone@gentoo.org> libsandbox.c:
Also show resolved symlink names in the log.
diff --git a/libsandbox.c b/libsandbox.c
index d90f41a..1b577d4 100644
--- a/libsandbox.c
+++ b/libsandbox.c
@@ -1178,7 +1178,8 @@ static int check_access(sbcontext_t * sbcontext, const char *func, const char *p
* passed path is writable, and if so, check if its a
* symlink, and give access only if the resolved path
* of the symlink's parent also have write access. */
- if ((0 == strncmp(func, "unlink", 6)) &&
+ if (((0 == strncmp(func, "unlink", 6)) ||
+ (0 == strncmp(func, "lchown", 6))) &&
((-1 != lstat(path, &st)) && (S_ISLNK(st.st_mode)))) {
int hresult = -1;