Overview
| Artifact ID: | 75402df4eff3d28470deaa8556f1bd84a053b9ad |
|---|---|
| Ticket: | 391bc0fd2cdd59209201660b95a2d886d24c1825
glob, -nocomplain, -types, and insufficient privileges |
| User & Date: | pooryorick on 2016-11-16 06:27:46 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- 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.
- foundin changed to: "8.6.6"
- is_private changed to: "0"
- login: "pooryorick"
- priority changed to: "5 Medium"
- private_contact changed to: "e476148cded301ffff84bcdc432536dc0c949e88"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "16. Commands A-H"
- title changed to:
glob, -nocomplain, -types, and insufficient privileges
- type changed to: "Bug"