Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception "Access to the path '...\SPCB.exe.Config' is denied. #101

Open
nils-a opened this issue Feb 2, 2021 · 5 comments
Open

Exception "Access to the path '...\SPCB.exe.Config' is denied. #101

nils-a opened this issue Feb 2, 2021 · 5 comments
Assignees
Labels
needs: triage status: to-be-reviewed Needs to be reviewed in more detail before deciding next steps. type: enhancement New feature or enhancement of existing capability

Comments

@nils-a
Copy link

nils-a commented Feb 2, 2021

I installed spcb in a location where users do not have write access, then start spcb as a normal user.

Would it be possible to store per-user settings in a user-configuration?

The full error I get is:

ex	{System.TypeInitializationException: The type initializer for 'SPBrowser.Globals' threw an exception. ---> System.UnauthorizedAccessException: Access to the path 'C:\ProgramData\chocolatey\lib\spcb\tools\SPCB.exe.Config' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
   at System.Configuration.Internal.WriteFileContext.ValidateWriteAccess(String filename)
   at System.Configuration.Internal.WriteFileContext.Complete(String filename, Boolean success)
   at System.Configuration.Internal.InternalConfigHost.StaticWriteCompleted(String streamName, Boolean success, Object writeContext, Boolean assertPermissions)
   at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext, Boolean assertPermissions)
   at System.Configuration.Internal.InternalConfigHost.System.Configuration.Internal.IInternalConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
   at System.Configuration.Internal.DelegatingConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
   at System.Configuration.UpdateConfigHost.WriteCompleted(String streamName, Boolean success, Object writeContext)
   at System.Configuration.MgmtConfigurationRecord.SaveAs(String filename, ConfigurationSaveMode saveMode, Boolean forceUpdateAll)
   at System.Configuration.Configuration.SaveAsImpl(String filename, ConfigurationSaveMode saveMode, Boolean forceSaveAll)
   at System.Configuration.Configuration.Save(ConfigurationSaveMode saveMode)
   at SPBrowser.Utils.ConfigUtil.GetOrCreateAppSetting(String key, Object defaultValue)
   at SPBrowser.Utils.ConfigUtil.GetOrCreateAppSetting(String key, Boolean defaultValue)
   at SPBrowser.Repositories.ConfigRepositoryAppConfig.<>c.<GetItems>b__2_3(ConfigurationItemBool x)
   at SPBrowser.Repositories.TypeSwitch.<>c__DisplayClass1_0`1.<Case>b__0(Object x)
   at SPBrowser.Repositories.TypeSwitch.Switch(Object x)
   at SPBrowser.Repositories.ConfigRepositoryAppConfig.GetItems()
   at SPBrowser.Managers.ConfigurationManager.GetAppConfig()
   at SPBrowser.Managers.ConfigurationManager..ctor()
   at SPBrowser.Globals..cctor()
   --- End of inner exception stack trace ---
   at SPBrowser.Globals.get_Configuration()
   at SPBrowser.Managers.TelemetryManager.Initialize()
   at SPBrowser.Managers.TelemetryManager..ctor()
   at SPBrowser.Program.Main(String[] args)}	System.Exception {System.TypeInitializationException}

@bramdejager
Copy link
Owner

Closing the issue, clean-up (issue expired).

@nils-a
Copy link
Author

nils-a commented Dec 17, 2024

@bramdejager should I re-create this issue, if I still like to see this feature?

@bramdejager
Copy link
Owner

@nils-a happy to hear from you. And happy to open this issue, because I was not sure if this is still active.

Can you elaborate on your need? What needs to be changed exactly to make this happen?

@bramdejager bramdejager reopened this Dec 17, 2024
@bramdejager bramdejager self-assigned this Dec 17, 2024
@bramdejager bramdejager added type: enhancement New feature or enhancement of existing capability needs: more information status: to-be-reviewed Needs to be reviewed in more detail before deciding next steps. needs: triage and removed needs: more information labels Dec 17, 2024
@nils-a
Copy link
Author

nils-a commented Dec 17, 2024

My scenario is as follows: spcb is installed by an admin for all users of the machine.
Now, when I start it, as a non-admin, spcb throws the exception that is mentioned above - complaining that ../SPCB.exe.Config is inaccessible.

Thus, the question is, whether that config could be stored user-specific.

@nils-a
Copy link
Author

nils-a commented Dec 17, 2024

Hm. I did a small test and that's probably no small change. When running from a system under my control, I can see more files being created in the same place right after the first start of the application.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: triage status: to-be-reviewed Needs to be reviewed in more detail before deciding next steps. type: enhancement New feature or enhancement of existing capability
Projects
None yet
Development

No branches or pull requests

2 participants