Date: Tue, 1 Jun 2010 15:50:25 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r208713 - projects/capabilities8/lib/libcapsicum Message-ID: <201006011550.o51FoPWH075475@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rwatson Date: Tue Jun 1 15:50:25 2010 New Revision: 208713 URL: http://svn.freebsd.org/changeset/base/208713 Log: Merge c178262, c178281, c179048 from the p4 TrustedBSD Capabilities branch to capabilities8: libcapsicum changes: Only set *relative_name if relative_name != NULL Only do relative naming if the retrieved filename has length > 0 Reverting an (accidental) previous change Submitted by: jona Modified: projects/capabilities8/lib/libcapsicum/libcapsicum_fdlist.c Modified: projects/capabilities8/lib/libcapsicum/libcapsicum_fdlist.c ============================================================================== --- projects/capabilities8/lib/libcapsicum/libcapsicum_fdlist.c Tue Jun 1 15:47:57 2010 (r208712) +++ projects/capabilities8/lib/libcapsicum/libcapsicum_fdlist.c Tue Jun 1 15:50:25 2010 (r208713) @@ -31,7 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $P4: //depot/projects/trustedbsd/capabilities/src/lib/libcapsicum/libcapsicum_fdlist.c#13 $ + * $P4: //depot/projects/trustedbsd/capabilities/src/lib/libcapsicum/libcapsicum_fdlist.c#15 $ */ #include <sys/mman.h> @@ -402,7 +402,8 @@ lc_fdlist_find(struct lc_fdlist *lfp, co /* try to find the file itself in the FD list */ size_t len = strlen(filename); - *relative_name = filename + len; + if (relative_name) + *relative_name = filename + len; while (fd == -1) { @@ -432,6 +433,14 @@ lc_fdlist_find(struct lc_fdlist *lfp, co return (-1); len = strlen(dirname); + + /* if there is no filename, we can't do relative naming */ + if (len == 0) + { + fd = -1; + continue; + } + if (strncmp(dirname, filename, len)) fd = -1; else {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006011550.o51FoPWH075475>