lib/modules: Pass credentials irrespective of "ExecProtocol".
Child processes do not need to support the ExecProtocol in order
to utilize credentials managed by the shell.
Change-Id: I42d1ae3a883cabf5bd8b59cfbf8579db1a44eb96
diff --git a/lib/modules/shell.go b/lib/modules/shell.go
index eec1e8e..9965aae 100644
--- a/lib/modules/shell.go
+++ b/lib/modules/shell.go
@@ -277,7 +277,7 @@
return fd, nil
}
-// NewCustomCredentials creates a new Principal for StartWithCredentials.
+// NewCustomCredentials creates a new Principal for StartWithOpts.
// Returns nil if the shell is not managing principals.
func (sh *Shell) NewCustomCredentials() (cred *CustomCredentials, err error) {
// Create child principal.
@@ -505,12 +505,10 @@
}
var p *os.File
- if opts.ExecProtocol {
- if opts.Credentials != nil {
- p, err = opts.Credentials.File()
- if err != nil {
- return nil, err
- }
+ if opts.Credentials != nil {
+ p, err = opts.Credentials.File()
+ if err != nil {
+ return nil, err
}
}