mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
fix bug in getRootResourcePath in previous commit
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
This commit is contained in:
parent
5c069940db
commit
48907d57ed
1 changed files with 2 additions and 16 deletions
|
@ -163,26 +163,12 @@ func (container *Container) WriteHostConfig() error {
|
|||
|
||||
func (container *Container) getResourcePath(path string) (string, error) {
|
||||
cleanPath := filepath.Join("/", path)
|
||||
fullPath := filepath.Join(container.basefs, cleanPath)
|
||||
|
||||
result, err := symlink.FollowSymlinkInScope(fullPath, container.basefs)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
return symlink.FollowSymlinkInScope(filepath.Join(container.basefs, cleanPath), container.basefs)
|
||||
}
|
||||
|
||||
func (container *Container) getRootResourcePath(path string) (string, error) {
|
||||
cleanPath := filepath.Join("/", path)
|
||||
fullPath := filepath.Join(container.root, cleanPath)
|
||||
|
||||
result, err := symlink.FollowSymlinkInScope(fullPath, container.basefs)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return result, nil
|
||||
return symlink.FollowSymlinkInScope(filepath.Join(container.root, cleanPath), container.root)
|
||||
}
|
||||
|
||||
func populateCommand(c *Container, env []string) error {
|
||||
|
|
Loading…
Add table
Reference in a new issue