diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-01-13 07:35:11 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-02 08:06:26 +0300 |
commit | 47f48a65ca97ee46a6351c0a53234586ab6ef087 (patch) | |
tree | 9a12c059966916ff6632ca6ee2ef8cbab54e44a4 /daemon.go | |
parent | dd3499cd07e539c237b8f84a2cc918ed98c677fe (diff) |
Remove wd and add note for pages-root
Diffstat (limited to 'daemon.go')
-rw-r--r-- | daemon.go | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -254,12 +254,6 @@ func jailDaemon(pagesRoot string, cmd *exec.Cmd) (*jail.Jail, error) { return nil, err } - // ensure pagesRoot is an absolute path - pagesRoot, err = filepath.Abs(pagesRoot) - if err != nil { - return nil, err - } - // Bind mount shared folder cage.MkDir(pagesRoot, 0755) cage.Bind(pagesRoot, pagesRoot) @@ -272,9 +266,11 @@ func jailDaemon(pagesRoot string, cmd *exec.Cmd) (*jail.Jail, error) { return cage, nil } -// func ensureRootPagesRoot() func daemonize(config appConfig, uid, gid uint, inPlace bool, pagesRoot string) error { - // ensure pagesRoot is an absolute path + // Ensure pagesRoot is an absolute path. This will produce a different path + // if any component of pagesRoot is a symlink (not likely). For example, + // -pages-root=/some-path where ln -s /other-path /some-path + // pagesPath will become: /other-path and we will fail to serve files from /some-path. pagesRoot, err := filepath.Abs(pagesRoot) if err != nil { return err |