Re: How to make the file undeleteable



Maybe something simple, like having a kernel-driver (win9x/nt) acquire a 
lock on the file at system startup, preventing any other process from 
opening it for deletion?

James

-- 
Microsoft MVP - Windows SDK
www.catch22.net
Free Win32 Source and Tutorials


"cjs_pro" <cjspro@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message 
news:2FD537F6-99AC-4EF5-9B33-BC9389DF881C@xxxxxxxxxxxxxxxx
> Certainly, I could use ACL programmatically but we distribute on systems 
> such
> as 95 and 98 too. Also, any high priviledge user may manipulate ACL too.
> Anyway, preventing the user from deleting the file without formatting the
> disk is difficult task. Taking into account your suggestions, I may have 
> to
> think about an alternative solution.
>
> Thanks a lot
>
>
>
> "James Brown" wrote:
>
>> You can apply NTFS permissions programmatically quite easily. Do a google
>> search, but there are all sorts of APIs for doing this. The ADSI or WMI
>> interfaces (which are very easy to use from VB/C#) are your best bet.
>>
>> In your case the best method is to create a special user-account and set 
>> the
>> permissions on the file so that only that particular user can delete the
>> file - i.e. admins/other users are forbidden from deleting the file, they
>> can only read/write it.
>>
>> You can theoretically perform hacks in kernel-mode using drivers which 
>> block
>> requests to delete the file (think Sony Rootkit fiasco), but an admin 
>> with
>> the right skills could also perform his own hacks to bypass your 
>> hacks...in
>> the end you have to shrug your shoulders and accept that it is not 
>> possible
>> to achieve things this way.
>>
>> My advise is to do things the proper, simple way with NTFS permissions.
>> Anything beyond this requires huge amounts of effort and will ultimately 
>> be
>> defeated. If someone really wants to delete your file they will - I know 
>> I
>> certainly could.
>>
>> James
>>
>> -- 
>> Microsoft MVP - Windows SDK
>> www.catch22.net
>> Free Win32 Source and Tutorials
>>
>>
>> "cjs_pro" <cjspro@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:3FD3BA83-3BE6-44B6-BB82-5FFC03B42F39@xxxxxxxxxxxxxxxx
>> >I need to programmatically make the file undeleteable, even by an
>> > administrator unless the user re-formats all diskspace.
>> >
>> > Thanks
>> >
>> >
>> >
>> > "James Brown" wrote:
>> >
>> >> set the NTFS permissions on the file so that only administrators
>> >> have delete access.
>> >>
>> >> James
>> >>
>> >> -- 
>> >> Microsoft MVP - Windows SDK
>> >> www.catch22.net
>> >> Free Win32 Source and Tutorials
>> >>
>> >>
>> >> "jcs_pro" <jcs_pro@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> >> news:5911F61D-6241-433F-87F2-C60429722809@xxxxxxxxxxxxxxxx
>> >> > Hi,
>> >> >
>> >> > My project requires a configuration file undeleteable by a user on a
>> >> > Windows
>> >> > system. I'm wondering if any simple way to achieve it.
>> >> >
>> >> > Thanks
>> >>
>> >>
>> >>
>>
>>
>>



.



Relevant Pages

  • Re: Make installworld failure
    ... I remember a stale symlink somewhere in /usr/include was preventing me ... After deleting it, everything worked again. ... HIH, ...
    (freebsd-stable)
  • Re: Queues directory?
    ... SilverICE wrote: ... something's preventing the system from deleting the files when ... MS Exchange FAQ at http://www.swinc.com/resource/exch_faq.htm ...
    (microsoft.public.exchange.admin)
  • Prevent deletion of Excel file
    ... Is there a way to allow other users to make changes to a worksheet ... while preventing them from deleting it? ... Prev by Date: ...
    (microsoft.public.excel.misc)

Loading