From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [IPv6:2a01:e0c:1:1599::12]) by sourceware.org (Postfix) with ESMTPS id CE7093858D39 for ; Fri, 26 May 2023 04:52:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CE7093858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=Denis-Excoffier.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=Denis-Excoffier.org Received: from smtpclient.apple (unknown [IPv6:2a01:e0a:a2e:d4d0:c1fc:94f6:b066:bc22]) by smtp3-g21.free.fr (Postfix) with ESMTPS id DFC5B13F88D; Fri, 26 May 2023 06:52:24 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: inside /bin/tar: cannot change mode From: Denis Excoffier In-Reply-To: Date: Fri, 26 May 2023 06:52:13 +0200 Cc: Denis Excoffier Content-Transfer-Encoding: quoted-printable Message-Id: <51B86F63-E8BC-492B-BC5F-8704B164FB17@Denis-Excoffier.org> References: To: Brian Inglis , cygwin@cygwin.com X-Mailer: Apple Mail (2.3731.500.231) X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NEUTRAL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On 2023-05-25 09:52, Brian Inglis via Cygwin wrote: >=20 > On 2023-05-24 12:18, Denis Excoffier via Cygwin wrote: >> I have an error (about symlinks it seems) that i have never met in = years: Cannot change mode. >> Apart from this message (and return code !=3D 0), the ?tar extract? = is ok. >> % uname -a >> CYGWIN_NT-10.0-17763 {edited} 3.5.0-0.295.g3bee68248fc8.x86_64 = 2023-05-01 17:58 UTC x86_64 Cygwin >> % cd /tmp; rm -rf mytest mytest.tar >> % mkdir mytest >> % ln -s b mytest/a >> % /bin/tar cf /tmp/mytest.tar mytest >> % /bin/tar tvf /tmp/mytest.tar >> drwxr-xr-x {edited}/{edited} 0 2023-05-24 13:12 mytest/ >> lrwxrwxrwx {edited}/{edited} 0 2023-05-24 13:12 mytest/a -> b >> % rm -rf mytest >> % /bin/tar xf /tmp/mytest.tar >> /bin/tar: mytest/a: Cannot change mode to rwxr-xr-x: Not a directory >> /bin/tar: Exiting with failure status due to previous errors >> % echo $status >> 2 >> % >> /tmp is under ntfs filesystem, all packages are up to date (e.g. = /bin/tar --version is 1.34). >=20 > I recently got this during a package update build, when it decided to = tar a=20 > build directory, which contained only symlinks to files in the src = directory,=20 > which the tar did not include, which would have created many dangling = symlinks. >=20 > I fixed the issue by adding -h, --dereference to give chf and tar real = files. >=20 I don=E2=80=99t catch this. A symlink, dangling or not, is a normal = file. In any case, the problem is the same if the symlink target is a member in the archive. See for example % mkdir -p /tmp/mytest2; cd /tmp/mytest2 % tar xf cygwin-devel-3.5.0-0.295.g3bee68248fc8.tar.xz /bin/tar: usr/lib/libg.a: Cannot change mode to rwxr-xr-x: Not a = directory /bin/tar: Exiting with failure status due to previous errors % I add that my symlinks are default ones, i.e. JUNCTIONS. Denis Excoffier.