Mercurial > go > multipass
changeset 8:4db389f948c9
Preserve the entire environment when password checking.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Sun, 25 Oct 2015 00:03:06 -0400 |
parents | 406d3cd76739 |
children | e58bfc7fc207 |
files | multipass-checkpassword.go |
diffstat | 1 files changed, 3 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/multipass-checkpassword.go Sat Oct 24 23:40:13 2015 -0400 +++ b/multipass-checkpassword.go Sun Oct 25 00:03:06 2015 -0400 @@ -40,15 +40,10 @@ if err != nil { os.Exit(Failed) } + os.Setenv("USER", user.Username) + os.Setenv("HOME", user.HomeDir) os.Setenv("userdb_uid", user.Uid) os.Setenv("userdb_gid", user.Gid) os.Setenv("EXTRA", "userdb_uid userdb_gid") - environ := []string{ - "USER=" + user.Username, - "userdb_uid=" + user.Uid, - "userdb_gid=" + user.Gid, - "HOME=" + user.HomeDir, - "EXTRA=userdb_uid userdb_gid", - } - syscall.Exec(os.Args[1], os.Args[1:], environ) + syscall.Exec(os.Args[1], os.Args[1:], os.Environ()) }