From 5934fad1d781f13d04184c7585014a98a3b86958 Mon Sep 17 00:00:00 2001 From: Christopher Koch Date: Tue, 11 Dec 2018 11:39:17 -0800 Subject: Remove unused envv variable from two funcs. PiperOrigin-RevId: 225041520 Change-Id: Ib1afc693e592d308d60db82022c5b7743fd3c646 --- pkg/sentry/loader/interpreter.go | 2 +- pkg/sentry/loader/loader.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/sentry/loader/interpreter.go b/pkg/sentry/loader/interpreter.go index 06a3c7156..35b83654d 100644 --- a/pkg/sentry/loader/interpreter.go +++ b/pkg/sentry/loader/interpreter.go @@ -37,7 +37,7 @@ const ( ) // parseInterpreterScript returns the interpreter path and argv. -func parseInterpreterScript(ctx context.Context, filename string, f *fs.File, argv, envv []string) (newpath string, newargv []string, err error) { +func parseInterpreterScript(ctx context.Context, filename string, f *fs.File, argv []string) (newpath string, newargv []string, err error) { line := make([]byte, interpMaxLineLength) n, err := readFull(ctx, f, usermem.BytesIOSequence(line), 0) // Short read is OK. diff --git a/pkg/sentry/loader/loader.go b/pkg/sentry/loader/loader.go index 69a090844..e955502e3 100644 --- a/pkg/sentry/loader/loader.go +++ b/pkg/sentry/loader/loader.go @@ -136,7 +136,7 @@ const ( // * arch.Context matching the binary arch // * fs.Dirent of the binary file // * Possibly updated argv -func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespace, root, wd *fs.Dirent, remainingTraversals *uint, fs *cpuid.FeatureSet, filename string, argv, envv []string) (loadedELF, arch.Context, *fs.Dirent, []string, error) { +func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespace, root, wd *fs.Dirent, remainingTraversals *uint, fs *cpuid.FeatureSet, filename string, argv []string) (loadedELF, arch.Context, *fs.Dirent, []string, error) { for i := 0; i < maxLoaderAttempts; i++ { d, f, err := openPath(ctx, mounts, root, wd, remainingTraversals, filename) if err != nil { @@ -172,7 +172,7 @@ func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespac d.IncRef() return loaded, ac, d, argv, err case bytes.Equal(hdr[:2], []byte(interpreterScriptMagic)): - newpath, newargv, err := parseInterpreterScript(ctx, filename, f, argv, envv) + newpath, newargv, err := parseInterpreterScript(ctx, filename, f, argv) if err != nil { ctx.Infof("Error loading interpreter script: %v", err) return loadedELF{}, nil, nil, nil, err @@ -198,7 +198,7 @@ func loadPath(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespac // * Load is called on the Task goroutine. func Load(ctx context.Context, m *mm.MemoryManager, mounts *fs.MountNamespace, root, wd *fs.Dirent, maxTraversals *uint, fs *cpuid.FeatureSet, filename string, argv, envv []string, extraAuxv []arch.AuxEntry, vdso *VDSO) (abi.OS, arch.Context, string, error) { // Load the binary itself. - loaded, ac, d, argv, err := loadPath(ctx, m, mounts, root, wd, maxTraversals, fs, filename, argv, envv) + loaded, ac, d, argv, err := loadPath(ctx, m, mounts, root, wd, maxTraversals, fs, filename, argv) if err != nil { ctx.Infof("Failed to load %s: %v", filename, err) return 0, nil, "", err -- cgit v1.2.3