Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 32f6038721b20139d5edb4c0df78d8a2ed162a0d
Ticket: 2511011fffffffffffffffffffffffffffffffff
[glob] can return non-existing filenames
User & Date: mpc_janssen on 2009-01-15 19:31:03
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    glob doesn't escape filenames starting with ~. This means glob by default can return filenames that 1) don't exists (annoying) or even point to a different spot all together (a user directory for instance, which is outright dangerous). 
    
    For example:
    create a file name "~test"
    
    % foreach file [glob *] { if {![file exists $file]} {puts "huh $file doesn't exists"}}
    huh ~test doesn't exists
    % info pa
    8.5.4
    
    Interactive session above was with Tcl 8.5.4.
    Dangerous situations can occur if a filename matches a valid user directory (~ for instance) and results of glob are used in recursive delete operations (which would lead to removal of the users home dir in this case)
    
    It seems that me that glob should properly escape ~ as "./~test".
    
    
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "mpc_janssen"
  10. subsystem changed to: "16. Commands A-H"
  11. title changed to: "[glob] can return non-existing filenames"
  12. type changed to: "RFE"