NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/54467: new tar overwrites symlinks to directories

The following reply was made to PR bin/54467; it has been noted by GNATS.

From: Christos Zoulas <>
 "" <>
Subject: Re: bin/54467: new tar overwrites symlinks to directories
Date: Sun, 18 Aug 2019 18:27:58 +0300

 Looking at -P on bsdtar.c:
 /* A basic set of security flags to request from libarchive. */
 #define SECURITY                                        \ 
         (ARCHIVE_EXTRACT_SECURE_SYMLINKS                \
 #if 0
                  * The common BSD -P option is not necessary, since
                  * our default is to archive symlinks, not follow
                  * them.  This is convenient, as -P conflicts with GNU
                  * tar anyway.
                 case 'P': /* BSD convention */
                         /* Default behavior, no option necessary. */
                 case 'P': /* GNU tar */
                         bsdtar->extract_flags &= ~SECURITY;
                         bsdtar->flags |= OPTFLAG_ABSOLUTE_PATHS;
 So I guess -P does what we want and unfortunately more. I'd rather it
 just disabled ARCHIVE_EXTRACT_SECURE_SYMLINKS... We could
 add a long option that did exactly want we wanted I guess:

Home | Main Index | Thread Index | Old Index