Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Aug 2004 14:24:01 -0700
From:      Tim Kientzle <kientzle@freebsd.org>
To:        Kris Kennaway <kris@obsecurity.org>
Cc:        current@freebsd.org
Subject:   Re: bsdtar's security restrictions (was Re: Spurious EACCES errors from apache)
Message-ID:  <4127BD71.60500@freebsd.org>
In-Reply-To: <20040815224844.GA26084@xor.obsecurity.org>
References:  <20040813235434.GA75875@xor.obsecurity.org> <20040814063541.GA43063@xor.obsecurity.org> <411FCCCC.8040508@freebsd.org> <20040815205946.GA18580@xor.obsecurity.org> <411FE1FA.5070703@freebsd.org> <20040815224844.GA26084@xor.obsecurity.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
Kris Kennaway wrote:
> 
> ....can't you make it just not clear
> permissions on files and directories that already exist?  If they have
> relaxed or insecure permissions, they had insecure permissions to
> begin with and one may assume this is by intention.

And, conversely, if they had restricted permissions, then we
can assume that was by intention and we shouldn't loosen
them. <sigh>  That makes the current behavior actually less secure
than it should be, doesn't it?

Try the attached and let me know if that fixes it.

Tim

[-- Attachment #2 --]
Index: archive_read_extract.c
===================================================================
RCS file: /home/ncvs/src/lib/libarchive/archive_read_extract.c,v
retrieving revision 1.33
diff -u -r1.33 archive_read_extract.c
--- archive_read_extract.c	7 Aug 2004 03:09:28 -0000	1.33
+++ archive_read_extract.c	21 Aug 2004 21:21:27 -0000
@@ -479,7 +479,7 @@
 	if (extract->pst != NULL) {
 		extract->pst = &extract->st;
 		if (S_ISDIR(extract->pst->st_mode))
-			goto success;
+			return (ARCHIVE_OK);
 		/* It exists but isn't a dir. */
 		if ((flags & ARCHIVE_EXTRACT_UNLINK))
 			unlink(path);

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4127BD71.60500>