AW: What rights do I need for IRP_MJ_SETINFORMATION ?

Hi,

maybe your problem is the user context your code is running in. The “system”
user usually has no network access.

In which thread-context (user/system) is your code executing ?

Regards,
Lars

-----Ursprüngliche Nachricht-----
Von: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]Im Auftrag von Ladislav Zezula
Gesendet: Donnerstag, 19. Februar 2004 12:19
An: Windows File Systems Devs Interest List
Betreff: [ntfsd] What rights do I need for IRP_MJ_SETINFORMATION ?

Hi, all

In my filter, I open a file for writing using NtOpenFile
with access
GENERIC_READ | GENERIC_WRITE | DELETE.

Then I call IRP_MJ_SET_INFORMATION, FileBasicInformation
(Changing file dates and file attributes)
succeeds on local drives, but for network files fails
with STATUS_ACCESS_DENIED.

OK, then, but what right do I need for successfull
operation ?

L.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@t-online.de
To unsubscribe send a blank email to xxxxx@lists.osr.com

> In which thread-context (user/system) is your code executing ?

If the file is on local drive, then I start the worker thread
in the system process. If the file is on the net, I start the thread
in the current caller process.

Actually, I already found the problem. It was (as usually)
between the chair and keyboard.

Although - Why can I set the file attributes of a local file
if I open it with FILE_READ_DATA only (in the context of system)
and this does not work if I open a network file in the context
of calling user ?

Is it by design, that LocalSystem account can set file attributes
without setting the flag FILE_WRITE_ATTRIBUTES
at file open ?

L.

Sorry, I wrote it wrong - Correct is

Although - Why can I set the file attributes of a local file
if I open it with *FILE_WRITE_DATA* only (in the context of system)
and this does not work if I open a network file in the context
of calling user ?

L.

File system doesn’t check if the operation you are trying to perform is
compatible with desired access you requested when the file was opened. This
check is performed by IoManager. When you create an IRP and send it directly
to file system - no validation is performed; kernel components trust other
kernel components. When you do the same thing with redirector the remote
system can’t consider incoming request as originated by a trusted component
and request is validated against desired access associated with the handle.

Alexei.

“Ladislav Zezula” wrote in message news:xxxxx@ntfsd…
> Sorry, I wrote it wrong - Correct is
>
> Although - Why can I set the file attributes of a local file
> if I open it with FILE_WRITE_DATA only (in the context of system)
> and this does not work if I open a network file in the context
> of calling user ?
>
> L.
>

Ah, thanks. It is true, because I open the file using NtOpenFile
and then set the file attributes using CallNextLowerDriver
(i.e. construct the IRP and send it down).
Thanks for the point.

L.