Skip to content

Commit

Permalink
daemon/graphdriver/windows: InitFilter() don't use idtools.MkdirAllAn…
Browse files Browse the repository at this point in the history
…dChown()

idtools.MkdirAllAndChown on Windows does not chown directories, which makes
idtools.MkdirAllAndChown() just an alias for system.MkDirAll().

Also setting the filemode to `0`, as changing filemode is a no-op on Windows as
well; both of these changes should make it more transparent that no chown'ing,
nor changing filemode takes place.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Mar 14, 2023
1 parent ee17ecb commit 605e8f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion daemon/graphdriver/windows/windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/longpath"
"github.com/docker/docker/pkg/reexec"
"github.com/docker/docker/pkg/system"
units "github.com/docker/go-units"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -106,7 +107,9 @@ func InitFilter(home string, options []string, _ idtools.IdentityMapping) (graph
return nil, fmt.Errorf("%s is on an ReFS volume - ReFS volumes are not supported", home)
}

if err := idtools.MkdirAllAndChown(home, 0700, idtools.Identity{UID: 0, GID: 0}); err != nil {
// Setting file-mode is a no-op on Windows, so passing "0" to make it more
// transparent that the filemode passed has no effect.
if err = system.MkdirAll(home, 0); err != nil {
return nil, fmt.Errorf("windowsfilter failed to create '%s': %v", home, err)
}

Expand Down

0 comments on commit 605e8f5

Please sign in to comment.