You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: cni_exec.go
    path of file: ./repos/sealer/vendor/github.com/containers/common/libnetwork/cni
    
    the code of the file until where you have to start completion: // Copyright 2016 CNI authors
// Copyright 2021 Podman authors
//
// This code has been originally copied from github.com/containernetworking/cni
// but has been changed to better fit the Podman use case.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build linux || freebsd
// +build linux freebsd

package cni

import (
	"bytes"
	"context"
	"encoding/json"
	"fmt"
	"os/exec"
	"path/filepath"

	"github.com/containernetw
    
func (e *cniExec) ExecPlugin(ctx context.Context, pluginPath string, stdinData []byte, environ []string) ([]byte, error) {
	stdout := &bytes.Buffer{}
	stderr := &bytes.Buffer{}
	c := exec.CommandContext(ctx, pluginPath)
	c.Env = environ
	c.Stdin = bytes.NewBuffer(stdinData)
	c.Stdout = stdout
	c.Stderr = stderr

	// The dnsname plugin tries to use XDG_RUNTIME_DIR to store files.
	// podman run will have XDG_RUNTIME_DIR set and thus the cni plugin can use
	// it. The problem is that XDG_RUNTIME_DIR is unset for the conmon process
	// for rootful users. This causes issues since the cleanup process is spawned
	// by conmon and thus not have XDG_RUNTIME_DIR set to same value as podman run.
	// Because of it dnsname will not find the config files and cannot correctly cleanup.
	// To fix this we should also unset XDG_RUNTIME_DIR for the cni plugins as rootful.
	if !unshare.IsRootless() {
		c.Env = append(c.Env, "XDG_RUNTIME_DIR=")
	}

	err := c.Run()
	if err != nil {
		return nil, annotatePluginError(err, pluginPath, stdout.Bytes(), stderr.Bytes())
	}
	return stdout.Bytes(), nil
}