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-29 08:35:44 +0300
committerJaime Martinez <jmartinez@gitlab.com>2021-02-02 08:06:26 +0300
commit39104bd02103d0ef0b37dc1f7a45527ac3ff510b (patch)
tree946417506e5793b3d932c9a783cd855634039f6d /daemon.go
parent76ec6a2f93097a48899bd7ac3d2ca4bbc844daaf (diff)
Add MkDirAll to jail
Diffstat (limited to 'daemon.go')
-rw-r--r--daemon.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/daemon.go b/daemon.go
index 5fee27ee..e73a0e95 100644
--- a/daemon.go
+++ b/daemon.go
@@ -255,7 +255,7 @@ func jailDaemon(pagesRoot string, cmd *exec.Cmd) (*jail.Jail, error) {
}
// Bind mount shared folder
- cage.MkDir(pagesRoot, 0755)
+ cage.MkDirAll(pagesRoot, 0755)
cage.Bind(pagesRoot, pagesRoot)
// Update command to use chroot
@@ -271,6 +271,8 @@ func daemonize(config appConfig, uid, gid uint, inPlace bool, pagesRoot string)
// 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.
+ // GitLab Rails also resolves the absolute path for `pages_path`
+ // https://gitlab.com/gitlab-org/gitlab/blob/981ad651d8bd3690e28583eec2363a79f775af89/config/initializers/1_settings.rb#L296
pagesRoot, err := filepath.Abs(pagesRoot)
if err != nil {
return err