Problem clearing read only over CIFS

Hi,

I have a strange problem that I’m wondering if anyone has any advice on.

In certain cases I clear the read-only flag so that I can open a network file for write access. I restore it later.

I have some native tests the excercise this functionality and it works fine. We also have some managed tests which for some reason are showing a problem.

Basically, I do:

  1. FltQueryInformationFile() to get the basic information.
  2. Verify that the read only bit is in fact set.
  3. Call FltSetInformationFile() to set the basic information with the read only bit cleared.

In this particular case, FltSetInformationFile() is returning STATUS_SUCCESS. However the read-only bit is still set. I can verify this any number of ways.

Does anyone have any idea what could happen that would cause the set information call to return STATUS_SUCCESS but the read only bit to still be set?

Thanks,
Matt

What does wireshark say? Can you see the setpathinfo or setfileinfo passing over the network? (Or loopback interface)

Sam

-----Original Message-----
From: mattklein123
Sent: 03 November 2009 23:55
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Problem clearing read only over CIFS

Hi,

I have a strange problem that I’m wondering if anyone has any advice on.

In certain cases I clear the read-only flag so that I can open a network file for write access. I restore it later.

I have some native tests the excercise this functionality and it works fine We also have some managed tests which for some reason are showing a problem.

Basically, I do:

1) FltQueryInformationFile() to get the basic information.
2) Verify that the read only bit is in fact set.
3) Call FltSetInformationFile() to set the basic information with the read only bit cleared.

In this particular case, FltSetInformationFile() is returning STATUS_SUCCESS. However the read-only bit is still set. I can verify this any number of ways.

Does anyone have any idea what could happen that would cause the set information call to return STATUS_SUCCESS but the read only bit to still be set?

Thanks,
Matt


NTFSD is sponsored by OSR

For our schedule of debugging and file system seminars
(including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

I figured this out. Basically when using the .NET APIs to set read-only, only the FILE_ATTRIBUTE_READONLY bit was set (0x1). When I cleared this there were no bits set (0x0) so the FSD ignored the change. I now check to see if clearing the read only bit causes there to be no bits set, and then I set FILE_ATTRIBUTE_NORMAL. When I ran the same type of tests on native it appears that both are set so that when I clear read-only it was a valid change.