Skip to content

Commit

Permalink
change variable name to something better
Browse files Browse the repository at this point in the history
Signed-off-by: amghazanfari <[email protected]>
  • Loading branch information
amghazanfari committed Sep 19, 2024
1 parent 59123be commit b65caff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ func getProcess(context *cli.Context, bundle string) (*specs.Process, error) {
}
// Override the user, if passed.
if user := context.String("user"); user != "" {
uidString, gidString, doesHaveGid := strings.Cut(user, ":")
if doesHaveGid {
gid, err := strconv.Atoi(gidString)
uids, gids, ok := strings.Cut(user, ":")
if ok {
gid, err := strconv.Atoi(gids)
if err != nil {
return nil, fmt.Errorf("bad gid: %w", err)
}
p.User.GID = uint32(gid)
}
uid, err := strconv.Atoi(uidString)
uid, err := strconv.Atoi(uids)
if err != nil {
return nil, fmt.Errorf("bad uid: %w", err)
}
Expand Down

0 comments on commit b65caff

Please sign in to comment.