Skip to content

Commit

Permalink
Merge pull request #5 from mialinx/master
Browse files Browse the repository at this point in the history
quickfix for empty credentials
  • Loading branch information
sevlyar committed Jan 17, 2015
2 parents 8fe5849 + 17654fe commit 04162ff
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions daemon_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,16 @@ func (d *Context) child() (err error) {
if len(d.Chroot) > 0 {
err = syscall.Chroot(d.Chroot)
}
if d.Credential.Gid > 0 {
if err = syscall.Setgid(int(d.Credential.Gid)); err != nil {
return
if d.Credential != nil {
if d.Credential.Gid > 0 {
if err = syscall.Setgid(int(d.Credential.Gid)); err != nil {
return
}
}
}
if d.Credential.Uid > 0 {
if err = syscall.Setuid(int(d.Credential.Uid)); err != nil {
return
if d.Credential.Uid > 0 {
if err = syscall.Setuid(int(d.Credential.Uid)); err != nil {
return
}
}
}

Expand Down

0 comments on commit 04162ff

Please sign in to comment.