Re: Overriding System Calls



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Content reorganized to correct top-posting


Prafulla T wrote:
David Schwartz wrote:
Anything that can be done by intercepting a system call can be done
another way. What are you trying to do?
[snip]
I am trying to develope recycle bin like thing in Linux.

Hmmm.. The only advantage that I can see of the "recycle bin" approach
vs a straight "delete" is that the contents of the "recycle bin" can be
restored. This implies that, within the recycle bin, you somehow track
the original path to the deleted file, and implement some mechanism for
selecting between different files with the same path to restore (i.e. I
edit a text file, and delete the txt~ backup. I edit again and delete
the 2nd txt~ backup, which shares the same name as the first txt~
backup. Now I want to restore the 1st txt~ backup file; how do I choose
it from the recycle bin?)

The recycle bin approach also implies a further "empty bin" function
that irreversably completes the delete process.

Add to this the requirements of properly handling hard and soft links
(hard links will be harder; how do you restore a file that had multiple
hard links? Do you overwrite the file (through the other links) that
/may/ have different contents than the "recycled" file, or do you
restore to a different name? If a different name is selected, how do
you select the name?)

For that matter, the restore will have to accomodate multiple users as
well, and you don't want user A restoring user B's deleted files from
the recycle bin, so you may need multiple recycle bins, and some way to
associate a specific recycle bin to a specific user, both for restore
and for delete.

For that i need to override unlink sys call!.

My gut feel is that
a) this is a job better done outside of the kernel, in userspace
somewhere. It depends too much on userspace variables and interaction
with the user to be part of the kernel, and
b) overriding the unlink syscall is the least of your worries if you
were to implement this in system space. You'll have to come up with
changes to the link() syscall and the symlink() syscall, and you'll
have to build several new syscalls to manage and restore from the
"recycle bin".

Anyways,It is working now!!

Good. Have fun with it. At least it's a learning experience for you

HTH
- --
Lew Pitcher

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - WinPT 0.11.12

iD8DBQFFCVCVagVFX4UWr64RAg2OAJ4pr+dK0iauEICPvKx0RbsUSKWzPQCgyjB4
RQeTAkyh2UILqEKa1QlFyYs=
=2rZW
-----END PGP SIGNATURE-----

.



Relevant Pages

  • Re: Trying to recover lost favorites....
    ... No, I didn't backup. ... Mistakenly thought System Restore would cover this ... on the Recycle Bin: ... Favorites weren't dumped there. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: xp search finds 3 files
    ... it appears that emptying the recycle bin may have ... 'restore' one. ... I restarted, opened my windows ... choose "Rename" from the list of options. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Cannot Empty Recycle Bin
    ... >>temporary directory and then took the time to slowly go through the backup ... >>is important and will not let me empty it from the recycle bin. ... >>let me restore it. ...
    (microsoft.public.windowsxp.general)
  • Re: time to delete
    ... by trying to restore from a backup created from a Windows Vista Ultimate ... After running the command that you suggested, it is allowing me to delete up to 10, not 10 but only 9. ... I feel would have been better off restoring to original and upgrading to Ultimate then restoring from the backup. ... If they are very large files, then perhaps the OS itself is limiting the amount that you can mass-delete because the recycle bin has a finite amount of space. ...
    (microsoft.public.windows.vista.general)
  • Re: restore recycle bin contents from external hard drive backup
    ... I want to restore to my computer the recycle bin contents ... When doing a complete system backup with the ... In trying to figure this problem out on my own, I ran across a folder called ...
    (microsoft.public.windowsxp.general)