windows - Why C function _stat does not set errno properly when access is denied to the folder -


I am developing a program with VS2005 and I came to know that when Folder access is restricted in such a manner The way I can make the folder or delete anything from a folder The _stat function for the folder does not incorrectly set erroneous Errno value is set to ENOENT I can not modify the permissions exactly, so I The value could be EACCES. Either return _stat 0 (no error) or the error has been set to ENOENT Can you tell me how can actually create a distinction between the folder and the user does not have sufficient permissions for the folder? One more thing is that I do not uderstand whether to return special permission result 1- when I see the effective permissions of that folder which I was testing _stat, there is nothing in the 'Danny' column here As long as 'Folders create / update data' is checked, I can not make folders in it unless

Thanks & amp; BR-Matti

Windows security features are great for testing with _stat () Its implementation FindFirstFile () Uses the API function, which can only fail if the files are not empowered to enumerate. It's hardly the case, usually closed or restricted is more restrictive Write or modify.

The hacking of security APIs is often avoided to test ACLs and is highly impossible, you can only find out that you do not have the necessary privileges while trying to open the file. It is quite acceptable because there is nothing in your code to get the right to access the file.


Comments