From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 13 07:28:50 2011 Received: (at submit) by debbugs.gnu.org; 13 Jun 2011 11:28:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW5K6-0004PL-2H for submit@debbugs.gnu.org; Mon, 13 Jun 2011 07:28:50 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW4j0-0003UD-3z for submit@debbugs.gnu.org; Mon, 13 Jun 2011 06:50:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW4it-0004tT-LB for submit@debbugs.gnu.org; Mon, 13 Jun 2011 06:50:24 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, T_DKIM_INVALID, T_TO_NO_BRKTS_FREEMAIL autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:35394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW4it-0004tO-8z for submit@debbugs.gnu.org; Mon, 13 Jun 2011 06:50:23 -0400 Received: from eggs.gnu.org ([140.186.70.92]:60734) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW4ir-0004l2-HZ for bug-coreutils@gnu.org; Mon, 13 Jun 2011 06:50:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QW4iq-0004ss-7a for bug-coreutils@gnu.org; Mon, 13 Jun 2011 06:50:21 -0400 Received: from mail-vw0-f41.google.com ([209.85.212.41]:55858) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QW4ip-0004se-UU for bug-coreutils@gnu.org; Mon, 13 Jun 2011 06:50:20 -0400 Received: by vws4 with SMTP id 4so4592583vws.0 for ; Mon, 13 Jun 2011 03:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type:content-transfer-encoding; bh=8Pyr7oFBVf26znAHbXOebYZck8IgeM/s/MJFK9bUpKg=; b=JqoW0w7UtV6hTJtqvR0qjegffLXf6dLByXeJsZI6Kqd7r0yhMZwEGkqFtVg7RYzeEx yS2j7Uk5P6WVcjGhlhVLvvC/o/0sjKjqPK9xhZh0uYdt18phwGBC27mp9ei7AlA0wwll yMwmJVIVKTl35AKL8ktiJlzI7233ngd1+IW8I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type:content-transfer-encoding; b=NplnxmO8tSv36bMCeMbDZ+Yyy2ZWfgbJ4FujBpMV5pY+bz1AREp1x/Wg47yT0K/2jU pmOJe8G4x//sooqR9UM15y+tZIC5On2DBxPBN6wKdsdDe+tDXhgGWRLB6A3UDgjTn5M1 gIOSWhygtB9yxCKQuuTKKy+hRYiL6jxWAZmto= MIME-Version: 1.0 Received: by 10.220.20.67 with SMTP id e3mr1941732vcb.132.1307962219216; Mon, 13 Jun 2011 03:50:19 -0700 (PDT) Received: by 10.220.84.65 with HTTP; Mon, 13 Jun 2011 03:50:19 -0700 (PDT) Date: Mon, 13 Jun 2011 12:50:19 +0200 X-Google-Sender-Auth: dhF8NmN4xIbm_GtEbUPK9KbnQ-A Message-ID: Subject: mkdir inside symlink creates wrong directory with relative parent From: =?UTF-8?B?T2xkxZlpY2ggSmVkbGnEjWth?= To: bug-coreutils@gnu.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 13 Jun 2011 07:28:49 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.2 (-----) Hi all, I was trying to search for any description helping me understand in what I see, but actually I didn't find any, so I'm here. I discovered it by using automake-1.11, because it uses relative paths a lot. So my simplified testcase is as follows: Have a directory structure x/y and x/z/a. Have a symbolic link from x/y/z that points to x/z. =C2=A0mkdir -p x/y =C2=A0mkdir -p x/z/a =C2=A0ln -s ../z x/y/z Now go into x/y/z/a and try to create directory like that: =C2=A0cd x/y/z/a =C2=A0mkdir ../dir_xyz =C2=A0mkdir ../../dir_xy =C2=A0mkdir ../../../dir_x I would expet that there would be a directory like this: =C2=A0x/dir_x =C2=A0x/y/dir_xy =C2=A0x/y/z/dir_xyz (x/z/dir_xyz) But the result is completely different: =C2=A0dir_x =C2=A0x/dir_xy =C2=A0x/y/z/dir_xyz (x/z/dir_xyz) So when you want to create a directory in the parent structure from within the symbolic link, you will fail in doing so, because the symbolic link would be resolved during walking through parents, so you can get to completely different tree while creating your directory. It looks like a bug, because it is nowhere documented to behave like that (and the behaviour is strange by itself). Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo with coreutils 8.12. Regards, Oldrich. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 13 10:55:41 2011 Received: (at 8850-done) by debbugs.gnu.org; 13 Jun 2011 14:55:41 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW8YH-0002OS-7g for submit@debbugs.gnu.org; Mon, 13 Jun 2011 10:55:41 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW8YE-0002OF-AL for 8850-done@debbugs.gnu.org; Mon, 13 Jun 2011 10:55:39 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 829E76019A; Mon, 13 Jun 2011 16:55:32 +0200 (CEST) From: Jim Meyering To: =?utf-8?Q?Old=C5=99ich_Jedli=C4=8Dka?= Subject: Re: bug#8850: mkdir inside symlink creates wrong directory with relative parent In-Reply-To: (=?utf-8?Q?=22Old=C5=99ich=09Jedli=C4=8Dka=22's?= message of "Mon, 13 Jun 2011 12:50:19 +0200") References: Date: Mon, 13 Jun 2011 16:55:32 +0200 Message-ID: <8762o9g4rf.fsf@rho.meyering.net> Lines: 44 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8850-done Cc: 8850-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) Old=C5=99ich Jedli=C4=8Dka wrote: > I was trying to search for any description helping me understand in > what I see, but actually I didn't find any, so I'm here. I discovered > it by using automake-1.11, because it uses relative paths a lot. So my > simplified testcase is as follows: > > Have a directory structure x/y and x/z/a. Have a symbolic link from > x/y/z that points to x/z. > > =C2=A0mkdir -p x/y > =C2=A0mkdir -p x/z/a > =C2=A0ln -s ../z x/y/z > > Now go into x/y/z/a and try to create directory like that: > > =C2=A0cd x/y/z/a > =C2=A0mkdir ../dir_xyz > =C2=A0mkdir ../../dir_xy > =C2=A0mkdir ../../../dir_x > > I would expet that there would be a directory like this: > > =C2=A0x/dir_x > =C2=A0x/y/dir_xy > =C2=A0x/y/z/dir_xyz (x/z/dir_xyz) > > But the result is completely different: > > =C2=A0dir_x > =C2=A0x/dir_xy > =C2=A0x/y/z/dir_xyz (x/z/dir_xyz) > > So when you want to create a directory in the parent structure from > within the symbolic link, you will fail in doing so, because the > symbolic link would be resolved during walking through parents, so you > can get to completely different tree while creating your directory. It > looks like a bug, because it is nowhere documented to behave like that > (and the behaviour is strange by itself). > > Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo > with coreutils 8.12. Loic explained that this is not a bug. (Thanks, Loic.) I'm marking this issue as closed. From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 13 10:57:02 2011 Received: (at control) by debbugs.gnu.org; 13 Jun 2011 14:57:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW8ZZ-0002Qh-Po for submit@debbugs.gnu.org; Mon, 13 Jun 2011 10:57:02 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QW8ZY-0002QS-Nd for control@debbugs.gnu.org; Mon, 13 Jun 2011 10:57:01 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 4CF4B602F7; Mon, 13 Jun 2011 16:56:55 +0200 (CEST) From: Jim Meyering To: control@debbugs.gnu.org Subject: notabug Date: Mon, 13 Jun 2011 16:56:55 +0200 Message-ID: <87zklleq4o.fsf@rho.meyering.net> Lines: 2 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) tags 8850 + notabug thanks From unknown Fri Sep 12 02:09:41 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 12 Jul 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator