bugfindutils - Bugs: bug #65831, Test -type l is unsuccessful for...

 
 

bug #65831: Test -type l is unsuccessful for symlink loops

Submitter:  James Youngman <jay>
Submitted:  Mon 03 Jun 2024 12:55:32 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Tavian Barnes Open/Closed:  Open
Release:  None Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 28 Aug 2024 02:22:52 PM UTC, comment #2: 

(Related) GNU Findutils manual / 2.7 Type

The behavior of find with types concerning loops is:

1. section "Test: -type c"

  • Nothing. The behavior of find -type c for loops is undefined.


2. section "Test: -xtype c"

  • "For broken symbolic links (or loops), ‘-xtype’ behaves like ‘-type’ does." (go to: 1.)


(^_^')

Jean-Baptiste de la Tour <jbdlt>
Mon 03 Jun 2024 09:36:32 PM UTC, comment #1: 

Hmm, I just found https://savannah.gnu.org/bugs/?19605#comment8 where Geoff Clare argues that ELOOP should in fact be an error, not just a broken link.

Tavian Barnes <tavianator>
Mon 03 Jun 2024 12:55:32 PM UTC, original submission:  

From https://savannah.gnu.org/bugs/?51926#comment8

>Commit b12fb8c ("Fix sv bug #51926: -xtype l fails on symlinks that have a loop") fixes this for -xtype, but what about
>$ ln -s loop loop
>$ find -L loop -type l


Right now we get this result:


$ find -L loop -type l
find: ‘loop’: Too many levels of symbolic links


The exit status is 1.  Nothing is printed on stdout. The POSIX standard says (in the non-normative RATIONALE section):

>Since the -L option resolves all symbolic links and the -type l primary is true for symbolic links that still exist after symbolic links have been resolved, the command:
>find -L . -type l
> prints a list of symbolic links reachable from the current directory that do not resolve to accessible files.




James Youngman <jay>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jbdlt (Posted a comment)
  • -email is unavailable- added by tavianator (Posted a comment)
  • -email is unavailable- added by jay (Submitted 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.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-8ccc.
    Corresponding source code