diff options
author | Jaime Martinez <jmartinez@gitlab.com> | 2021-01-12 05:42:46 +0300 |
---|---|---|
committer | Jaime Martinez <jmartinez@gitlab.com> | 2021-02-02 08:06:26 +0300 |
commit | dd3499cd07e539c237b8f84a2cc918ed98c677fe (patch) | |
tree | dbf3c480bb82a8fe22f2b6757f29ccd5e7670c40 /daemon.go | |
parent | e7d71ae540f433eb8dbbfef64118674f7e76e473 (diff) |
Ensure pages-root is abs
MkdirAll in jail so the full pages-root path is created
Diffstat (limited to 'daemon.go')
-rw-r--r-- | daemon.go | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -274,10 +274,17 @@ func jailDaemon(pagesRoot string, cmd *exec.Cmd) (*jail.Jail, error) { // func ensureRootPagesRoot() func daemonize(config appConfig, uid, gid uint, inPlace bool, pagesRoot string) error { + // ensure pagesRoot is an absolute path + pagesRoot, err := filepath.Abs(pagesRoot) + if err != nil { + return err + } + log.WithFields(log.Fields{ - "uid": uid, - "gid": gid, - "in-place": inPlace, + "uid": uid, + "gid": gid, + "in-place": inPlace, + "pages-root": pagesRoot, }).Info("running the daemon as unprivileged user") cmd, err := daemonReexec(uid, gid, daemonRunProgram) |