dlog.Fatal("Root privileges are required in order to switch to a different user. Maybe try again with 'sudo'")
}
userInfo,err:=user.Lookup(userStr)
args:=os.Args
iferr!=nil{
uid,err2:=strconv.Atoi(userStr)
iferr2!=nil||uid<=0{
dlog.Fatalf("Unable to retrieve any information about user [%s]: [%s] - Remove the user_name directive from the configuration file in order to avoid identity switch",userStr,err)
}
dlog.Warnf("Unable to retrieve any information about user [%s]: [%s] - Switching to user id [%v] with the same group id, as [%v] looks like a user id. But you should remove or fix the user_name directive in the configuration file if possible",userStr,err,uid,uid)
userInfo=&user.User{Uid:userStr,Gid:userStr}
}
uid,err:=strconv.Atoi(userInfo.Uid)
iferr!=nil{
dlog.Fatal(err)
}
gid,err:=strconv.Atoi(userInfo.Gid)
iferr!=nil{
dlog.Fatal(err)
}
execPath,err:=exec.LookPath(args[0])
iferr!=nil{
dlog.Fatalf("Unable to get the path to the dnscrypt-proxy executable file: [%s]",err)