From unknown Fri Sep 05 08:56:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21290: ln --relative bug? Resent-From: Matteo Cerutti Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 18 Aug 2015 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 21290 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 21290@debbugs.gnu.org X-Debbugs-Original-To: "bug-coreutils@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.143991188510021 (code B ref -1); Tue, 18 Aug 2015 15:32:01 +0000 Received: (at submit) by debbugs.gnu.org; 18 Aug 2015 15:31:25 +0000 Received: from localhost ([127.0.0.1]:59137 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRirE-0002bX-5t for submit@debbugs.gnu.org; Tue, 18 Aug 2015 11:31:24 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54309) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRf0a-0003Sx-0A for submit@debbugs.gnu.org; Tue, 18 Aug 2015 07:24:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRf0Y-0003DY-Rd for submit@debbugs.gnu.org; Tue, 18 Aug 2015 07:24:47 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,RECEIVED_FROM_WINDOWS_HOST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49822) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRf0Y-0003DT-OX for submit@debbugs.gnu.org; Tue, 18 Aug 2015 07:24:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRf0X-00064W-Th for bug-coreutils@gnu.org; Tue, 18 Aug 2015 07:24:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZRf0U-0003Bs-NT for bug-coreutils@gnu.org; Tue, 18 Aug 2015 07:24:45 -0400 Received: from dub004-omc3s3.hotmail.com ([157.55.2.12]:49325) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZRf0U-0003BK-IF for bug-coreutils@gnu.org; Tue, 18 Aug 2015 07:24:42 -0400 Received: from DUB116-W127 ([157.55.2.7]) by DUB004-OMC3S3.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Tue, 18 Aug 2015 04:04:38 -0700 X-TMN: [g7CS6UnTpN+AWvttC7hMZDB7kOacTFNl] X-Originating-Email: [matteo.cerutti@hotmail.co.uk] Message-ID: Content-Type: multipart/alternative; boundary="_21b43e21-5d13-4e4c-a1c2-f802263f0e6f_" From: Matteo Cerutti Date: Tue, 18 Aug 2015 13:04:38 +0200 Importance: Normal MIME-Version: 1.0 X-OriginalArrivalTime: 18 Aug 2015 11:04:38.0520 (UTC) FILETIME=[ACC57F80:01D0D9A5] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Tue, 18 Aug 2015 11:31:23 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) --_21b43e21-5d13-4e4c-a1c2-f802263f0e6f_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=2C is this the expected behavior? # ln -s /tmp/non_existent_file b # ln -s --relative b c # ls -lrth total 0 lrwxrwxrwx. 1 root root 22 Aug 18 13:03 b -> /tmp/non_existent_file lrwxrwxrwx. 1 root root 20 Aug 18 13:03 c -> ../non_existent_file # shouldn't c point to b? Mind that it doesn't happen when the --relative option is absent. Cheers=2C Matteo = --_21b43e21-5d13-4e4c-a1c2-f802263f0e6f_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi=2C

is this the expecte= d behavior?

# ln -s /tmp/non_existent_file b
# ln -s = --relative b c
# ls -lrth
total 0
lrwxrwxrwx. 1 root root 22 Aug 1= 8 13:03 b ->=3B /tmp/non_existent_file
lrwxrwxrwx. 1 root root 20 Aug = 18 13:03 c ->=3B ../non_existent_file
#

shouldn't = c point to b?

Mind that it doesn't happen when the --relative option= is absent.

Cheers=2C
Matteo
= --_21b43e21-5d13-4e4c-a1c2-f802263f0e6f_-- From unknown Fri Sep 05 08:56:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21290: ln --relative bug? Resent-From: =?UTF-8?Q?P=C3=A1draig?= Brady Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 18 Aug 2015 20:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21290 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: Matteo Cerutti , 21290@debbugs.gnu.org Received: via spool by 21290-submit@debbugs.gnu.org id=B21290.143992905311899 (code B ref 21290); Tue, 18 Aug 2015 20:18:01 +0000 Received: (at 21290) by debbugs.gnu.org; 18 Aug 2015 20:17:33 +0000 Received: from localhost ([127.0.0.1]:60002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRnK8-00035q-TA for submit@debbugs.gnu.org; Tue, 18 Aug 2015 16:17:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34348) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRnK6-00035h-Sv for 21290@debbugs.gnu.org; Tue, 18 Aug 2015 16:17:31 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id B70CC550DD; Tue, 18 Aug 2015 20:17:29 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7IKHQ8A009601 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 18 Aug 2015 16:17:28 -0400 Message-ID: <55D392D5.4010700@draigBrady.com> Date: Tue, 18 Aug 2015 13:17:25 -0700 From: =?UTF-8?Q?P=C3=A1draig?= Brady User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) tag 21290 notabug close 21290 stop On 18/08/15 04:04, Matteo Cerutti wrote: > Hi, > > is this the expected behavior? > > # ln -s /tmp/non_existent_file b > # ln -s --relative b c > # ls -lrth > total 0 > lrwxrwxrwx. 1 root root 22 Aug 18 13:03 b -> /tmp/non_existent_file > lrwxrwxrwx. 1 root root 20 Aug 18 13:03 c -> ../non_existent_file > # > > > shouldn't c point to b? > > Mind that it doesn't happen when the --relative option is absent. Are you referring to the non_existent_file or the fact that the symlink is dereferenced before the relative adjustment? If the latter then that's expected as detailed at: http://www.gnu.org/software/coreutils/ln Also included there is an example using `realpath` which gives more control over the dereferencing. thanks, Pádraig. > > Cheers, > Matteo From unknown Fri Sep 05 08:56:16 2025 X-Loop: help-debbugs@gnu.org Subject: bug#21290: ln --relative bug? Resent-From: Bob Proulx Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Tue, 18 Aug 2015 22:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21290 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 21290@debbugs.gnu.org Cc: Matteo Cerutti Received: via spool by 21290-submit@debbugs.gnu.org id=B21290.14399384932997 (code B ref 21290); Tue, 18 Aug 2015 22:55:02 +0000 Received: (at 21290) by debbugs.gnu.org; 18 Aug 2015 22:54:53 +0000 Received: from localhost ([127.0.0.1]:60082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRpmO-0000mH-Kr for submit@debbugs.gnu.org; Tue, 18 Aug 2015 18:54:52 -0400 Received: from joseki.proulx.com ([216.17.153.58]:48902) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZRpmM-0000m6-Po for 21290@debbugs.gnu.org; Tue, 18 Aug 2015 18:54:51 -0400 Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 10DD621236; Tue, 18 Aug 2015 16:54:49 -0600 (MDT) Received: by hysteria.proulx.com (Postfix, from userid 1000) id C97872DC42; Tue, 18 Aug 2015 16:54:48 -0600 (MDT) Date: Tue, 18 Aug 2015 16:54:48 -0600 From: Bob Proulx Message-ID: <20150818162656863511045@bob.proulx.com> References: <55D392D5.4010700@draigBrady.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <55D392D5.4010700@draigBrady.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Score: -0.4 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.4 (/) Pádraig Brady wrote: > Matteo Cerutti wrote: > > # ln -s --relative b c > > lrwxrwxrwx. 1 root root 20 Aug 18 13:03 c -> ../non_existent_file > > shouldn't c point to b? > > > > Mind that it doesn't happen when the --relative option is absent. > > Are you referring to the non_existent_file > or the fact that the symlink is dereferenced before the relative adjustment? Regarding: ln -s --relative b c I think the expectation of least surprise is that --relative would restrict itself to changing only the relative path of "b". Since "b" is already a relative path that --relative would have nothing to do there. And indeed when I saw that it surprised me. (Until I read the documentation.) Because now it is order dependent. mkdir /tmp/test cd /tmp/test ln -s --relative b c ln -s /tmp/non_existent_file b ls -ldog b c lrwxrwxrwx 1 22 Aug 18 16:30 b -> /tmp/non_existent_file lrwxrwxrwx 1 1 Aug 18 16:29 c -> b ln -sfn --relative b c lrwxrwxrwx 1 17 Aug 18 16:31 c -> non_existent_file rm -f c ln -s --relative b c lrwxrwxrwx 1 1 Aug 18 16:38 c -> b Without reading the documentation for --relative I found that surprising. It isn't behavior that I would ever knowingly want to use. > If the latter then that's expected as detailed at: > > http://www.gnu.org/software/coreutils/ln > > Also included there is an example using `realpath` > which gives more control over the dereferencing. The documentation does clearly state that --relative does *both* conversion of the value to a relative path and to dereference using realpath. Relative symbolic links are generated based on their canonicalized containing directory, and canonicalized targets. I.E. all symbolic links in these file names will be resolved. *Note realpath invocation::, which gives greater control over relative file name generation, as demonstrated in the following example: In hindsight perhaps it should have been called --relative-realpath instead of just --relative. Because now eventually it will be suggested that --relative-only would be a useful option to only create relative paths only. Oh well. (shrug) Bob From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 24 16:58:00 2018 Received: (at control) by debbugs.gnu.org; 24 Oct 2018 20:58:00 +0000 Received: from localhost ([127.0.0.1]:40614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFQE4-0001mg-2g for submit@debbugs.gnu.org; Wed, 24 Oct 2018 16:58:00 -0400 Received: from mail-pl1-f174.google.com ([209.85.214.174]:42665) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gFQE1-0001mT-UF for control@debbugs.gnu.org; Wed, 24 Oct 2018 16:57:58 -0400 Received: by mail-pl1-f174.google.com with SMTP id t6-v6so2761754plo.9 for ; Wed, 24 Oct 2018 13:57:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:message-id:date:user-agent:mime-version:content-language :content-transfer-encoding; bh=nl15EP4D9GyEaH26VU7pvurRq24EcmSsDd5g6jj5Be0=; b=jEEFAKJLWeGrS2rm9eCMtC1d8NusEKueWJRIgTSCGTMnqDrw5TkPYxxaZVZ8F5u0D2 4edfakO/eAR8aEfIUMqPHXJAjOQDXgGua/DZePwNno/C22hBP/ZuQqj+XnXW0x+9CIMm AOxyWmaZUBEuC9Sm4zZjfbSBEJJAuTVrB0hMdNTdGpBpe39SDe1xXy4tln2Nk4o4+IC7 +MpsQrZy7b+1bZMp+u120F4lzSmIytgUjZIzzxHidExg/AdkUwn2hXA/exyfTzwm4vJy 0sxoTU13WvOBNAsUPKITY1g4mRoY3fsNPfVSgFeesCLrLg7gFHW3PsP44ihpGvXXJT1O yoKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=nl15EP4D9GyEaH26VU7pvurRq24EcmSsDd5g6jj5Be0=; b=AiS3r49r+WKYG8w9e39fFQS7w4Ayn7kxvU6xJmMs7fiU/HVpvJKDZMWKtTAJhGSBLI R6IGy9RZ2ewF73eQU1JnW5AhAeC/2CaQU9RJCQMuTNVfikpbAJqj+nKI15ZNlifSU+RW nrTNKPPCLOSaW6MCWsTV5+EIVL3m95c3Gs+KqMM42sYIuomT1bQ9g4+KpZ3uzYXGYU+R 5NwqywnfA6LJ41ZpcsZslr8JiIu3WMm83vAcPeIzdsODxmtVsb3qRpqqS1UILACKKoPW 6KLcTRJ8g1dHhlkei4UagB063pUR26Nm1UMwEsvON2LjGPMR2gi3y5+up+8DMHgNE+1Y pMwg== X-Gm-Message-State: AGRZ1gKQciNEN304Ao+M7F7/3okIUWOB89gYSgm/JiZu7pMEqUYXo21N 8l4TcrlQyOWc9lasle/M7sR+dtS44Yk= X-Google-Smtp-Source: AJdET5chJpaIOlkkweMtPkciFmJiq6g+JW+qR0YghpjNHUPQqc5VSDMgAhxSayabe9D3oaWsDJhAWg== X-Received: by 2002:a17:902:ea:: with SMTP id a97-v6mr3900955pla.164.1540414671593; Wed, 24 Oct 2018 13:57:51 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id v84-v6sm10017893pfk.12.2018.10.24.13.57.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 13:57:50 -0700 (PDT) To: control@debbugs.gnu.org From: Assaf Gordon Message-ID: <964242bc-89ba-73ad-1437-355dfbc14d1f@gmail.com> Date: Wed, 24 Oct 2018 14:57:49 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: tag 21290 notabug close 21290 [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (assafgordon[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.214.174 listed in list.dnswl.org] 1.8 MISSING_SUBJECT Missing Subject: header 0.2 NO_SUBJECT Extra score for no subject X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) tag 21290 notabug close 21290