Skip to content

Breaking change from version 0.14 - cannot init repository if there is no read access to the root of the drive #795

@ghost

Description

Hi guys, thanks for the great project.

Starting from version 0.14, there seems to be a breaking change. In order to init repository, it is now needed to have the Read access to the root of the disk drive on which this repository should reside.

Unfortunately, this breaks many deployment scenarios for us, because due to infrastructural reasons it is not possible to give users access to drive roots. For example, this happens in the shared web hosting scenarios and large enterprise deployments.

Here is the repro (it's not automated yet, because there are some non-trivial steps):
//Arrange

  • Create a new user in Windows called TestUser
  • Map a small disk drive on X: (you can also use C: drive, but it will take lots of time to remove permissions).
  • Make a directory X:\Data\Projects
  • Remove all rights for TestUser from drive X:\
  • Grant Modify rights to TestUser for folder X:\Data\Projects

Now the setup is complete. We have a user who does not have access to the root the drive X: but has his own directory on this drive where he can do whatever he wants.

//Act

  • Log in under TestUser and run the following code:
    new Repository(Repository.Init(@"X:\Data\Projects\NewProject"));

//Assert

  • Repository is not created because the following exception is thrown:
    LibGit2Sharp.LibGit2SharpException: An error was raised by libgit2. Category = Os (Error).
    Failed to make directory 'x:/data': Access is denied.

This works as expected before version 0.14 (at least in 0.11 and below).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions