Merge pull request #2198 from hamo/hamo/chdir_error

check return value of syscall.Chdir when changing working directory
This commit is contained in:
Victor Vieux 2013-10-22 09:54:25 -07:00
commit 13c913d883
2 changed files with 4 additions and 1 deletions

View File

@ -185,4 +185,5 @@ Vladimir Kirillov <proger@wilab.org.ua>
Walter Stanish <walter@pratyeka.org>
Wes Morgan <cap10morgan@gmail.com>
Will Dietz <w@wdtz.org>
Yang Bai <hamo.by@gmail.com>
Zaiste! <oh@zaiste.net>

View File

@ -27,7 +27,9 @@ func setupWorkingDirectory(workdir string) {
if workdir == "" {
return
}
syscall.Chdir(workdir)
if err := syscall.Chdir(workdir); err != nil {
log.Fatalf("Unable to change dir to %v: %v", workdir, err)
}
}
// Takes care of dropping privileges to the desired user