File Permissions Bug in Windows - Blender ignores Windows folder permissions and fails to write in valid folders with proper permissions.
Open, IncompletePublic

Description

Windows 10
Blender 2.78c
hash: e92f235283

When saving files, Blender will save files to "My Documents" based on some hard coding. It will not save to other folders even if they have valid windows file/folder permissions. Further, it does not honor the redirection shortcuts as described below.

Blender should follow Windows file/folder permissions and not force it's own file rules of only using "My Documents".

Why it breaks for me:

In windows, it is possible to MOVE your "My Documents", "My Music", and other folders. You can "change location" for these standard folders. In my case, I use OneDrive. I have moved "My Documents" into my "OneDrive\My Documents" folder. This enables my documents to sync from one computer to another automatically.

Blender is only willing to save to C:\users\jerry\my documents. It will not honor my personalized location of "c:\users\jerry\onedrive\my documents".

My folders do have correct permissions for Windows apps and works perfectly for other applications. But since blender implements it's own internal restrictions on where it is willing to write files, that is causing a problem.

Others who encounter this problem are simply running blender as administrator. They never figure out that the reason they must do that is because blender is not honoring windows conventions for files and folders.

There are two parts to this bug:

  1. You should honor shortcuts and relocated "my documents" folders, etc. Windows allows things to move. Blender should respect that.
  1. Blender denies writing to folders where writing is allowed by windows because it forces usage of default "my documents" locations on the C: drive. All other folders are denied. Blender should honor the permissions systems implemented in Windows and not override them.

Details

Type
Bug
matali23 (matali23) triaged this task as "Incomplete" priority.Tue, Jul 18, 2:03 PM

First of all, when you do assumptions, you should speak more gently. Nobody should do what you say or want.
Second, Blender does respect permissions, I couldn't reproduce your bug. If I try to write to a folder I'm allowed to write in, it works, whatever folder/partition it is, if I'm not allowed it won't.
So you have to better describe your problem and speak normally.

Probably this is some issue with NTFS file junctions. What is the exact error you message get, when saving a .blend to this folder?

This is definitely a challenging problem to describe. Let me give you my step-by-step.

  • Installed blender with MSI
  • Created tiny test project
  • Tried to save it to c:\users\jerry\onedrive\myfile.blend - got error: Cannot open file @ for writing: Permission denied.
  • Tried to save it to c:\myfile.blend - got same error
  • Tried to save to c:\users\jerry\my documents\myfile.blend - success (I tried many other locations, but only this location worked.
  • Tried to save to network drives - also success.
  • I uninstalled and reinstalled - exact same behavior.
  • I posted to blender support forums and was told i need to run blender as administrator - I also saw that advice with google searches. apparently it's a common answer.
  • I modified shortcut to "run as administrator" - now I can save my files.
  • as a test - i removed the "run as administrator" check and tried again
  • saving to c:\myfile.blend created same error message.
  • tried same filename and location several times - one time it worked - 5 times it failed. The file did save once. So that's interesting.
  • tried saving to existing to c:\user\jerry\onedrive and it did save several times successfully.

The first series of tests prior to this ticket being created produced consistent failures. Now the results are intermittent. Maybe running it as administrator in between cleared up some problems. But it did fail a few times, so there is an issue.

My assumption that this is a blender issue with hot it opens and handles file permissions is because there seems to be a common suggestion to run it as administrator. This suggests other people have problems as well but they are not reporting it as a bug, they just find a work-around.

First of all, when you do assumptions, you should speak more gently. Nobody should do what you say or want.
Second, Blender does respect permissions, I couldn't reproduce your bug. If I try to write to a folder I'm allowed to write in, it works, whatever folder/partition it is, if I'm not allowed it won't.
So you have to better describe your problem and speak normally.

Matali, I apologize for anything that sounded harsh or demanding to you. It wasn't intended that way. I was trying to describe what seemed like the problem to me. Not complaining. but I see how it came across as abrasive. I apologize for that. I reposted in a comment and described it "more gently". Please don't imagine I'm an angry and demanding person. I am not. Hopefully my bulleted list is more helpful.

Hmmm… the '@' file is a temp .blend file Blender uses to dump its binary data in, before renaming it to final file name - it avoids potentially running an existing .blend file whe you write over it.

We have another report witch seems to root to same problem (T52036) - could it be that Windows now forbids '@' in filenames? Could not find any mention of '@' char in https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx though…

On the other end, since '@' file is written first, would be the first one to hit permission issue, so…

@Bastien Montagne (mont29) , I think this bug(?) is quite old - back in 2012. I managed to find someone post a solution-ish for Windows 7.

https://www.youtube.com/watch?v=N5qXI5G0HlA

I don't know if the issue is with Blender or OS though...

I think there are two distinct issue here. In T52036 it seems that Blender tries to use C:\ as the temporary directory. This report seems to be about NTFS junctions, which are a special type of symbol link used by Windows to move e.g. My Documents to another location.