Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 75402df4eff3d28470deaa8556f1bd84a053b9ad
Ticket: 391bc0fd2cdd59209201660b95a2d886d24c1825
glob, -nocomplain, -types, and insufficient privileges
User & Date: pooryorick on 2016-11-16 06:27:46
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    When <code>glob</code> is denied permission to get a directory listing, the
    result is an error.  This is true even with <code>-nocomplain</code>.  However,
    there is a circumstance under which inability to return the requested result
    due to insufficient permissions does not result in an error.  On *nix
    platforms, a user may have read permissions but not execute permissions on a
    directory, which means that they may list the contents of the directory, but
    not the attributes of those contents.  In this situation, <code>glob
    -nocomplain -dir /path/to/dir -types d</code> returns the empty string, since
    it lacks the ability to get the attributes of the file and thus determine its
    type.  Back before <code>glob</code> had a <code>-nocomplain</code> option,
    this scenario was covered by the "empty list result is an error" behaviour of
    <code>glob</code>.  The introduction of <code>-nocomplain</code> may have
    inadvertently lead to this current behaviour, where inability to complete the
    operation due to insufficient permissions ended up not being an error.
    
    Another facet of this issue is that <code>-types hidden</code> also returns an
    empty string, even though on *nix, that information is contained in the "."
    character prefixing the name.
    
    Because of this behaviour, the simple task of walking a hierarchy of files,
    modifying them as needed in order to continue the walk, becomes rather complex:
    <code>-types</code> can't be used at all, hidden files have to be explicitly
    matched on *nix systems, and something like <code>file type</code>, which
    *does* raise an error, must be used instead in order to raise the alert that
    there is a potential permissions problem.
    
  5. foundin changed to: "8.6.6"
  6. is_private changed to: "0"
  7. login: "pooryorick"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "e476148cded301ffff84bcdc432536dc0c949e88"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "pooryorick"
  14. subsystem changed to: "16. Commands A-H"
  15. title changed to:
    glob, -nocomplain, -types, and insufficient privileges
    
  16. type changed to: "Bug"