{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/31645","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/31645/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/31645/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/31645/events","html_url":"https://github.com/dotnet/corefx/issues/31645","id":348620004,"node_id":"MDU6SXNzdWUzNDg2MjAwMDQ=","number":31645,"title":"Support SeBackupPrivilege in System.IO.FileFilestream API","user":{"login":"Genbox","id":657616,"node_id":"MDQ6VXNlcjY1NzYxNg==","avatar_url":"https://avatars1.githubusercontent.com/u/657616?v=4","gravatar_id":"","url":"https://api.github.com/users/Genbox","html_url":"https://github.com/Genbox","followers_url":"https://api.github.com/users/Genbox/followers","following_url":"https://api.github.com/users/Genbox/following{/other_user}","gists_url":"https://api.github.com/users/Genbox/gists{/gist_id}","starred_url":"https://api.github.com/users/Genbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Genbox/subscriptions","organizations_url":"https://api.github.com/users/Genbox/orgs","repos_url":"https://api.github.com/users/Genbox/repos","events_url":"https://api.github.com/users/Genbox/events{/privacy}","received_events_url":"https://api.github.com/users/Genbox/received_events","type":"User","site_admin":false},"labels":[{"id":154422420,"node_id":"MDU6TGFiZWwxNTQ0MjI0MjA=","url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.IO","name":"area-System.IO","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-08-08T08:11:55Z","updated_at":"2018-08-14T19:39:40Z","closed_at":null,"author_association":"NONE","body":"The [SeBackupPrivilege](https://docs.microsoft.com/en-us/windows/desktop/secauthz/privilege-constants) privilege on Windows gives the user the ability to bypass ACLs in the filesystem, which is paramount when doing a file-based backup.\r\n\r\nThe normal process is as follows:\r\n1. Get the current program's token\r\n2. Enable the SeBackupPrivilege on the token\r\n3. Call the Win32 [CreateFile](https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea) API with the FILE_FLAG_BACKUP_SEMANTICS flag to have the filesystem driver bypass the ACLs on the drive.\r\n\r\nRight now it is not possible to do step 3 using the .NET API as the backup file flag is not available. It is already used in places like the [FileSystemEnumerator ](https://github.com/dotnet/corefx/blob/d3ed110eff677ceefb9346109dbd1c681e080f34/src/System.IO.FileSystem/src/System/IO/Enumeration/FileSystemEnumerator.Windows.cs#L98) for opening directories, but not exposed as part of the System.IO.Filestream API. Actually, it is [implicitly filtered here](https://github.com/dotnet/corefx/blob/aa73b08881ccc2a438947c19d60a6665008bcc08/src/Common/src/CoreLib/System/IO/FileStream.cs#L204).\r\n\r\nIt would be great if we extended the FileOptions enum with a Backup flag and allow it in the enum validation check above."},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/412991131","html_url":"https://github.com/dotnet/corefx/issues/31645#issuecomment-412991131","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/31645","id":412991131,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjk5MTEzMQ==","user":{"login":"danmosemsft","id":6385855,"node_id":"MDQ6VXNlcjYzODU4NTU=","avatar_url":"https://avatars3.githubusercontent.com/u/6385855?v=4","gravatar_id":"","url":"https://api.github.com/users/danmosemsft","html_url":"https://github.com/danmosemsft","followers_url":"https://api.github.com/users/danmosemsft/followers","following_url":"https://api.github.com/users/danmosemsft/following{/other_user}","gists_url":"https://api.github.com/users/danmosemsft/gists{/gist_id}","starred_url":"https://api.github.com/users/danmosemsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmosemsft/subscriptions","organizations_url":"https://api.github.com/users/danmosemsft/orgs","repos_url":"https://api.github.com/users/danmosemsft/repos","events_url":"https://api.github.com/users/danmosemsft/events{/privacy}","received_events_url":"https://api.github.com/users/danmosemsft/received_events","type":"User","site_admin":false},"created_at":"2018-08-14T19:39:40Z","updated_at":"2018-08-14T19:39:40Z","author_association":"MEMBER","body":"@JeremyKuhne @pjanotti own the IO area and can indicate their preference."}}
{"actor":{"display_login":"danmosemsft"}}