From owner-freebsd-bugs@freebsd.org Thu Jun 21 14:21:45 2018 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C440810205AC for ; Thu, 21 Jun 2018 14:21:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4077E8F7 for ; Thu, 21 Jun 2018 14:21:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.ysv.freebsd.org (Postfix) id 1453810205AB; Thu, 21 Jun 2018 14:21:45 +0000 (UTC) Delivered-To: bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC19E10205AA for ; Thu, 21 Jun 2018 14:21:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 69E217E8F5 for ; Thu, 21 Jun 2018 14:21:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id AD16828451 for ; Thu, 21 Jun 2018 14:21:43 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LELhIM095140 for ; Thu, 21 Jun 2018 14:21:43 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id w5LELhhc095139 for bugs@FreeBSD.org; Thu, 21 Jun 2018 14:21:43 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 229208] `install -l rs` (relative symlink to source) into directory creates invalid symlink Date: Thu, 21 Jun 2018 14:21:43 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 11.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: andreas.sommer87@googlemail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jun 2018 14:21:46 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D229208 Bug ID: 229208 Summary: `install -l rs` (relative symlink to source) into directory creates invalid symlink Product: Base System Version: 11.1-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: bin Assignee: bugs@FreeBSD.org Reporter: andreas.sommer87@googlemail.com Created attachment 194459 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D194459&action= =3Dedit Unit test which depicts expected behavior but currently fails Good on 10.3-RELEASE: $ rm -rf /tmp/dest && mkdir /tmp/dest && touch /tmp/myfile && cd /tmp && install -l rs ./myfile /tmp/dest && ls -la /tmp/dest total 146 drwxr-xr-x 2 rmg-builder wheel 3 Jun 21 14:12 . drwxrwxrwt 16 root wheel 613 Jun 21 14:12 .. lrwxr-xr-x 1 rmg-builder wheel 9 Jun 21 14:12 myfile -> ../myfile Bad on 11.1-RELEASE and 11.2-rc3: $ rm -rf /tmp/dest && mkdir /tmp/dest && touch /tmp/myfile && cd /tmp && install -l rs ./myfile /tmp/dest && ls -la /tmp/dest total 8 drwxr-xr-x 2 vagrant wheel 512 Jun 21 13:01 . drwxrwxrwt 7 root wheel 512 Jun 21 13:01 .. lrwxr-xr-x 1 vagrant wheel 8 Jun 21 13:01 myfile -> ./myfile It seems that unit tests were only added to the source code after 10.4, and= I don't even know how the tool should behave. My expectation would be the previous behavior, obviously, also because `install src dest_which_is_a_directory` would normally be expected to create `dest_which_is_a_directory/basename_of_src`. Please find attached a new unit test to check for the old behavior. Did not= dig too deep into the code (usr.bin/xinstall/xinstall.c) yet to find a solution= . My feeling is that the function `makelink(...)` isn't even called in the buggy case but probably should. Sharing it so more people can take a look. I stumbled upon this because the ports tree macro `RLN` (see bsd.commands.m= k) is doing exactly this, and broke our software build on 11.x for internal po= rts. --=20 You are receiving this mail because: You are the assignee for the bug.=