mirror of
https://github.com/containers/podman.git
synced 2025-07-18 01:57:24 +08:00

Support a new concept in containers.conf called "modules". A "module" is a containers.conf file located at a specific directory. More than one module can be loaded in the specified order, following existing override semantics. There are three directories to load modules from: - $CONFIG_HOME/containers/containers.conf.modules - /etc/containers/containers.conf.modules - /usr/share/containers/containers.conf.modules With CONFIG_HOME pointing to $HOME/.config or, if set, $XDG_CONFIG_HOME. Absolute paths will be loaded as is, relative paths will be resolved relative to the three directories above allowing for admin configs (/etc/) to override system configs (/usr/share/) and user configs ($CONFIG_HOME) to override admin configs. Pulls in containers/common/pull/1599. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
31 lines
642 B
Go
31 lines
642 B
Go
//go:build darwin || linux
|
|
// +build darwin linux
|
|
|
|
// fill in statvfs structure with OS specific values
|
|
// Statfs_t is different per-kernel, and only exists on some unixes (not Solaris for instance)
|
|
|
|
package sftp
|
|
|
|
import (
|
|
"syscall"
|
|
)
|
|
|
|
func (p *sshFxpExtendedPacketStatVFS) respond(svr *Server) responsePacket {
|
|
retPkt, err := getStatVFSForPath(p.Path)
|
|
if err != nil {
|
|
return statusFromError(p.ID, err)
|
|
}
|
|
retPkt.ID = p.ID
|
|
|
|
return retPkt
|
|
}
|
|
|
|
func getStatVFSForPath(name string) (*StatVFS, error) {
|
|
var stat syscall.Statfs_t
|
|
if err := syscall.Statfs(name, &stat); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return statvfsFromStatfst(&stat)
|
|
}
|