Skip to content

Commit

Permalink
Export the RunAsUser func
Browse files Browse the repository at this point in the history
  • Loading branch information
Micah-Kolide committed Mar 14, 2024
1 parent 1b9bcda commit b8bc458
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ee/tables/homebrew/upgradeable.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (t *Table) generate(ctx context.Context, queryContext table.QueryContext) (

for _, uid := range uids {
for _, dataQuery := range tablehelpers.GetConstraints(queryContext, "query", tablehelpers.WithDefaults("*")) {
output, err := tablehelpers.runCmdAsUser(cmd, uid)
output, err := tablehelpers.RunCmdAsUser(cmd, uid)
if err != nil {
t.slogger.Log(ctx, slog.LevelInfo, "failure querying user brew installed packages", "err", err, "target_uid", uid)
continue
Expand Down
2 changes: 1 addition & 1 deletion ee/tables/nix_env/upgradeable/upgradeable.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func (t *Table) generate(ctx context.Context, queryContext table.QueryContext) (

for _, uid := range uids {
for _, dataQuery := range tablehelpers.GetConstraints(queryContext, "query", tablehelpers.WithDefaults("*")) {
output, err := tablehelpers.runCmdAsUser(cmd, uid)
output, err := tablehelpers.RunCmdAsUser(cmd, uid)
if err != nil {
t.slogger.Log(ctx, slog.LevelInfo, "failure querying user installed packages", "err", err, "target_uid", uid)
continue
Expand Down
2 changes: 1 addition & 1 deletion ee/tables/tablehelpers/run_as_user.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"syscall"
)

func runCmdAsUser(cmd *exec.Cmd, uid string) ([]byte, error) {
func RunCmdAsUser(cmd *exec.Cmd, uid string) ([]byte, error) {
currentUser, err := user.Current()
if err != nil {
return nil, fmt.Errorf("getting current user: %w", err)
Expand Down

0 comments on commit b8bc458

Please sign in to comment.