lkml.org 
[lkml]   [2002]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: rm-ing files with open file descriptors
    Date
    In article <843d119h0g.fsf@rjk.greenend.org.uk>,
    Richard Kettlewell <rjk@terraraq.org.uk> wrote:
    >If the file descriptor you have was opened O_RDONLY, but you have
    >write permission on the file itself, then creating a new name for it
    >would allow you to open it O_RDWR.

    /proc allows for this anyway.

    open("knuth.txt", O_RDONLY) = 3
    unlink("knuth.txt") = 0
    open("/proc/self/fd/3", O_RDWR) = 4

    Mike.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:15    [W:0.022 / U:91.604 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site