Skip to content

Commit

Permalink
interp: set EUID
Browse files Browse the repository at this point in the history
Set EUID variable analog to UID.

Signed-off-by: Jonathon Anderson <janderson@ciq.co>
  • Loading branch information
anderbubble committed Dec 16, 2022
1 parent 5800023 commit bfe6aab
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [3.6.1] - 2023-??-??

- **interp**
- Set `EUID` just like `UID`

## [3.6.0] - 2022-12-11

This release drops support for Go 1.17 and includes many features and fixes.
Expand Down
7 changes: 7 additions & 0 deletions interp/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,13 @@ func (r *Runner) Reset() {
Str: strconv.Itoa(os.Getuid()),
})
}
if !r.writeEnv.Get("EUID").IsSet() {
r.setVar("EUID", nil, expand.Variable{
Kind: expand.String,
ReadOnly: true,
Str: strconv.Itoa(os.Getuid()),
})
}
if !r.writeEnv.Get("GID").IsSet() {
r.setVar("GID", nil, expand.Variable{
Kind: expand.String,
Expand Down

0 comments on commit bfe6aab

Please sign in to comment.