bugfindutils - Bugs: bug #48135, samefile-p-brokenlink.exp fails on...

 
 

bug #48135: samefile-p-brokenlink.exp fails on Hurd and BSD

Submitter:  Andreas Metzler <ametzler>
Submitted:  Sun 05 Jun 2016 09:55:53 AM UTC
 
Category:  find Severity:  3 - Normal
Item Group:  Test suite failure Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.6.0 Fixed Release:  4.8.0
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

Sun 01 Sep 2019 11:21:58 AM UTC, comment #2: 

comment #1:

> I applied your patch, making a tweak to the wording and adding an update to the NEWS file.  The result is https://git.savannah.gnu.org/cgit/findutils.git/commit/?id=c31ef289899fb06777cdf97fd8e2bf8b22fa49cc


Thank you.

> Do you think it would be worthwhile to use -P with ln as a matter of course?


Sorry, I have no idea about the implications.

Andreas Metzler <ametzler>
Sun 01 Sep 2019 08:31:14 AM UTC, comment #1: 

I applied your patch, making a tweak to the wording and adding an update to the NEWS file.  The result is https://git.savannah.gnu.org/cgit/findutils.git/commit/?id=c31ef289899fb06777cdf97fd8e2bf8b22fa49cc

Do you think it would be worthwhile to use -P with ln as a matter of course?

James Youngman <jay>
Project Administrator
Sun 05 Jun 2016 09:55:53 AM UTC, original submission:  

Hello,

this was originally submitted as http://bugs.debian.org/826357 by Samuel Thibault:
------------------
kfreebsd & hurd both get the following issue in the testsuite:

Running ./find.gnu/samefile-p-brokenlink.exp ...
ERROR: tcl error sourcing ./find.gnu/samefile-p-brokenlink.exp.
ERROR: ln: failed to access 'tmp/broken': No such file or directory
    while executing
"exec ln    tmp/broken tmp/blink"
    (file "./find.gnu/samefile-p-brokenlink.exp" line 8)
    invoked from within
"source ./find.gnu/samefile-p-brokenlink.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source ./find.gnu/samefile-p-brokenlink.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""

Here is the script:

exec rm -rf tmp
exec mkdir tmp
exec touch tmp/file1
exec ln    tmp/file1 tmp/link
exec ln -s tmp/file1 tmp/symlink
exec ln -s tmp/file2 tmp/broken
exec ln    tmp/broken tmp/blink

That last ln is failing, because both BSD and Hurd's link() follow symlinks (here broken, thus the error), while Linux doesn't. POSIX says that it is implementation-defined whether link() follows symlinks, so findutils should not assume one way or the other.
------------------

Find attached a simple patch to fix, passing -P to ln. In this patch I have also changed

exec ln -s tmp/file1 tmp/symlink
to
exec ln -s file1 tmp/symlink

because afaiu from the naming this command should generate a vaild, non broken symlink.

cu Andreas

Andreas Metzler <ametzler>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by berny (Updated the item)
  • -email is unavailable- added by jay (Updated the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-09 berny Open/ClosedOpen Closed
        Fixed ReleaseNone 4.8.0
    2019-09-01 jay StatusNone Fixed
    2019-09-01 jay Assigned toNone jay
    2016-06-05 ametzler Carbon-CopyRemoved 20807 -
    2016-06-05 ametzler Attached File- Added 0001-Fix-testsuite-error-on-hurd-and-BSD-related-to-ln.patch, #37393

    Back to the top


    Powered by Savane 3.9