MPExtended/MPExtended — Issue #48: Improve handling of files on network shares
Author: oxan
Created: 2011-11-14 22:38:56+00:00
State: open
Labels: mas, plugins, streaming, tas

```
[23:25:22] http://forums.asp.net/t/923580.aspx
[23:25:39] do you use the same user for the service as your local login?
[23:26:44] btw oxan, did you know about impersonation? http://www.codeproject.com/KB/cs/zetaimpersonator.aspx
[23:26:57] no
[23:27:11] looks interesting
[23:27:51] yes, same user as local login is used
[23:28:15] I'm not sure how mapped network drives work
[23:28:35] the article seems to suggest that they exist on a per-session basis
[23:28:59] yeah afaik they're on a per-session basis with an option to make them per-user (which almost all people use)
[23:29:54] When I add a mapped network drive I see no option to do such a thing
[23:30:46] maybe you can only do that on the command line then
[23:30:56] net use X:\ \\server\bla /persisent:yes
[23:32:04] hm, it seems persistent is the same as "reconnect at startup"
[23:32:23] but the question is if this is visible for services running under the user
[23:32:27] it would seem not
[23:33:26] but maybe user impersonation would fix our problem
[23:34:01] it would also make it easier (no need to change the services' user)
[23:34:23] btw
[23:34:39] we should add a warning for files on nas systems
[23:34:40] yeah we should try if impersonation helps us
[23:34:44] yep
[23:34:52] so e.g. if a file is requested and access is denied
[23:34:58] we check if it starts with "\\\\"
[23:35:30] if yes, we log a warning "we cant access the file and it seems to be located on a network share, make sure you run under a user with access"
[23:35:33] or smth like that
[23:35:39] i think that we can expect more problems with mapped network drives then with UNC paths
[23:35:41] but yes, good idea
```

We should either handle it in MediaSource or in the GetFileInfo and friends methods. It needs a bit of redesign to avoid copying the impersonation code all over the place I'm afraid.