mirror of
https://github.com/openziti/zrok.git
synced 2025-06-24 19:51:32 +02:00
use EUID if $USER is unset or does not resolve to a POSIX account
This commit is contained in:
parent
3f5db643aa
commit
4342dbe89d
@ -1,5 +1,9 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## v1.0.5
|
||||||
|
|
||||||
|
FIX: `zrok enable` now handles the case where the user ID does not resolve to a username when generating the default environment description (https://github.com/openziti/zrok/issues/959)
|
||||||
|
|
||||||
## v1.0.4
|
## v1.0.4
|
||||||
|
|
||||||
FIX: `zrok admin bootstrap` and `zrok enable` functionality were broken in `v1.0.3`. A bad combination of dependencies caused issues with marshalling data from the associated controller endpoints
|
FIX: `zrok admin bootstrap` and `zrok enable` functionality were broken in `v1.0.3`. A bad combination of dependencies caused issues with marshalling data from the associated controller endpoints
|
||||||
|
@ -56,14 +56,15 @@ func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
var username string
|
var username string
|
||||||
user, err := user2.Current()
|
userObj, err := user2.Current()
|
||||||
if err != nil {
|
if err == nil && userObj.Username != "" {
|
||||||
username := os.Getenv("USER")
|
username = userObj.Username
|
||||||
if username == "" {
|
|
||||||
logrus.Panicf("unable to determine the current user: %v", err)
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
username = user.Username
|
username = os.Getenv("USER")
|
||||||
|
if username == "" {
|
||||||
|
username = fmt.Sprintf("user-%d", os.Geteuid())
|
||||||
|
logrus.Warnf("unable to determine the current user, using effective UID: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
hostDetail = fmt.Sprintf("%v; %v", username, hostDetail)
|
hostDetail = fmt.Sprintf("%v; %v", username, hostDetail)
|
||||||
if cmd.description == "<user>@<hostname>" {
|
if cmd.description == "<user>@<hostname>" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user