Ylianst / MeshCentralAssistant

Tray icon tool for the MeshCentral Agent. It displays the state of the agent, you can start and stop the agent and request help.
https://meshcentral.com
Apache License 2.0
36 stars 26 forks source link

Unauthorized file access causes crash #14

Closed ramiresviana closed 2 years ago

ramiresviana commented 3 years ago

Accessing a file which the user does not have permission, via MeshCentral file explorer, causes the application to close forcefully. Contents of debug.log file:

UnhandledExceptionEventSink: System.UnauthorizedAccessException: Access to the path 'C:\Recovery' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileSystemEnumerableIterator`1.CommonInit()
   at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
   at System.IO.Directory.EnumerateDirectories(String path)
   at MeshAssistant.MeshCentralTunnel.ParseFilesCommand(String data)
   at MeshAssistant.MeshCentralTunnel.WebSocket_onBinaryData(webSocketClient sender, Byte[] data, Int32 off, Int32 len, Int32 orglen)
   at MeshAssistant.webSocketClient.ProcessWsBuffer(Byte[] data, Int32 offset, Int32 len, Int32 op)
   at MeshAssistant.webSocketClient.ProcessBuffer(Byte[] buffer, Int32 offset, Int32 len)
   at MeshAssistant.webSocketClient.OnTlsDataSink(IAsyncResult ar)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Security._SslStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security._SslStream.ReadFrameCallback(AsyncProtocolRequest asyncRequest)
   at System.Net.AsyncProtocolRequest.CompleteRequest(Int32 result)
   at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
   at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
   at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
   at System.Net.ContextAwareResult.CompleteCallback(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Net.ContextAwareResult.Complete(IntPtr userToken)
   at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
   at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
   at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Ylianst commented 2 years ago

Thanks for reporting this! Will be fixed in MeshCentral v0.9.16.

ramiresviana commented 2 years ago

Accessing files without permission now doesn't cause crash since v0.9.16.