]> git.wh0rd.org - dump.git/blobdiff - restore/tape.c
Use lchown instead of chown (security problem of symlinks ownership)
[dump.git] / restore / tape.c
index 32a5582d1e32f11e51ef1a69e4a2f2117a79d611..754da610152cb9732c855c854209486f4466c3ff 100644 (file)
@@ -2,8 +2,7 @@
  *     Ported to Linux's Second Extended File System as part of the
  *     dump and restore backup suit
  *     Remy Card <card@Linux.EU.Org>, 1994-1997
- *      Stelian Pop <pop@cybercable.fr>, 1999 
- *
+ *     Stelian Pop <pop@cybercable.fr>, 1999 
  */
 
 /*
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $Id: tape.c,v 1.5 1999/10/11 13:31:13 stelian Exp $
  */
 
+#ifndef lint
+static const char rcsid[] =
+       "$Id: tape.c,v 1.7 1999/11/05 22:02:19 tiniou Exp $";
+#endif /* not lint */
+
 #include <sys/param.h>
 #include <sys/file.h>
 #include <sys/mtio.h>
@@ -577,7 +579,9 @@ extractfile(char *name)
                }
                if (linkit(lnkbuf, name, SYMLINK) == FAIL)
                        return (FAIL);
-               (void) chown(name, luid, lgid);
+#ifdef HAVE_LCHOWN
+               (void) lchown(name, luid, lgid);
+#endif
                return (GOOD);
        }