Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2021-01-13 07:35:11 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-02-02 08:06:26 +0300
commit47f48a65ca97ee46a6351c0a53234586ab6ef087 (patch)
tree9a12c059966916ff6632ca6ee2ef8cbab54e44a4 /daemon.go
parentdd3499cd07e539c237b8f84a2cc918ed98c677fe (diff)
Remove wd and add note for pages-root
Diffstat (limited to 'daemon.go')
-rw-r--r--daemon.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/daemon.go b/daemon.go
index 86de6fc8..5fee27ee 100644
--- a/daemon.go
+++ b/daemon.go
@@ -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