Skip to content

Commit b834658

Browse files
committed
setenv
1 parent 5ac6706 commit b834658

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

jail.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212

1313
type Commander interface {
1414
Open() error
15+
SetEnv(key string, value string)
1516
Command(command []string) *exec.Cmd
1617
Close() error
1718
}
@@ -83,4 +84,4 @@ func (j *Jail) Close() error {
8384

8485
// Close command executor
8586
return j.commandExecutor.Close()
86-
}
87+
}

namespace/linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ func (l *Linux) Open() error {
115115
return nil
116116
}
117117

118+
// SetEnv sets an environment variable for commands run in the namespace
119+
func (l *Linux) SetEnv(key string, value string) {
120+
121+
}
122+
118123
// Command returns an exec.Cmd configured to run within the network namespace
119124
func (l *Linux) Command(command []string) *exec.Cmd {
120125
l.logger.Debug("Command called", "command", command)

namespace/macos.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@ func (m *MacOSNetJail) Open() error {
121121
return nil
122122
}
123123

124+
// SetEnv sets an environment variable for commands run in the namespace
125+
func (m *MacOSNetJail) SetEnv(key string, value string) {
126+
127+
}
128+
124129
// Execute runs the command with the network jail group membership
125130
func (m *MacOSNetJail) Command(command []string) *exec.Cmd {
126131
m.logger.Debug("Command called", "command", command)

0 commit comments

Comments
 (0)