Skip to content
Tcl Source Code History Of Ticket 930225ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 930225ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 930225ffffffffffffffffffffffffffffffffff

  1. Ticket change [c8a2079af6] (rid 122139) by dgp on 2004-04-06 05:13:52:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      While reading man pages on the
      access() system call, I came across:
      
      CAVEAT
           Access() is a potential security hole and should
      never be used.
      
      Yet, the access() call is the implementation
      of Tcl_FSAccess() on native Unix filesystems
      in tcl/unix/tclUnixFile.c
      
    4. foundin initialized to: "obsolete: 8.4.6"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "dgp"
    9. subsystem initialized to: "37. File System"
    10. title initialized to: "access() - safe to use?"
    11. type initialized to: "Bug"
  2. Ticket change [339a27b884] (rid 106626) by vincentdarley on 2004-04-06 14:26:10:

    1. assignee changed to: "hobbs"
    2. icomment:
      Logged In: YES 
      user_id=32170
      
      I know nothing about such unix-specific technicalities (and
      don't really want to learn ;-)... assigning to someone who does.
      
      
      
    3. login: "vincentdarley"
    4. mimetype: "text/plain"
    5. username: "vincentdarley"
  3. Ticket change [e43fca3828] (rid 87921) by dkf on 2004-04-06 16:36:42:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Which OS states this in its manpages?
      
      The security problems of access() only really bite when
      running setuid/setgid, since you otherwise go through the
      same set of checks internally when you manipulate the file
      with open(), etc.  Luckily, that's not a normal
      configuration of Tcl so we can ignore it for now.
      
      The alternatives are to stat() and check the permissions on
      the file ourselves (which has exactly the same security
      problems) or open the file and either check the result or do
      an fstat(), which has its own set of problems (especially
      when writing a file.)
      
      Everything gets *much* more complex when you use AFS or some
      other filesystem with ACLs, and it turns out that the
      access(2) manpage on RH9 is wrong (as access() checks ACLs)
      and is therefore not replacable with any *stat() based solution.
      
      I think the only "fix" is to warn people writing scripts
      that run setuid/setgid to be very careful.  And beware of
      scaremongering manual pages.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [13c78716c4] (rid 124277) by dgp on 2004-04-06 20:40:21:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      I was on a Mac OS X Panther
      system when I read that.
      
      I think the man page originally
      came from some BSD.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [708c29db03] (rid 100498) by dkf on 2004-04-06 21:38:30:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      OK, access(2) is broken-by-design but we can't substitute
      for anything else.  Solution is for *users* to avoid it when
      running in a Tcl interpreter with non-trivial privileges. 
      In theory we could enforce this by refusing to call access()
      when the real and effective [ug]ids are different, but that
      would be very intrusive.
      
      A better solution would be to provide access to something
      like fstat() so that code could check that it has opened
      what it thinks it has opened...?
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [7e532d07c5] (rid 97392) by dgp on 2004-04-07 03:29:06:

    1. assignee changed to: "dgp"
    2. closedate changed to: "2004-04-06T20:29:06"
    3. closer changed to: "dgp"
    4. icomment:
      Logged In: YES 
      user_id=80530
      
      Fair enough.
      
      For the record, besides Tcl_FSAccess()
      and  Tcl_Access()
      itself, this will impact the built-in commands
      
      [file executable|writable|readable|link], [cd],
      [load] on all platforms, and [exec] and [open "|..."] 
      on Windows.
      
      
      
    5. login: "dgp"
    6. mimetype: "text/plain"
    7. resolution changed to: "Wont Fix"
    8. status changed to: "Closed"
    9. username: "dgp"
  7. Ticket change [bfedb3f66f] (rid 102329) by dgp on 2004-04-07 03:59:31:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      Ignore the part  of my last comment
      about Windows.  access() is not used
      there.
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  8. Ticket change [da5161678c] (rid 107753) by dkf on 2004-04-07 04:37:47:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Neither [cd] nor [load] are affected on native filesystems.
       OTOH, [file executable] etc are, but that's because they're
      just a wrapper round access()'s basic functionality.
      
      In general, if you can it is better to just [open] (with the
      right options; with the wrong ones you still have a security
      hole) or [exec] the file and check for errors in the process.
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"