Date: Thu, 21 Jun 2018 14:21:43 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 229208] `install -l rs` (relative symlink to source) into directory creates invalid symlink Message-ID: <bug-229208-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
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.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-229208-227>