Skip to content

Commit

Permalink
Merge pull request #677 from matejvasek/add-opt-for-chown
Browse files Browse the repository at this point in the history
add config option for ChownCopiedFiles
  • Loading branch information
rhatdan authored Jul 14, 2021
2 parents 913c7e5 + 15783e5 commit b15e2ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/containers.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ By default this will be configured relative to where containers/storage store
containers. This convention is followed by the default volume driver, but may
not be by other drivers.

**chown_copied_files**=true

Determines whether file copied into a container will have changed ownership to
the primary uid/gid of the container.

## SERVICE DESTINATION TABLE
The `service_destinations` table contains configuration options used to set up remote connections to the podman service for the podman API.

Expand Down
4 changes: 4 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ type EngineConfig struct {
// will refer to the plugin as) mapped to a path, which must point to a
// Unix socket that conforms to the Volume Plugin specification.
VolumePlugins map[string]string `toml:"volume_plugins,omitempty"`

// ChownCopiedFiles tells the container engine whether to chown files copied
// into a container to the container's primary uid/gid.
ChownCopiedFiles bool `toml:"chown_copied_files"`
}

// SetOptions contains a subset of options in a Config. It's used to indicate if
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
c.LockType = "shm"
c.MachineEnabled = false

c.ChownCopiedFiles = true

return c, nil
}

Expand Down

0 comments on commit b15e2ff

Please sign in to comment.