BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] recover contents of deleted but still open file on a Linux system.
- Subject: [Discuss] recover contents of deleted but still open file on a Linux system.
- From: bogstad at pobox.com (Bill Bogstad)
- Date: Thu, 9 Jul 2020 03:51:55 -0400
- In-reply-to: <5f05eefb.1c69fb81.1af20.156d@mx.google.com>
- References: <CAJFsZ=r=sHG84R1XAjjou=KNbYf_9Psc0s+rpVRps_A57pW3MA@mail.gmail.com> <5f04906a.1c69fb81.4e25f.a491@mx.google.com> <CAJFsZ=oDHLAEAhk9b6XFYJBi28ot=HUPJ6eLip=GFK07P8uWww@mail.gmail.com> <5f05eefb.1c69fb81.1af20.156d@mx.google.com>
On Wed, Jul 8, 2020 at 12:07 PM Rich Pieri <richard.pieri at gmail.com> wrote: > > On Tue, 7 Jul 2020 19:44:37 -0400 > Bill Bogstad <bogstad at pobox.com> wrote: > > > But not all UNIX-like systems have a /proc/PID/fd directory that makes > > it easy to access the contents of > > such an unlinked file. I don't know if the *BSDs do or not. > > True, but it should be possible to find the file descriptor somehow if > the process is still running. /proc just makes that easier. I'm not sure I'm following you here. /proc not only lets me easily discover on what fd # the file is opened. It also gives me an easy way to reopen the file so I can copy its contents. How would you go about recovering the file easily without it? Just theorizing here, maybe if you attached a debugger to the the process that had the file open, you might be able to craft some code which could be inserted into the memory space of that process which would copy the deleted file to a newly opened file. I'm sure that people who use buffer overflows to hack programs have the skills to do something like that, but I certainly don't. Maybe something easier could be done with the linkat() system call, but the Linux manual page seems to suggest using /proc to re-link the file. But that seems to be Linux specific and still would involve inserting code into the running process. The POSIX man page for linkat() makes it seem less useful for this purpose. Bill Bogstad > > -- > Rich Pieri > _______________________________________________ > Discuss mailing list > Discuss at lists.blu.org > http://lists.blu.org/mailman/listinfo/discuss
- Follow-Ups:
- [Discuss] recover contents of deleted but still open file on a Linux system.
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] recover contents of deleted but still open file on a Linux system.
- References:
- [Discuss] recover contents of deleted but still open file on a Linux system.
- From: bogstad at pobox.com (Bill Bogstad)
- [Discuss] recover contents of deleted but still open file on a Linux system.
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] recover contents of deleted but still open file on a Linux system.
- From: bogstad at pobox.com (Bill Bogstad)
- [Discuss] recover contents of deleted but still open file on a Linux system.
- From: richard.pieri at gmail.com (Rich Pieri)
- [Discuss] recover contents of deleted but still open file on a Linux system.
- Prev by Date: [Discuss] recover contents of deleted but still open file on a Linux system.
- Next by Date: [Discuss] recover contents of deleted but still open file on a Linux system.
- Previous by thread: [Discuss] recover contents of deleted but still open file on a Linux system.
- Next by thread: [Discuss] recover contents of deleted but still open file on a Linux system.
- Index(es):