diff --git a/.travis.yml b/.travis.yml index ab3c2d5996..8fd2c16ce1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ services: - docker go: - - 1.8rc2 + - 1.8 matrix: allow_failures: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b2012eb45..2bf4a2df9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ ## Next (Unreleased) +DEPRECATIONS/CHANGES: + + * List Operations Always Use Trailing Slash: Any list operation, whether via + the `GET` or `LIST` HTTP verb, will now internally canonicalize the path to + have a trailing slash. This makes policy writing more predictable, as it + means clients will no longer work or fail based on which client they're + using or which HTTP verb they're using. However, it also means that policies + allowing `list` capability must be carefully checked to ensure that they + contain a trailing slash; some policies may need to be split into multiple + stanzas to accommodate. + IMPROVEMENTS: * auth/ldap: Use the value of the `LOGNAME` or `USER` env vars for the @@ -7,14 +18,20 @@ IMPROVEMENTS: [GH-2154] * audit: Support adding a configurable prefix (such as `@cee`) before each line [GH-2359] + * core: Canonicalize list operations to use a trailing slash [GH-2390] + * secret/pki: O (Organization) values can now be set to role-defined values + for issued/signed certificates [GH-2369] BUG FIXES: + * audit: When auditing headers use case-insensitive comparisons [GH-2362] * auth/aws-ec2: Return role period in seconds and not nanoseconds [GH-2374] * auth/okta: Fix panic if user had no local groups and/or policies set [GH-2367] * command/server: Fix parsing of redirect address when port is not mentioned [GH-2354] + * physical/postgresql: Fix listing returning incorrect results if there were + multiple levels of children [GH-2393] ## 0.6.5 (February 7th, 2017) diff --git a/Makefile b/Makefile index f36e9dc48b..732ba93a61 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,11 @@ dev-dynamic: generate test: generate CGO_ENABLED=0 VAULT_TOKEN= VAULT_ACC= go test -tags='$(BUILD_TAGS)' $(TEST) $(TESTARGS) -timeout=10m -parallel=4 +testcompile: generate + @for pkg in $(TEST) ; do \ + go test -v -c -tags='$(BUILD_TAGS)' $$pkg -parallel=4 ; \ + done + # testacc runs acceptance tests testacc: generate @if [ "$(TEST)" = "./..." ]; then \ diff --git a/README.md b/README.md index c7c46fca45..bf40cb75f2 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,9 @@ All documentation is available on the [Vault website](https://www.vaultproject.i Developing Vault -------------------- -If you wish to work on Vault itself or any of its built-in systems, -you'll first need [Go](https://www.golang.org) installed on your -machine (version 1.8+ is *required*). +If you wish to work on Vault itself or any of its built-in systems, you'll +first need [Go](https://www.golang.org) installed on your machine (version 1.8+ +is *required*). For local dev first make sure Go is properly installed, including setting up a [GOPATH](https://golang.org/doc/code.html#GOPATH). Next, clone this repository diff --git a/api/sys_audit.go b/api/sys_audit.go index 1ffdef880f..89f2141664 100644 --- a/api/sys_audit.go +++ b/api/sys_audit.go @@ -3,6 +3,7 @@ package api import ( "fmt" + "github.com/fatih/structs" "github.com/mitchellh/mapstructure" ) @@ -71,13 +72,18 @@ func (c *Sys) ListAudit() (map[string]*Audit, error) { return mounts, nil } +// DEPRECATED: Use EnableAuditWithOptions instead func (c *Sys) EnableAudit( path string, auditType string, desc string, opts map[string]string) error { - body := map[string]interface{}{ - "type": auditType, - "description": desc, - "options": opts, - } + return c.EnableAuditWithOptions(path, &EnableAuditOptions{ + Type: auditType, + Description: desc, + Options: opts, + }) +} + +func (c *Sys) EnableAuditWithOptions(path string, options *EnableAuditOptions) error { + body := structs.Map(options) r := c.c.NewRequest("PUT", fmt.Sprintf("/v1/sys/audit/%s", path)) if err := r.SetJSONBody(body); err != nil { @@ -106,9 +112,17 @@ func (c *Sys) DisableAudit(path string) error { // individually documented because the map almost directly to the raw HTTP API // documentation. Please refer to that documentation for more details. +type EnableAuditOptions struct { + Type string `json:"type" structs:"type"` + Description string `json:"description" structs:"description"` + Options map[string]string `json:"options" structs:"options"` + Local bool `json:"local" structs:"local"` +} + type Audit struct { Path string Type string Description string Options map[string]string + Local bool } diff --git a/api/sys_auth.go b/api/sys_auth.go index 1940e84172..f9f3c8c2cc 100644 --- a/api/sys_auth.go +++ b/api/sys_auth.go @@ -3,6 +3,7 @@ package api import ( "fmt" + "github.com/fatih/structs" "github.com/mitchellh/mapstructure" ) @@ -42,11 +43,16 @@ func (c *Sys) ListAuth() (map[string]*AuthMount, error) { return mounts, nil } +// DEPRECATED: Use EnableAuthWithOptions instead func (c *Sys) EnableAuth(path, authType, desc string) error { - body := map[string]string{ - "type": authType, - "description": desc, - } + return c.EnableAuthWithOptions(path, &EnableAuthOptions{ + Type: authType, + Description: desc, + }) +} + +func (c *Sys) EnableAuthWithOptions(path string, options *EnableAuthOptions) error { + body := structs.Map(options) r := c.c.NewRequest("POST", fmt.Sprintf("/v1/sys/auth/%s", path)) if err := r.SetJSONBody(body); err != nil { @@ -75,10 +81,17 @@ func (c *Sys) DisableAuth(path string) error { // individually documentd because the map almost directly to the raw HTTP API // documentation. Please refer to that documentation for more details. +type EnableAuthOptions struct { + Type string `json:"type" structs:"type"` + Description string `json:"description" structs:"description"` + Local bool `json:"local" structs:"local"` +} + type AuthMount struct { Type string `json:"type" structs:"type" mapstructure:"type"` Description string `json:"description" structs:"description" mapstructure:"description"` Config AuthConfigOutput `json:"config" structs:"config" mapstructure:"config"` + Local bool `json:"local" structs:"local" mapstructure:"local"` } type AuthConfigOutput struct { diff --git a/api/sys_mounts.go b/api/sys_mounts.go index ca5e42707a..768e09fd61 100644 --- a/api/sys_mounts.go +++ b/api/sys_mounts.go @@ -123,6 +123,7 @@ type MountInput struct { Type string `json:"type" structs:"type"` Description string `json:"description" structs:"description"` Config MountConfigInput `json:"config" structs:"config"` + Local bool `json:"local" structs:"local"` } type MountConfigInput struct { @@ -134,6 +135,7 @@ type MountOutput struct { Type string `json:"type" structs:"type"` Description string `json:"description" structs:"description"` Config MountConfigOutput `json:"config" structs:"config"` + Local bool `json:"local" structs:"local"` } type MountConfigOutput struct { diff --git a/audit/format.go b/audit/format.go index 4eb4f22824..86b00f8a25 100644 --- a/audit/format.go +++ b/audit/format.go @@ -27,7 +27,11 @@ func (f *AuditFormatter) FormatRequest( config FormatterConfig, auth *logical.Auth, req *logical.Request, - err error) error { + inErr error) error { + + if req == nil { + return fmt.Errorf("request to request-audit a nil request") + } if w == nil { return fmt.Errorf("writer for audit request is nil") @@ -49,22 +53,26 @@ func (f *AuditFormatter) FormatRequest( }() } - // Copy the structures - cp, err := copystructure.Copy(auth) - if err != nil { - return err + // Copy the auth structure + if auth != nil { + cp, err := copystructure.Copy(auth) + if err != nil { + return err + } + auth = cp.(*logical.Auth) } - auth = cp.(*logical.Auth) - cp, err = copystructure.Copy(req) + cp, err := copystructure.Copy(req) if err != nil { return err } req = cp.(*logical.Request) // Hash any sensitive information - if err := Hash(config.Salt, auth); err != nil { - return err + if auth != nil { + if err := Hash(config.Salt, auth); err != nil { + return err + } } // Cache and restore accessor in the request @@ -85,8 +93,8 @@ func (f *AuditFormatter) FormatRequest( auth = new(logical.Auth) } var errString string - if err != nil { - errString = err.Error() + if inErr != nil { + errString = inErr.Error() } reqEntry := &AuditRequestEntry{ @@ -107,6 +115,7 @@ func (f *AuditFormatter) FormatRequest( Path: req.Path, Data: req.Data, RemoteAddr: getRemoteAddr(req), + ReplicationCluster: req.ReplicationCluster, Headers: req.Headers, }, } @@ -128,7 +137,11 @@ func (f *AuditFormatter) FormatResponse( auth *logical.Auth, req *logical.Request, resp *logical.Response, - err error) error { + inErr error) error { + + if req == nil { + return fmt.Errorf("request to response-audit a nil request") + } if w == nil { return fmt.Errorf("writer for audit request is nil") @@ -150,37 +163,43 @@ func (f *AuditFormatter) FormatResponse( }() } - // Copy the structure - cp, err := copystructure.Copy(auth) - if err != nil { - return err + // Copy the auth structure + if auth != nil { + cp, err := copystructure.Copy(auth) + if err != nil { + return err + } + auth = cp.(*logical.Auth) } - auth = cp.(*logical.Auth) - cp, err = copystructure.Copy(req) + cp, err := copystructure.Copy(req) if err != nil { return err } req = cp.(*logical.Request) - cp, err = copystructure.Copy(resp) - if err != nil { - return err + if resp != nil { + cp, err := copystructure.Copy(resp) + if err != nil { + return err + } + resp = cp.(*logical.Response) } - resp = cp.(*logical.Response) // Hash any sensitive information // Cache and restore accessor in the auth - var accessor, wrappedAccessor string - if !config.HMACAccessor && auth != nil && auth.Accessor != "" { - accessor = auth.Accessor - } - if err := Hash(config.Salt, auth); err != nil { - return err - } - if accessor != "" { - auth.Accessor = accessor + if auth != nil { + var accessor string + if !config.HMACAccessor && auth.Accessor != "" { + accessor = auth.Accessor + } + if err := Hash(config.Salt, auth); err != nil { + return err + } + if accessor != "" { + auth.Accessor = accessor + } } // Cache and restore accessor in the request @@ -196,21 +215,23 @@ func (f *AuditFormatter) FormatResponse( } // Cache and restore accessor in the response - accessor = "" - if !config.HMACAccessor && resp != nil && resp.Auth != nil && resp.Auth.Accessor != "" { - accessor = resp.Auth.Accessor - } - if !config.HMACAccessor && resp != nil && resp.WrapInfo != nil && resp.WrapInfo.WrappedAccessor != "" { - wrappedAccessor = resp.WrapInfo.WrappedAccessor - } - if err := Hash(config.Salt, resp); err != nil { - return err - } - if accessor != "" { - resp.Auth.Accessor = accessor - } - if wrappedAccessor != "" { - resp.WrapInfo.WrappedAccessor = wrappedAccessor + if resp != nil { + var accessor, wrappedAccessor string + if !config.HMACAccessor && resp != nil && resp.Auth != nil && resp.Auth.Accessor != "" { + accessor = resp.Auth.Accessor + } + if !config.HMACAccessor && resp != nil && resp.WrapInfo != nil && resp.WrapInfo.WrappedAccessor != "" { + wrappedAccessor = resp.WrapInfo.WrappedAccessor + } + if err := Hash(config.Salt, resp); err != nil { + return err + } + if accessor != "" { + resp.Auth.Accessor = accessor + } + if wrappedAccessor != "" { + resp.WrapInfo.WrappedAccessor = wrappedAccessor + } } } @@ -222,8 +243,8 @@ func (f *AuditFormatter) FormatResponse( resp = new(logical.Response) } var errString string - if err != nil { - errString = err.Error() + if inErr != nil { + errString = inErr.Error() } var respAuth *AuditAuth @@ -276,6 +297,7 @@ func (f *AuditFormatter) FormatResponse( Path: req.Path, Data: req.Data, RemoteAddr: getRemoteAddr(req), + ReplicationCluster: req.ReplicationCluster, Headers: req.Headers, }, @@ -312,14 +334,15 @@ type AuditRequestEntry struct { type AuditResponseEntry struct { Time string `json:"time,omitempty"` Type string `json:"type"` - Error string `json:"error"` Auth AuditAuth `json:"auth"` Request AuditRequest `json:"request"` Response AuditResponse `json:"response"` + Error string `json:"error"` } type AuditRequest struct { ID string `json:"id"` + ReplicationCluster string `json:"replication_cluster,omitempty"` Operation logical.Operation `json:"operation"` ClientToken string `json:"client_token"` ClientTokenAccessor string `json:"client_token_accessor"` diff --git a/audit/format_test.go b/audit/format_test.go new file mode 100644 index 0000000000..6a6425b3a4 --- /dev/null +++ b/audit/format_test.go @@ -0,0 +1,55 @@ +package audit + +import ( + "io" + "io/ioutil" + "testing" + + "github.com/hashicorp/vault/helper/salt" + "github.com/hashicorp/vault/logical" +) + +type noopFormatWriter struct { +} + +func (n *noopFormatWriter) WriteRequest(_ io.Writer, _ *AuditRequestEntry) error { + return nil +} + +func (n *noopFormatWriter) WriteResponse(_ io.Writer, _ *AuditResponseEntry) error { + return nil +} + +func TestFormatRequestErrors(t *testing.T) { + salter, _ := salt.NewSalt(nil, nil) + config := FormatterConfig{ + Salt: salter, + } + formatter := AuditFormatter{ + AuditFormatWriter: &noopFormatWriter{}, + } + + if err := formatter.FormatRequest(ioutil.Discard, config, nil, nil, nil); err == nil { + t.Fatal("expected error due to nil request") + } + if err := formatter.FormatRequest(nil, config, nil, &logical.Request{}, nil); err == nil { + t.Fatal("expected error due to nil writer") + } +} + +func TestFormatResponseErrors(t *testing.T) { + salter, _ := salt.NewSalt(nil, nil) + config := FormatterConfig{ + Salt: salter, + } + formatter := AuditFormatter{ + AuditFormatWriter: &noopFormatWriter{}, + } + + if err := formatter.FormatResponse(ioutil.Discard, config, nil, nil, nil, nil); err == nil { + t.Fatal("expected error due to nil request") + } + if err := formatter.FormatResponse(nil, config, nil, &logical.Request{}, nil, nil); err == nil { + t.Fatal("expected error due to nil writer") + } +} diff --git a/builtin/audit/file/backend.go b/builtin/audit/file/backend.go index 359d9242ef..cc2cfe5540 100644 --- a/builtin/audit/file/backend.go +++ b/builtin/audit/file/backend.go @@ -157,10 +157,15 @@ func (b *Backend) open() error { return err } - // Change the file mode in case the log file already existed - err = os.Chmod(b.path, b.mode) - if err != nil { - return err + // Change the file mode in case the log file already existed. We special + // case /dev/null since we can't chmod it + switch b.path { + case "/dev/null": + default: + err = os.Chmod(b.path, b.mode) + if err != nil { + return err + } } return nil diff --git a/builtin/credential/app-id/backend.go b/builtin/credential/app-id/backend.go index f0bd321487..76d9a6e996 100644 --- a/builtin/credential/app-id/backend.go +++ b/builtin/credential/app-id/backend.go @@ -17,20 +17,10 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) { } func Backend(conf *logical.BackendConfig) (*framework.Backend, error) { - // Initialize the salt - salt, err := salt.NewSalt(conf.StorageView, &salt.Config{ - HashFunc: salt.SHA1Hash, - }) - if err != nil { - return nil, err - } - var b backend - b.Salt = salt b.MapAppId = &framework.PolicyMap{ PathMap: framework.PathMap{ Name: "app-id", - Salt: salt, Schema: map[string]*framework.FieldSchema{ "display_name": &framework.FieldSchema{ Type: framework.TypeString, @@ -48,7 +38,6 @@ func Backend(conf *logical.BackendConfig) (*framework.Backend, error) { b.MapUserId = &framework.PathMap{ Name: "user-id", - Salt: salt, Schema: map[string]*framework.FieldSchema{ "cidr_block": &framework.FieldSchema{ Type: framework.TypeString, @@ -81,17 +70,11 @@ func Backend(conf *logical.BackendConfig) (*framework.Backend, error) { ), AuthRenew: b.pathLoginRenew, + + Init: b.initialize, } - // Since the salt is new in 0.2, we need to handle this by migrating - // any existing keys to use the salt. We can deprecate this eventually, - // but for now we want a smooth upgrade experience by automatically - // upgrading to use salting. - if salt.DidGenerate() { - if err := b.upgradeToSalted(conf.StorageView); err != nil { - return nil, err - } - } + b.view = conf.StorageView return b.Backend, nil } @@ -100,10 +83,36 @@ type backend struct { *framework.Backend Salt *salt.Salt + view logical.Storage MapAppId *framework.PolicyMap MapUserId *framework.PathMap } +func (b *backend) initialize() error { + salt, err := salt.NewSalt(b.view, &salt.Config{ + HashFunc: salt.SHA1Hash, + }) + if err != nil { + return err + } + b.Salt = salt + + b.MapAppId.Salt = salt + b.MapUserId.Salt = salt + + // Since the salt is new in 0.2, we need to handle this by migrating + // any existing keys to use the salt. We can deprecate this eventually, + // but for now we want a smooth upgrade experience by automatically + // upgrading to use salting. + if salt.DidGenerate() { + if err := b.upgradeToSalted(b.view); err != nil { + return err + } + } + + return nil +} + // upgradeToSalted is used to upgrade the non-salted keys prior to // Vault 0.2 to be salted. This is done on mount time and is only // done once. It can be deprecated eventually, but should be around diff --git a/builtin/credential/app-id/backend_test.go b/builtin/credential/app-id/backend_test.go index 55bb3e9d85..2960e4060e 100644 --- a/builtin/credential/app-id/backend_test.go +++ b/builtin/credential/app-id/backend_test.go @@ -72,6 +72,10 @@ func TestBackend_upgradeToSalted(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + err = backend.Initialize() + if err != nil { + t.Fatalf("err: %v", err) + } // Check the keys have been upgraded out, err := inm.Get("struct/map/app-id/foo") diff --git a/builtin/credential/approle/backend.go b/builtin/credential/approle/backend.go index df10e9d1bb..d40b75ebff 100644 --- a/builtin/credential/approle/backend.go +++ b/builtin/credential/approle/backend.go @@ -17,6 +17,9 @@ type backend struct { // by this backend. salt *salt.Salt + // The view to use when creating the salt + view logical.Storage + // Guard to clean-up the expired SecretID entries tidySecretIDCASGuard uint32 @@ -57,18 +60,9 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) { } func Backend(conf *logical.BackendConfig) (*backend, error) { - // Initialize the salt - salt, err := salt.NewSalt(conf.StorageView, &salt.Config{ - HashFunc: salt.SHA256Hash, - }) - if err != nil { - return nil, err - } - // Create a backend object b := &backend{ - // Set the salt object for the backend - salt: salt, + view: conf.StorageView, // Create the map of locks to modify the registered roles roleLocksMap: make(map[string]*sync.RWMutex, 257), @@ -83,6 +77,8 @@ func Backend(conf *logical.BackendConfig) (*backend, error) { secretIDAccessorLocksMap: make(map[string]*sync.RWMutex, 257), } + var err error + // Create 256 locks each for managing RoleID and SecretIDs. This will avoid // a superfluous number of locks directly proportional to the number of RoleID // and SecretIDs. These locks can be accessed by indexing based on the first two @@ -129,10 +125,22 @@ func Backend(conf *logical.BackendConfig) (*backend, error) { pathTidySecretID(b), }, ), + Init: b.initialize, } return b, nil } +func (b *backend) initialize() error { + salt, err := salt.NewSalt(b.view, &salt.Config{ + HashFunc: salt.SHA256Hash, + }) + if err != nil { + return err + } + b.salt = salt + return nil +} + // periodicFunc of the backend will be invoked once a minute by the RollbackManager. // RoleRole backend utilizes this function to delete expired SecretID entries. // This could mean that the SecretID may live in the backend upto 1 min after its diff --git a/builtin/credential/approle/backend_test.go b/builtin/credential/approle/backend_test.go index 2a3e3773ec..e49cf48f8b 100644 --- a/builtin/credential/approle/backend_test.go +++ b/builtin/credential/approle/backend_test.go @@ -21,5 +21,9 @@ func createBackendWithStorage(t *testing.T) (*backend, logical.Storage) { if err != nil { t.Fatal(err) } + err = b.Initialize() + if err != nil { + t.Fatal(err) + } return b, config.StorageView } diff --git a/builtin/credential/approle/validation.go b/builtin/credential/approle/validation.go index 7582b6daa9..b4d3af154f 100644 --- a/builtin/credential/approle/validation.go +++ b/builtin/credential/approle/validation.go @@ -143,7 +143,7 @@ func (b *backend) validateCredentials(req *logical.Request, data *framework.Fiel return nil, "", metadata, fmt.Errorf("failed to verify the CIDR restrictions set on the role: %v", err) } if !belongs { - return nil, "", metadata, fmt.Errorf("source address unauthorized through CIDR restrictions on the role") + return nil, "", metadata, fmt.Errorf("source address %q unauthorized through CIDR restrictions on the role", req.Connection.RemoteAddr) } } @@ -199,7 +199,7 @@ func (b *backend) validateBindSecretID(req *logical.Request, roleName, secretID, } if belongs, err := cidrutil.IPBelongsToCIDRBlocksSlice(req.Connection.RemoteAddr, result.CIDRList); !belongs || err != nil { - return false, nil, fmt.Errorf("source address unauthorized through CIDR restrictions on the secret ID: %v", err) + return false, nil, fmt.Errorf("source address %q unauthorized through CIDR restrictions on the secret ID: %v", req.Connection.RemoteAddr, err) } } @@ -261,7 +261,7 @@ func (b *backend) validateBindSecretID(req *logical.Request, roleName, secretID, } if belongs, err := cidrutil.IPBelongsToCIDRBlocksSlice(req.Connection.RemoteAddr, result.CIDRList); !belongs || err != nil { - return false, nil, fmt.Errorf("source address unauthorized through CIDR restrictions on the secret ID: %v", err) + return false, nil, fmt.Errorf("source address %q unauthorized through CIDR restrictions on the secret ID: %v", req.Connection.RemoteAddr, err) } } diff --git a/builtin/credential/aws-ec2/backend.go b/builtin/credential/aws-ec2/backend.go index f24f3bfe88..33ef4a80ce 100644 --- a/builtin/credential/aws-ec2/backend.go +++ b/builtin/credential/aws-ec2/backend.go @@ -23,6 +23,9 @@ type backend struct { *framework.Backend Salt *salt.Salt + // Used during initialization to set the salt + view logical.Storage + // Lock to make changes to any of the backend's configuration endpoints. configMutex sync.RWMutex @@ -59,18 +62,11 @@ type backend struct { } func Backend(conf *logical.BackendConfig) (*backend, error) { - salt, err := salt.NewSalt(conf.StorageView, &salt.Config{ - HashFunc: salt.SHA256Hash, - }) - if err != nil { - return nil, err - } - b := &backend{ // Setting the periodic func to be run once in an hour. // If there is a real need, this can be made configurable. tidyCooldownPeriod: time.Hour, - Salt: salt, + view: conf.StorageView, EC2ClientsMap: make(map[string]map[string]*ec2.EC2), IAMClientsMap: make(map[string]map[string]*iam.IAM), } @@ -83,6 +79,9 @@ func Backend(conf *logical.BackendConfig) (*backend, error) { Unauthenticated: []string{ "login", }, + LocalStorage: []string{ + "whitelist/identity/", + }, }, Paths: []*framework.Path{ pathLogin(b), @@ -104,11 +103,26 @@ func Backend(conf *logical.BackendConfig) (*backend, error) { pathIdentityWhitelist(b), pathTidyIdentityWhitelist(b), }, + + Invalidate: b.invalidate, + + Init: b.initialize, } return b, nil } +func (b *backend) initialize() error { + salt, err := salt.NewSalt(b.view, &salt.Config{ + HashFunc: salt.SHA256Hash, + }) + if err != nil { + return err + } + b.Salt = salt + return nil +} + // periodicFunc performs the tasks that the backend wishes to do periodically. // Currently this will be triggered once in a minute by the RollbackManager. // @@ -169,6 +183,16 @@ func (b *backend) periodicFunc(req *logical.Request) error { return nil } +func (b *backend) invalidate(key string) { + switch key { + case "config/client": + b.configMutex.Lock() + defer b.configMutex.Unlock() + b.flushCachedEC2Clients() + b.flushCachedIAMClients() + } +} + const backendHelp = ` aws-ec2 auth backend takes in PKCS#7 signature of an AWS EC2 instance and a client created nonce to authenticates the EC2 instance with Vault. diff --git a/builtin/credential/cert/backend.go b/builtin/credential/cert/backend.go index a07ec33671..088cc41ab1 100644 --- a/builtin/credential/cert/backend.go +++ b/builtin/credential/cert/backend.go @@ -1,6 +1,7 @@ package cert import ( + "strings" "sync" "github.com/hashicorp/vault/logical" @@ -13,7 +14,7 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) { if err != nil { return b, err } - return b, b.populateCRLs(conf.StorageView) + return b, nil } func Backend() *backend { @@ -36,9 +37,10 @@ func Backend() *backend { }), AuthRenew: b.pathLoginRenew, + + Invalidate: b.invalidate, } - b.crls = map[string]CRLInfo{} b.crlUpdateMutex = &sync.RWMutex{} return &b @@ -52,6 +54,15 @@ type backend struct { crlUpdateMutex *sync.RWMutex } +func (b *backend) invalidate(key string) { + switch { + case strings.HasPrefix(key, "crls/"): + b.crlUpdateMutex.Lock() + defer b.crlUpdateMutex.Unlock() + b.crls = nil + } +} + const backendHelp = ` The "cert" credential provider allows authentication using TLS client certificates. A client connects to Vault and uses diff --git a/builtin/credential/cert/path_crls.go b/builtin/credential/cert/path_crls.go index f45effbdd4..234b93adc7 100644 --- a/builtin/credential/cert/path_crls.go +++ b/builtin/credential/cert/path_crls.go @@ -45,6 +45,12 @@ func (b *backend) populateCRLs(storage logical.Storage) error { b.crlUpdateMutex.Lock() defer b.crlUpdateMutex.Unlock() + if b.crls != nil { + return nil + } + + b.crls = map[string]CRLInfo{} + keys, err := storage.List("crls/") if err != nil { return fmt.Errorf("error listing CRLs: %v", err) @@ -56,6 +62,7 @@ func (b *backend) populateCRLs(storage logical.Storage) error { for _, key := range keys { entry, err := storage.Get("crls/" + key) if err != nil { + b.crls = nil return fmt.Errorf("error loading CRL %s: %v", key, err) } if entry == nil { @@ -64,6 +71,7 @@ func (b *backend) populateCRLs(storage logical.Storage) error { var crlInfo CRLInfo err = entry.DecodeJSON(&crlInfo) if err != nil { + b.crls = nil return fmt.Errorf("error decoding CRL %s: %v", key, err) } b.crls[key] = crlInfo @@ -121,6 +129,10 @@ func (b *backend) pathCRLDelete( return logical.ErrorResponse(`"name" parameter cannot be empty`), nil } + if err := b.populateCRLs(req.Storage); err != nil { + return nil, err + } + b.crlUpdateMutex.Lock() defer b.crlUpdateMutex.Unlock() @@ -131,8 +143,7 @@ func (b *backend) pathCRLDelete( )), nil } - err := req.Storage.Delete("crls/" + name) - if err != nil { + if err := req.Storage.Delete("crls/" + name); err != nil { return logical.ErrorResponse(fmt.Sprintf( "error deleting crl %s: %v", name, err), ), nil @@ -150,6 +161,10 @@ func (b *backend) pathCRLRead( return logical.ErrorResponse(`"name" parameter must be set`), nil } + if err := b.populateCRLs(req.Storage); err != nil { + return nil, err + } + b.crlUpdateMutex.RLock() defer b.crlUpdateMutex.RUnlock() @@ -185,6 +200,10 @@ func (b *backend) pathCRLWrite( return logical.ErrorResponse("parsed CRL is nil"), nil } + if err := b.populateCRLs(req.Storage); err != nil { + return nil, err + } + b.crlUpdateMutex.Lock() defer b.crlUpdateMutex.Unlock() diff --git a/builtin/logical/aws/backend.go b/builtin/logical/aws/backend.go index 6c9ced381b..246e25cf24 100644 --- a/builtin/logical/aws/backend.go +++ b/builtin/logical/aws/backend.go @@ -17,6 +17,12 @@ func Backend() *backend { b.Backend = &framework.Backend{ Help: strings.TrimSpace(backendHelp), + PathsSpecial: &logical.Paths{ + LocalStorage: []string{ + framework.WALPrefix, + }, + }, + Paths: []*framework.Path{ pathConfigRoot(), pathConfigLease(&b), diff --git a/builtin/logical/cassandra/backend.go b/builtin/logical/cassandra/backend.go index 81149f806d..c2e769ccb4 100644 --- a/builtin/logical/cassandra/backend.go +++ b/builtin/logical/cassandra/backend.go @@ -31,6 +31,8 @@ func Backend() *backend { secretCreds(&b), }, + Invalidate: b.invalidate, + Clean: func() { b.ResetDB(nil) }, @@ -107,6 +109,13 @@ func (b *backend) ResetDB(newSession *gocql.Session) { b.session = newSession } +func (b *backend) invalidate(key string) { + switch key { + case "config/connection": + b.ResetDB(nil) + } +} + const backendHelp = ` The Cassandra backend dynamically generates database users. diff --git a/builtin/logical/cassandra/test-fixtures/cassandra.yaml b/builtin/logical/cassandra/test-fixtures/cassandra.yaml index 54f47d34ac..5b12c8cf4e 100644 --- a/builtin/logical/cassandra/test-fixtures/cassandra.yaml +++ b/builtin/logical/cassandra/test-fixtures/cassandra.yaml @@ -421,7 +421,7 @@ seed_provider: parameters: # seeds is actually a comma-delimited list of addresses. # Ex: ",," - - seeds: "172.17.0.2" + - seeds: "172.17.0.3" # For workloads with more data than can fit in memory, Cassandra's # bottleneck will be reads that need to fetch data from @@ -572,7 +572,7 @@ ssl_storage_port: 7001 # # Setting listen_address to 0.0.0.0 is always wrong. # -listen_address: 172.17.0.2 +listen_address: 172.17.0.3 # Set listen_address OR listen_interface, not both. Interfaces must correspond # to a single address, IP aliasing is not supported. @@ -586,7 +586,7 @@ listen_address: 172.17.0.2 # Address to broadcast to other Cassandra nodes # Leaving this blank will set it to the same value as listen_address -broadcast_address: 172.17.0.2 +broadcast_address: 172.17.0.3 # When using multiple physical network interfaces, set this # to true to listen on broadcast_address in addition to @@ -668,7 +668,7 @@ rpc_port: 9160 # be set to 0.0.0.0. If left blank, this will be set to the value of # rpc_address. If rpc_address is set to 0.0.0.0, broadcast_rpc_address must # be set. -broadcast_rpc_address: 172.17.0.2 +broadcast_rpc_address: 172.17.0.3 # enable or disable keepalive on rpc/native connections rpc_keepalive: true diff --git a/builtin/logical/mongodb/backend.go b/builtin/logical/mongodb/backend.go index 8360e971da..e9f3b29add 100644 --- a/builtin/logical/mongodb/backend.go +++ b/builtin/logical/mongodb/backend.go @@ -33,6 +33,8 @@ func Backend() *framework.Backend { }, Clean: b.ResetSession, + + Invalidate: b.invalidate, } return b.Backend @@ -97,6 +99,13 @@ func (b *backend) ResetSession() { b.session = nil } +func (b *backend) invalidate(key string) { + switch key { + case "config/connection": + b.ResetSession() + } +} + // LeaseConfig returns the lease configuration func (b *backend) LeaseConfig(s logical.Storage) (*configLease, error) { entry, err := s.Get("config/lease") diff --git a/builtin/logical/mssql/backend.go b/builtin/logical/mssql/backend.go index 02597788b5..2a7689f17f 100644 --- a/builtin/logical/mssql/backend.go +++ b/builtin/logical/mssql/backend.go @@ -32,6 +32,8 @@ func Backend() *backend { secretCreds(&b), }, + Invalidate: b.invalidate, + Clean: b.ResetDB, } @@ -112,6 +114,13 @@ func (b *backend) ResetDB() { b.db = nil } +func (b *backend) invalidate(key string) { + switch key { + case "config/connection": + b.ResetDB() + } +} + // LeaseConfig returns the lease configuration func (b *backend) LeaseConfig(s logical.Storage) (*configLease, error) { entry, err := s.Get("config/lease") diff --git a/builtin/logical/mysql/backend.go b/builtin/logical/mysql/backend.go index 6bc3057340..7ae0335e1a 100644 --- a/builtin/logical/mysql/backend.go +++ b/builtin/logical/mysql/backend.go @@ -32,6 +32,8 @@ func Backend() *backend { secretCreds(&b), }, + Invalidate: b.invalidate, + Clean: b.ResetDB, } @@ -105,6 +107,13 @@ func (b *backend) ResetDB() { b.db = nil } +func (b *backend) invalidate(key string) { + switch key { + case "config/connection": + b.ResetDB() + } +} + // Lease returns the lease information func (b *backend) Lease(s logical.Storage) (*configLease, error) { entry, err := s.Get("config/lease") diff --git a/builtin/logical/pki/backend.go b/builtin/logical/pki/backend.go index 19e2cbc075..6128028346 100644 --- a/builtin/logical/pki/backend.go +++ b/builtin/logical/pki/backend.go @@ -29,6 +29,12 @@ func Backend() *backend { "crl/pem", "crl", }, + + LocalStorage: []string{ + "revoked/", + "crl", + "certs/", + }, }, Paths: []*framework.Path{ diff --git a/builtin/logical/pki/backend_test.go b/builtin/logical/pki/backend_test.go index 2669efcb44..4cb2c9acc9 100644 --- a/builtin/logical/pki/backend_test.go +++ b/builtin/logical/pki/backend_test.go @@ -1478,6 +1478,27 @@ func generateRoleSteps(t *testing.T, useCSRs bool) []logicaltest.TestStep { } } + getOrganizationCheck := func(role roleEntry) logicaltest.TestCheckFunc { + var certBundle certutil.CertBundle + return func(resp *logical.Response) error { + err := mapstructure.Decode(resp.Data, &certBundle) + if err != nil { + return err + } + parsedCertBundle, err := certBundle.ToParsedCertBundle() + if err != nil { + return fmt.Errorf("Error checking generated certificate: %s", err) + } + cert := parsedCertBundle.Certificate + + expected := strutil.ParseDedupAndSortStrings(role.Organization, ",") + if !reflect.DeepEqual(cert.Subject.Organization, expected) { + return fmt.Errorf("Error: returned certificate has Organization of %s but %s was specified in the role.", cert.Subject.Organization, expected) + } + return nil + } + } + // Returns a TestCheckFunc that performs various validity checks on the // returned certificate information, mostly within checkCertsAndPrivateKey getCnCheck := func(name string, role roleEntry, key crypto.Signer, usage x509.KeyUsage, extUsage x509.ExtKeyUsage, validity time.Duration) logicaltest.TestCheckFunc { @@ -1755,6 +1776,14 @@ func generateRoleSteps(t *testing.T, useCSRs bool) []logicaltest.TestStep { roleVals.OU = "foo,bar" addTests(getOuCheck(roleVals)) } + // Organization tests + { + roleVals.Organization = "system:masters" + addTests(getOrganizationCheck(roleVals)) + + roleVals.Organization = "foo,bar" + addTests(getOrganizationCheck(roleVals)) + } // IP SAN tests { issueVals.IPSANs = "127.0.0.1,::1" diff --git a/builtin/logical/pki/cert_util.go b/builtin/logical/pki/cert_util.go index 44dc388864..212cc57555 100644 --- a/builtin/logical/pki/cert_util.go +++ b/builtin/logical/pki/cert_util.go @@ -35,6 +35,7 @@ const ( type creationBundle struct { CommonName string OU []string + Organization []string DNSNames []string EmailAddresses []string IPAddresses []net.IP @@ -581,6 +582,14 @@ func generateCreationBundle(b *backend, } } + // Set O (organization) values if specified in the role + organization := []string{} + { + if role.Organization != "" { + organization = strutil.ParseDedupAndSortStrings(role.Organization, ",") + } + } + // Read in alternate names -- DNS and email addresses dnsNames := []string{} emailAddresses := []string{} @@ -728,6 +737,7 @@ func generateCreationBundle(b *backend, creationBundle := &creationBundle{ CommonName: cn, OU: ou, + Organization: organization, DNSNames: dnsNames, EmailAddresses: emailAddresses, IPAddresses: ipAddresses, @@ -820,6 +830,7 @@ func createCertificate(creationInfo *creationBundle) (*certutil.ParsedCertBundle subject := pkix.Name{ CommonName: creationInfo.CommonName, OrganizationalUnit: creationInfo.OU, + Organization: creationInfo.Organization, } certTemplate := &x509.Certificate{ @@ -983,6 +994,7 @@ func signCertificate(creationInfo *creationBundle, subject := pkix.Name{ CommonName: creationInfo.CommonName, OrganizationalUnit: creationInfo.OU, + Organization: creationInfo.Organization, } certTemplate := &x509.Certificate{ diff --git a/builtin/logical/pki/path_roles.go b/builtin/logical/pki/path_roles.go index 6ca59051ad..879952207e 100644 --- a/builtin/logical/pki/path_roles.go +++ b/builtin/logical/pki/path_roles.go @@ -172,6 +172,13 @@ Names. Defaults to true.`, Type: framework.TypeString, Default: "", Description: `If set, the OU (OrganizationalUnit) will be set to +this value in certificates issued by this role.`, + }, + + "organization": &framework.FieldSchema{ + Type: framework.TypeString, + Default: "", + Description: `If set, the O (Organization) will be set to this value in certificates issued by this role.`, }, }, @@ -336,6 +343,7 @@ func (b *backend) pathRoleCreate( UseCSRCommonName: data.Get("use_csr_common_name").(bool), KeyUsage: data.Get("key_usage").(string), OU: data.Get("ou").(string), + Organization: data.Get("organization").(string), } if entry.KeyType == "rsa" && entry.KeyBits < 2048 { @@ -451,6 +459,7 @@ type roleEntry struct { MaxPathLength *int `json:",omitempty" structs:",omitempty"` KeyUsage string `json:"key_usage" structs:"key_usage" mapstructure:"key_usage"` OU string `json:"ou" structs:"ou" mapstructure:"ou"` + Organization string `json:"organization" structs:"organization" mapstructure:"organization"` } const pathListRolesHelpSyn = `List the existing roles in this backend` diff --git a/builtin/logical/postgresql/backend.go b/builtin/logical/postgresql/backend.go index 8dc59aa211..6f4befd8a1 100644 --- a/builtin/logical/postgresql/backend.go +++ b/builtin/logical/postgresql/backend.go @@ -34,6 +34,8 @@ func Backend(conf *logical.BackendConfig) *backend { }, Clean: b.ResetDB, + + Invalidate: b.invalidate, } b.logger = conf.Logger @@ -126,6 +128,13 @@ func (b *backend) ResetDB() { b.db = nil } +func (b *backend) invalidate(key string) { + switch key { + case "config/connection": + b.ResetDB() + } +} + // Lease returns the lease information func (b *backend) Lease(s logical.Storage) (*configLease, error) { entry, err := s.Get("config/lease") diff --git a/builtin/logical/rabbitmq/backend.go b/builtin/logical/rabbitmq/backend.go index e0123753e5..4f9cde0d7e 100644 --- a/builtin/logical/rabbitmq/backend.go +++ b/builtin/logical/rabbitmq/backend.go @@ -35,6 +35,8 @@ func Backend() *backend { }, Clean: b.resetClient, + + Invalidate: b.invalidate, } return &b @@ -99,6 +101,13 @@ func (b *backend) resetClient() { b.client = nil } +func (b *backend) invalidate(key string) { + switch key { + case "config/connection": + b.resetClient() + } +} + // Lease returns the lease information func (b *backend) Lease(s logical.Storage) (*configLease, error) { entry, err := s.Get("config/lease") diff --git a/builtin/logical/ssh/backend.go b/builtin/logical/ssh/backend.go index d39cae2a50..06fc4ccd82 100644 --- a/builtin/logical/ssh/backend.go +++ b/builtin/logical/ssh/backend.go @@ -10,6 +10,7 @@ import ( type backend struct { *framework.Backend + view logical.Storage salt *salt.Salt } @@ -22,15 +23,8 @@ func Factory(conf *logical.BackendConfig) (logical.Backend, error) { } func Backend(conf *logical.BackendConfig) (*backend, error) { - salt, err := salt.NewSalt(conf.StorageView, &salt.Config{ - HashFunc: salt.SHA256Hash, - }) - if err != nil { - return nil, err - } - var b backend - b.salt = salt + b.view = conf.StorageView b.Backend = &framework.Backend{ Help: strings.TrimSpace(backendHelp), @@ -38,6 +32,10 @@ func Backend(conf *logical.BackendConfig) (*backend, error) { Unauthenticated: []string{ "verify", }, + + LocalStorage: []string{ + "otp/", + }, }, Paths: []*framework.Path{ @@ -54,10 +52,23 @@ func Backend(conf *logical.BackendConfig) (*backend, error) { secretDynamicKey(&b), secretOTP(&b), }, + + Init: b.Initialize, } return &b, nil } +func (b *backend) Initialize() error { + salt, err := salt.NewSalt(b.view, &salt.Config{ + HashFunc: salt.SHA256Hash, + }) + if err != nil { + return err + } + b.salt = salt + return nil +} + const backendHelp = ` The SSH backend generates credentials allowing clients to establish SSH connections to remote hosts. diff --git a/builtin/logical/ssh/backend_test.go b/builtin/logical/ssh/backend_test.go index 2fa3a0be21..5012465326 100644 --- a/builtin/logical/ssh/backend_test.go +++ b/builtin/logical/ssh/backend_test.go @@ -73,6 +73,10 @@ func TestBackend_allowed_users(t *testing.T) { if err != nil { t.Fatal(err) } + err = b.Initialize() + if err != nil { + t.Fatal(err) + } roleData := map[string]interface{}{ "key_type": "otp", diff --git a/builtin/logical/transit/backend.go b/builtin/logical/transit/backend.go index 7737a8a756..37ebca43e4 100644 --- a/builtin/logical/transit/backend.go +++ b/builtin/logical/transit/backend.go @@ -1,6 +1,8 @@ package transit import ( + "strings" + "github.com/hashicorp/vault/helper/keysutil" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/logical/framework" @@ -39,6 +41,8 @@ func Backend(conf *logical.BackendConfig) *backend { }, Secrets: []*framework.Secret{}, + + Invalidate: b.invalidate, } b.lm = keysutil.NewLockManager(conf.System.CachingDisabled()) @@ -50,3 +54,14 @@ type backend struct { *framework.Backend lm *keysutil.LockManager } + +func (b *backend) invalidate(key string) { + if b.Logger().IsTrace() { + b.Logger().Trace("transit: invalidating key", "key", key) + } + switch { + case strings.HasPrefix(key, "policy/"): + name := strings.TrimPrefix(key, "policy/") + b.lm.InvalidatePolicy(name) + } +} diff --git a/command/audit_disable_test.go b/command/audit_disable_test.go index 012bb20c5e..500ee9ccb1 100644 --- a/command/audit_disable_test.go +++ b/command/audit_disable_test.go @@ -3,6 +3,7 @@ package command import ( "testing" + "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/http" "github.com/hashicorp/vault/meta" "github.com/hashicorp/vault/vault" @@ -44,3 +45,42 @@ func TestAuditDisable(t *testing.T) { t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String()) } } + +func TestAuditDisableWithOptions(t *testing.T) { + core, _, token := vault.TestCoreUnsealed(t) + ln, addr := http.TestServer(t, core) + defer ln.Close() + + ui := new(cli.MockUi) + c := &AuditDisableCommand{ + Meta: meta.Meta{ + ClientToken: token, + Ui: ui, + }, + } + + args := []string{ + "-address", addr, + "noop", + } + + // Run once to get the client + c.Run(args) + + // Get the client + client, err := c.Client() + if err != nil { + t.Fatalf("err: %#v", err) + } + if err := client.Sys().EnableAuditWithOptions("noop", &api.EnableAuditOptions{ + Type: "noop", + Description: "noop", + }); err != nil { + t.Fatalf("err: %#v", err) + } + + // Run again + if code := c.Run(args); code != 0 { + t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String()) + } +} diff --git a/command/audit_enable.go b/command/audit_enable.go index 7178c60423..3293c792f9 100644 --- a/command/audit_enable.go +++ b/command/audit_enable.go @@ -6,6 +6,7 @@ import ( "os" "strings" + "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/helper/kv-builder" "github.com/hashicorp/vault/meta" "github.com/mitchellh/mapstructure" @@ -21,9 +22,11 @@ type AuditEnableCommand struct { func (c *AuditEnableCommand) Run(args []string) int { var desc, path string + var local bool flags := c.Meta.FlagSet("audit-enable", meta.FlagSetDefault) flags.StringVar(&desc, "description", "", "") flags.StringVar(&path, "path", "", "") + flags.BoolVar(&local, "local", false, "") flags.Usage = func() { c.Ui.Error(c.Help()) } if err := flags.Parse(args); err != nil { return 1 @@ -68,7 +71,12 @@ func (c *AuditEnableCommand) Run(args []string) int { return 1 } - err = client.Sys().EnableAudit(path, auditType, desc, opts) + err = client.Sys().EnableAuditWithOptions(path, &api.EnableAuditOptions{ + Type: auditType, + Description: desc, + Options: opts, + Local: local, + }) if err != nil { c.Ui.Error(fmt.Sprintf( "Error enabling audit backend: %s", err)) @@ -113,6 +121,9 @@ Audit Enable Options: is purely for referencing this audit backend. By default this will be the backend type. + -local Mark the mount as a local mount. Local mounts + are not replicated nor (if a secondary) + removed by replication. ` return strings.TrimSpace(helpText) } diff --git a/command/audit_list.go b/command/audit_list.go index 20c070f132..b9914eb929 100644 --- a/command/audit_list.go +++ b/command/audit_list.go @@ -48,16 +48,19 @@ func (c *AuditListCommand) Run(args []string) int { } sort.Strings(paths) - columns := []string{"Path | Type | Description | Options"} + columns := []string{"Path | Type | Description | Replication Behavior | Options"} for _, path := range paths { audit := audits[path] opts := make([]string, 0, len(audit.Options)) for k, v := range audit.Options { opts = append(opts, k+"="+v) } - + replicatedBehavior := "replicated" + if audit.Local { + replicatedBehavior = "local" + } columns = append(columns, fmt.Sprintf( - "%s | %s | %s | %s", audit.Path, audit.Type, audit.Description, strings.Join(opts, " "))) + "%s | %s | %s | %s | %s", audit.Path, audit.Type, audit.Description, replicatedBehavior, strings.Join(opts, " "))) } c.Ui.Output(columnize.SimpleFormat(columns)) diff --git a/command/audit_list_test.go b/command/audit_list_test.go index 0f35aebcce..01d4f83ed0 100644 --- a/command/audit_list_test.go +++ b/command/audit_list_test.go @@ -3,6 +3,7 @@ package command import ( "testing" + "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/http" "github.com/hashicorp/vault/meta" "github.com/hashicorp/vault/vault" @@ -34,7 +35,11 @@ func TestAuditList(t *testing.T) { if err != nil { t.Fatalf("err: %#v", err) } - if err := client.Sys().EnableAudit("foo", "noop", "", nil); err != nil { + if err := client.Sys().EnableAuditWithOptions("foo", &api.EnableAuditOptions{ + Type: "noop", + Description: "noop", + Options: nil, + }); err != nil { t.Fatalf("err: %#v", err) } diff --git a/command/auth.go b/command/auth.go index 1dc15fb3c3..6ea2a0fe9c 100644 --- a/command/auth.go +++ b/command/auth.go @@ -281,7 +281,7 @@ func (c *AuthCommand) listMethods() int { } sort.Strings(paths) - columns := []string{"Path | Type | Default TTL | Max TTL | Description"} + columns := []string{"Path | Type | Default TTL | Max TTL | Replication Behavior | Description"} for _, path := range paths { auth := auth[path] defTTL := "system" @@ -292,8 +292,12 @@ func (c *AuthCommand) listMethods() int { if auth.Config.MaxLeaseTTL != 0 { maxTTL = strconv.Itoa(auth.Config.MaxLeaseTTL) } + replicatedBehavior := "replicated" + if auth.Local { + replicatedBehavior = "local" + } columns = append(columns, fmt.Sprintf( - "%s | %s | %s | %s | %s", path, auth.Type, defTTL, maxTTL, auth.Description)) + "%s | %s | %s | %s | %s | %s", path, auth.Type, defTTL, maxTTL, replicatedBehavior, auth.Description)) } c.Ui.Output(columnize.SimpleFormat(columns)) diff --git a/command/auth_disable_test.go b/command/auth_disable_test.go index 65cb48f61b..fb2b91fb23 100644 --- a/command/auth_disable_test.go +++ b/command/auth_disable_test.go @@ -3,6 +3,7 @@ package command import ( "testing" + "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/http" "github.com/hashicorp/vault/meta" "github.com/hashicorp/vault/vault" @@ -52,3 +53,50 @@ func TestAuthDisable(t *testing.T) { t.Fatal("should not have noop mount") } } + +func TestAuthDisableWithOptions(t *testing.T) { + core, _, token := vault.TestCoreUnsealed(t) + ln, addr := http.TestServer(t, core) + defer ln.Close() + + ui := new(cli.MockUi) + c := &AuthDisableCommand{ + Meta: meta.Meta{ + ClientToken: token, + Ui: ui, + }, + } + + args := []string{ + "-address", addr, + "noop", + } + + // Run the command once to setup the client, it will fail + c.Run(args) + + client, err := c.Client() + if err != nil { + t.Fatalf("err: %s", err) + } + + if err := client.Sys().EnableAuthWithOptions("noop", &api.EnableAuthOptions{ + Type: "noop", + Description: "", + }); err != nil { + t.Fatalf("err: %#v", err) + } + + if code := c.Run(args); code != 0 { + t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String()) + } + + mounts, err := client.Sys().ListAuth() + if err != nil { + t.Fatalf("err: %s", err) + } + + if _, ok := mounts["noop"]; ok { + t.Fatal("should not have noop mount") + } +} diff --git a/command/auth_enable.go b/command/auth_enable.go index 882d97985d..c7b8422ed3 100644 --- a/command/auth_enable.go +++ b/command/auth_enable.go @@ -4,6 +4,7 @@ import ( "fmt" "strings" + "github.com/hashicorp/vault/api" "github.com/hashicorp/vault/meta" ) @@ -14,9 +15,11 @@ type AuthEnableCommand struct { func (c *AuthEnableCommand) Run(args []string) int { var description, path string + var local bool flags := c.Meta.FlagSet("auth-enable", meta.FlagSetDefault) flags.StringVar(&description, "description", "", "") flags.StringVar(&path, "path", "", "") + flags.BoolVar(&local, "local", false, "") flags.Usage = func() { c.Ui.Error(c.Help()) } if err := flags.Parse(args); err != nil { return 1 @@ -44,7 +47,11 @@ func (c *AuthEnableCommand) Run(args []string) int { return 2 } - if err := client.Sys().EnableAuth(path, authType, description); err != nil { + if err := client.Sys().EnableAuthWithOptions(path, &api.EnableAuthOptions{ + Type: authType, + Description: description, + Local: local, + }); err != nil { c.Ui.Error(fmt.Sprintf( "Error: %s", err)) return 2 @@ -82,6 +89,9 @@ Auth Enable Options: to the type of the mount. This will make the auth provider available at "/auth/" + -local Mark the mount as a local mount. Local mounts + are not replicated nor (if a secondary) + removed by replication. ` return strings.TrimSpace(helpText) } diff --git a/command/mount.go b/command/mount.go index bfdba87591..9700dccdbf 100644 --- a/command/mount.go +++ b/command/mount.go @@ -15,11 +15,13 @@ type MountCommand struct { func (c *MountCommand) Run(args []string) int { var description, path, defaultLeaseTTL, maxLeaseTTL string + var local bool flags := c.Meta.FlagSet("mount", meta.FlagSetDefault) flags.StringVar(&description, "description", "", "") flags.StringVar(&path, "path", "", "") flags.StringVar(&defaultLeaseTTL, "default-lease-ttl", "", "") flags.StringVar(&maxLeaseTTL, "max-lease-ttl", "", "") + flags.BoolVar(&local, "local", false, "") flags.Usage = func() { c.Ui.Error(c.Help()) } if err := flags.Parse(args); err != nil { return 1 @@ -54,6 +56,7 @@ func (c *MountCommand) Run(args []string) int { DefaultLeaseTTL: defaultLeaseTTL, MaxLeaseTTL: maxLeaseTTL, }, + Local: local, } if err := client.Sys().Mount(path, mountInfo); err != nil { @@ -102,6 +105,10 @@ Mount Options: the previously set value. Set to '0' to explicitly set it to use the global default. + -local Mark the mount as a local mount. Local mounts + are not replicated nor (if a secondary) + removed by replication. + ` return strings.TrimSpace(helpText) } diff --git a/command/mounts.go b/command/mounts.go index 823aa57e75..d57837dd2c 100644 --- a/command/mounts.go +++ b/command/mounts.go @@ -42,7 +42,7 @@ func (c *MountsCommand) Run(args []string) int { } sort.Strings(paths) - columns := []string{"Path | Type | Default TTL | Max TTL | Description"} + columns := []string{"Path | Type | Default TTL | Max TTL | Replication Behavior | Description"} for _, path := range paths { mount := mounts[path] defTTL := "system" @@ -63,8 +63,12 @@ func (c *MountsCommand) Run(args []string) int { case mount.Config.MaxLeaseTTL != 0: maxTTL = strconv.Itoa(mount.Config.MaxLeaseTTL) } + replicatedBehavior := "replicated" + if mount.Local { + replicatedBehavior = "local" + } columns = append(columns, fmt.Sprintf( - "%s | %s | %s | %s | %s", path, mount.Type, defTTL, maxTTL, mount.Description)) + "%s | %s | %s | %s | %s | %s", path, mount.Type, defTTL, maxTTL, replicatedBehavior, mount.Description)) } c.Ui.Output(columnize.SimpleFormat(columns)) diff --git a/command/server.go b/command/server.go index cf8a442d49..e0b81f90a4 100644 --- a/command/server.go +++ b/command/server.go @@ -61,7 +61,7 @@ type ServerCommand struct { } func (c *ServerCommand) Run(args []string) int { - var dev, verifyOnly, devHA bool + var dev, verifyOnly, devHA, devTransactional bool var configPath []string var logLevel, devRootTokenID, devListenAddress string flags := c.Meta.FlagSet("server", meta.FlagSetDefault) @@ -70,7 +70,8 @@ func (c *ServerCommand) Run(args []string) int { flags.StringVar(&devListenAddress, "dev-listen-address", "", "") flags.StringVar(&logLevel, "log-level", "info", "") flags.BoolVar(&verifyOnly, "verify-only", false, "") - flags.BoolVar(&devHA, "dev-ha", false, "") + flags.BoolVar(&devHA, "ha", false, "") + flags.BoolVar(&devTransactional, "transactional", false, "") flags.Usage = func() { c.Ui.Output(c.Help()) } flags.Var((*sliceflag.StringFlag)(&configPath), "config", "config") if err := flags.Parse(args); err != nil { @@ -122,7 +123,7 @@ func (c *ServerCommand) Run(args []string) int { devListenAddress = os.Getenv("VAULT_DEV_LISTEN_ADDRESS") } - if devHA { + if devHA || devTransactional { dev = true } @@ -143,7 +144,7 @@ func (c *ServerCommand) Run(args []string) int { // Load the configuration var config *server.Config if dev { - config = server.DevConfig(devHA) + config = server.DevConfig(devHA, devTransactional) if devListenAddress != "" { config.Listeners[0].Config["address"] = devListenAddress } @@ -235,6 +236,9 @@ func (c *ServerCommand) Run(args []string) int { ClusterName: config.ClusterName, CacheSize: config.CacheSize, } + if dev { + coreConfig.DevToken = devRootTokenID + } var disableClustering bool diff --git a/command/server/config.go b/command/server/config.go index 8840aa5efc..77bece5b7f 100644 --- a/command/server/config.go +++ b/command/server/config.go @@ -38,7 +38,7 @@ type Config struct { } // DevConfig is a Config that is used for dev mode of Vault. -func DevConfig(ha bool) *Config { +func DevConfig(ha, transactional bool) *Config { ret := &Config{ DisableCache: false, DisableMlock: true, @@ -63,7 +63,12 @@ func DevConfig(ha bool) *Config { DefaultLeaseTTL: 32 * 24 * time.Hour, } - if ha { + switch { + case ha && transactional: + ret.Backend.Type = "inmem_transactional_ha" + case !ha && transactional: + ret.Backend.Type = "inmem_transactional" + case ha && !transactional: ret.Backend.Type = "inmem_ha" } diff --git a/command/server_ha_test.go b/command/server_ha_test.go index 30280c5571..26dc00878f 100644 --- a/command/server_ha_test.go +++ b/command/server_ha_test.go @@ -33,7 +33,7 @@ func TestServer_CommonHA(t *testing.T) { args := []string{"-config", tmpfile.Name(), "-verify-only", "true"} if code := c.Run(args); code != 0 { - t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String()) + t.Fatalf("bad: %d\n\n%s\n\n%s", code, ui.ErrorWriter.String(), ui.OutputWriter.String()) } if !strings.Contains(ui.OutputWriter.String(), "(HA available)") { @@ -61,7 +61,7 @@ func TestServer_GoodSeparateHA(t *testing.T) { args := []string{"-config", tmpfile.Name(), "-verify-only", "true"} if code := c.Run(args); code != 0 { - t.Fatalf("bad: %d\n\n%s", code, ui.ErrorWriter.String()) + t.Fatalf("bad: %d\n\n%s\n\n%s", code, ui.ErrorWriter.String(), ui.OutputWriter.String()) } if !strings.Contains(ui.OutputWriter.String(), "HA Backend:") { diff --git a/command/status.go b/command/status.go index f413f88781..3d584c7617 100644 --- a/command/status.go +++ b/command/status.go @@ -40,7 +40,7 @@ func (c *StatusCommand) Run(args []string) int { "Key Shares: %d\n"+ "Key Threshold: %d\n"+ "Unseal Progress: %d\n"+ - "Unseal Nonce: %v"+ + "Unseal Nonce: %v\n"+ "Version: %s", sealStatus.Sealed, sealStatus.N, diff --git a/helper/cidrutil/cidr_test.go b/helper/cidrutil/cidr_test.go index e220f0eae4..f6d5849c3e 100644 --- a/helper/cidrutil/cidr_test.go +++ b/helper/cidrutil/cidr_test.go @@ -14,6 +14,16 @@ func TestCIDRUtil_IPBelongsToCIDR(t *testing.T) { t.Fatalf("expected IP %q to belong to CIDR %q", ip, cidr) } + ip = "10.197.192.6" + cidr = "10.197.192.0/18" + belongs, err = IPBelongsToCIDR(ip, cidr) + if err != nil { + t.Fatal(err) + } + if !belongs { + t.Fatalf("expected IP %q to belong to CIDR %q", ip, cidr) + } + ip = "192.168.25.30" cidr = "192.168.26.30/24" belongs, err = IPBelongsToCIDR(ip, cidr) @@ -44,6 +54,17 @@ func TestCIDRUtil_IPBelongsToCIDRBlocksString(t *testing.T) { t.Fatalf("expected IP %q to belong to one of the CIDRs in %q", ip, cidrList) } + ip = "10.197.192.6" + cidrList = "1.2.3.0/8,10.197.192.0/18,10.197.193.0/24" + + belongs, err = IPBelongsToCIDRBlocksString(ip, cidrList, ",") + if err != nil { + t.Fatal(err) + } + if !belongs { + t.Fatalf("expected IP %q to belong to one of the CIDRs in %q", ip, cidrList) + } + ip = "192.168.27.29" cidrList = "172.169.100.200/18,192.168.0.0.0/16,10.10.20.20/24" diff --git a/helper/consts/consts.go b/helper/consts/consts.go new file mode 100644 index 0000000000..2ec952b2b9 --- /dev/null +++ b/helper/consts/consts.go @@ -0,0 +1,7 @@ +package consts + +const ( + // ExpirationRestoreWorkerCount specifies the numer of workers to use while + // restoring leases into the expiration manager + ExpirationRestoreWorkerCount = 64 +) diff --git a/helper/consts/error.go b/helper/consts/error.go new file mode 100644 index 0000000000..d96ba4fe84 --- /dev/null +++ b/helper/consts/error.go @@ -0,0 +1,13 @@ +package consts + +import "errors" + +var ( + // ErrSealed is returned if an operation is performed on a sealed barrier. + // No operation is expected to succeed before unsealing + ErrSealed = errors.New("Vault is sealed") + + // ErrStandby is returned if an operation is performed on a standby Vault. + // No operation is expected to succeed until active. + ErrStandby = errors.New("Vault is in standby mode") +) diff --git a/helper/consts/replication.go b/helper/consts/replication.go new file mode 100644 index 0000000000..62bbcb363d --- /dev/null +++ b/helper/consts/replication.go @@ -0,0 +1,20 @@ +package consts + +type ReplicationState uint32 + +const ( + ReplicationDisabled ReplicationState = iota + ReplicationPrimary + ReplicationSecondary +) + +func (r ReplicationState) String() string { + switch r { + case ReplicationSecondary: + return "secondary" + case ReplicationPrimary: + return "primary" + } + + return "disabled" +} diff --git a/helper/keysutil/lock_manager.go b/helper/keysutil/lock_manager.go index 1549c27401..380c39af11 100644 --- a/helper/keysutil/lock_manager.go +++ b/helper/keysutil/lock_manager.go @@ -71,6 +71,15 @@ func (lm *LockManager) CacheActive() bool { return lm.cache != nil } +func (lm *LockManager) InvalidatePolicy(name string) { + // Check if it's in our cache. If so, return right away. + if lm.CacheActive() { + lm.cacheMutex.Lock() + defer lm.cacheMutex.Unlock() + delete(lm.cache, name) + } +} + func (lm *LockManager) policyLock(name string, lockType bool) *sync.RWMutex { lm.locksMutex.RLock() lock := lm.locks[name] diff --git a/http/handler.go b/http/handler.go index 8a83af658e..09533b539b 100644 --- a/http/handler.go +++ b/http/handler.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/hashicorp/errwrap" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/duration" "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/logical" @@ -206,11 +207,11 @@ func handleRequestForwarding(core *vault.Core, handler http.Handler) http.Handle // case of an error. func request(core *vault.Core, w http.ResponseWriter, rawReq *http.Request, r *logical.Request) (*logical.Response, bool) { resp, err := core.HandleRequest(r) - if errwrap.Contains(err, vault.ErrStandby.Error()) { + if errwrap.Contains(err, consts.ErrStandby.Error()) { respondStandby(core, w, rawReq.URL) return resp, false } - if respondErrorCommon(w, resp, err) { + if respondErrorCommon(w, r, resp, err) { return resp, false } @@ -310,20 +311,7 @@ func requestWrapInfo(r *http.Request, req *logical.Request) (*logical.Request, e } func respondError(w http.ResponseWriter, status int, err error) { - // Adjust status code when sealed - if errwrap.Contains(err, vault.ErrSealed.Error()) { - status = http.StatusServiceUnavailable - } - - // Adjust status code on - if errwrap.Contains(err, "http: request body too large") { - status = http.StatusRequestEntityTooLarge - } - - // Allow HTTPCoded error passthrough to specify a code - if t, ok := err.(logical.HTTPCodedError); ok { - status = t.Code() - } + logical.AdjustErrorStatusCode(&status, err) w.Header().Add("Content-Type", "application/json") w.WriteHeader(status) @@ -337,42 +325,13 @@ func respondError(w http.ResponseWriter, status int, err error) { enc.Encode(resp) } -func respondErrorCommon(w http.ResponseWriter, resp *logical.Response, err error) bool { - // If there are no errors return - if err == nil && (resp == nil || !resp.IsError()) { +func respondErrorCommon(w http.ResponseWriter, req *logical.Request, resp *logical.Response, err error) bool { + statusCode, newErr := logical.RespondErrorCommon(req, resp, err) + if newErr == nil && statusCode == 0 { return false } - // Start out with internal server error since in most of these cases there - // won't be a response so this won't be overridden - statusCode := http.StatusInternalServerError - // If we actually have a response, start out with bad request - if resp != nil { - statusCode = http.StatusBadRequest - } - - // Now, check the error itself; if it has a specific logical error, set the - // appropriate code - if err != nil { - switch { - case errwrap.ContainsType(err, new(vault.StatusBadRequest)): - statusCode = http.StatusBadRequest - case errwrap.Contains(err, logical.ErrPermissionDenied.Error()): - statusCode = http.StatusForbidden - case errwrap.Contains(err, logical.ErrUnsupportedOperation.Error()): - statusCode = http.StatusMethodNotAllowed - case errwrap.Contains(err, logical.ErrUnsupportedPath.Error()): - statusCode = http.StatusNotFound - case errwrap.Contains(err, logical.ErrInvalidRequest.Error()): - statusCode = http.StatusBadRequest - } - } - - if resp != nil && resp.IsError() { - err = fmt.Errorf("%s", resp.Data["error"].(string)) - } - - respondError(w, statusCode, err) + respondError(w, statusCode, newErr) return true } diff --git a/http/handler_test.go b/http/handler_test.go index a7b1ad3d03..0cda837281 100644 --- a/http/handler_test.go +++ b/http/handler_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/hashicorp/go-cleanhttp" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/vault" ) @@ -80,6 +81,7 @@ func TestSysMounts_headerAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -88,6 +90,7 @@ func TestSysMounts_headerAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -96,6 +99,7 @@ func TestSysMounts_headerAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, }, "secret/": map[string]interface{}{ @@ -105,6 +109,7 @@ func TestSysMounts_headerAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -113,6 +118,7 @@ func TestSysMounts_headerAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -121,6 +127,7 @@ func TestSysMounts_headerAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, } testResponseStatus(t, resp, 200) @@ -223,7 +230,7 @@ func TestHandler_error(t *testing.T) { // vault.ErrSealed is a special case w3 := httptest.NewRecorder() - respondError(w3, 400, vault.ErrSealed) + respondError(w3, 400, consts.ErrSealed) if w3.Code != 503 { t.Fatalf("expected 503, got %d", w3.Code) diff --git a/http/help.go b/http/help.go index b7191a929a..f0ca8b1707 100644 --- a/http/help.go +++ b/http/help.go @@ -35,7 +35,7 @@ func handleHelp(core *vault.Core, w http.ResponseWriter, req *http.Request) { resp, err := core.HandleRequest(lreq) if err != nil { - respondErrorCommon(w, resp, err) + respondErrorCommon(w, lreq, resp, err) return } diff --git a/http/logical.go b/http/logical.go index f350bf0c06..f73e532d68 100644 --- a/http/logical.go +++ b/http/logical.go @@ -53,6 +53,12 @@ func buildLogicalRequest(core *vault.Core, w http.ResponseWriter, r *http.Reques return nil, http.StatusMethodNotAllowed, nil } + if op == logical.ListOperation { + if !strings.HasSuffix(path, "/") { + path += "/" + } + } + // Parse the request if we can var data map[string]interface{} if op == logical.UpdateOperation { @@ -109,40 +115,13 @@ func handleLogical(core *vault.Core, dataOnly bool, prepareRequestCallback Prepa // Make the internal request. We attach the connection info // as well in case this is an authentication request that requires - // it. Vault core handles stripping this if we need to. + // it. Vault core handles stripping this if we need to. This also + // handles all error cases; if we hit respondLogical, the request is a + // success. resp, ok := request(core, w, r, req) if !ok { return } - switch { - case req.Operation == logical.ReadOperation: - if resp == nil { - respondError(w, http.StatusNotFound, nil) - return - } - - // Basically: if we have empty "keys" or no keys at all, 404. This - // provides consistency with GET. - case req.Operation == logical.ListOperation && resp.WrapInfo == nil: - if resp == nil || len(resp.Data) == 0 { - respondError(w, http.StatusNotFound, nil) - return - } - keysRaw, ok := resp.Data["keys"] - if !ok || keysRaw == nil { - respondError(w, http.StatusNotFound, nil) - return - } - keys, ok := keysRaw.([]string) - if !ok { - respondError(w, http.StatusInternalServerError, nil) - return - } - if len(keys) == 0 { - respondError(w, http.StatusNotFound, nil) - return - } - } // Build the proper response respondLogical(w, r, req, dataOnly, resp) diff --git a/http/logical_test.go b/http/logical_test.go index bc4cdfb041..1a2cdd065f 100644 --- a/http/logical_test.go +++ b/http/logical_test.go @@ -4,8 +4,10 @@ import ( "bytes" "encoding/json" "io" + "net/http" "reflect" "strconv" + "strings" "testing" "time" @@ -101,7 +103,7 @@ func TestLogical_StandbyRedirect(t *testing.T) { // Attempt to fix raciness in this test by giving the first core a chance // to grab the lock - time.Sleep(time.Second) + time.Sleep(2 * time.Second) // Create a second HA Vault conf2 := &vault.CoreConfig{ @@ -252,3 +254,42 @@ func TestLogical_RequestSizeLimit(t *testing.T) { }) testResponseStatus(t, resp, 413) } + +func TestLogical_ListSuffix(t *testing.T) { + core, _, _ := vault.TestCoreUnsealed(t) + req, _ := http.NewRequest("GET", "http://127.0.0.1:8200/v1/secret/foo", nil) + lreq, status, err := buildLogicalRequest(core, nil, req) + if err != nil { + t.Fatal(err) + } + if status != 0 { + t.Fatalf("got status %d", status) + } + if strings.HasSuffix(lreq.Path, "/") { + t.Fatal("trailing slash found on path") + } + + req, _ = http.NewRequest("GET", "http://127.0.0.1:8200/v1/secret/foo?list=true", nil) + lreq, status, err = buildLogicalRequest(core, nil, req) + if err != nil { + t.Fatal(err) + } + if status != 0 { + t.Fatalf("got status %d", status) + } + if !strings.HasSuffix(lreq.Path, "/") { + t.Fatal("trailing slash not found on path") + } + + req, _ = http.NewRequest("LIST", "http://127.0.0.1:8200/v1/secret/foo", nil) + lreq, status, err = buildLogicalRequest(core, nil, req) + if err != nil { + t.Fatal(err) + } + if status != 0 { + t.Fatalf("got status %d", status) + } + if !strings.HasSuffix(lreq.Path, "/") { + t.Fatal("trailing slash not found on path") + } +} diff --git a/http/sys_audit_test.go b/http/sys_audit_test.go index 499435a77b..58873bfb12 100644 --- a/http/sys_audit_test.go +++ b/http/sys_audit_test.go @@ -35,6 +35,7 @@ func TestSysAudit(t *testing.T) { "type": "noop", "description": "", "options": map[string]interface{}{}, + "local": false, }, }, "noop/": map[string]interface{}{ @@ -42,6 +43,7 @@ func TestSysAudit(t *testing.T) { "type": "noop", "description": "", "options": map[string]interface{}{}, + "local": false, }, } testResponseStatus(t, resp, 200) diff --git a/http/sys_auth_test.go b/http/sys_auth_test.go index 3301e115e6..9e193916f0 100644 --- a/http/sys_auth_test.go +++ b/http/sys_auth_test.go @@ -32,6 +32,7 @@ func TestSysAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, }, "token/": map[string]interface{}{ @@ -41,6 +42,7 @@ func TestSysAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, } testResponseStatus(t, resp, 200) @@ -83,6 +85,7 @@ func TestSysEnableAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "token/": map[string]interface{}{ "description": "token based credentials", @@ -91,6 +94,7 @@ func TestSysEnableAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, }, "foo/": map[string]interface{}{ @@ -100,6 +104,7 @@ func TestSysEnableAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "token/": map[string]interface{}{ "description": "token based credentials", @@ -108,6 +113,7 @@ func TestSysEnableAuth(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, } testResponseStatus(t, resp, 200) @@ -153,6 +159,7 @@ func TestSysDisableAuth(t *testing.T) { }, "description": "token based credentials", "type": "token", + "local": false, }, }, "token/": map[string]interface{}{ @@ -162,6 +169,7 @@ func TestSysDisableAuth(t *testing.T) { }, "description": "token based credentials", "type": "token", + "local": false, }, } testResponseStatus(t, resp, 200) diff --git a/http/sys_mount_test.go b/http/sys_mount_test.go index 513e5b9419..e84ee67914 100644 --- a/http/sys_mount_test.go +++ b/http/sys_mount_test.go @@ -33,6 +33,7 @@ func TestSysMounts(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -41,6 +42,7 @@ func TestSysMounts(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -49,6 +51,7 @@ func TestSysMounts(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, }, "secret/": map[string]interface{}{ @@ -58,6 +61,7 @@ func TestSysMounts(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -66,6 +70,7 @@ func TestSysMounts(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -74,6 +79,7 @@ func TestSysMounts(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, } testResponseStatus(t, resp, 200) @@ -114,6 +120,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -122,6 +129,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -130,6 +138,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -138,6 +147,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, }, "foo/": map[string]interface{}{ @@ -147,6 +157,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -155,6 +166,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -163,6 +175,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -171,6 +184,7 @@ func TestSysMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, } testResponseStatus(t, resp, 200) @@ -233,6 +247,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -241,6 +256,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -249,6 +265,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -257,6 +274,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, }, "bar/": map[string]interface{}{ @@ -266,6 +284,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -274,6 +293,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -282,6 +302,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -290,6 +311,7 @@ func TestSysRemount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, } testResponseStatus(t, resp, 200) @@ -333,6 +355,7 @@ func TestSysUnmount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -341,6 +364,7 @@ func TestSysUnmount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -349,6 +373,7 @@ func TestSysUnmount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, }, "secret/": map[string]interface{}{ @@ -358,6 +383,7 @@ func TestSysUnmount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -366,6 +392,7 @@ func TestSysUnmount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -374,6 +401,7 @@ func TestSysUnmount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, } testResponseStatus(t, resp, 200) @@ -414,6 +442,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -422,6 +451,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -430,6 +460,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -438,6 +469,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, }, "foo/": map[string]interface{}{ @@ -447,6 +479,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -455,6 +488,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -463,6 +497,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -471,6 +506,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, } testResponseStatus(t, resp, 200) @@ -532,6 +568,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("259196400"), "max_lease_ttl": json.Number("259200000"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -540,6 +577,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -548,6 +586,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -556,6 +595,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, }, "foo/": map[string]interface{}{ @@ -565,6 +605,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("259196400"), "max_lease_ttl": json.Number("259200000"), }, + "local": false, }, "secret/": map[string]interface{}{ "description": "generic secret storage", @@ -573,6 +614,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "sys/": map[string]interface{}{ "description": "system endpoints used for control, policy and debugging", @@ -581,6 +623,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -589,6 +632,7 @@ func TestSysTuneMount(t *testing.T) { "default_lease_ttl": json.Number("0"), "max_lease_ttl": json.Number("0"), }, + "local": true, }, } diff --git a/http/sys_rekey.go b/http/sys_rekey.go index 2d6c970008..023452c185 100644 --- a/http/sys_rekey.go +++ b/http/sys_rekey.go @@ -7,6 +7,7 @@ import ( "fmt" "net/http" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/pgpkeys" "github.com/hashicorp/vault/vault" ) @@ -19,6 +20,13 @@ func handleSysRekeyInit(core *vault.Core, recovery bool) http.Handler { return } + repState := core.ReplicationState() + if repState == consts.ReplicationSecondary { + respondError(w, http.StatusBadRequest, + fmt.Errorf("rekeying can only be performed on the primary cluster when replication is activated")) + return + } + switch { case recovery && !core.SealAccess().RecoveryKeySupported(): respondError(w, http.StatusBadRequest, fmt.Errorf("recovery rekeying not supported")) @@ -108,7 +116,7 @@ func handleSysRekeyInitPut(core *vault.Core, recovery bool, w http.ResponseWrite // Right now we don't support this, but the rest of the code is ready for // when we do, hence the check below for this to be false if // StoredShares is greater than zero - if core.SealAccess().StoredKeysSupported() { + if core.SealAccess().StoredKeysSupported() && !recovery { respondError(w, http.StatusBadRequest, fmt.Errorf("rekeying of barrier not supported when stored key support is available")) return } diff --git a/http/sys_seal.go b/http/sys_seal.go index 27e3434ece..07ffbcd5ba 100644 --- a/http/sys_seal.go +++ b/http/sys_seal.go @@ -8,6 +8,7 @@ import ( "net/http" "github.com/hashicorp/errwrap" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/vault" "github.com/hashicorp/vault/version" @@ -126,7 +127,7 @@ func handleSysUnseal(core *vault.Core) http.Handler { case errwrap.Contains(err, vault.ErrBarrierInvalidKey.Error()): case errwrap.Contains(err, vault.ErrBarrierNotInit.Error()): case errwrap.Contains(err, vault.ErrBarrierSealed.Error()): - case errwrap.Contains(err, vault.ErrStandby.Error()): + case errwrap.Contains(err, consts.ErrStandby.Error()): default: respondError(w, http.StatusInternalServerError, err) return diff --git a/logical/connection.go b/logical/connection.go index f14f65567a..d54a0f5327 100644 --- a/logical/connection.go +++ b/logical/connection.go @@ -8,7 +8,7 @@ import ( // is present on the Request structure for credential backends. type Connection struct { // RemoteAddr is the network address that sent the request. - RemoteAddr string + RemoteAddr string `json:"remote_addr"` // ConnState is the TLS connection state if applicable. ConnState *tls.ConnectionState diff --git a/logical/error.go b/logical/error.go index 9d082013f6..19e3e2dea8 100644 --- a/logical/error.go +++ b/logical/error.go @@ -21,3 +21,27 @@ func (e *codedError) Error() string { func (e *codedError) Code() int { return e.code } + +// Struct to identify user input errors. This is helpful in responding the +// appropriate status codes to clients from the HTTP endpoints. +type StatusBadRequest struct { + Err string +} + +// Implementing error interface +func (s *StatusBadRequest) Error() string { + return s.Err +} + +// This is a new type declared to not cause potential compatibility problems if +// the logic around the HTTPCodedError interface changes; in particular for +// logical request paths it is basically ignored, and changing that behavior +// might cause unforseen issues. +type ReplicationCodedError struct { + Msg string + Code int +} + +func (r *ReplicationCodedError) Error() string { + return r.Msg +} diff --git a/logical/framework/backend.go b/logical/framework/backend.go index aa287b8694..eddace22e4 100644 --- a/logical/framework/backend.go +++ b/logical/framework/backend.go @@ -1,6 +1,7 @@ package framework import ( + "encoding/json" "fmt" "io/ioutil" "regexp" @@ -12,6 +13,7 @@ import ( log "github.com/mgutz/logxi/v1" "github.com/hashicorp/go-multierror" + "github.com/hashicorp/vault/helper/duration" "github.com/hashicorp/vault/helper/errutil" "github.com/hashicorp/vault/helper/logformat" "github.com/hashicorp/vault/logical" @@ -534,7 +536,40 @@ type FieldSchema struct { // the zero value of the type. func (s *FieldSchema) DefaultOrZero() interface{} { if s.Default != nil { - return s.Default + switch s.Type { + case TypeDurationSecond: + var result int + switch inp := s.Default.(type) { + case nil: + return s.Type.Zero() + case int: + result = inp + case int64: + result = int(inp) + case float32: + result = int(inp) + case float64: + result = int(inp) + case string: + dur, err := duration.ParseDurationSecond(inp) + if err != nil { + return s.Type.Zero() + } + result = int(dur.Seconds()) + case json.Number: + valInt64, err := inp.Int64() + if err != nil { + return s.Type.Zero() + } + result = int(valInt64) + default: + return s.Type.Zero() + } + return result + + default: + return s.Default + } } return s.Type.Zero() diff --git a/logical/framework/backend_test.go b/logical/framework/backend_test.go index d777ecda8a..d94beedd35 100644 --- a/logical/framework/backend_test.go +++ b/logical/framework/backend_test.go @@ -554,6 +554,16 @@ func TestFieldSchemaDefaultOrZero(t *testing.T) { 60, }, + "default duration int64": { + &FieldSchema{Type: TypeDurationSecond, Default: int64(60)}, + 60, + }, + + "default duration string": { + &FieldSchema{Type: TypeDurationSecond, Default: "60s"}, + 60, + }, + "default duration not set": { &FieldSchema{Type: TypeDurationSecond}, 0, diff --git a/logical/logical.go b/logical/logical.go index 9234bfe6d6..3b66fba51f 100644 --- a/logical/logical.go +++ b/logical/logical.go @@ -80,22 +80,3 @@ type Paths struct { // indicates that these paths should not be replicated LocalStorage []string } - -type ReplicationState uint32 - -const ( - ReplicationDisabled ReplicationState = iota - ReplicationPrimary - ReplicationSecondary -) - -func (r ReplicationState) String() string { - switch r { - case ReplicationSecondary: - return "secondary" - case ReplicationPrimary: - return "primary" - } - - return "disabled" -} diff --git a/logical/request.go b/logical/request.go index f352b9ea89..f7f49e2d4c 100644 --- a/logical/request.go +++ b/logical/request.go @@ -25,6 +25,10 @@ type Request struct { // Id is the uuid associated with each request ID string `json:"id" structs:"id" mapstructure:"id"` + // If set, the name given to the replication secondary where this request + // originated + ReplicationCluster string `json:"replication_cluster" structs:"replication_cluster", mapstructure:"replication_cluster"` + // Operation is the requested operation type Operation Operation `json:"operation" structs:"operation" mapstructure:"operation"` @@ -38,7 +42,7 @@ type Request struct { Data map[string]interface{} `json:"map" structs:"data" mapstructure:"data"` // Storage can be used to durably store and retrieve state. - Storage Storage `json:"storage" structs:"storage" mapstructure:"storage"` + Storage Storage `json:"-"` // Secret will be non-nil only for Revoke and Renew operations // to represent the secret that was returned prior. diff --git a/logical/response_util.go b/logical/response_util.go new file mode 100644 index 0000000000..a3fd2bfd19 --- /dev/null +++ b/logical/response_util.go @@ -0,0 +1,111 @@ +package logical + +import ( + "errors" + "fmt" + "net/http" + + "github.com/hashicorp/errwrap" + multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/vault/helper/consts" +) + +// RespondErrorCommon pulls most of the functionality from http's +// respondErrorCommon and some of http's handleLogical and makes it available +// to both the http package and elsewhere. +func RespondErrorCommon(req *Request, resp *Response, err error) (int, error) { + if err == nil && (resp == nil || !resp.IsError()) { + switch { + case req.Operation == ReadOperation: + if resp == nil { + return http.StatusNotFound, nil + } + + // Basically: if we have empty "keys" or no keys at all, 404. This + // provides consistency with GET. + case req.Operation == ListOperation && resp.WrapInfo == nil: + if resp == nil || len(resp.Data) == 0 { + return http.StatusNotFound, nil + } + keysRaw, ok := resp.Data["keys"] + if !ok || keysRaw == nil { + return http.StatusNotFound, nil + } + keys, ok := keysRaw.([]string) + if !ok { + return http.StatusInternalServerError, nil + } + if len(keys) == 0 { + return http.StatusNotFound, nil + } + } + + return 0, nil + } + + if errwrap.ContainsType(err, new(ReplicationCodedError)) { + var allErrors error + codedErr := errwrap.GetType(err, new(ReplicationCodedError)).(*ReplicationCodedError) + errwrap.Walk(err, func(inErr error) { + newErr, ok := inErr.(*ReplicationCodedError) + if !ok { + allErrors = multierror.Append(allErrors, newErr) + } + }) + if allErrors != nil { + return codedErr.Code, multierror.Append(errors.New(fmt.Sprintf("errors from both primary and secondary; primary error was %v; secondary errors follow", codedErr.Msg)), allErrors) + } + return codedErr.Code, errors.New(codedErr.Msg) + } + + // Start out with internal server error since in most of these cases there + // won't be a response so this won't be overridden + statusCode := http.StatusInternalServerError + // If we actually have a response, start out with bad request + if resp != nil { + statusCode = http.StatusBadRequest + } + + // Now, check the error itself; if it has a specific logical error, set the + // appropriate code + if err != nil { + switch { + case errwrap.ContainsType(err, new(StatusBadRequest)): + statusCode = http.StatusBadRequest + case errwrap.Contains(err, ErrPermissionDenied.Error()): + statusCode = http.StatusForbidden + case errwrap.Contains(err, ErrUnsupportedOperation.Error()): + statusCode = http.StatusMethodNotAllowed + case errwrap.Contains(err, ErrUnsupportedPath.Error()): + statusCode = http.StatusNotFound + case errwrap.Contains(err, ErrInvalidRequest.Error()): + statusCode = http.StatusBadRequest + } + } + + if resp != nil && resp.IsError() { + err = fmt.Errorf("%s", resp.Data["error"].(string)) + } + + return statusCode, err +} + +// AdjustErrorStatusCode adjusts the status that will be sent in error +// conditions in a way that can be shared across http's respondError and other +// locations. +func AdjustErrorStatusCode(status *int, err error) { + // Adjust status code when sealed + if errwrap.Contains(err, consts.ErrSealed.Error()) { + *status = http.StatusServiceUnavailable + } + + // Adjust status code on + if errwrap.Contains(err, "http: request body too large") { + *status = http.StatusRequestEntityTooLarge + } + + // Allow HTTPCoded error passthrough to specify a code + if t, ok := err.(HTTPCodedError); ok { + *status = t.Code() + } +} diff --git a/logical/system_view.go b/logical/system_view.go index 836c865c25..d769397dfc 100644 --- a/logical/system_view.go +++ b/logical/system_view.go @@ -1,6 +1,10 @@ package logical -import "time" +import ( + "time" + + "github.com/hashicorp/vault/helper/consts" +) // SystemView exposes system configuration information in a safe way // for logical backends to consume @@ -32,7 +36,7 @@ type SystemView interface { CachingDisabled() bool // ReplicationState indicates the state of cluster replication - ReplicationState() ReplicationState + ReplicationState() consts.ReplicationState } type StaticSystemView struct { @@ -42,7 +46,7 @@ type StaticSystemView struct { TaintedVal bool CachingDisabledVal bool Primary bool - ReplicationStateVal ReplicationState + ReplicationStateVal consts.ReplicationState } func (d StaticSystemView) DefaultLeaseTTL() time.Duration { @@ -65,6 +69,6 @@ func (d StaticSystemView) CachingDisabled() bool { return d.CachingDisabledVal } -func (d StaticSystemView) ReplicationState() ReplicationState { +func (d StaticSystemView) ReplicationState() consts.ReplicationState { return d.ReplicationStateVal } diff --git a/meta/meta.go b/meta/meta.go index 3ff422e2f8..0f5fef9fd5 100644 --- a/meta/meta.go +++ b/meta/meta.go @@ -23,6 +23,21 @@ const ( FlagSetDefault = FlagSetServer ) +var ( + additionalOptionsUsage = func() string { + return ` + -wrap-ttl="" Indicates that the response should be wrapped in a + cubbyhole token with the requested TTL. The response + can be fetched by calling the "sys/wrapping/unwrap" + endpoint, passing in the wrappping token's ID. This + is a numeric string with an optional suffix + "s", "m", or "h"; if no suffix is specified it will + be parsed as seconds. May also be specified via + VAULT_WRAP_TTL. +` + } +) + // Meta contains the meta-options and functionality that nearly every // Vault command inherits. type Meta struct { @@ -188,6 +203,6 @@ func GeneralOptionsUsage() string { if VAULT_SKIP_VERIFY is set. ` - general += AdditionalOptionsUsage() + general += additionalOptionsUsage() return general } diff --git a/meta/meta_non_vault.go b/meta/meta_non_vault.go deleted file mode 100644 index a00dfa1241..0000000000 --- a/meta/meta_non_vault.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !vault - -package meta - -func AdditionalOptionsUsage() string { - return "" -} diff --git a/meta/meta_vault.go b/meta/meta_vault.go deleted file mode 100644 index f1fc97afc3..0000000000 --- a/meta/meta_vault.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build vault - -package meta - -func AdditionalOptionsUsage() string { - return ` - -wrap-ttl="" Indicates that the response should be wrapped in a - cubbyhole token with the requested TTL. The response - can be fetched by calling the "sys/wrapping/unwrap" - endpoint, passing in the wrappping token's ID. This - is a numeric string with an optional suffix - "s", "m", or "h"; if no suffix is specified it will - be parsed as seconds. May also be specified via - VAULT_WRAP_TTL. -` -} diff --git a/physical/cache.go b/physical/cache.go index 318809250e..7707f3d0ef 100644 --- a/physical/cache.go +++ b/physical/cache.go @@ -1,9 +1,15 @@ package physical import ( + "crypto/sha1" + "encoding/hex" + "fmt" "strings" + "sync" "github.com/hashicorp/golang-lru" + "github.com/hashicorp/vault/helper/locksutil" + "github.com/hashicorp/vault/helper/strutil" log "github.com/mgutz/logxi/v1" ) @@ -17,8 +23,11 @@ const ( // Vault are for policy objects so there is a large read reduction // by using a simple write-through cache. type Cache struct { - backend Backend - lru *lru.TwoQueueCache + backend Backend + transactional Transactional + lru *lru.TwoQueueCache + locks map[string]*sync.RWMutex + logger log.Logger } // NewCache returns a physical cache of the given size. @@ -34,16 +43,58 @@ func NewCache(b Backend, size int, logger log.Logger) *Cache { c := &Cache{ backend: b, lru: cache, + locks: make(map[string]*sync.RWMutex, 256), + logger: logger, } + if err := locksutil.CreateLocks(c.locks, 256); err != nil { + logger.Error("physical/cache: error creating locks", "error", err) + return nil + } + + if txnl, ok := c.backend.(Transactional); ok { + c.transactional = txnl + } + return c } +func (c *Cache) lockHashForKey(key string) string { + hf := sha1.New() + hf.Write([]byte(key)) + return strings.ToLower(hex.EncodeToString(hf.Sum(nil))[:2]) +} + +func (c *Cache) lockForKey(key string) *sync.RWMutex { + return c.locks[c.lockHashForKey(key)] +} + // Purge is used to clear the cache func (c *Cache) Purge() { + // Lock the world + lockHashes := make([]string, 0, len(c.locks)) + for hash := range c.locks { + lockHashes = append(lockHashes, hash) + } + + // Sort and deduplicate. This ensures we don't try to grab the same lock + // twice, and enforcing a sort means we'll not have multiple goroutines + // deadlock by acquiring in different orders. + lockHashes = strutil.RemoveDuplicates(lockHashes) + + for _, lockHash := range lockHashes { + lock := c.locks[lockHash] + lock.Lock() + defer lock.Unlock() + } + c.lru.Purge() } func (c *Cache) Put(entry *Entry) error { + lock := c.lockForKey(entry.Key) + lock.Lock() + defer lock.Unlock() + err := c.backend.Put(entry) if err == nil { c.lru.Add(entry.Key, entry) @@ -52,6 +103,10 @@ func (c *Cache) Put(entry *Entry) error { } func (c *Cache) Get(key string) (*Entry, error) { + lock := c.lockForKey(key) + lock.RLock() + defer lock.RUnlock() + // Check the LRU first if raw, ok := c.lru.Get(key); ok { if raw == nil { @@ -79,6 +134,10 @@ func (c *Cache) Get(key string) (*Entry, error) { } func (c *Cache) Delete(key string) error { + lock := c.lockForKey(key) + lock.Lock() + defer lock.Unlock() + err := c.backend.Delete(key) if err == nil { c.lru.Remove(key) @@ -87,6 +146,45 @@ func (c *Cache) Delete(key string) error { } func (c *Cache) List(prefix string) ([]string, error) { - // Always pass-through as this would be difficult to cache. + // Always pass-through as this would be difficult to cache. For the same + // reason we don't lock as we can't reasonably know which locks to readlock + // ahead of time. return c.backend.List(prefix) } + +func (c *Cache) Transaction(txns []TxnEntry) error { + if c.transactional == nil { + return fmt.Errorf("physical/cache: underlying backend does not support transactions") + } + + var lockHashes []string + for _, txn := range txns { + lockHashes = append(lockHashes, c.lockHashForKey(txn.Entry.Key)) + } + + // Sort and deduplicate. This ensures we don't try to grab the same lock + // twice, and enforcing a sort means we'll not have multiple goroutines + // deadlock by acquiring in different orders. + lockHashes = strutil.RemoveDuplicates(lockHashes) + + for _, lockHash := range lockHashes { + lock := c.locks[lockHash] + lock.Lock() + defer lock.Unlock() + } + + if err := c.transactional.Transaction(txns); err != nil { + return err + } + + for _, txn := range txns { + switch txn.Operation { + case PutOperation: + c.lru.Add(txn.Entry.Key, txn.Entry) + case DeleteOperation: + c.lru.Remove(txn.Entry.Key) + } + } + + return nil +} diff --git a/physical/consul.go b/physical/consul.go index 9f069e4862..eecc988853 100644 --- a/physical/consul.go +++ b/physical/consul.go @@ -1,6 +1,7 @@ package physical import ( + "errors" "fmt" "io/ioutil" "net" @@ -21,6 +22,8 @@ import ( "github.com/hashicorp/consul/lib" "github.com/hashicorp/errwrap" "github.com/hashicorp/go-cleanhttp" + multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/strutil" "github.com/hashicorp/vault/helper/tlsutil" ) @@ -154,6 +157,10 @@ func newConsulBackend(conf map[string]string, logger log.Logger) (Backend, error // Configure the client consulConf := api.DefaultConfig() + // Set MaxIdleConnsPerHost to the number of processes used in expiration.Restore + tr := cleanhttp.DefaultPooledTransport() + tr.MaxIdleConnsPerHost = consts.ExpirationRestoreWorkerCount + consulConf.HttpClient.Transport = tr if addr, ok := conf["address"]; ok { consulConf.Address = addr @@ -179,7 +186,7 @@ func newConsulBackend(conf map[string]string, logger log.Logger) (Backend, error } transport := cleanhttp.DefaultPooledTransport() - transport.MaxIdleConnsPerHost = 4 + transport.MaxIdleConnsPerHost = consts.ExpirationRestoreWorkerCount transport.TLSClientConfig = tlsClientConfig consulConf.HttpClient.Transport = transport logger.Debug("physical/consul: configured TLS") @@ -284,17 +291,59 @@ func setupTLSConfig(conf map[string]string) (*tls.Config, error) { return tlsClientConfig, nil } +// Used to run multiple entries via a transaction +func (c *ConsulBackend) Transaction(txns []TxnEntry) error { + if len(txns) == 0 { + return nil + } + + ops := make([]*api.KVTxnOp, 0, len(txns)) + + for _, op := range txns { + cop := &api.KVTxnOp{ + Key: c.path + op.Entry.Key, + } + switch op.Operation { + case DeleteOperation: + cop.Verb = api.KVDelete + case PutOperation: + cop.Verb = api.KVSet + cop.Value = op.Entry.Value + default: + return fmt.Errorf("%q is not a supported transaction operation", op.Operation) + } + + ops = append(ops, cop) + } + + ok, resp, _, err := c.kv.Txn(ops, nil) + if err != nil { + return err + } + if ok { + return nil + } + + var retErr *multierror.Error + for _, res := range resp.Errors { + retErr = multierror.Append(retErr, errors.New(res.What)) + } + + return retErr +} + // Put is used to insert or update an entry func (c *ConsulBackend) Put(entry *Entry) error { defer metrics.MeasureSince([]string{"consul", "put"}, time.Now()) + + c.permitPool.Acquire() + defer c.permitPool.Release() + pair := &api.KVPair{ Key: c.path + entry.Key, Value: entry.Value, } - c.permitPool.Acquire() - defer c.permitPool.Release() - _, err := c.kv.Put(pair, nil) return err } diff --git a/physical/file.go b/physical/file.go index 25feee0549..d9c5225aef 100644 --- a/physical/file.go +++ b/physical/file.go @@ -22,12 +22,17 @@ import ( // and non-performant. It is meant mostly for local testing and development. // It can be improved in the future. type FileBackend struct { - Path string - l sync.Mutex - logger log.Logger + sync.RWMutex + path string + logger log.Logger + permitPool *PermitPool } -// newFileBackend constructs a Filebackend using the given directory +type TransactionalFileBackend struct { + FileBackend +} + +// newFileBackend constructs a FileBackend using the given directory func newFileBackend(conf map[string]string, logger log.Logger) (Backend, error) { path, ok := conf["path"] if !ok { @@ -35,20 +40,44 @@ func newFileBackend(conf map[string]string, logger log.Logger) (Backend, error) } return &FileBackend{ - Path: path, - logger: logger, + path: path, + logger: logger, + permitPool: NewPermitPool(DefaultParallelOperations), + }, nil +} + +func newTransactionalFileBackend(conf map[string]string, logger log.Logger) (Backend, error) { + path, ok := conf["path"] + if !ok { + return nil, fmt.Errorf("'path' must be set") + } + + // Create a pool of size 1 so only one operation runs at a time + return &TransactionalFileBackend{ + FileBackend: FileBackend{ + path: path, + logger: logger, + permitPool: NewPermitPool(1), + }, }, nil } func (b *FileBackend) Delete(path string) error { + b.permitPool.Acquire() + defer b.permitPool.Release() + + b.Lock() + defer b.Unlock() + + return b.DeleteInternal(path) +} + +func (b *FileBackend) DeleteInternal(path string) error { if path == "" { return nil } - b.l.Lock() - defer b.l.Unlock() - - basePath, key := b.path(path) + basePath, key := b.expandPath(path) fullPath := filepath.Join(basePath, key) err := os.Remove(fullPath) @@ -66,7 +95,7 @@ func (b *FileBackend) Delete(path string) error { func (b *FileBackend) cleanupLogicalPath(path string) error { nodes := strings.Split(path, fmt.Sprintf("%c", os.PathSeparator)) for i := len(nodes) - 1; i > 0; i-- { - fullPath := filepath.Join(b.Path, filepath.Join(nodes[:i]...)) + fullPath := filepath.Join(b.path, filepath.Join(nodes[:i]...)) dir, err := os.Open(fullPath) if err != nil { @@ -96,10 +125,17 @@ func (b *FileBackend) cleanupLogicalPath(path string) error { } func (b *FileBackend) Get(k string) (*Entry, error) { - b.l.Lock() - defer b.l.Unlock() + b.permitPool.Acquire() + defer b.permitPool.Release() - path, key := b.path(k) + b.RLock() + defer b.RUnlock() + + return b.GetInternal(k) +} + +func (b *FileBackend) GetInternal(k string) (*Entry, error) { + path, key := b.expandPath(k) path = filepath.Join(path, key) f, err := os.Open(path) @@ -121,10 +157,17 @@ func (b *FileBackend) Get(k string) (*Entry, error) { } func (b *FileBackend) Put(entry *Entry) error { - path, key := b.path(entry.Key) + b.permitPool.Acquire() + defer b.permitPool.Release() - b.l.Lock() - defer b.l.Unlock() + b.Lock() + defer b.Unlock() + + return b.PutInternal(entry) +} + +func (b *FileBackend) PutInternal(entry *Entry) error { + path, key := b.expandPath(entry.Key) // Make the parent tree if err := os.MkdirAll(path, 0755); err != nil { @@ -145,10 +188,17 @@ func (b *FileBackend) Put(entry *Entry) error { } func (b *FileBackend) List(prefix string) ([]string, error) { - b.l.Lock() - defer b.l.Unlock() + b.permitPool.Acquire() + defer b.permitPool.Release() - path := b.Path + b.RLock() + defer b.RUnlock() + + return b.ListInternal(prefix) +} + +func (b *FileBackend) ListInternal(prefix string) ([]string, error) { + path := b.path if prefix != "" { path = filepath.Join(path, prefix) } @@ -180,9 +230,19 @@ func (b *FileBackend) List(prefix string) ([]string, error) { return names, nil } -func (b *FileBackend) path(k string) (string, string) { - path := filepath.Join(b.Path, k) +func (b *FileBackend) expandPath(k string) (string, string) { + path := filepath.Join(b.path, k) key := filepath.Base(path) path = filepath.Dir(path) return path, "_" + key } + +func (b *TransactionalFileBackend) Transaction(txns []TxnEntry) error { + b.permitPool.Acquire() + defer b.permitPool.Release() + + b.Lock() + defer b.Unlock() + + return genericTransactionHandler(b, txns) +} diff --git a/physical/inmem.go b/physical/inmem.go index 8eaee95684..47f18ebc4a 100644 --- a/physical/inmem.go +++ b/physical/inmem.go @@ -13,12 +13,16 @@ import ( // for testing and development situations where the data is not // expected to be durable. type InmemBackend struct { + sync.RWMutex root *radix.Tree - l sync.RWMutex permitPool *PermitPool logger log.Logger } +type TransactionalInmemBackend struct { + InmemBackend +} + // NewInmem constructs a new in-memory backend func NewInmem(logger log.Logger) *InmemBackend { in := &InmemBackend{ @@ -29,14 +33,31 @@ func NewInmem(logger log.Logger) *InmemBackend { return in } +// Basically for now just creates a permit pool of size 1 so only one operation +// can run at a time +func NewTransactionalInmem(logger log.Logger) *TransactionalInmemBackend { + in := &TransactionalInmemBackend{ + InmemBackend: InmemBackend{ + root: radix.New(), + permitPool: NewPermitPool(1), + logger: logger, + }, + } + return in +} + // Put is used to insert or update an entry func (i *InmemBackend) Put(entry *Entry) error { i.permitPool.Acquire() defer i.permitPool.Release() - i.l.Lock() - defer i.l.Unlock() + i.Lock() + defer i.Unlock() + return i.PutInternal(entry) +} + +func (i *InmemBackend) PutInternal(entry *Entry) error { i.root.Insert(entry.Key, entry) return nil } @@ -46,9 +67,13 @@ func (i *InmemBackend) Get(key string) (*Entry, error) { i.permitPool.Acquire() defer i.permitPool.Release() - i.l.RLock() - defer i.l.RUnlock() + i.RLock() + defer i.RUnlock() + return i.GetInternal(key) +} + +func (i *InmemBackend) GetInternal(key string) (*Entry, error) { if raw, ok := i.root.Get(key); ok { return raw.(*Entry), nil } @@ -60,9 +85,13 @@ func (i *InmemBackend) Delete(key string) error { i.permitPool.Acquire() defer i.permitPool.Release() - i.l.Lock() - defer i.l.Unlock() + i.Lock() + defer i.Unlock() + return i.DeleteInternal(key) +} + +func (i *InmemBackend) DeleteInternal(key string) error { i.root.Delete(key) return nil } @@ -73,9 +102,13 @@ func (i *InmemBackend) List(prefix string) ([]string, error) { i.permitPool.Acquire() defer i.permitPool.Release() - i.l.RLock() - defer i.l.RUnlock() + i.RLock() + defer i.RUnlock() + return i.ListInternal(prefix) +} + +func (i *InmemBackend) ListInternal(prefix string) ([]string, error) { var out []string seen := make(map[string]interface{}) walkFn := func(s string, v interface{}) bool { @@ -96,3 +129,14 @@ func (i *InmemBackend) List(prefix string) ([]string, error) { return out, nil } + +// Implements the transaction interface +func (t *TransactionalInmemBackend) Transaction(txns []TxnEntry) error { + t.permitPool.Acquire() + defer t.permitPool.Release() + + t.Lock() + defer t.Unlock() + + return genericTransactionHandler(t, txns) +} diff --git a/physical/inmem_ha.go b/physical/inmem_ha.go index f7ec92d148..bc691c59a9 100644 --- a/physical/inmem_ha.go +++ b/physical/inmem_ha.go @@ -8,19 +8,40 @@ import ( ) type InmemHABackend struct { - InmemBackend + Backend locks map[string]string l sync.Mutex cond *sync.Cond logger log.Logger } +type TransactionalInmemHABackend struct { + Transactional + InmemHABackend +} + // NewInmemHA constructs a new in-memory HA backend. This is only for testing. func NewInmemHA(logger log.Logger) *InmemHABackend { in := &InmemHABackend{ - InmemBackend: *NewInmem(logger), - locks: make(map[string]string), - logger: logger, + Backend: NewInmem(logger), + locks: make(map[string]string), + logger: logger, + } + in.cond = sync.NewCond(&in.l) + return in +} + +func NewTransactionalInmemHA(logger log.Logger) *TransactionalInmemHABackend { + transInmem := NewTransactionalInmem(logger) + inmemHA := InmemHABackend{ + Backend: transInmem, + locks: make(map[string]string), + logger: logger, + } + + in := &TransactionalInmemHABackend{ + InmemHABackend: inmemHA, + Transactional: transInmem, } in.cond = sync.NewCond(&in.l) return in diff --git a/physical/physical.go b/physical/physical.go index 9427820bc4..568ffe917a 100644 --- a/physical/physical.go +++ b/physical/physical.go @@ -9,6 +9,16 @@ import ( const DefaultParallelOperations = 128 +// The operation type +type Operation string + +const ( + DeleteOperation Operation = "delete" + GetOperation = "get" + ListOperation = "list" + PutOperation = "put" +) + // ShutdownSignal type ShutdownChannel chan struct{} @@ -121,20 +131,27 @@ var builtinBackends = map[string]Factory{ "inmem": func(_ map[string]string, logger log.Logger) (Backend, error) { return NewInmem(logger), nil }, + "inmem_transactional": func(_ map[string]string, logger log.Logger) (Backend, error) { + return NewTransactionalInmem(logger), nil + }, "inmem_ha": func(_ map[string]string, logger log.Logger) (Backend, error) { return NewInmemHA(logger), nil }, - "consul": newConsulBackend, - "zookeeper": newZookeeperBackend, - "file": newFileBackend, - "s3": newS3Backend, - "azure": newAzureBackend, - "dynamodb": newDynamoDBBackend, - "etcd": newEtcdBackend, - "mysql": newMySQLBackend, - "postgresql": newPostgreSQLBackend, - "swift": newSwiftBackend, - "gcs": newGCSBackend, + "inmem_transactional_ha": func(_ map[string]string, logger log.Logger) (Backend, error) { + return NewTransactionalInmemHA(logger), nil + }, + "file_transactional": newTransactionalFileBackend, + "consul": newConsulBackend, + "zookeeper": newZookeeperBackend, + "file": newFileBackend, + "s3": newS3Backend, + "azure": newAzureBackend, + "dynamodb": newDynamoDBBackend, + "etcd": newEtcdBackend, + "mysql": newMySQLBackend, + "postgresql": newPostgreSQLBackend, + "swift": newSwiftBackend, + "gcs": newGCSBackend, } // PermitPool is used to limit maximum outstanding requests diff --git a/physical/postgresql.go b/physical/postgresql.go index 0682f646b7..2b11d4881a 100644 --- a/physical/postgresql.go +++ b/physical/postgresql.go @@ -71,7 +71,8 @@ func newPostgreSQLBackend(conf map[string]string, logger log.Logger) (Backend, e get_query: "SELECT value FROM " + quoted_table + " WHERE path = $1 AND key = $2", delete_query: "DELETE FROM " + quoted_table + " WHERE path = $1 AND key = $2", list_query: "SELECT key FROM " + quoted_table + " WHERE path = $1" + - "UNION SELECT substr(path, length($1)+1) FROM " + quoted_table + "WHERE parent_path = $1", + "UNION SELECT DISTINCT substring(substr(path, length($1)+1) from '^.*?/') FROM " + + quoted_table + " WHERE parent_path LIKE concat($1, '%')", logger: logger, } diff --git a/physical/transactions.go b/physical/transactions.go new file mode 100644 index 0000000000..b9ddffa902 --- /dev/null +++ b/physical/transactions.go @@ -0,0 +1,121 @@ +package physical + +import multierror "github.com/hashicorp/go-multierror" + +// TxnEntry is an operation that takes atomically as part of +// a transactional update. Only supported by Transactional backends. +type TxnEntry struct { + Operation Operation + Entry *Entry +} + +// Transactional is an optional interface for backends that +// support doing transactional updates of multiple keys. This is +// required for some features such as replication. +type Transactional interface { + // The function to run a transaction + Transaction([]TxnEntry) error +} + +type PseudoTransactional interface { + // An internal function should do no locking or permit pool acquisition. + // Depending on the backend and if it natively supports transactions, these + // may simply chain to the normal backend functions. + GetInternal(string) (*Entry, error) + PutInternal(*Entry) error + DeleteInternal(string) error +} + +// Implements the transaction interface +func genericTransactionHandler(t PseudoTransactional, txns []TxnEntry) (retErr error) { + rollbackStack := make([]TxnEntry, 0, len(txns)) + var dirty bool + + // We walk the transactions in order; each successful operation goes into a + // LIFO for rollback if we hit an error along the way +TxnWalk: + for _, txn := range txns { + switch txn.Operation { + case DeleteOperation: + entry, err := t.GetInternal(txn.Entry.Key) + if err != nil { + retErr = multierror.Append(retErr, err) + dirty = true + break TxnWalk + } + if entry == nil { + // Nothing to delete or roll back + continue + } + rollbackEntry := TxnEntry{ + Operation: PutOperation, + Entry: &Entry{ + Key: entry.Key, + Value: entry.Value, + }, + } + err = t.DeleteInternal(txn.Entry.Key) + if err != nil { + retErr = multierror.Append(retErr, err) + dirty = true + break TxnWalk + } + rollbackStack = append([]TxnEntry{rollbackEntry}, rollbackStack...) + + case PutOperation: + entry, err := t.GetInternal(txn.Entry.Key) + if err != nil { + retErr = multierror.Append(retErr, err) + dirty = true + break TxnWalk + } + // Nothing existed so in fact rolling back requires a delete + var rollbackEntry TxnEntry + if entry == nil { + rollbackEntry = TxnEntry{ + Operation: DeleteOperation, + Entry: &Entry{ + Key: txn.Entry.Key, + }, + } + } else { + rollbackEntry = TxnEntry{ + Operation: PutOperation, + Entry: &Entry{ + Key: entry.Key, + Value: entry.Value, + }, + } + } + err = t.PutInternal(txn.Entry) + if err != nil { + retErr = multierror.Append(retErr, err) + dirty = true + break TxnWalk + } + rollbackStack = append([]TxnEntry{rollbackEntry}, rollbackStack...) + } + } + + // Need to roll back because we hit an error along the way + if dirty { + // While traversing this, if we get an error, we continue anyways in + // best-effort fashion + for _, txn := range rollbackStack { + switch txn.Operation { + case DeleteOperation: + err := t.DeleteInternal(txn.Entry.Key) + if err != nil { + retErr = multierror.Append(retErr, err) + } + case PutOperation: + err := t.PutInternal(txn.Entry) + if err != nil { + retErr = multierror.Append(retErr, err) + } + } + } + } + + return +} diff --git a/physical/transactions_test.go b/physical/transactions_test.go new file mode 100644 index 0000000000..e365a95974 --- /dev/null +++ b/physical/transactions_test.go @@ -0,0 +1,254 @@ +package physical + +import ( + "fmt" + "reflect" + "sort" + "testing" + + radix "github.com/armon/go-radix" + "github.com/hashicorp/vault/helper/logformat" + log "github.com/mgutz/logxi/v1" +) + +type faultyPseudo struct { + underlying InmemBackend + faultyPaths map[string]struct{} +} + +func (f *faultyPseudo) Get(key string) (*Entry, error) { + return f.underlying.Get(key) +} + +func (f *faultyPseudo) Put(entry *Entry) error { + return f.underlying.Put(entry) +} + +func (f *faultyPseudo) Delete(key string) error { + return f.underlying.Delete(key) +} + +func (f *faultyPseudo) GetInternal(key string) (*Entry, error) { + if _, ok := f.faultyPaths[key]; ok { + return nil, fmt.Errorf("fault") + } + return f.underlying.GetInternal(key) +} + +func (f *faultyPseudo) PutInternal(entry *Entry) error { + if _, ok := f.faultyPaths[entry.Key]; ok { + return fmt.Errorf("fault") + } + return f.underlying.PutInternal(entry) +} + +func (f *faultyPseudo) DeleteInternal(key string) error { + if _, ok := f.faultyPaths[key]; ok { + return fmt.Errorf("fault") + } + return f.underlying.DeleteInternal(key) +} + +func (f *faultyPseudo) List(prefix string) ([]string, error) { + return f.underlying.List(prefix) +} + +func (f *faultyPseudo) Transaction(txns []TxnEntry) error { + f.underlying.permitPool.Acquire() + defer f.underlying.permitPool.Release() + + f.underlying.Lock() + defer f.underlying.Unlock() + + return genericTransactionHandler(f, txns) +} + +func newFaultyPseudo(logger log.Logger, faultyPaths []string) *faultyPseudo { + out := &faultyPseudo{ + underlying: InmemBackend{ + root: radix.New(), + permitPool: NewPermitPool(1), + logger: logger, + }, + faultyPaths: make(map[string]struct{}, len(faultyPaths)), + } + for _, v := range faultyPaths { + out.faultyPaths[v] = struct{}{} + } + return out +} + +func TestPseudo_Basic(t *testing.T) { + logger := logformat.NewVaultLogger(log.LevelTrace) + p := newFaultyPseudo(logger, nil) + testBackend(t, p) + testBackend_ListPrefix(t, p) +} + +func TestPseudo_SuccessfulTransaction(t *testing.T) { + logger := logformat.NewVaultLogger(log.LevelTrace) + p := newFaultyPseudo(logger, nil) + + txns := setupPseudo(p, t) + + if err := p.Transaction(txns); err != nil { + t.Fatal(err) + } + + keys, err := p.List("") + if err != nil { + t.Fatal(err) + } + + expected := []string{"foo", "zip"} + + sort.Strings(keys) + sort.Strings(expected) + if !reflect.DeepEqual(keys, expected) { + t.Fatalf("mismatch: expected\n%#v\ngot\n%#v\n", expected, keys) + } + + entry, err := p.Get("foo") + if err != nil { + t.Fatal(err) + } + if entry == nil { + t.Fatal("got nil entry") + } + if entry.Value == nil { + t.Fatal("got nil value") + } + if string(entry.Value) != "bar3" { + t.Fatal("updates did not apply correctly") + } + + entry, err = p.Get("zip") + if err != nil { + t.Fatal(err) + } + if entry == nil { + t.Fatal("got nil entry") + } + if entry.Value == nil { + t.Fatal("got nil value") + } + if string(entry.Value) != "zap3" { + t.Fatal("updates did not apply correctly") + } +} + +func TestPseudo_FailedTransaction(t *testing.T) { + logger := logformat.NewVaultLogger(log.LevelTrace) + p := newFaultyPseudo(logger, []string{"zip"}) + + txns := setupPseudo(p, t) + + if err := p.Transaction(txns); err == nil { + t.Fatal("expected error during transaction") + } + + keys, err := p.List("") + if err != nil { + t.Fatal(err) + } + + expected := []string{"foo", "zip", "deleteme", "deleteme2"} + + sort.Strings(keys) + sort.Strings(expected) + if !reflect.DeepEqual(keys, expected) { + t.Fatalf("mismatch: expected\n%#v\ngot\n%#v\n", expected, keys) + } + + entry, err := p.Get("foo") + if err != nil { + t.Fatal(err) + } + if entry == nil { + t.Fatal("got nil entry") + } + if entry.Value == nil { + t.Fatal("got nil value") + } + if string(entry.Value) != "bar" { + t.Fatal("values did not rollback correctly") + } + + entry, err = p.Get("zip") + if err != nil { + t.Fatal(err) + } + if entry == nil { + t.Fatal("got nil entry") + } + if entry.Value == nil { + t.Fatal("got nil value") + } + if string(entry.Value) != "zap" { + t.Fatal("values did not rollback correctly") + } +} + +func setupPseudo(p *faultyPseudo, t *testing.T) []TxnEntry { + // Add a few keys so that we test rollback with deletion + if err := p.Put(&Entry{ + Key: "foo", + Value: []byte("bar"), + }); err != nil { + t.Fatal(err) + } + if err := p.Put(&Entry{ + Key: "zip", + Value: []byte("zap"), + }); err != nil { + t.Fatal(err) + } + if err := p.Put(&Entry{ + Key: "deleteme", + }); err != nil { + t.Fatal(err) + } + if err := p.Put(&Entry{ + Key: "deleteme2", + }); err != nil { + t.Fatal(err) + } + + txns := []TxnEntry{ + TxnEntry{ + Operation: PutOperation, + Entry: &Entry{ + Key: "foo", + Value: []byte("bar2"), + }, + }, + TxnEntry{ + Operation: DeleteOperation, + Entry: &Entry{ + Key: "deleteme", + }, + }, + TxnEntry{ + Operation: PutOperation, + Entry: &Entry{ + Key: "foo", + Value: []byte("bar3"), + }, + }, + TxnEntry{ + Operation: DeleteOperation, + Entry: &Entry{ + Key: "deleteme2", + }, + }, + TxnEntry{ + Operation: PutOperation, + Entry: &Entry{ + Key: "zip", + Value: []byte("zap3"), + }, + }, + } + + return txns +} diff --git a/scripts/cross/Dockerfile b/scripts/cross/Dockerfile index 7d9638b0a2..1194fb02ed 100644 --- a/scripts/cross/Dockerfile +++ b/scripts/cross/Dockerfile @@ -10,7 +10,7 @@ RUN apt-get update -y && apt-get install --no-install-recommends -y -q \ git mercurial bzr \ && rm -rf /var/lib/apt/lists/* -ENV GOVERSION 1.8rc3 +ENV GOVERSION 1.8 RUN mkdir /goroot && mkdir /gopath RUN curl https://storage.googleapis.com/golang/go${GOVERSION}.linux-amd64.tar.gz \ | tar xvzf - -C /goroot --strip-components=1 diff --git a/vault/audit.go b/vault/audit.go index 3df4cd96b1..b8974963eb 100644 --- a/vault/audit.go +++ b/vault/audit.go @@ -2,7 +2,6 @@ package vault import ( "crypto/sha256" - "encoding/json" "errors" "fmt" "strings" @@ -26,6 +25,10 @@ const ( // can only be viewed or modified after an unseal. coreAuditConfigPath = "core/audit" + // coreLocalAuditConfigPath is used to store audit information for local + // (non-replicated) mounts + coreLocalAuditConfigPath = "core/local-audit" + // auditBarrierPrefix is the prefix to the UUID used in the // barrier view for the audit backends. auditBarrierPrefix = "audit/" @@ -69,12 +72,15 @@ func (c *Core) enableAudit(entry *MountEntry) error { } // Generate a new UUID and view - entryUUID, err := uuid.GenerateUUID() - if err != nil { - return err + if entry.UUID == "" { + entryUUID, err := uuid.GenerateUUID() + if err != nil { + return err + } + entry.UUID = entryUUID } - entry.UUID = entryUUID - view := NewBarrierView(c.barrier, auditBarrierPrefix+entry.UUID+"/") + viewPath := auditBarrierPrefix + entry.UUID + "/" + view := NewBarrierView(c.barrier, viewPath) // Lookup the new backend backend, err := c.newAuditBackend(entry, view, entry.Options) @@ -119,6 +125,12 @@ func (c *Core) disableAudit(path string) (bool, error) { c.removeAuditReloadFunc(entry) + // When unmounting all entries the JSON code will load back up from storage + // as a nil slice, which kills tests...just set it nil explicitly + if len(newTable.Entries) == 0 { + newTable.Entries = nil + } + // Update the audit table if err := c.persistAudit(newTable); err != nil { return true, errors.New("failed to update audit table") @@ -131,12 +143,14 @@ func (c *Core) disableAudit(path string) (bool, error) { if c.logger.IsInfo() { c.logger.Info("core: disabled audit backend", "path", path) } + return true, nil } // loadAudits is invoked as part of postUnseal to load the audit table func (c *Core) loadAudits() error { auditTable := &MountTable{} + localAuditTable := &MountTable{} // Load the existing audit table raw, err := c.barrier.Get(coreAuditConfigPath) @@ -144,6 +158,11 @@ func (c *Core) loadAudits() error { c.logger.Error("core: failed to read audit table", "error", err) return errLoadAuditFailed } + rawLocal, err := c.barrier.Get(coreLocalAuditConfigPath) + if err != nil { + c.logger.Error("core: failed to read local audit table", "error", err) + return errLoadAuditFailed + } c.auditLock.Lock() defer c.auditLock.Unlock() @@ -155,6 +174,13 @@ func (c *Core) loadAudits() error { } c.audit = auditTable } + if rawLocal != nil { + if err := jsonutil.DecodeJSON(rawLocal.Value, localAuditTable); err != nil { + c.logger.Error("core: failed to decode local audit table", "error", err) + return errLoadAuditFailed + } + c.audit.Entries = append(c.audit.Entries, localAuditTable.Entries...) + } // Done if we have restored the audit table if c.audit != nil { @@ -203,17 +229,33 @@ func (c *Core) persistAudit(table *MountTable) error { } } + nonLocalAudit := &MountTable{ + Type: auditTableType, + } + + localAudit := &MountTable{ + Type: auditTableType, + } + + for _, entry := range table.Entries { + if entry.Local { + localAudit.Entries = append(localAudit.Entries, entry) + } else { + nonLocalAudit.Entries = append(nonLocalAudit.Entries, entry) + } + } + // Marshal the table - raw, err := json.Marshal(table) + compressedBytes, err := jsonutil.EncodeJSONAndCompress(nonLocalAudit, nil) if err != nil { - c.logger.Error("core: failed to encode audit table", "error", err) + c.logger.Error("core: failed to encode and/or compress audit table", "error", err) return err } // Create an entry entry := &Entry{ Key: coreAuditConfigPath, - Value: raw, + Value: compressedBytes, } // Write to the physical backend @@ -221,6 +263,24 @@ func (c *Core) persistAudit(table *MountTable) error { c.logger.Error("core: failed to persist audit table", "error", err) return err } + + // Repeat with local audit + compressedBytes, err = jsonutil.EncodeJSONAndCompress(localAudit, nil) + if err != nil { + c.logger.Error("core: failed to encode and/or compress local audit table", "error", err) + return err + } + + entry = &Entry{ + Key: coreLocalAuditConfigPath, + Value: compressedBytes, + } + + if err := c.barrier.Put(entry); err != nil { + c.logger.Error("core: failed to persist local audit table", "error", err) + return err + } + return nil } @@ -236,7 +296,8 @@ func (c *Core) setupAudits() error { for _, entry := range c.audit.Entries { // Create a barrier view using the UUID - view := NewBarrierView(c.barrier, auditBarrierPrefix+entry.UUID+"/") + viewPath := auditBarrierPrefix + entry.UUID + "/" + view := NewBarrierView(c.barrier, viewPath) // Initialize the backend audit, err := c.newAuditBackend(entry, view, entry.Options) diff --git a/vault/audit_test.go b/vault/audit_test.go index e1cd51cf99..491be49158 100644 --- a/vault/audit_test.go +++ b/vault/audit_test.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/go-uuid" "github.com/hashicorp/vault/audit" + "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/helper/logformat" "github.com/hashicorp/vault/logical" log "github.com/mgutz/logxi/v1" @@ -164,6 +165,94 @@ func TestCore_EnableAudit_MixedFailures(t *testing.T) { } } +// Test that the local table actually gets populated as expected with local +// entries, and that upon reading the entries from both are recombined +// correctly +func TestCore_EnableAudit_Local(t *testing.T) { + c, _, _ := TestCoreUnsealed(t) + c.auditBackends["noop"] = func(config *audit.BackendConfig) (audit.Backend, error) { + return &NoopAudit{ + Config: config, + }, nil + } + + c.auditBackends["fail"] = func(config *audit.BackendConfig) (audit.Backend, error) { + return nil, fmt.Errorf("failing enabling") + } + + c.audit = &MountTable{ + Type: auditTableType, + Entries: []*MountEntry{ + &MountEntry{ + Table: auditTableType, + Path: "noop/", + Type: "noop", + UUID: "abcd", + }, + &MountEntry{ + Table: auditTableType, + Path: "noop2/", + Type: "noop", + UUID: "bcde", + }, + }, + } + + // Both should set up successfully + err := c.setupAudits() + if err != nil { + t.Fatal(err) + } + + rawLocal, err := c.barrier.Get(coreLocalAuditConfigPath) + if err != nil { + t.Fatal(err) + } + if rawLocal == nil { + t.Fatal("expected non-nil local audit") + } + localAuditTable := &MountTable{} + if err := jsonutil.DecodeJSON(rawLocal.Value, localAuditTable); err != nil { + t.Fatal(err) + } + if len(localAuditTable.Entries) > 0 { + t.Fatalf("expected no entries in local audit table, got %#v", localAuditTable) + } + + c.audit.Entries[1].Local = true + if err := c.persistAudit(c.audit); err != nil { + t.Fatal(err) + } + + rawLocal, err = c.barrier.Get(coreLocalAuditConfigPath) + if err != nil { + t.Fatal(err) + } + if rawLocal == nil { + t.Fatal("expected non-nil local audit") + } + localAuditTable = &MountTable{} + if err := jsonutil.DecodeJSON(rawLocal.Value, localAuditTable); err != nil { + t.Fatal(err) + } + if len(localAuditTable.Entries) != 1 { + t.Fatalf("expected one entry in local audit table, got %#v", localAuditTable) + } + + oldAudit := c.audit + if err := c.loadAudits(); err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(oldAudit, c.audit) { + t.Fatalf("expected\n%#v\ngot\n%#v\n", oldAudit, c.audit) + } + + if len(c.audit.Entries) != 2 { + t.Fatalf("expected two audit entries, got %#v", localAuditTable) + } +} + func TestCore_DisableAudit(t *testing.T) { c, keys, _ := TestCoreUnsealed(t) c.auditBackends["noop"] = func(config *audit.BackendConfig) (audit.Backend, error) { @@ -217,7 +306,7 @@ func TestCore_DisableAudit(t *testing.T) { // Verify matching mount tables if !reflect.DeepEqual(c.audit, c2.audit) { - t.Fatalf("mismatch: %v %v", c.audit, c2.audit) + t.Fatalf("mismatch:\n%#v\n%#v", c.audit, c2.audit) } } diff --git a/vault/auth.go b/vault/auth.go index 399626ca1f..5c8315645f 100644 --- a/vault/auth.go +++ b/vault/auth.go @@ -1,7 +1,6 @@ package vault import ( - "encoding/json" "errors" "fmt" "strings" @@ -17,6 +16,10 @@ const ( // can only be viewed or modified after an unseal. coreAuthConfigPath = "core/auth" + // coreLocalAuthConfigPath is used to store credential configuration for + // local (non-replicated) mounts + coreLocalAuthConfigPath = "core/local-auth" + // credentialBarrierPrefix is the prefix to the UUID used in the // barrier view for the credential backends. credentialBarrierPrefix = "auth/" @@ -71,16 +74,25 @@ func (c *Core) enableCredential(entry *MountEntry) error { } // Generate a new UUID and view - entryUUID, err := uuid.GenerateUUID() + if entry.UUID == "" { + entryUUID, err := uuid.GenerateUUID() + if err != nil { + return err + } + entry.UUID = entryUUID + } + + viewPath := credentialBarrierPrefix + entry.UUID + "/" + view := NewBarrierView(c.barrier, viewPath) + sysView := c.mountEntrySysView(entry) + + // Create the new backend + backend, err := c.newCredentialBackend(entry.Type, sysView, view, nil) if err != nil { return err } - entry.UUID = entryUUID - view := NewBarrierView(c.barrier, credentialBarrierPrefix+entry.UUID+"/") - // Create the new backend - backend, err := c.newCredentialBackend(entry.Type, c.mountEntrySysView(entry), view, nil) - if err != nil { + if err := backend.Initialize(); err != nil { return err } @@ -121,7 +133,7 @@ func (c *Core) disableCredential(path string) (bool, error) { fullPath := credentialRoutePrefix + path view := c.router.MatchingStorageView(fullPath) if view == nil { - return false, fmt.Errorf("no matching backend") + return false, fmt.Errorf("no matching backend %s", fullPath) } // Mark the entry as tainted @@ -206,12 +218,19 @@ func (c *Core) taintCredEntry(path string) error { // loadCredentials is invoked as part of postUnseal to load the auth table func (c *Core) loadCredentials() error { authTable := &MountTable{} + localAuthTable := &MountTable{} + // Load the existing mount table raw, err := c.barrier.Get(coreAuthConfigPath) if err != nil { c.logger.Error("core: failed to read auth table", "error", err) return errLoadAuthFailed } + rawLocal, err := c.barrier.Get(coreLocalAuthConfigPath) + if err != nil { + c.logger.Error("core: failed to read local auth table", "error", err) + return errLoadAuthFailed + } c.authLock.Lock() defer c.authLock.Unlock() @@ -223,6 +242,13 @@ func (c *Core) loadCredentials() error { } c.auth = authTable } + if rawLocal != nil { + if err := jsonutil.DecodeJSON(rawLocal.Value, localAuthTable); err != nil { + c.logger.Error("core: failed to decode local auth table", "error", err) + return errLoadAuthFailed + } + c.auth.Entries = append(c.auth.Entries, localAuthTable.Entries...) + } // Done if we have restored the auth table if c.auth != nil { @@ -272,17 +298,33 @@ func (c *Core) persistAuth(table *MountTable) error { } } + nonLocalAuth := &MountTable{ + Type: credentialTableType, + } + + localAuth := &MountTable{ + Type: credentialTableType, + } + + for _, entry := range table.Entries { + if entry.Local { + localAuth.Entries = append(localAuth.Entries, entry) + } else { + nonLocalAuth.Entries = append(nonLocalAuth.Entries, entry) + } + } + // Marshal the table - raw, err := json.Marshal(table) + compressedBytes, err := jsonutil.EncodeJSONAndCompress(nonLocalAuth, nil) if err != nil { - c.logger.Error("core: failed to encode auth table", "error", err) + c.logger.Error("core: failed to encode and/or compress auth table", "error", err) return err } // Create an entry entry := &Entry{ Key: coreAuthConfigPath, - Value: raw, + Value: compressedBytes, } // Write to the physical backend @@ -290,6 +332,24 @@ func (c *Core) persistAuth(table *MountTable) error { c.logger.Error("core: failed to persist auth table", "error", err) return err } + + // Repeat with local auth + compressedBytes, err = jsonutil.EncodeJSONAndCompress(localAuth, nil) + if err != nil { + c.logger.Error("core: failed to encode and/or compress local auth table", "error", err) + return err + } + + entry = &Entry{ + Key: coreLocalAuthConfigPath, + Value: compressedBytes, + } + + if err := c.barrier.Put(entry); err != nil { + c.logger.Error("core: failed to persist local auth table", "error", err) + return err + } + return nil } @@ -312,15 +372,21 @@ func (c *Core) setupCredentials() error { } // Create a barrier view using the UUID - view = NewBarrierView(c.barrier, credentialBarrierPrefix+entry.UUID+"/") + viewPath := credentialBarrierPrefix + entry.UUID + "/" + view = NewBarrierView(c.barrier, viewPath) + sysView := c.mountEntrySysView(entry) // Initialize the backend - backend, err = c.newCredentialBackend(entry.Type, c.mountEntrySysView(entry), view, nil) + backend, err = c.newCredentialBackend(entry.Type, sysView, view, nil) if err != nil { c.logger.Error("core: failed to create credential entry", "path", entry.Path, "error", err) return errLoadAuthFailed } + if err := backend.Initialize(); err != nil { + return err + } + // Mount the backend path := credentialRoutePrefix + entry.Path err = c.router.Mount(backend, path, entry, view) diff --git a/vault/auth_test.go b/vault/auth_test.go index 75caa789fe..41f9eb37bb 100644 --- a/vault/auth_test.go +++ b/vault/auth_test.go @@ -2,8 +2,10 @@ package vault import ( "reflect" + "strings" "testing" + "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/logical" ) @@ -84,6 +86,88 @@ func TestCore_EnableCredential(t *testing.T) { } } +// Test that the local table actually gets populated as expected with local +// entries, and that upon reading the entries from both are recombined +// correctly +func TestCore_EnableCredential_Local(t *testing.T) { + c, _, _ := TestCoreUnsealed(t) + c.credentialBackends["noop"] = func(*logical.BackendConfig) (logical.Backend, error) { + return &NoopBackend{}, nil + } + + c.auth = &MountTable{ + Type: credentialTableType, + Entries: []*MountEntry{ + &MountEntry{ + Table: credentialTableType, + Path: "noop/", + Type: "noop", + UUID: "abcd", + }, + &MountEntry{ + Table: credentialTableType, + Path: "noop2/", + Type: "noop", + UUID: "bcde", + }, + }, + } + + // Both should set up successfully + err := c.setupCredentials() + if err != nil { + t.Fatal(err) + } + + rawLocal, err := c.barrier.Get(coreLocalAuthConfigPath) + if err != nil { + t.Fatal(err) + } + if rawLocal == nil { + t.Fatal("expected non-nil local credential") + } + localCredentialTable := &MountTable{} + if err := jsonutil.DecodeJSON(rawLocal.Value, localCredentialTable); err != nil { + t.Fatal(err) + } + if len(localCredentialTable.Entries) > 0 { + t.Fatalf("expected no entries in local credential table, got %#v", localCredentialTable) + } + + c.auth.Entries[1].Local = true + if err := c.persistAuth(c.auth); err != nil { + t.Fatal(err) + } + + rawLocal, err = c.barrier.Get(coreLocalAuthConfigPath) + if err != nil { + t.Fatal(err) + } + if rawLocal == nil { + t.Fatal("expected non-nil local credential") + } + localCredentialTable = &MountTable{} + if err := jsonutil.DecodeJSON(rawLocal.Value, localCredentialTable); err != nil { + t.Fatal(err) + } + if len(localCredentialTable.Entries) != 1 { + t.Fatalf("expected one entry in local credential table, got %#v", localCredentialTable) + } + + oldCredential := c.auth + if err := c.loadCredentials(); err != nil { + t.Fatal(err) + } + + if !reflect.DeepEqual(oldCredential, c.auth) { + t.Fatalf("expected\n%#v\ngot\n%#v\n", oldCredential, c.auth) + } + + if len(c.auth.Entries) != 2 { + t.Fatalf("expected two credential entries, got %#v", localCredentialTable) + } +} + func TestCore_EnableCredential_twice_409(t *testing.T) { c, _, _ := TestCoreUnsealed(t) c.credentialBackends["noop"] = func(*logical.BackendConfig) (logical.Backend, error) { @@ -132,7 +216,7 @@ func TestCore_DisableCredential(t *testing.T) { } existed, err := c.disableCredential("foo") - if existed || err.Error() != "no matching backend" { + if existed || (err != nil && !strings.HasPrefix(err.Error(), "no matching backend")) { t.Fatalf("existed: %v; err: %v", existed, err) } diff --git a/vault/barrier.go b/vault/barrier.go index df0660d0fe..7c9acc0550 100644 --- a/vault/barrier.go +++ b/vault/barrier.go @@ -86,6 +86,11 @@ type SecurityBarrier interface { // VerifyMaster is used to check if the given key matches the master key VerifyMaster(key []byte) error + // SetMasterKey is used to directly set a new master key. This is used in + // repliated scenarios due to the chicken and egg problem of reloading the + // keyring from disk before we have the master key to decrypt it. + SetMasterKey(key []byte) error + // ReloadKeyring is used to re-read the underlying keyring. // This is used for HA deployments to ensure the latest keyring // is present in the leader. @@ -119,8 +124,14 @@ type SecurityBarrier interface { // Rekey is used to change the master key used to protect the keyring Rekey([]byte) error + // For replication we must send over the keyring, so this must be available + Keyring() (*Keyring, error) + // SecurityBarrier must provide the storage APIs BarrierStorage + + // SecurityBarrier must provide the encryption APIs + BarrierEncryptor } // BarrierStorage is the storage only interface required for a Barrier. @@ -139,6 +150,14 @@ type BarrierStorage interface { List(prefix string) ([]string, error) } +// BarrierEncryptor is the in memory only interface that does not actually +// use the underlying barrier. It is used for lower level modules like the +// Write-Ahead-Log and Merkle index to allow them to use the barrier. +type BarrierEncryptor interface { + Encrypt(key string, plaintext []byte) ([]byte, error) + Decrypt(key string, ciphertext []byte) ([]byte, error) +} + // Entry is used to represent data stored by the security barrier type Entry struct { Key string diff --git a/vault/barrier_aes_gcm.go b/vault/barrier_aes_gcm.go index 56ebeb8c0c..37c191bd6b 100644 --- a/vault/barrier_aes_gcm.go +++ b/vault/barrier_aes_gcm.go @@ -574,19 +574,12 @@ func (b *AESGCMBarrier) ActiveKeyInfo() (*KeyInfo, error) { func (b *AESGCMBarrier) Rekey(key []byte) error { b.l.Lock() defer b.l.Unlock() - if b.sealed { - return ErrBarrierSealed - } - // Verify the key size - min, max := b.KeyLength() - if len(key) < min || len(key) > max { - return fmt.Errorf("Key size must be %d or %d", min, max) + newKeyring, err := b.updateMasterKeyCommon(key) + if err != nil { + return err } - // Add a new encryption key - newKeyring := b.keyring.SetMasterKey(key) - // Persist the new keyring if err := b.persistKeyring(newKeyring); err != nil { return err @@ -599,6 +592,40 @@ func (b *AESGCMBarrier) Rekey(key []byte) error { return nil } +// SetMasterKey updates the keyring's in-memory master key but does not persist +// anything to storage +func (b *AESGCMBarrier) SetMasterKey(key []byte) error { + b.l.Lock() + defer b.l.Unlock() + + newKeyring, err := b.updateMasterKeyCommon(key) + if err != nil { + return err + } + + // Swap the keyrings + oldKeyring := b.keyring + b.keyring = newKeyring + oldKeyring.Zeroize(false) + return nil +} + +// Performs common tasks related to updating the master key; note that the lock +// must be held before calling this function +func (b *AESGCMBarrier) updateMasterKeyCommon(key []byte) (*Keyring, error) { + if b.sealed { + return nil, ErrBarrierSealed + } + + // Verify the key size + min, max := b.KeyLength() + if len(key) < min || len(key) > max { + return nil, fmt.Errorf("Key size must be %d or %d", min, max) + } + + return b.keyring.SetMasterKey(key), nil +} + // Put is used to insert or update an entry func (b *AESGCMBarrier) Put(entry *Entry) error { defer metrics.MeasureSince([]string{"barrier", "put"}, time.Now()) @@ -813,3 +840,47 @@ func (b *AESGCMBarrier) decryptKeyring(path string, cipher []byte) ([]byte, erro return nil, fmt.Errorf("version bytes mis-match") } } + +// Encrypt is used to encrypt in-memory for the BarrierEncryptor interface +func (b *AESGCMBarrier) Encrypt(key string, plaintext []byte) ([]byte, error) { + b.l.RLock() + defer b.l.RUnlock() + if b.sealed { + return nil, ErrBarrierSealed + } + + term := b.keyring.ActiveTerm() + primary, err := b.aeadForTerm(term) + if err != nil { + return nil, err + } + + ciphertext := b.encrypt(key, term, primary, plaintext) + return ciphertext, nil +} + +// Decrypt is used to decrypt in-memory for the BarrierEncryptor interface +func (b *AESGCMBarrier) Decrypt(key string, ciphertext []byte) ([]byte, error) { + b.l.RLock() + defer b.l.RUnlock() + if b.sealed { + return nil, ErrBarrierSealed + } + + // Decrypt the ciphertext + plain, err := b.decryptKeyring(key, ciphertext) + if err != nil { + return nil, fmt.Errorf("decryption failed: %v", err) + } + return plain, nil +} + +func (b *AESGCMBarrier) Keyring() (*Keyring, error) { + b.l.RLock() + defer b.l.RUnlock() + if b.sealed { + return nil, ErrBarrierSealed + } + + return b.keyring.Clone(), nil +} diff --git a/vault/barrier_aes_gcm_test.go b/vault/barrier_aes_gcm_test.go index b1957b3092..7d575cee83 100644 --- a/vault/barrier_aes_gcm_test.go +++ b/vault/barrier_aes_gcm_test.go @@ -15,7 +15,7 @@ var ( ) // mockBarrier returns a physical backend, security barrier, and master key -func mockBarrier(t *testing.T) (physical.Backend, SecurityBarrier, []byte) { +func mockBarrier(t testing.TB) (physical.Backend, SecurityBarrier, []byte) { inm := physical.NewInmem(logger) b, err := NewAESGCMBarrier(inm) @@ -433,3 +433,30 @@ func TestInitialize_KeyLength(t *testing.T) { t.Fatalf("key length protection failed") } } + +func TestEncrypt_BarrierEncryptor(t *testing.T) { + inm := physical.NewInmem(logger) + b, err := NewAESGCMBarrier(inm) + if err != nil { + t.Fatalf("err: %v", err) + } + + // Initialize and unseal + key, _ := b.GenerateKey() + b.Initialize(key) + b.Unseal(key) + + cipher, err := b.Encrypt("foo", []byte("quick brown fox")) + if err != nil { + t.Fatalf("err: %v", err) + } + + plain, err := b.Decrypt("foo", cipher) + if err != nil { + t.Fatalf("err: %v", err) + } + + if string(plain) != "quick brown fox" { + t.Fatalf("bad: %s", plain) + } +} diff --git a/vault/barrier_view.go b/vault/barrier_view.go index b0dbbf2d1d..0fa6f2d78f 100644 --- a/vault/barrier_view.go +++ b/vault/barrier_view.go @@ -69,14 +69,18 @@ func (v *BarrierView) Get(key string) (*logical.StorageEntry, error) { // logical.Storage impl. func (v *BarrierView) Put(entry *logical.StorageEntry) error { - if v.readonly { - return logical.ErrReadOnly - } if err := v.sanityCheck(entry.Key); err != nil { return err } + + expandedKey := v.expandKey(entry.Key) + + if v.readonly { + return logical.ErrReadOnly + } + nested := &Entry{ - Key: v.expandKey(entry.Key), + Key: expandedKey, Value: entry.Value, } return v.barrier.Put(nested) @@ -84,13 +88,18 @@ func (v *BarrierView) Put(entry *logical.StorageEntry) error { // logical.Storage impl. func (v *BarrierView) Delete(key string) error { - if v.readonly { - return logical.ErrReadOnly - } if err := v.sanityCheck(key); err != nil { return err } - return v.barrier.Delete(v.expandKey(key)) + + expandedKey := v.expandKey(key) + + if v.readonly { + return logical.ErrReadOnly + } + + + return v.barrier.Delete(expandedKey) } // SubView constructs a nested sub-view using the given prefix diff --git a/vault/capabilities.go b/vault/capabilities.go index 4d3add4950..6994e52edf 100644 --- a/vault/capabilities.go +++ b/vault/capabilities.go @@ -1,27 +1,19 @@ package vault -import "sort" +import ( + "sort" -// Struct to identify user input errors. -// This is helpful in responding the appropriate status codes to clients -// from the HTTP endpoints. -type StatusBadRequest struct { - Err string -} - -// Implementing error interface -func (s *StatusBadRequest) Error() string { - return s.Err -} + "github.com/hashicorp/vault/logical" +) // Capabilities is used to fetch the capabilities of the given token on the given path func (c *Core) Capabilities(token, path string) ([]string, error) { if path == "" { - return nil, &StatusBadRequest{Err: "missing path"} + return nil, &logical.StatusBadRequest{Err: "missing path"} } if token == "" { - return nil, &StatusBadRequest{Err: "missing token"} + return nil, &logical.StatusBadRequest{Err: "missing token"} } te, err := c.tokenStore.Lookup(token) @@ -29,7 +21,7 @@ func (c *Core) Capabilities(token, path string) ([]string, error) { return nil, err } if te == nil { - return nil, &StatusBadRequest{Err: "invalid token"} + return nil, &logical.StatusBadRequest{Err: "invalid token"} } if te.Policies == nil { diff --git a/vault/cluster.go b/vault/cluster.go index 732080759b..1686c09ced 100644 --- a/vault/cluster.go +++ b/vault/cluster.go @@ -43,7 +43,7 @@ var ( // This can be one of a few key types so the different params may or may not be filled type clusterKeyParams struct { - Type string `json:"type"` + Type string `json:"type" structs:"type" mapstructure:"type"` X *big.Int `json:"x" structs:"x" mapstructure:"x"` Y *big.Int `json:"y" structs:"y" mapstructure:"y"` D *big.Int `json:"d" structs:"d" mapstructure:"d"` @@ -339,45 +339,67 @@ func (c *Core) stopClusterListener() { c.logger.Info("core/stopClusterListener: success") } -// ClusterTLSConfig generates a TLS configuration based on the local cluster -// key and cert. +// ClusterTLSConfig generates a TLS configuration based on the local/replicated +// cluster key and cert. func (c *Core) ClusterTLSConfig() (*tls.Config, error) { cluster, err := c.Cluster() if err != nil { return nil, err } if cluster == nil { - return nil, fmt.Errorf("cluster information is nil") + return nil, fmt.Errorf("local cluster information is nil") } // Prevent data races with the TLS parameters c.clusterParamsLock.Lock() defer c.clusterParamsLock.Unlock() - if c.localClusterCert == nil || len(c.localClusterCert) == 0 { - return nil, fmt.Errorf("cluster certificate is nil") + forwarding := c.localClusterCert != nil && len(c.localClusterCert) > 0 + + var parsedCert *x509.Certificate + if forwarding { + parsedCert, err = x509.ParseCertificate(c.localClusterCert) + if err != nil { + return nil, fmt.Errorf("error parsing local cluster certificate: %v", err) + } + + // This is idempotent, so be sure it's been added + c.clusterCertPool.AddCert(parsedCert) } - parsedCert, err := x509.ParseCertificate(c.localClusterCert) - if err != nil { - return nil, fmt.Errorf("error parsing local cluster certificate: %v", err) - } + nameLookup := func(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) { + c.clusterParamsLock.RLock() + defer c.clusterParamsLock.RUnlock() - // This is idempotent, so be sure it's been added - c.clusterCertPool.AddCert(parsedCert) - - tlsConfig := &tls.Config{ - Certificates: []tls.Certificate{ - tls.Certificate{ + if forwarding && clientHello.ServerName == parsedCert.Subject.CommonName { + return &tls.Certificate{ Certificate: [][]byte{c.localClusterCert}, PrivateKey: c.localClusterPrivateKey, - }, - }, - RootCAs: c.clusterCertPool, - ServerName: parsedCert.Subject.CommonName, - ClientAuth: tls.RequireAndVerifyClientCert, - ClientCAs: c.clusterCertPool, - MinVersion: tls.VersionTLS12, + }, nil + } + + return nil, nil + } + + var clientCertificates []tls.Certificate + if forwarding { + clientCertificates = append(clientCertificates, tls.Certificate{ + Certificate: [][]byte{c.localClusterCert}, + PrivateKey: c.localClusterPrivateKey, + }) + } + + tlsConfig := &tls.Config{ + // We need this here for the client side + Certificates: clientCertificates, + RootCAs: c.clusterCertPool, + ClientAuth: tls.RequireAndVerifyClientCert, + ClientCAs: c.clusterCertPool, + GetCertificate: nameLookup, + MinVersion: tls.VersionTLS12, + } + if forwarding { + tlsConfig.ServerName = parsedCert.Subject.CommonName } return tlsConfig, nil diff --git a/vault/cluster_test.go b/vault/cluster_test.go index 204d76d467..d3ee5126ff 100644 --- a/vault/cluster_test.go +++ b/vault/cluster_test.go @@ -10,6 +10,7 @@ import ( "testing" "time" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/logformat" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/physical" @@ -100,7 +101,7 @@ func TestCluster_ListenForRequests(t *testing.T) { checkListenersFunc := func(expectFail bool) { tlsConfig, err := cores[0].ClusterTLSConfig() if err != nil { - if err.Error() != ErrSealed.Error() { + if err.Error() != consts.ErrSealed.Error() { t.Fatal(err) } tlsConfig = lastTLSConfig diff --git a/vault/core.go b/vault/core.go index 0e5cf4cadc..5562eb8181 100644 --- a/vault/core.go +++ b/vault/core.go @@ -1,9 +1,9 @@ package vault import ( - "bytes" "crypto" "crypto/ecdsa" + "crypto/subtle" "crypto/x509" "errors" "fmt" @@ -23,6 +23,7 @@ import ( "github.com/hashicorp/go-multierror" "github.com/hashicorp/go-uuid" "github.com/hashicorp/vault/audit" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/errutil" "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/helper/logformat" @@ -56,17 +57,14 @@ const ( // leaderPrefixCleanDelay is how long to wait between deletions // of orphaned leader keys, to prevent slamming the backend. leaderPrefixCleanDelay = 200 * time.Millisecond + + // coreKeyringCanaryPath is used as a canary to indicate to replicated + // clusters that they need to perform a rekey operation synchronously; this + // isn't keyring-canary to avoid ignoring it when ignoring core/keyring + coreKeyringCanaryPath = "core/canary-keyring" ) var ( - // ErrSealed is returned if an operation is performed on - // a sealed barrier. No operation is expected to succeed before unsealing - ErrSealed = errors.New("Vault is sealed") - - // ErrStandby is returned if an operation is performed on - // a standby Vault. No operation is expected to succeed until active. - ErrStandby = errors.New("Vault is in standby mode") - // ErrAlreadyInit is returned if the core is already // initialized. This prevents a re-initialization. ErrAlreadyInit = errors.New("Vault is already initialized") @@ -87,6 +85,12 @@ var ( // step down of the active node, to prevent instantly regrabbing the lock. // It's var not const so that tests can manipulate it. manualStepDownSleepPeriod = 10 * time.Second + + // Functions only in the Enterprise version + enterprisePostUnseal = enterprisePostUnsealImpl + enterprisePreSeal = enterprisePreSealImpl + startReplication = startReplicationImpl + stopReplication = stopReplicationImpl ) // ReloadFunc are functions that are called when a reload is requested. @@ -133,6 +137,11 @@ type unlockInformation struct { // interface for API handlers and is responsible for managing the logical and physical // backends, router, security barrier, and audit trails. type Core struct { + // N.B.: This is used to populate a dev token down replication, as + // otherwise, after replication is started, a dev would have to go through + // the generate-root process simply to talk to the new follower cluster. + devToken string + // HABackend may be available depending on the physical backend ha physical.HABackend @@ -268,7 +277,7 @@ type Core struct { // // Name clusterName string - // Used to modify cluster TLS params + // Used to modify cluster parameters clusterParamsLock sync.RWMutex // The private key stored in the barrier used for establishing // mutually-authenticated connections between Vault cluster members @@ -310,11 +319,13 @@ type Core struct { // replicationState keeps the current replication state cached for quick // lookup - replicationState logical.ReplicationState + replicationState consts.ReplicationState } // CoreConfig is used to parameterize a core type CoreConfig struct { + DevToken string `json:"dev_token" structs:"dev_token" mapstructure:"dev_token"` + LogicalBackends map[string]logical.Factory `json:"logical_backends" structs:"logical_backends" mapstructure:"logical_backends"` CredentialBackends map[string]logical.Factory `json:"credential_backends" structs:"credential_backends" mapstructure:"credential_backends"` @@ -390,6 +401,30 @@ func NewCore(conf *CoreConfig) (*Core, error) { conf.Logger = logformat.NewVaultLogger(log.LevelTrace) } + // Setup the core + c := &Core{ + redirectAddr: conf.RedirectAddr, + clusterAddr: conf.ClusterAddr, + physical: conf.Physical, + seal: conf.Seal, + router: NewRouter(), + sealed: true, + standby: true, + logger: conf.Logger, + defaultLeaseTTL: conf.DefaultLeaseTTL, + maxLeaseTTL: conf.MaxLeaseTTL, + cachingDisabled: conf.DisableCache, + clusterName: conf.ClusterName, + clusterCertPool: x509.NewCertPool(), + clusterListenerShutdownCh: make(chan struct{}), + clusterListenerShutdownSuccessCh: make(chan struct{}), + } + + // Wrap the physical backend in a cache layer if enabled and not already wrapped + if _, isCache := conf.Physical.(*physical.Cache); !conf.DisableCache && !isCache { + c.physical = physical.NewCache(conf.Physical, conf.CacheSize, conf.Logger) + } + if !conf.DisableMlock { // Ensure our memory usage is locked into physical RAM if err := mlock.LockMemory(); err != nil { @@ -407,36 +442,12 @@ func NewCore(conf *CoreConfig) (*Core, error) { } // Construct a new AES-GCM barrier - barrier, err := NewAESGCMBarrier(conf.Physical) + var err error + c.barrier, err = NewAESGCMBarrier(c.physical) if err != nil { return nil, fmt.Errorf("barrier setup failed: %v", err) } - // Setup the core - c := &Core{ - redirectAddr: conf.RedirectAddr, - clusterAddr: conf.ClusterAddr, - physical: conf.Physical, - seal: conf.Seal, - barrier: barrier, - router: NewRouter(), - sealed: true, - standby: true, - logger: conf.Logger, - defaultLeaseTTL: conf.DefaultLeaseTTL, - maxLeaseTTL: conf.MaxLeaseTTL, - cachingDisabled: conf.DisableCache, - clusterName: conf.ClusterName, - clusterCertPool: x509.NewCertPool(), - clusterListenerShutdownCh: make(chan struct{}), - clusterListenerShutdownSuccessCh: make(chan struct{}), - } - - // Wrap the backend in a cache unless disabled - if _, isCache := conf.Physical.(*physical.Cache); !conf.DisableCache && !isCache { - c.physical = physical.NewCache(conf.Physical, conf.CacheSize, conf.Logger) - } - if conf.HAPhysical != nil && conf.HAPhysical.HAEnabled() { c.ha = conf.HAPhysical } @@ -518,10 +529,10 @@ func (c *Core) LookupToken(token string) (*TokenEntry, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } // Many tests don't have a token store running @@ -656,7 +667,7 @@ func (c *Core) Leader() (isLeader bool, leaderAddr string, err error) { // Check if sealed if c.sealed { - return false, "", ErrSealed + return false, "", consts.ErrSealed } // Check if HA enabled @@ -803,17 +814,29 @@ func (c *Core) Unseal(key []byte) (bool, error) { return true, nil } + masterKey, err := c.unsealPart(config, key) + if err != nil { + return false, err + } + if masterKey != nil { + return c.unsealInternal(masterKey) + } + + return false, nil +} + +func (c *Core) unsealPart(config *SealConfig, key []byte) ([]byte, error) { // Check if we already have this piece if c.unlockInfo != nil { for _, existing := range c.unlockInfo.Parts { - if bytes.Equal(existing, key) { - return false, nil + if subtle.ConstantTimeCompare(existing, key) == 1 { + return nil, nil } } } else { uuid, err := uuid.GenerateUUID() if err != nil { - return false, err + return nil, err } c.unlockInfo = &unlockInformation{ Nonce: uuid, @@ -828,27 +851,37 @@ func (c *Core) Unseal(key []byte) (bool, error) { if c.logger.IsDebug() { c.logger.Debug("core: cannot unseal, not enough keys", "keys", len(c.unlockInfo.Parts), "threshold", config.SecretThreshold, "nonce", c.unlockInfo.Nonce) } - return false, nil + return nil, nil } + // Best-effort memzero of unlock parts once we're done with them + defer func() { + for i, _ := range c.unlockInfo.Parts { + memzero(c.unlockInfo.Parts[i]) + } + c.unlockInfo = nil + }() + // Recover the master key var masterKey []byte + var err error if config.SecretThreshold == 1 { - masterKey = c.unlockInfo.Parts[0] - c.unlockInfo = nil + masterKey = make([]byte, len(c.unlockInfo.Parts[0])) + copy(masterKey, c.unlockInfo.Parts[0]) } else { masterKey, err = shamir.Combine(c.unlockInfo.Parts) - c.unlockInfo = nil if err != nil { - return false, fmt.Errorf("failed to compute master key: %v", err) + return nil, fmt.Errorf("failed to compute master key: %v", err) } } - defer memzero(masterKey) - return c.unsealInternal(masterKey) + return masterKey, nil } +// This must be called with the state write lock held func (c *Core) unsealInternal(masterKey []byte) (bool, error) { + defer memzero(masterKey) + // Attempt to unlock if err := c.barrier.Unseal(masterKey); err != nil { return false, err @@ -867,12 +900,14 @@ func (c *Core) unsealInternal(masterKey []byte) (bool, error) { c.logger.Warn("core: vault is sealed") return false, err } + if err := c.postUnseal(); err != nil { c.logger.Error("core: post-unseal setup failed", "error", err) c.barrier.Seal() c.logger.Warn("core: vault is sealed") return false, err } + c.standby = false } else { // Go to standby mode, wait until we are active to unseal @@ -1168,6 +1203,7 @@ func (c *Core) postUnseal() (retErr error) { if purgable, ok := c.physical.(physical.Purgable); ok { purgable.Purge() } + // HA mode requires us to handle keyring rotation and rekeying if c.ha != nil { // We want to reload these from disk so that in case of a rekey we're @@ -1190,6 +1226,9 @@ func (c *Core) postUnseal() (retErr error) { return err } } + if err := enterprisePostUnseal(c); err != nil { + return err + } if err := c.ensureWrappingKey(); err != nil { return err } @@ -1251,6 +1290,7 @@ func (c *Core) preSeal() error { c.metricsCh = nil } var result error + if c.ha != nil { c.stopClusterListener() } @@ -1273,6 +1313,10 @@ func (c *Core) preSeal() error { if err := c.unloadMounts(); err != nil { result = multierror.Append(result, errwrap.Wrapf("error unloading mounts: {{err}}", err)) } + if err := enterprisePreSeal(c); err != nil { + result = multierror.Append(result, err) + } + // Purge the backend if supported if purgable, ok := c.physical.(physical.Purgable); ok { purgable.Purge() @@ -1281,6 +1325,22 @@ func (c *Core) preSeal() error { return result } +func enterprisePostUnsealImpl(c *Core) error { + return nil +} + +func enterprisePreSealImpl(c *Core) error { + return nil +} + +func startReplicationImpl(c *Core) error { + return nil +} + +func stopReplicationImpl(c *Core) error { + return nil +} + // runStandby is a long running routine that is used when an HA backend // is enabled. It waits until we are leader and switches this Vault to // active. @@ -1599,6 +1659,14 @@ func (c *Core) emitMetrics(stopCh chan struct{}) { } } +func (c *Core) ReplicationState() consts.ReplicationState { + var state consts.ReplicationState + c.clusterParamsLock.RLock() + state = c.replicationState + c.clusterParamsLock.RUnlock() + return state +} + func (c *Core) SealAccess() *SealAccess { sa := &SealAccess{} sa.SetSeal(c.seal) diff --git a/vault/core_test.go b/vault/core_test.go index 6b9eab04d8..eb991d17b1 100644 --- a/vault/core_test.go +++ b/vault/core_test.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/errwrap" "github.com/hashicorp/go-uuid" "github.com/hashicorp/vault/audit" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/logformat" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/physical" @@ -198,7 +199,7 @@ func TestCore_Route_Sealed(t *testing.T) { Path: "sys/mounts", } _, err := c.HandleRequest(req) - if err != ErrSealed { + if err != consts.ErrSealed { t.Fatalf("err: %v", err) } @@ -1541,7 +1542,7 @@ func testCore_Standby_Common(t *testing.T, inm physical.Backend, inmha physical. // Request should fail in standby mode _, err = core2.HandleRequest(req) - if err != ErrStandby { + if err != consts.ErrStandby { t.Fatalf("err: %v", err) } diff --git a/vault/dynamic_system_view.go b/vault/dynamic_system_view.go index 21fb2d0e90..32c906fae6 100644 --- a/vault/dynamic_system_view.go +++ b/vault/dynamic_system_view.go @@ -3,6 +3,7 @@ package vault import ( "time" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/logical" ) @@ -79,8 +80,8 @@ func (d dynamicSystemView) CachingDisabled() bool { } // Checks if this is a primary Vault instance. -func (d dynamicSystemView) ReplicationState() logical.ReplicationState { - var state logical.ReplicationState +func (d dynamicSystemView) ReplicationState() consts.ReplicationState { + var state consts.ReplicationState d.core.clusterParamsLock.RLock() state = d.core.replicationState d.core.clusterParamsLock.RUnlock() diff --git a/vault/expiration.go b/vault/expiration.go index 84420c6d60..87fceaba67 100644 --- a/vault/expiration.go +++ b/vault/expiration.go @@ -12,6 +12,7 @@ import ( log "github.com/mgutz/logxi/v1" "github.com/hashicorp/go-uuid" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/logical" ) @@ -125,46 +126,114 @@ func (m *ExpirationManager) Restore() error { if err != nil { return fmt.Errorf("failed to scan for leases: %v", err) } - m.logger.Debug("expiration: leases collected", "num_existing", len(existing)) - // Restore each key - for i, leaseID := range existing { - if i%500 == 0 { - m.logger.Trace("expiration: leases loading", "progress", i) - } - // Load the entry - le, err := m.loadEntry(leaseID) - if err != nil { - return err - } + // Make the channels used for the worker pool + broker := make(chan string) + quit := make(chan bool) + // Buffer these channels to prevent deadlocks + errs := make(chan error, len(existing)) + result := make(chan *leaseEntry, len(existing)) - // If there is no entry, nothing to restore - if le == nil { - continue - } + // Use a wait group + wg := &sync.WaitGroup{} - // If there is no expiry time, don't do anything - if le.ExpireTime.IsZero() { - continue - } + // Create 64 workers to distribute work to + for i := 0; i < consts.ExpirationRestoreWorkerCount; i++ { + wg.Add(1) + go func() { + defer wg.Done() - // Determine the remaining time to expiration - expires := le.ExpireTime.Sub(time.Now()) - if expires <= 0 { - expires = minRevokeDelay - } + for { + select { + case leaseID, ok := <-broker: + // broker has been closed, we are done + if !ok { + return + } - // Setup revocation timer - m.pending[le.LeaseID] = time.AfterFunc(expires, func() { - m.expireID(le.LeaseID) - }) + le, err := m.loadEntry(leaseID) + if err != nil { + errs <- err + continue + } + + // Write results out to the result channel + result <- le + + // quit early + case <-quit: + return + } + } + }() } + + // Distribute the collected keys to the workers in a go routine + wg.Add(1) + go func() { + defer wg.Done() + for i, leaseID := range existing { + if i%500 == 0 { + m.logger.Trace("expiration: leases loading", "progress", i) + } + + select { + case <-quit: + return + + default: + broker <- leaseID + } + } + + // Close the broker, causing worker routines to exit + close(broker) + }() + + // Restore each key by pulling from the result chan + for i := 0; i < len(existing); i++ { + select { + case err := <-errs: + // Close all go routines + close(quit) + + return err + + case le := <-result: + + // If there is no entry, nothing to restore + if le == nil { + continue + } + + // If there is no expiry time, don't do anything + if le.ExpireTime.IsZero() { + continue + } + + // Determine the remaining time to expiration + expires := le.ExpireTime.Sub(time.Now()) + if expires <= 0 { + expires = minRevokeDelay + } + + // Setup revocation timer + m.pending[le.LeaseID] = time.AfterFunc(expires, func() { + m.expireID(le.LeaseID) + }) + } + } + + // Let all go routines finish + wg.Wait() + if len(m.pending) > 0 { if m.logger.IsInfo() { m.logger.Info("expire: leases restored", "restored_lease_count", len(m.pending)) } } + return nil } diff --git a/vault/expiration_test.go b/vault/expiration_test.go index 2ae8bd6650..b8255b3e9d 100644 --- a/vault/expiration_test.go +++ b/vault/expiration_test.go @@ -2,23 +2,131 @@ package vault import ( "fmt" + "os" "reflect" "sort" "strings" + "sync" "testing" "time" "github.com/hashicorp/go-uuid" + "github.com/hashicorp/vault/helper/logformat" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/logical/framework" + "github.com/hashicorp/vault/physical" + log "github.com/mgutz/logxi/v1" +) + +var ( + testImagePull sync.Once ) // mockExpiration returns a mock expiration manager -func mockExpiration(t *testing.T) *ExpirationManager { +func mockExpiration(t testing.TB) *ExpirationManager { _, ts, _, _ := TestCoreWithTokenStore(t) return ts.expiration } +func mockBackendExpiration(t testing.TB, backend physical.Backend) (*Core, *ExpirationManager) { + c, ts, _, _ := TestCoreWithBackendTokenStore(t, backend) + return c, ts.expiration +} + +func BenchmarkExpiration_Restore_Etcd(b *testing.B) { + addr := os.Getenv("PHYSICAL_BACKEND_BENCHMARK_ADDR") + randPath := fmt.Sprintf("vault-%d/", time.Now().Unix()) + + logger := logformat.NewVaultLogger(log.LevelTrace) + physicalBackend, err := physical.NewBackend("etcd", logger, map[string]string{ + "address": addr, + "path": randPath, + "max_parallel": "256", + }) + if err != nil { + b.Fatalf("err: %s", err) + } + + benchmarkExpirationBackend(b, physicalBackend, 10000) // 10,000 leases +} + +func BenchmarkExpiration_Restore_Consul(b *testing.B) { + addr := os.Getenv("PHYSICAL_BACKEND_BENCHMARK_ADDR") + randPath := fmt.Sprintf("vault-%d/", time.Now().Unix()) + + logger := logformat.NewVaultLogger(log.LevelTrace) + physicalBackend, err := physical.NewBackend("consul", logger, map[string]string{ + "address": addr, + "path": randPath, + "max_parallel": "256", + }) + if err != nil { + b.Fatalf("err: %s", err) + } + + benchmarkExpirationBackend(b, physicalBackend, 10000) // 10,000 leases +} + +func BenchmarkExpiration_Restore_InMem(b *testing.B) { + logger := logformat.NewVaultLogger(log.LevelTrace) + benchmarkExpirationBackend(b, physical.NewInmem(logger), 100000) // 100,000 Leases +} + +func benchmarkExpirationBackend(b *testing.B, physicalBackend physical.Backend, numLeases int) { + c, exp := mockBackendExpiration(b, physicalBackend) + noop := &NoopBackend{} + view := NewBarrierView(c.barrier, "logical/") + meUUID, err := uuid.GenerateUUID() + if err != nil { + b.Fatal(err) + } + exp.router.Mount(noop, "prod/aws/", &MountEntry{UUID: meUUID}, view) + + // Register fake leases + for i := 0; i < numLeases; i++ { + pathUUID, err := uuid.GenerateUUID() + if err != nil { + b.Fatal(err) + } + + req := &logical.Request{ + Operation: logical.ReadOperation, + Path: "prod/aws/" + pathUUID, + } + resp := &logical.Response{ + Secret: &logical.Secret{ + LeaseOptions: logical.LeaseOptions{ + TTL: 400 * time.Second, + }, + }, + Data: map[string]interface{}{ + "access_key": "xyz", + "secret_key": "abcd", + }, + } + _, err = exp.Register(req, resp) + if err != nil { + b.Fatalf("err: %v", err) + } + } + + // Stop everything + err = exp.Stop() + if err != nil { + b.Fatalf("err: %v", err) + } + + b.ResetTimer() + for i := 0; i < b.N; i++ { + err = exp.Restore() + // Restore + if err != nil { + b.Fatalf("err: %v", err) + } + } + b.StopTimer() +} + func TestExpiration_Restore(t *testing.T) { exp := mockExpiration(t) noop := &NoopBackend{} diff --git a/vault/generate_root.go b/vault/generate_root.go index 0966e96023..4278b022f3 100644 --- a/vault/generate_root.go +++ b/vault/generate_root.go @@ -6,6 +6,7 @@ import ( "fmt" "github.com/hashicorp/go-uuid" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/pgpkeys" "github.com/hashicorp/vault/helper/xor" "github.com/hashicorp/vault/shamir" @@ -34,10 +35,10 @@ func (c *Core) GenerateRootProgress() (int, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return 0, ErrSealed + return 0, consts.ErrSealed } if c.standby { - return 0, ErrStandby + return 0, consts.ErrStandby } c.generateRootLock.Lock() @@ -52,10 +53,10 @@ func (c *Core) GenerateRootConfiguration() (*GenerateRootConfig, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } c.generateRootLock.Lock() @@ -101,10 +102,10 @@ func (c *Core) GenerateRootInit(otp, pgpKey string) error { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return ErrSealed + return consts.ErrSealed } if c.standby { - return ErrStandby + return consts.ErrStandby } c.generateRootLock.Lock() @@ -170,10 +171,10 @@ func (c *Core) GenerateRootUpdate(key []byte, nonce string) (*GenerateRootResult c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } c.generateRootLock.Lock() @@ -308,10 +309,10 @@ func (c *Core) GenerateRootCancel() error { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return ErrSealed + return consts.ErrSealed } if c.standby { - return ErrStandby + return consts.ErrStandby } c.generateRootLock.Lock() diff --git a/vault/init.go b/vault/init.go index 221a9bd051..3e267fd011 100644 --- a/vault/init.go +++ b/vault/init.go @@ -133,36 +133,12 @@ func (c *Core) Initialize(initParams *InitParams) (*InitResult, error) { return nil, fmt.Errorf("error initializing seal: %v", err) } - err = c.seal.SetBarrierConfig(barrierConfig) - if err != nil { - c.logger.Error("core: failed to save barrier configuration", "error", err) - return nil, fmt.Errorf("barrier configuration saving failed: %v", err) - } - barrierKey, barrierUnsealKeys, err := c.generateShares(barrierConfig) if err != nil { c.logger.Error("core: error generating shares", "error", err) return nil, err } - // If we are storing shares, pop them out of the returned results and push - // them through the seal - if barrierConfig.StoredShares > 0 { - var keysToStore [][]byte - for i := 0; i < barrierConfig.StoredShares; i++ { - keysToStore = append(keysToStore, barrierUnsealKeys[0]) - barrierUnsealKeys = barrierUnsealKeys[1:] - } - if err := c.seal.SetStoredKeys(keysToStore); err != nil { - c.logger.Error("core: failed to store keys", "error", err) - return nil, fmt.Errorf("failed to store keys: %v", err) - } - } - - results := &InitResult{ - SecretShares: barrierUnsealKeys, - } - // Initialize the barrier if err := c.barrier.Initialize(barrierKey); err != nil { c.logger.Error("core: failed to initialize barrier", "error", err) @@ -180,11 +156,38 @@ func (c *Core) Initialize(initParams *InitParams) (*InitResult, error) { // Ensure the barrier is re-sealed defer func() { + // Defers are LIFO so we need to run this here too to ensure the stop + // happens before sealing. preSeal also stops, so we just make the + // stopping safe against multiple calls. if err := c.barrier.Seal(); err != nil { c.logger.Error("core: failed to seal barrier", "error", err) } }() + err = c.seal.SetBarrierConfig(barrierConfig) + if err != nil { + c.logger.Error("core: failed to save barrier configuration", "error", err) + return nil, fmt.Errorf("barrier configuration saving failed: %v", err) + } + + // If we are storing shares, pop them out of the returned results and push + // them through the seal + if barrierConfig.StoredShares > 0 { + var keysToStore [][]byte + for i := 0; i < barrierConfig.StoredShares; i++ { + keysToStore = append(keysToStore, barrierUnsealKeys[0]) + barrierUnsealKeys = barrierUnsealKeys[1:] + } + if err := c.seal.SetStoredKeys(keysToStore); err != nil { + c.logger.Error("core: failed to store keys", "error", err) + return nil, fmt.Errorf("failed to store keys: %v", err) + } + } + + results := &InitResult{ + SecretShares: barrierUnsealKeys, + } + // Perform initial setup if err := c.setupCluster(); err != nil { c.logger.Error("core: cluster setup failed during init", "error", err) diff --git a/vault/logical_cubbyhole_test.go b/vault/logical_cubbyhole_test.go index fcf3ec3a0c..880011513f 100644 --- a/vault/logical_cubbyhole_test.go +++ b/vault/logical_cubbyhole_test.go @@ -10,14 +10,6 @@ import ( "github.com/hashicorp/vault/logical" ) -func TestCubbyholeBackend_RootPaths(t *testing.T) { - b := testCubbyholeBackend() - root := b.SpecialPaths() - if root != nil { - t.Fatalf("unexpected: %v", root) - } -} - func TestCubbyholeBackend_Write(t *testing.T) { b := testCubbyholeBackend() req := logical.TestRequest(t, logical.UpdateOperation, "foo") diff --git a/vault/logical_system.go b/vault/logical_system.go index 7438003218..02b17e0022 100644 --- a/vault/logical_system.go +++ b/vault/logical_system.go @@ -9,6 +9,7 @@ import ( "sync" "time" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/duration" "github.com/hashicorp/vault/logical" "github.com/hashicorp/vault/logical/framework" @@ -21,6 +22,25 @@ var ( protectedPaths = []string{ "core", } + + replicationPaths = func(b *SystemBackend) []*framework.Path { + return []*framework.Path{ + &framework.Path{ + Pattern: "replication/status", + Callbacks: map[logical.Operation]framework.OperationFunc{ + logical.ReadOperation: func(req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + var state consts.ReplicationState + resp := &logical.Response{ + Data: map[string]interface{}{ + "mode": state.String(), + }, + } + return resp, nil + }, + }, + }, + } + } ) func NewSystemBackend(core *Core, config *logical.BackendConfig) (logical.Backend, error) { @@ -39,12 +59,15 @@ func NewSystemBackend(core *Core, config *logical.BackendConfig) (logical.Backen "audit", "audit/*", "raw/*", + "replication/primary/secondary-token", + "replication/reindex", "rotate", "config/auditing/*", }, Unauthenticated: []string{ "wrapping/pubkey", + "replication/status", }, }, @@ -226,6 +249,11 @@ func NewSystemBackend(core *Core, config *logical.BackendConfig) (logical.Backen Type: framework.TypeMap, Description: strings.TrimSpace(sysHelp["mount_config"][0]), }, + "local": &framework.FieldSchema{ + Type: framework.TypeBool, + Default: false, + Description: strings.TrimSpace(sysHelp["mount_local"][0]), + }, }, Callbacks: map[logical.Operation]framework.OperationFunc{ @@ -377,6 +405,11 @@ func NewSystemBackend(core *Core, config *logical.BackendConfig) (logical.Backen Type: framework.TypeString, Description: strings.TrimSpace(sysHelp["auth_desc"][0]), }, + "local": &framework.FieldSchema{ + Type: framework.TypeBool, + Default: false, + Description: strings.TrimSpace(sysHelp["mount_local"][0]), + }, }, Callbacks: map[logical.Operation]framework.OperationFunc{ @@ -495,6 +528,11 @@ func NewSystemBackend(core *Core, config *logical.BackendConfig) (logical.Backen Type: framework.TypeMap, Description: strings.TrimSpace(sysHelp["audit_opts"][0]), }, + "local": &framework.FieldSchema{ + Type: framework.TypeBool, + Default: false, + Description: strings.TrimSpace(sysHelp["mount_local"][0]), + }, }, Callbacks: map[logical.Operation]framework.OperationFunc{ @@ -657,6 +695,10 @@ func NewSystemBackend(core *Core, config *logical.BackendConfig) (logical.Backen }, } + b.Backend.Paths = append(b.Backend.Paths, replicationPaths(b)...) + + b.Backend.Invalidate = b.invalidate + return b.Backend.Setup(config) } @@ -668,6 +710,20 @@ type SystemBackend struct { Backend *framework.Backend } +func (b *SystemBackend) invalidate(key string) { + if b.Core.logger.IsTrace() { + b.Core.logger.Trace("sys: invaliding key", "key", key) + } + switch { + case strings.HasPrefix(key, policySubPath): + b.Core.stateLock.RLock() + defer b.Core.stateLock.RUnlock() + if b.Core.policyStore != nil { + b.Core.policyStore.invalidate(strings.TrimPrefix(key, policySubPath)) + } + } +} + // handleAuditedHeaderUpdate creates or overwrites a header entry func (b *SystemBackend) handleAuditedHeaderUpdate(req *logical.Request, d *framework.FieldData) (*logical.Response, error) { header := d.Get("header").(string) @@ -869,6 +925,7 @@ func (b *SystemBackend) handleMountTable( "default_lease_ttl": int64(entry.Config.DefaultLeaseTTL.Seconds()), "max_lease_ttl": int64(entry.Config.MaxLeaseTTL.Seconds()), }, + "local": entry.Local, } resp.Data[entry.Path] = info @@ -880,6 +937,15 @@ func (b *SystemBackend) handleMountTable( // handleMount is used to mount a new path func (b *SystemBackend) handleMount( req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + b.Core.clusterParamsLock.RLock() + repState := b.Core.replicationState + b.Core.clusterParamsLock.RUnlock() + + local := data.Get("local").(bool) + if !local && repState == consts.ReplicationSecondary { + return logical.ErrorResponse("cannot add a non-local mount to a replication secondary"), nil + } + // Get all the options path := data.Get("path").(string) logicalType := data.Get("type").(string) @@ -954,6 +1020,7 @@ func (b *SystemBackend) handleMount( Type: logicalType, Description: description, Config: config, + Local: local, } // Attempt mount @@ -979,6 +1046,10 @@ func handleError( // handleUnmount is used to unmount a path func (b *SystemBackend) handleUnmount( req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + b.Core.clusterParamsLock.RLock() + repState := b.Core.replicationState + b.Core.clusterParamsLock.RUnlock() + suffix := strings.TrimPrefix(req.Path, "mounts/") if len(suffix) == 0 { return logical.ErrorResponse("path cannot be blank"), logical.ErrInvalidRequest @@ -986,6 +1057,11 @@ func (b *SystemBackend) handleUnmount( suffix = sanitizeMountPath(suffix) + entry := b.Core.router.MatchingMountEntry(suffix) + if entry != nil && !entry.Local && repState == consts.ReplicationSecondary { + return logical.ErrorResponse("cannot unmount a non-local mount on a replication secondary"), nil + } + // Attempt unmount if existed, err := b.Core.unmount(suffix); existed && err != nil { b.Backend.Logger().Error("sys: unmount failed", "path", suffix, "error", err) @@ -998,6 +1074,10 @@ func (b *SystemBackend) handleUnmount( // handleRemount is used to remount a path func (b *SystemBackend) handleRemount( req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + b.Core.clusterParamsLock.RLock() + repState := b.Core.replicationState + b.Core.clusterParamsLock.RUnlock() + // Get the paths fromPath := data.Get("from").(string) toPath := data.Get("to").(string) @@ -1010,6 +1090,11 @@ func (b *SystemBackend) handleRemount( fromPath = sanitizeMountPath(fromPath) toPath = sanitizeMountPath(toPath) + entry := b.Core.router.MatchingMountEntry(fromPath) + if entry != nil && !entry.Local && repState == consts.ReplicationSecondary { + return logical.ErrorResponse("cannot remount a non-local mount on a replication secondary"), nil + } + // Attempt remount if err := b.Core.remount(fromPath, toPath); err != nil { b.Backend.Logger().Error("sys: remount failed", "from_path", fromPath, "to_path", toPath, "error", err) @@ -1095,6 +1180,10 @@ func (b *SystemBackend) handleMountTuneWrite( // handleTuneWriteCommon is used to set config settings on a path func (b *SystemBackend) handleTuneWriteCommon( path string, data *framework.FieldData) (*logical.Response, error) { + b.Core.clusterParamsLock.RLock() + repState := b.Core.replicationState + b.Core.clusterParamsLock.RUnlock() + path = sanitizeMountPath(path) // Prevent protected paths from being changed @@ -1110,6 +1199,9 @@ func (b *SystemBackend) handleTuneWriteCommon( b.Backend.Logger().Error("sys: tune failed: no mount entry found", "path", path) return handleError(fmt.Errorf("sys: tune of path '%s' failed: no mount entry found", path)) } + if mountEntry != nil && !mountEntry.Local && repState == consts.ReplicationSecondary { + return logical.ErrorResponse("cannot tune a non-local mount on a replication secondary"), nil + } var lock *sync.RWMutex switch { @@ -1249,6 +1341,7 @@ func (b *SystemBackend) handleAuthTable( "default_lease_ttl": int64(entry.Config.DefaultLeaseTTL.Seconds()), "max_lease_ttl": int64(entry.Config.MaxLeaseTTL.Seconds()), }, + "local": entry.Local, } resp.Data[entry.Path] = info } @@ -1258,6 +1351,15 @@ func (b *SystemBackend) handleAuthTable( // handleEnableAuth is used to enable a new credential backend func (b *SystemBackend) handleEnableAuth( req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + b.Core.clusterParamsLock.RLock() + repState := b.Core.replicationState + b.Core.clusterParamsLock.RUnlock() + + local := data.Get("local").(bool) + if !local && repState == consts.ReplicationSecondary { + return logical.ErrorResponse("cannot add a non-local mount to a replication secondary"), nil + } + // Get all the options path := data.Get("path").(string) logicalType := data.Get("type").(string) @@ -1277,6 +1379,7 @@ func (b *SystemBackend) handleEnableAuth( Path: path, Type: logicalType, Description: description, + Local: local, } // Attempt enabling @@ -1391,6 +1494,7 @@ func (b *SystemBackend) handleAuditTable( "type": entry.Type, "description": entry.Description, "options": entry.Options, + "local": entry.Local, } resp.Data[entry.Path] = info } @@ -1424,6 +1528,15 @@ func (b *SystemBackend) handleAuditHash( // handleEnableAudit is used to enable a new audit backend func (b *SystemBackend) handleEnableAudit( req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + b.Core.clusterParamsLock.RLock() + repState := b.Core.replicationState + b.Core.clusterParamsLock.RUnlock() + + local := data.Get("local").(bool) + if !local && repState == consts.ReplicationSecondary { + return logical.ErrorResponse("cannot add a non-local mount to a replication secondary"), nil + } + // Get all the options path := data.Get("path").(string) backendType := data.Get("type").(string) @@ -1447,6 +1560,7 @@ func (b *SystemBackend) handleEnableAudit( Type: backendType, Description: description, Options: optionMap, + Local: local, } // Attempt enabling @@ -1562,6 +1676,13 @@ func (b *SystemBackend) handleKeyStatus( // handleRotate is used to trigger a key rotation func (b *SystemBackend) handleRotate( req *logical.Request, data *framework.FieldData) (*logical.Response, error) { + b.Core.clusterParamsLock.RLock() + repState := b.Core.replicationState + b.Core.clusterParamsLock.RUnlock() + if repState == consts.ReplicationSecondary { + return logical.ErrorResponse("cannot rotate on a replication secondary"), nil + } + // Rotate to the new term newTerm, err := b.Core.barrier.Rotate() if err != nil { @@ -1584,6 +1705,17 @@ func (b *SystemBackend) handleRotate( } }) } + + // Write to the canary path, which will force a synchronous truing during + // replication + if err := b.Core.barrier.Put(&Entry{ + Key: coreKeyringCanaryPath, + Value: []byte(fmt.Sprintf("new-rotation-term-%d", newTerm)), + }); err != nil { + b.Core.logger.Error("core: error saving keyring canary", "error", err) + return nil, fmt.Errorf("failed to save keyring canary: %v", err) + } + return nil, nil } @@ -1950,6 +2082,11 @@ west coast. and max_lease_ttl.`, }, + "mount_local": { + `Mark the mount as a local mount, which is not replicated +and is unaffected by replication.`, + }, + "tune_default_lease_ttl": { `The default lease TTL for this mount.`, }, diff --git a/vault/logical_system_test.go b/vault/logical_system_test.go index 62737744b2..15f60a50c2 100644 --- a/vault/logical_system_test.go +++ b/vault/logical_system_test.go @@ -21,6 +21,8 @@ func TestSystemBackend_RootPaths(t *testing.T) { "audit", "audit/*", "raw/*", + "replication/primary/secondary-token", + "replication/reindex", "rotate", "config/auditing/*", } @@ -50,6 +52,7 @@ func TestSystemBackend_mounts(t *testing.T) { "default_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["secret/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), }, + "local": false, }, "sys/": map[string]interface{}{ "type": "system", @@ -58,6 +61,7 @@ func TestSystemBackend_mounts(t *testing.T) { "default_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["sys/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), }, + "local": false, }, "cubbyhole/": map[string]interface{}{ "description": "per-token private secret storage", @@ -66,6 +70,7 @@ func TestSystemBackend_mounts(t *testing.T) { "default_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["default_lease_ttl"].(int64), "max_lease_ttl": resp.Data["cubbyhole/"].(map[string]interface{})["config"].(map[string]interface{})["max_lease_ttl"].(int64), }, + "local": true, }, } if !reflect.DeepEqual(resp.Data, exp) { @@ -580,6 +585,7 @@ func TestSystemBackend_authTable(t *testing.T) { "default_lease_ttl": int64(0), "max_lease_ttl": int64(0), }, + "local": false, }, } if !reflect.DeepEqual(resp.Data, exp) { @@ -843,6 +849,7 @@ func TestSystemBackend_auditTable(t *testing.T) { req.Data["options"] = map[string]interface{}{ "foo": "bar", } + req.Data["local"] = true b.HandleRequest(req) req = logical.TestRequest(t, logical.ReadOperation, "audit") @@ -859,6 +866,7 @@ func TestSystemBackend_auditTable(t *testing.T) { "options": map[string]string{ "foo": "bar", }, + "local": true, }, } if !reflect.DeepEqual(resp.Data, exp) { diff --git a/vault/mount.go b/vault/mount.go index 072583ae91..8ac952016f 100644 --- a/vault/mount.go +++ b/vault/mount.go @@ -5,6 +5,7 @@ import ( "encoding/json" "errors" "fmt" + "sort" "strings" "time" @@ -19,6 +20,10 @@ const ( // can only be viewed or modified after an unseal. coreMountConfigPath = "core/mounts" + // coreLocalMountConfigPath is used to store mount configuration for local + // (non-replicated) mounts + coreLocalMountConfigPath = "core/local-mounts" + // backendBarrierPrefix is the prefix to the UUID used in the // barrier view for the backends. backendBarrierPrefix = "logical/" @@ -115,6 +120,15 @@ func (t *MountTable) remove(path string) *MountEntry { return nil } +// sortEntriesByPath sorts the entries in the table by path and returns the +// table; this is useful for tests +func (t *MountTable) sortEntriesByPath() *MountTable { + sort.Slice(t.Entries, func(i, j int) bool { + return t.Entries[i].Path < t.Entries[j].Path + }) + return t +} + // MountEntry is used to represent a mount table entry type MountEntry struct { Table string `json:"table"` // The table it belongs to @@ -124,6 +138,7 @@ type MountEntry struct { UUID string `json:"uuid"` // Barrier view UUID Config MountConfig `json:"config"` // Configuration related to this mount (but not backend-derived) Options map[string]string `json:"options"` // Backend options + Local bool `json:"local"` // Local mounts are not replicated or affected by replication Tainted bool `json:"tainted,omitempty"` // Set as a Write-Ahead flag for unmount/remount } @@ -147,28 +162,29 @@ func (e *MountEntry) Clone() *MountEntry { UUID: e.UUID, Config: e.Config, Options: optClone, + Local: e.Local, Tainted: e.Tainted, } } // Mount is used to mount a new backend to the mount table. -func (c *Core) mount(me *MountEntry) error { +func (c *Core) mount(entry *MountEntry) error { // Ensure we end the path in a slash - if !strings.HasSuffix(me.Path, "/") { - me.Path += "/" + if !strings.HasSuffix(entry.Path, "/") { + entry.Path += "/" } // Prevent protected paths from being mounted for _, p := range protectedMounts { - if strings.HasPrefix(me.Path, p) { - return logical.CodedError(403, fmt.Sprintf("cannot mount '%s'", me.Path)) + if strings.HasPrefix(entry.Path, p) { + return logical.CodedError(403, fmt.Sprintf("cannot mount '%s'", entry.Path)) } } // Do not allow more than one instance of a singleton mount for _, p := range singletonMounts { - if me.Type == p { - return logical.CodedError(403, fmt.Sprintf("Cannot mount more than one instance of '%s'", me.Type)) + if entry.Type == p { + return logical.CodedError(403, fmt.Sprintf("Cannot mount more than one instance of '%s'", entry.Type)) } } @@ -176,37 +192,47 @@ func (c *Core) mount(me *MountEntry) error { defer c.mountsLock.Unlock() // Verify there is no conflicting mount - if match := c.router.MatchingMount(me.Path); match != "" { + if match := c.router.MatchingMount(entry.Path); match != "" { return logical.CodedError(409, fmt.Sprintf("existing mount at %s", match)) } // Generate a new UUID and view - meUUID, err := uuid.GenerateUUID() + if entry.UUID == "" { + entryUUID, err := uuid.GenerateUUID() + if err != nil { + return err + } + entry.UUID = entryUUID + } + viewPath := backendBarrierPrefix + entry.UUID + "/" + view := NewBarrierView(c.barrier, viewPath) + sysView := c.mountEntrySysView(entry) + + backend, err := c.newLogicalBackend(entry.Type, sysView, view, nil) if err != nil { return err } - me.UUID = meUUID - view := NewBarrierView(c.barrier, backendBarrierPrefix+me.UUID+"/") - backend, err := c.newLogicalBackend(me.Type, c.mountEntrySysView(me), view, nil) - if err != nil { + // Call initialize; this takes care of init tasks that must be run after + // the ignore paths are collected + if err := backend.Initialize(); err != nil { return err } newTable := c.mounts.shallowClone() - newTable.Entries = append(newTable.Entries, me) + newTable.Entries = append(newTable.Entries, entry) if err := c.persistMounts(newTable); err != nil { c.logger.Error("core: failed to update mount table", "error", err) return logical.CodedError(500, "failed to update mount table") } c.mounts = newTable - if err := c.router.Mount(backend, me.Path, me, view); err != nil { + if err := c.router.Mount(backend, entry.Path, entry, view); err != nil { return err } if c.logger.IsInfo() { - c.logger.Info("core: successful mount", "path", me.Path, "type", me.Type) + c.logger.Info("core: successful mount", "path", entry.Path, "type", entry.Type) } return nil } @@ -291,6 +317,12 @@ func (c *Core) removeMountEntry(path string) error { newTable := c.mounts.shallowClone() newTable.remove(path) + // When unmounting all entries the JSON code will load back up from storage + // as a nil slice, which kills tests...just set it nil explicitly + if len(newTable.Entries) == 0 { + newTable.Entries = nil + } + // Update the mount table if err := c.persistMounts(newTable); err != nil { c.logger.Error("core: failed to update mount table", "error", err) @@ -405,12 +437,18 @@ func (c *Core) remount(src, dst string) error { // loadMounts is invoked as part of postUnseal to load the mount table func (c *Core) loadMounts() error { mountTable := &MountTable{} + localMountTable := &MountTable{} // Load the existing mount table raw, err := c.barrier.Get(coreMountConfigPath) if err != nil { c.logger.Error("core: failed to read mount table", "error", err) return errLoadMountsFailed } + rawLocal, err := c.barrier.Get(coreLocalMountConfigPath) + if err != nil { + c.logger.Error("core: failed to read local mount table", "error", err) + return errLoadMountsFailed + } c.mountsLock.Lock() defer c.mountsLock.Unlock() @@ -425,6 +463,13 @@ func (c *Core) loadMounts() error { } c.mounts = mountTable } + if rawLocal != nil { + if err := jsonutil.DecodeJSON(rawLocal.Value, localMountTable); err != nil { + c.logger.Error("core: failed to decompress and/or decode the local mount table", "error", err) + return err + } + c.mounts.Entries = append(c.mounts.Entries, localMountTable.Entries...) + } // Ensure that required entries are loaded, or new ones // added may never get loaded at all. Note that this @@ -492,8 +537,24 @@ func (c *Core) persistMounts(table *MountTable) error { } } + nonLocalMounts := &MountTable{ + Type: mountTableType, + } + + localMounts := &MountTable{ + Type: mountTableType, + } + + for _, entry := range table.Entries { + if entry.Local { + localMounts.Entries = append(localMounts.Entries, entry) + } else { + nonLocalMounts.Entries = append(nonLocalMounts.Entries, entry) + } + } + // Encode the mount table into JSON and compress it (lzw). - compressedBytes, err := jsonutil.EncodeJSONAndCompress(table, nil) + compressedBytes, err := jsonutil.EncodeJSONAndCompress(nonLocalMounts, nil) if err != nil { c.logger.Error("core: failed to encode and/or compress the mount table", "error", err) return err @@ -510,6 +571,24 @@ func (c *Core) persistMounts(table *MountTable) error { c.logger.Error("core: failed to persist mount table", "error", err) return err } + + // Repeat with local mounts + compressedBytes, err = jsonutil.EncodeJSONAndCompress(localMounts, nil) + if err != nil { + c.logger.Error("core: failed to encode and/or compress the local mount table", "error", err) + return err + } + + entry = &Entry{ + Key: coreLocalMountConfigPath, + Value: compressedBytes, + } + + if err := c.barrier.Put(entry); err != nil { + c.logger.Error("core: failed to persist local mount table", "error", err) + return err + } + return nil } @@ -532,15 +611,19 @@ func (c *Core) setupMounts() error { // Create a barrier view using the UUID view = NewBarrierView(c.barrier, barrierPath) - + sysView := c.mountEntrySysView(entry) // Initialize the backend // Create the new backend - backend, err = c.newLogicalBackend(entry.Type, c.mountEntrySysView(entry), view, nil) + backend, err = c.newLogicalBackend(entry.Type, sysView, view, nil) if err != nil { c.logger.Error("core: failed to create mount entry", "path", entry.Path, "error", err) return errLoadMountsFailed } + if err := backend.Initialize(); err != nil { + return err + } + switch entry.Type { case "system": c.systemBarrierView = view @@ -616,10 +699,10 @@ func (c *Core) newLogicalBackend(t string, sysView logical.SystemView, view logi // mountEntrySysView creates a logical.SystemView from global and // mount-specific entries; because this should be called when setting // up a mountEntry, it doesn't check to ensure that me is not nil -func (c *Core) mountEntrySysView(me *MountEntry) logical.SystemView { +func (c *Core) mountEntrySysView(entry *MountEntry) logical.SystemView { return dynamicSystemView{ core: c, - mountEntry: me, + mountEntry: entry, } } @@ -660,6 +743,7 @@ func requiredMountTable() *MountTable { Type: "cubbyhole", Description: "per-token private secret storage", UUID: cubbyholeUUID, + Local: true, } sysUUID, err := uuid.GenerateUUID() diff --git a/vault/mount_test.go b/vault/mount_test.go index dd6ef59445..49f5f76d0d 100644 --- a/vault/mount_test.go +++ b/vault/mount_test.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/vault/audit" "github.com/hashicorp/vault/helper/compressutil" + "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/logical" ) @@ -36,7 +37,7 @@ func TestCore_DefaultMountTable(t *testing.T) { } // Verify matching mount tables - if !reflect.DeepEqual(c.mounts, c2.mounts) { + if !reflect.DeepEqual(c.mounts.sortEntriesByPath(), c2.mounts.sortEntriesByPath()) { t.Fatalf("mismatch: %v %v", c.mounts, c2.mounts) } } @@ -77,11 +78,105 @@ func TestCore_Mount(t *testing.T) { } // Verify matching mount tables - if !reflect.DeepEqual(c.mounts, c2.mounts) { + if !reflect.DeepEqual(c.mounts.sortEntriesByPath(), c2.mounts.sortEntriesByPath()) { t.Fatalf("mismatch: %v %v", c.mounts, c2.mounts) } } +// Test that the local table actually gets populated as expected with local +// entries, and that upon reading the entries from both are recombined +// correctly +func TestCore_Mount_Local(t *testing.T) { + c, _, _ := TestCoreUnsealed(t) + + c.mounts = &MountTable{ + Type: mountTableType, + Entries: []*MountEntry{ + &MountEntry{ + Table: mountTableType, + Path: "noop/", + Type: "generic", + UUID: "abcd", + }, + &MountEntry{ + Table: mountTableType, + Path: "noop2/", + Type: "generic", + UUID: "bcde", + }, + }, + } + + // Both should set up successfully + err := c.setupMounts() + if err != nil { + t.Fatal(err) + } + if len(c.mounts.Entries) != 2 { + t.Fatalf("expected two entries, got %d", len(c.mounts.Entries)) + } + + rawLocal, err := c.barrier.Get(coreLocalMountConfigPath) + if err != nil { + t.Fatal(err) + } + if rawLocal == nil { + t.Fatal("expected non-nil local mounts") + } + localMountsTable := &MountTable{} + if err := jsonutil.DecodeJSON(rawLocal.Value, localMountsTable); err != nil { + t.Fatal(err) + } + if len(localMountsTable.Entries) != 1 || localMountsTable.Entries[0].Type != "cubbyhole" { + t.Fatalf("expected only cubbyhole entry in local mount table, got %#v", localMountsTable) + } + + c.mounts.Entries[1].Local = true + if err := c.persistMounts(c.mounts); err != nil { + t.Fatal(err) + } + + rawLocal, err = c.barrier.Get(coreLocalMountConfigPath) + if err != nil { + t.Fatal(err) + } + if rawLocal == nil { + t.Fatal("expected non-nil local mount") + } + localMountsTable = &MountTable{} + if err := jsonutil.DecodeJSON(rawLocal.Value, localMountsTable); err != nil { + t.Fatal(err) + } + // This requires some explanation: because we're directly munging the mount + // table, the table initially when core unseals contains cubbyhole as per + // above, but then we overwrite it with our own table with one local entry, + // so we should now only expect the noop2 entry + if len(localMountsTable.Entries) != 1 || localMountsTable.Entries[0].Path != "noop2/" { + t.Fatalf("expected one entry in local mount table, got %#v", localMountsTable) + } + + oldMounts := c.mounts + if err := c.loadMounts(); err != nil { + t.Fatal(err) + } + compEntries := c.mounts.Entries[:0] + // Filter out required mounts + for _, v := range c.mounts.Entries { + if v.Type == "generic" { + compEntries = append(compEntries, v) + } + } + c.mounts.Entries = compEntries + + if !reflect.DeepEqual(oldMounts, c.mounts) { + t.Fatalf("expected\n%#v\ngot\n%#v\n", oldMounts, c.mounts) + } + + if len(c.mounts.Entries) != 2 { + t.Fatalf("expected two mount entries, got %#v", localMountsTable) + } +} + func TestCore_Unmount(t *testing.T) { c, keys, _ := TestCoreUnsealed(t) existed, err := c.unmount("secret") @@ -113,7 +208,7 @@ func TestCore_Unmount(t *testing.T) { } // Verify matching mount tables - if !reflect.DeepEqual(c.mounts, c2.mounts) { + if !reflect.DeepEqual(c.mounts.sortEntriesByPath(), c2.mounts.sortEntriesByPath()) { t.Fatalf("mismatch: %v %v", c.mounts, c2.mounts) } } @@ -392,6 +487,17 @@ func testCore_MountTable_UpgradeToTyped_Common( mt = c.auth } + // We filter out local entries here since the logic is rather dumb + // (straight JSON comparison) and doesn't seal well with the separate + // locations + newEntries := mt.Entries[:0] + for _, entry := range mt.Entries { + if !entry.Local { + newEntries = append(newEntries, entry) + } + } + mt.Entries = newEntries + // Save the expected table goodJson, err := json.Marshal(mt) if err != nil { @@ -486,22 +592,23 @@ func verifyDefaultTable(t *testing.T, table *MountTable) { if len(table.Entries) != 3 { t.Fatalf("bad: %v", table.Entries) } + table.sortEntriesByPath() for idx, entry := range table.Entries { switch idx { case 0: - if entry.Path != "secret/" { - t.Fatalf("bad: %v", entry) - } - if entry.Type != "generic" { - t.Fatalf("bad: %v", entry) - } - case 1: if entry.Path != "cubbyhole/" { t.Fatalf("bad: %v", entry) } if entry.Type != "cubbyhole" { t.Fatalf("bad: %v", entry) } + case 1: + if entry.Path != "secret/" { + t.Fatalf("bad: %v", entry) + } + if entry.Type != "generic" { + t.Fatalf("bad: %v", entry) + } case 2: if entry.Path != "sys/" { t.Fatalf("bad: %v", entry) @@ -520,5 +627,4 @@ func verifyDefaultTable(t *testing.T, table *MountTable) { t.Fatalf("bad: %v", entry) } } - } diff --git a/vault/policy_store.go b/vault/policy_store.go index 873a8dde8b..27a5f7ec4e 100644 --- a/vault/policy_store.go +++ b/vault/policy_store.go @@ -2,11 +2,13 @@ package vault import ( "fmt" + "strings" "time" "github.com/armon/go-metrics" "github.com/hashicorp/errwrap" "github.com/hashicorp/golang-lru" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/strutil" "github.com/hashicorp/vault/logical" ) @@ -68,11 +70,6 @@ path "cubbyhole/*" { capabilities = ["create", "read", "update", "delete", "list"] } -# Allow a token to list its cubbyhole (not covered by the splat above) -path "cubbyhole" { - capabilities = ["list"] -} - # Allow a token to wrap arbitrary values in a response-wrapping token path "sys/wrapping/wrap" { capabilities = ["update"] @@ -137,7 +134,13 @@ func (c *Core) setupPolicyStore() error { view := c.systemBarrierView.SubView(policySubPath) // Create the policy store - c.policyStore = NewPolicyStore(view, &dynamicSystemView{core: c}) + sysView := &dynamicSystemView{core: c} + c.policyStore = NewPolicyStore(view, sysView) + + if sysView.ReplicationState() == consts.ReplicationSecondary { + // Policies will sync from the primary + return nil + } // Ensure that the default policy exists, and if not, create it policy, err := c.policyStore.GetPolicy("default") @@ -173,6 +176,16 @@ func (c *Core) teardownPolicyStore() error { return nil } +func (ps *PolicyStore) invalidate(name string) { + if ps.lru == nil { + // Nothing to do if the cache is not used + return + } + + // This may come with a prefixed "/" due to joining the file path + ps.lru.Remove(strings.TrimPrefix(name, "/")) +} + // SetPolicy is used to create or update the given policy func (ps *PolicyStore) SetPolicy(p *Policy) error { defer metrics.MeasureSince([]string{"policy", "set_policy"}, time.Now()) diff --git a/vault/rekey.go b/vault/rekey.go index 964abef4f0..50f683b6b2 100644 --- a/vault/rekey.go +++ b/vault/rekey.go @@ -7,6 +7,7 @@ import ( "fmt" "github.com/hashicorp/go-uuid" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/helper/pgpkeys" "github.com/hashicorp/vault/physical" @@ -44,10 +45,10 @@ func (c *Core) RekeyThreshold(recovery bool) (int, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return 0, ErrSealed + return 0, consts.ErrSealed } if c.standby { - return 0, ErrStandby + return 0, consts.ErrStandby } c.rekeyLock.RLock() @@ -72,10 +73,10 @@ func (c *Core) RekeyProgress(recovery bool) (int, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return 0, ErrSealed + return 0, consts.ErrSealed } if c.standby { - return 0, ErrStandby + return 0, consts.ErrStandby } c.rekeyLock.RLock() @@ -92,10 +93,10 @@ func (c *Core) RekeyConfig(recovery bool) (*SealConfig, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } c.rekeyLock.Lock() @@ -146,10 +147,10 @@ func (c *Core) BarrierRekeyInit(config *SealConfig) error { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return ErrSealed + return consts.ErrSealed } if c.standby { - return ErrStandby + return consts.ErrStandby } c.rekeyLock.Lock() @@ -196,10 +197,10 @@ func (c *Core) RecoveryRekeyInit(config *SealConfig) error { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return ErrSealed + return consts.ErrSealed } if c.standby { - return ErrStandby + return consts.ErrStandby } c.rekeyLock.Lock() @@ -240,10 +241,10 @@ func (c *Core) BarrierRekeyUpdate(key []byte, nonce string) (*RekeyResult, error c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } // Verify the key length @@ -422,10 +423,10 @@ func (c *Core) RecoveryRekeyUpdate(key []byte, nonce string) (*RekeyResult, erro c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } // Verify the key length @@ -589,10 +590,10 @@ func (c *Core) RekeyCancel(recovery bool) error { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return ErrSealed + return consts.ErrSealed } if c.standby { - return ErrStandby + return consts.ErrStandby } c.rekeyLock.Lock() @@ -615,10 +616,10 @@ func (c *Core) RekeyRetrieveBackup(recovery bool) (*RekeyBackup, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } c.rekeyLock.RLock() @@ -652,10 +653,10 @@ func (c *Core) RekeyDeleteBackup(recovery bool) error { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return ErrSealed + return consts.ErrSealed } if c.standby { - return ErrStandby + return consts.ErrStandby } c.rekeyLock.Lock() diff --git a/vault/rekey_test.go b/vault/rekey_test.go index dacba36d9d..c463325fe4 100644 --- a/vault/rekey_test.go +++ b/vault/rekey_test.go @@ -237,7 +237,7 @@ func testCore_Rekey_Update_Common(t *testing.T, c *Core, keys [][]byte, root str t.Fatalf("err: %v", err) } for i := 0; i < 3; i++ { - _, err = TestCoreUnseal(c, result.SecretShares[i]) + _, err = TestCoreUnseal(c, TestKeyCopy(result.SecretShares[i])) if err != nil { t.Fatalf("err: %v", err) } @@ -270,7 +270,7 @@ func testCore_Rekey_Update_Common(t *testing.T, c *Core, keys [][]byte, root str // Provide the parts master oldResult := result for i := 0; i < 3; i++ { - result, err = c.RekeyUpdate(oldResult.SecretShares[i], rkconf.Nonce, recovery) + result, err = c.RekeyUpdate(TestKeyCopy(oldResult.SecretShares[i]), rkconf.Nonce, recovery) if err != nil { t.Fatalf("err: %v", err) } diff --git a/vault/request_forwarding.go b/vault/request_forwarding.go index f29cb95b0b..04f65cef0b 100644 --- a/vault/request_forwarding.go +++ b/vault/request_forwarding.go @@ -27,6 +27,9 @@ func (c *Core) startForwarding() error { // Clean up in case we have transitioned from a client to a server c.clearForwardingClients() + // Resolve locally to avoid races + ha := c.ha != nil + // Get our base handler (for our RPC server) and our wrapped handler (for // straight HTTP/2 forwarding) baseHandler, wrappedHandler := c.clusterHandlerSetupFunc() @@ -43,10 +46,13 @@ func (c *Core) startForwarding() error { // Create our RPC server and register the request handler server c.rpcServer = grpc.NewServer() - RegisterRequestForwardingServer(c.rpcServer, &forwardedRequestRPCServer{ - core: c, - handler: baseHandler, - }) + + if ha { + RegisterRequestForwardingServer(c.rpcServer, &forwardedRequestRPCServer{ + core: c, + handler: baseHandler, + }) + } // Create the HTTP/2 server that will be shared by both RPC and regular // duties. Doing it this way instead of listening via the server and gRPC @@ -82,6 +88,7 @@ func (c *Core) startForwarding() error { // Wrap the listener with TLS tlsLn := tls.NewListener(tcpLn, tlsConfig) + defer tlsLn.Close() if c.logger.IsInfo() { c.logger.Info("core/startClusterListener: serving cluster requests", "cluster_listen_address", tlsLn.Addr()) @@ -89,7 +96,6 @@ func (c *Core) startForwarding() error { for { if atomic.LoadUint32(&shutdown) > 0 { - tlsLn.Close() return } @@ -100,10 +106,11 @@ func (c *Core) startForwarding() error { // Accept the connection conn, err := tlsLn.Accept() + if conn != nil { + // Always defer although it may be closed ahead of time + defer conn.Close() + } if err != nil { - if conn != nil { - conn.Close() - } continue } @@ -123,19 +130,29 @@ func (c *Core) startForwarding() error { switch tlsConn.ConnectionState().NegotiatedProtocol { case "h2": + if !ha { + conn.Close() + continue + } + c.logger.Debug("core/startClusterListener/Accept: got h2 connection") go fws.ServeConn(conn, &http2.ServeConnOpts{ Handler: wrappedHandler, }) case "req_fw_sb-act_v1": + if !ha { + conn.Close() + continue + } + c.logger.Debug("core/startClusterListener/Accept: got req_fw_sb-act_v1 connection") go fws.ServeConn(conn, &http2.ServeConnOpts{ Handler: c.rpcServer, }) default: - c.logger.Debug("core/startClusterListener/Accept: unknown negotiated protocol") + c.logger.Debug("core: unknown negotiated protocol on cluster port") conn.Close() continue } @@ -154,8 +171,9 @@ func (c *Core) startForwarding() error { <-c.clusterListenerShutdownCh // Stop the RPC server + c.logger.Info("core: shutting down forwarding rpc listeners") c.rpcServer.Stop() - c.logger.Info("core/startClusterListener: shutting down listeners") + c.logger.Info("core: forwarding rpc listeners stopped") // Set the shutdown flag. This will cause the listeners to shut down // within the deadline in clusterListenerAcceptDeadline @@ -163,7 +181,7 @@ func (c *Core) startForwarding() error { // Wait for them all to shut down shutdownWg.Wait() - c.logger.Info("core/startClusterListener: listeners successfully shut down") + c.logger.Info("core: rpc listeners successfully shut down") // Tell the main thread that shutdown is done. c.clusterListenerShutdownSuccessCh <- struct{}{} @@ -223,6 +241,7 @@ func (c *Core) refreshRequestForwardingConnection(clusterAddr string) error { // It's not really insecure, but we have to dial manually to get the // ALPN header right. It's just "insecure" because GRPC isn't managing // the TLS state. + ctx, cancelFunc := context.WithCancel(context.Background()) c.rpcClientConnCancelFunc = cancelFunc c.rpcClientConn, err = grpc.DialContext(ctx, clusterURL.Host, grpc.WithDialer(c.getGRPCDialer("req_fw_sb-act_v1", "")), grpc.WithInsecure()) diff --git a/vault/request_handling.go b/vault/request_handling.go index 44b8125507..c73270f2aa 100644 --- a/vault/request_handling.go +++ b/vault/request_handling.go @@ -7,6 +7,7 @@ import ( "github.com/armon/go-metrics" "github.com/hashicorp/go-multierror" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/helper/policyutil" "github.com/hashicorp/vault/helper/strutil" @@ -18,10 +19,10 @@ func (c *Core) HandleRequest(req *logical.Request) (resp *logical.Response, err c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return nil, ErrSealed + return nil, consts.ErrSealed } if c.standby { - return nil, ErrStandby + return nil, consts.ErrStandby } // Allowing writing to a path ending in / makes it extremely difficult to @@ -183,7 +184,7 @@ func (c *Core) handleRequest(req *logical.Request) (retResp *logical.Response, r } // Route the request - resp, err := c.router.Route(req) + resp, routeErr := c.router.Route(req) if resp != nil { // If wrapping is used, use the shortest between the request and response var wrapTTL time.Duration @@ -305,8 +306,8 @@ func (c *Core) handleRequest(req *logical.Request) (retResp *logical.Response, r } // Return the response and error - if err != nil { - retErr = multierror.Append(retErr, err) + if routeErr != nil { + retErr = multierror.Append(retErr, routeErr) } return resp, auth, retErr } @@ -330,7 +331,7 @@ func (c *Core) handleLoginRequest(req *logical.Request) (*logical.Response, *log } // Route the request - resp, err := c.router.Route(req) + resp, routeErr := c.router.Route(req) if resp != nil { // If wrapping is used, use the shortest between the request and response var wrapTTL time.Duration @@ -445,5 +446,5 @@ func (c *Core) handleLoginRequest(req *logical.Request) (*logical.Response, *log req.DisplayName = auth.DisplayName } - return resp, auth, err + return resp, auth, routeErr } diff --git a/vault/testing.go b/vault/testing.go index b287941a99..2229c7b996 100644 --- a/vault/testing.go +++ b/vault/testing.go @@ -67,19 +67,37 @@ oOyBJU/HMVvBfv4g+OVFLVgSwwm6owwsouZ0+D/LasbuHqYyqYqdyPJQYzWA2Y+F ) // TestCore returns a pure in-memory, uninitialized core for testing. -func TestCore(t *testing.T) *Core { +func TestCore(t testing.TB) *Core { return TestCoreWithSeal(t, nil) } // TestCoreNewSeal returns an in-memory, ininitialized core with the new seal // configuration. -func TestCoreNewSeal(t *testing.T) *Core { +func TestCoreNewSeal(t testing.TB) *Core { return TestCoreWithSeal(t, &TestSeal{}) } // TestCoreWithSeal returns a pure in-memory, uninitialized core with the // specified seal for testing. -func TestCoreWithSeal(t *testing.T, testSeal Seal) *Core { +func TestCoreWithSeal(t testing.TB, testSeal Seal) *Core { + logger := logformat.NewVaultLogger(log.LevelTrace) + physicalBackend := physical.NewInmem(logger) + + conf := testCoreConfig(t, physicalBackend, logger) + + if testSeal != nil { + conf.Seal = testSeal + } + + c, err := NewCore(conf) + if err != nil { + t.Fatalf("err: %s", err) + } + + return c +} + +func testCoreConfig(t testing.TB, physicalBackend physical.Backend, logger log.Logger) *CoreConfig { noopAudits := map[string]audit.Factory{ "noop": func(config *audit.BackendConfig) (audit.Backend, error) { view := &logical.InmemStorage{} @@ -118,9 +136,6 @@ func TestCoreWithSeal(t *testing.T, testSeal Seal) *Core { logicalBackends[backendName] = backendFactory } - logger := logformat.NewVaultLogger(log.LevelTrace) - - physicalBackend := physical.NewInmem(logger) conf := &CoreConfig{ Physical: physicalBackend, AuditBackends: noopAudits, @@ -129,25 +144,17 @@ func TestCoreWithSeal(t *testing.T, testSeal Seal) *Core { DisableMlock: true, Logger: logger, } - if testSeal != nil { - conf.Seal = testSeal - } - c, err := NewCore(conf) - if err != nil { - t.Fatalf("err: %s", err) - } - - return c + return conf } // TestCoreInit initializes the core with a single key, and returns // the key that must be used to unseal the core and a root token. -func TestCoreInit(t *testing.T, core *Core) ([][]byte, string) { +func TestCoreInit(t testing.TB, core *Core) ([][]byte, string) { return TestCoreInitClusterWrapperSetup(t, core, nil, func() (http.Handler, http.Handler) { return nil, nil }) } -func TestCoreInitClusterWrapperSetup(t *testing.T, core *Core, clusterAddrs []*net.TCPAddr, handlerSetupFunc func() (http.Handler, http.Handler)) ([][]byte, string) { +func TestCoreInitClusterWrapperSetup(t testing.TB, core *Core, clusterAddrs []*net.TCPAddr, handlerSetupFunc func() (http.Handler, http.Handler)) ([][]byte, string) { core.SetClusterListenerAddrs(clusterAddrs) core.SetClusterSetupFuncs(handlerSetupFunc) result, err := core.Initialize(&InitParams{ @@ -155,7 +162,10 @@ func TestCoreInitClusterWrapperSetup(t *testing.T, core *Core, clusterAddrs []*n SecretShares: 3, SecretThreshold: 3, }, - RecoveryConfig: nil, + RecoveryConfig: &SealConfig{ + SecretShares: 3, + SecretThreshold: 3, + }, }) if err != nil { t.Fatalf("err: %s", err) @@ -170,7 +180,7 @@ func TestCoreUnseal(core *Core, key []byte) (bool, error) { // TestCoreUnsealed returns a pure in-memory core that is already // initialized and unsealed. -func TestCoreUnsealed(t *testing.T) (*Core, [][]byte, string) { +func TestCoreUnsealed(t testing.TB) (*Core, [][]byte, string) { core := TestCore(t) keys, token := TestCoreInit(t, core) for _, key := range keys { @@ -190,11 +200,35 @@ func TestCoreUnsealed(t *testing.T) (*Core, [][]byte, string) { return core, keys, token } -// TestCoreWithTokenStore returns an in-memory core that has a token store -// mounted, so that logical token functions can be used -func TestCoreWithTokenStore(t *testing.T) (*Core, *TokenStore, [][]byte, string) { - c, keys, root := TestCoreUnsealed(t) +func TestCoreUnsealedBackend(t testing.TB, backend physical.Backend) (*Core, [][]byte, string) { + logger := logformat.NewVaultLogger(log.LevelTrace) + conf := testCoreConfig(t, backend, logger) + conf.Seal = &TestSeal{} + core, err := NewCore(conf) + if err != nil { + t.Fatalf("err: %s", err) + } + + keys, token := TestCoreInit(t, core) + for _, key := range keys { + if _, err := TestCoreUnseal(core, TestKeyCopy(key)); err != nil { + t.Fatalf("unseal err: %s", err) + } + } + + sealed, err := core.Sealed() + if err != nil { + t.Fatalf("err checking seal status: %s", err) + } + if sealed { + t.Fatal("should not be sealed") + } + + return core, keys, token +} + +func testTokenStore(t testing.TB, c *Core) *TokenStore { me := &MountEntry{ Table: credentialTableType, Path: "token/", @@ -209,8 +243,12 @@ func TestCoreWithTokenStore(t *testing.T) (*Core, *TokenStore, [][]byte, string) me.UUID = meUUID view := NewBarrierView(c.barrier, credentialBarrierPrefix+me.UUID+"/") + sysView := c.mountEntrySysView(me) - tokenstore, _ := c.newCredentialBackend("token", c.mountEntrySysView(me), view, nil) + tokenstore, _ := c.newCredentialBackend("token", sysView, view, nil) + if err := tokenstore.Initialize(); err != nil { + panic(err) + } ts := tokenstore.(*TokenStore) router := NewRouter() @@ -222,6 +260,25 @@ func TestCoreWithTokenStore(t *testing.T) (*Core, *TokenStore, [][]byte, string) exp := NewExpirationManager(router, subview, ts, logger) ts.SetExpirationManager(exp) + return ts +} + +// TestCoreWithTokenStore returns an in-memory core that has a token store +// mounted, so that logical token functions can be used +func TestCoreWithTokenStore(t testing.TB) (*Core, *TokenStore, [][]byte, string) { + c, keys, root := TestCoreUnsealed(t) + ts := testTokenStore(t, c) + + return c, ts, keys, root +} + +// TestCoreWithBackendTokenStore returns a core that has a token store +// mounted and used the provided physical backend, so that logical token +// functions can be used +func TestCoreWithBackendTokenStore(t testing.TB, backend physical.Backend) (*Core, *TokenStore, [][]byte, string) { + c, keys, root := TestCoreUnsealedBackend(t, backend) + ts := testTokenStore(t, c) + return c, ts, keys, root } @@ -420,7 +477,7 @@ func GenerateRandBytes(length int) ([]byte, error) { return buf, nil } -func TestWaitActive(t *testing.T, core *Core) { +func TestWaitActive(t testing.TB, core *Core) { start := time.Now() var standby bool var err error @@ -463,7 +520,7 @@ func (t *TestClusterCore) CloseListeners() { time.Sleep(time.Second) } -func TestCluster(t *testing.T, handlers []http.Handler, base *CoreConfig, unsealStandbys bool) []*TestClusterCore { +func TestCluster(t testing.TB, handlers []http.Handler, base *CoreConfig, unsealStandbys bool) []*TestClusterCore { if handlers == nil || len(handlers) != 3 { t.Fatal("handlers must be size 3") } diff --git a/vault/token_store.go b/vault/token_store.go index 0db5547e56..48a1d18524 100644 --- a/vault/token_store.go +++ b/vault/token_store.go @@ -109,19 +109,10 @@ func NewTokenStore(c *Core, config *logical.BackendConfig) (*TokenStore, error) t.policyLookupFunc = c.policyStore.GetPolicy } - // Setup the salt - salt, err := salt.NewSalt(view, &salt.Config{ - HashFunc: salt.SHA1Hash, - }) - if err != nil { - return nil, err - } - t.salt = salt - t.tokenLocks = map[string]*sync.RWMutex{} // Create 256 locks - if err = locksutil.CreateLocks(t.tokenLocks, 256); err != nil { + if err := locksutil.CreateLocks(t.tokenLocks, 256); err != nil { return nil, fmt.Errorf("failed to create locks: %v", err) } @@ -136,6 +127,15 @@ func NewTokenStore(c *Core, config *logical.BackendConfig) (*TokenStore, error) "revoke-orphan/*", "accessors*", }, + + // Most token store items are local since tokens are local, but a + // notable exception is roles + LocalStorage: []string{ + lookupPrefix, + accessorPrefix, + parentPrefix, + "salt", + }, }, Paths: []*framework.Path{ @@ -467,6 +467,8 @@ func NewTokenStore(c *Core, config *logical.BackendConfig) (*TokenStore, error) HelpDescription: strings.TrimSpace(tokenTidyDesc), }, }, + + Init: t.Initialize, } t.Backend.Setup(config) @@ -474,6 +476,19 @@ func NewTokenStore(c *Core, config *logical.BackendConfig) (*TokenStore, error) return t, nil } +func (ts *TokenStore) Initialize() error { + // Setup the salt + salt, err := salt.NewSalt(ts.view, &salt.Config{ + HashFunc: salt.SHA1Hash, + }) + if err != nil { + return err + } + ts.salt = salt + + return nil +} + // TokenEntry is used to represent a given token type TokenEntry struct { // ID of this entry, generally a random UUID @@ -1085,7 +1100,7 @@ func (ts *TokenStore) lookupBySaltedAccessor(saltedAccessor string) (accessorEnt return aEntry, fmt.Errorf("failed to read index using accessor: %s", err) } if entry == nil { - return aEntry, &StatusBadRequest{Err: "invalid accessor"} + return aEntry, &logical.StatusBadRequest{Err: "invalid accessor"} } err = jsonutil.DecodeJSON(entry.Value, &aEntry) @@ -1225,7 +1240,7 @@ func (ts *TokenStore) handleUpdateLookupAccessor(req *logical.Request, data *fra if accessor == "" { accessor = data.Get("urlaccessor").(string) if accessor == "" { - return nil, &StatusBadRequest{Err: "missing accessor"} + return nil, &logical.StatusBadRequest{Err: "missing accessor"} } urlaccessor = true } @@ -1279,7 +1294,7 @@ func (ts *TokenStore) handleUpdateRevokeAccessor(req *logical.Request, data *fra if accessor == "" { accessor = data.Get("urlaccessor").(string) if accessor == "" { - return nil, &StatusBadRequest{Err: "missing accessor"} + return nil, &logical.StatusBadRequest{Err: "missing accessor"} } urlaccessor = true } diff --git a/vault/token_store_test.go b/vault/token_store_test.go index 745c6e3541..69e5b7ca45 100644 --- a/vault/token_store_test.go +++ b/vault/token_store_test.go @@ -437,6 +437,9 @@ func TestTokenStore_CreateLookup(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + if err := ts2.Initialize(); err != nil { + t.Fatalf("err: %v", err) + } // Should still match out, err = ts2.Lookup(ent.ID) @@ -476,6 +479,9 @@ func TestTokenStore_CreateLookup_ProvidedID(t *testing.T) { if err != nil { t.Fatalf("err: %v", err) } + if err := ts2.Initialize(); err != nil { + t.Fatalf("err: %v", err) + } // Should still match out, err = ts2.Lookup(ent.ID) diff --git a/vault/wrapping.go b/vault/wrapping.go index 0dc2e9b59a..46409c39bb 100644 --- a/vault/wrapping.go +++ b/vault/wrapping.go @@ -13,6 +13,7 @@ import ( "github.com/SermoDigital/jose/jws" "github.com/SermoDigital/jose/jwt" "github.com/hashicorp/errwrap" + "github.com/hashicorp/vault/helper/consts" "github.com/hashicorp/vault/helper/jsonutil" "github.com/hashicorp/vault/logical" ) @@ -284,10 +285,10 @@ func (c *Core) ValidateWrappingToken(req *logical.Request) (bool, error) { c.stateLock.RLock() defer c.stateLock.RUnlock() if c.sealed { - return false, ErrSealed + return false, consts.ErrSealed } if c.standby { - return false, ErrStandby + return false, consts.ErrStandby } te, err := c.tokenStore.Lookup(token) diff --git a/vendor/cloud.google.com/go/storage/acl.go b/vendor/cloud.google.com/go/storage/acl.go index 714d280e27..6c2439425a 100644 --- a/vendor/cloud.google.com/go/storage/acl.go +++ b/vendor/cloud.google.com/go/storage/acl.go @@ -27,6 +27,7 @@ type ACLRole string const ( RoleOwner ACLRole = "OWNER" RoleReader ACLRole = "READER" + RoleWriter ACLRole = "WRITER" ) // ACLEntity refers to a user or group. diff --git a/vendor/cloud.google.com/go/storage/storage.go b/vendor/cloud.google.com/go/storage/storage.go index bafb136a5d..53fc029236 100644 --- a/vendor/cloud.google.com/go/storage/storage.go +++ b/vendor/cloud.google.com/go/storage/storage.go @@ -82,7 +82,7 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error option.WithUserAgent(userAgent), } opts = append(o, opts...) - hc, _, err := transport.NewHTTPClient(ctx, opts...) + hc, ep, err := transport.NewHTTPClient(ctx, opts...) if err != nil { return nil, fmt.Errorf("dialing: %v", err) } @@ -90,6 +90,9 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*Client, error if err != nil { return nil, fmt.Errorf("storage client: %v", err) } + if ep != "" { + rawService.BasePath = ep + } return &Client{ hc: hc, raw: rawService, @@ -508,27 +511,33 @@ func (o *ObjectHandle) NewRangeReader(ctx context.Context, offset, length int64) return nil, err } var res *http.Response - err = runWithRetry(ctx, func() error { res, err = o.c.hc.Do(req); return err }) + err = runWithRetry(ctx, func() error { + res, err = o.c.hc.Do(req) + if err != nil { + return err + } + if res.StatusCode == http.StatusNotFound { + res.Body.Close() + return ErrObjectNotExist + } + if res.StatusCode < 200 || res.StatusCode > 299 { + body, _ := ioutil.ReadAll(res.Body) + res.Body.Close() + return &googleapi.Error{ + Code: res.StatusCode, + Header: res.Header, + Body: string(body), + } + } + if offset > 0 && length != 0 && res.StatusCode != http.StatusPartialContent { + res.Body.Close() + return errors.New("storage: partial request not satisfied") + } + return nil + }) if err != nil { return nil, err } - if res.StatusCode == http.StatusNotFound { - res.Body.Close() - return nil, ErrObjectNotExist - } - if res.StatusCode < 200 || res.StatusCode > 299 { - body, _ := ioutil.ReadAll(res.Body) - res.Body.Close() - return nil, &googleapi.Error{ - Code: res.StatusCode, - Header: res.Header, - Body: string(body), - } - } - if offset > 0 && length != 0 && res.StatusCode != http.StatusPartialContent { - res.Body.Close() - return nil, errors.New("storage: partial request not satisfied") - } var size int64 // total size of object, even if a range was requested. if res.StatusCode == http.StatusPartialContent { diff --git a/vendor/github.com/Jeffail/gabs/README.md b/vendor/github.com/Jeffail/gabs/README.md index 9ae67f7536..35edc19599 100644 --- a/vendor/github.com/Jeffail/gabs/README.md +++ b/vendor/github.com/Jeffail/gabs/README.md @@ -228,7 +228,7 @@ This is the easiest part: ```go ... -jsonParsedObj := gabs.ParseJSON([]byte(`{ +jsonParsedObj, _ := gabs.ParseJSON([]byte(`{ "outter":{ "values":{ "first":10, diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go index aeeada0d69..17fc76a0f6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/client.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/client.go @@ -24,6 +24,13 @@ type ConfigProvider interface { ClientConfig(serviceName string, cfgs ...*aws.Config) Config } +// ConfigNoResolveEndpointProvider same as ConfigProvider except it will not +// resolve the endpoint automatically. The service client's endpoint must be +// provided via the aws.Config.Endpoint field. +type ConfigNoResolveEndpointProvider interface { + ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) Config +} + // A Client implements the base client request and response handling // used by all service clients. type Client struct { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go index 3adec1315d..37e19ab00d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go @@ -27,6 +27,25 @@ type Options struct { // error will be returned. This option will prevent returning endpoints // that look valid, but may not resolve to any real endpoint. StrictMatching bool + + // Enables resolving a service endpoint based on the region provided if the + // service does not exist. The service endpoint ID will be used as the service + // domain name prefix. By default the endpoint resolver requires the service + // to be known when resolving endpoints. + // + // If resolving an endpoint on the partition list the provided region will + // be used to determine which partition's domain name pattern to the service + // endpoint ID with. If both the service and region are unkonwn and resolving + // the endpoint on partition list an UnknownEndpointError error will be returned. + // + // If resolving and endpoint on a partition specific resolver that partition's + // domain name pattern will be used with the service endpoint ID. If both + // region and service do not exist when resolving an endpoint on a specific + // partition the partition's domain pattern will be used to combine the + // endpoint and region together. + // + // This option is ignored if StrictMatching is enabled. + ResolveUnknownService bool } // Set combines all of the option functions together. @@ -54,6 +73,12 @@ func StrictMatchingOption(o *Options) { o.StrictMatching = true } +// ResolveUnknownServiceOption sets the ResolveUnknownService option. Can be used +// as a functional option when resolving endpoints. +func ResolveUnknownServiceOption(o *Options) { + o.ResolveUnknownService = true +} + // A Resolver provides the interface for functionality to resolve endpoints. // The build in Partition and DefaultResolver return value satisfy this interface. type Resolver interface { @@ -114,15 +139,18 @@ func (p *Partition) ID() string { return p.id } // // If the service cannot be found in the metadata the UnknownServiceError // error will be returned. This validation will occur regardless if -// StrictMatching is enabled. +// StrictMatching is enabled. To enable resolving unknown services set the +// "ResolveUnknownService" option to true. When StrictMatching is disabled +// this option allows the partition resolver to resolve a endpoint based on +// the service endpoint ID provided. // // When resolving endpoints you can choose to enable StrictMatching. This will // require the provided service and region to be known by the partition. // If the endpoint cannot be strictly resolved an error will be returned. This // mode is useful to ensure the endpoint resolved is valid. Without -// StrictMatching enabled the enpoint returned my look valid but may not work. +// StrictMatching enabled the endpoint returned my look valid but may not work. // StrictMatching requires the SDK to be updated if you want to take advantage -// of new regions and services expantions. +// of new regions and services expansions. // // Errors that can be returned. // * UnknownServiceError diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index 6522ce9b35..13d968a249 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -79,7 +79,9 @@ func (p partition) EndpointFor(service, region string, opts ...func(*Options)) ( opt.Set(opts...) s, hasService := p.Services[service] - if !hasService { + if !(hasService || opt.ResolveUnknownService) { + // Only return error if the resolver will not fallback to creating + // endpoint based on service endpoint ID passed in. return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services)) } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go index 18743baf2b..3d52fc20d7 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/session.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/session.go @@ -404,6 +404,10 @@ func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) ( func(opt *endpoints.Options) { opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL) opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack) + + // Support the condition where the service is modeled but its + // endpoint metadata is not available. + opt.ResolveUnknownService = true }, ) } @@ -416,3 +420,27 @@ func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) ( SigningName: resolved.SigningName, }, err } + +// ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception +// that the EndpointResolver will not be used to resolve the endpoint. The only +// endpoint set must come from the aws.Config.Endpoint field. +func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Config { + s = s.Copy(cfgs...) + + var resolved endpoints.ResolvedEndpoint + + region := aws.StringValue(s.Config.Region) + + if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 { + resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL)) + resolved.SigningRegion = region + } + + return client.Config{ + Config: s.Config, + Handlers: s.Handlers, + Endpoint: resolved.URL, + SigningRegion: resolved.SigningRegion, + SigningName: resolved.SigningName, + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/version.go b/vendor/github.com/aws/aws-sdk-go/aws/version.go index b0148e4b26..2eb30f030d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.6.19" +const SDKVersion = "1.6.24" diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go index 125247059d..cb4ded4bce 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -553,6 +553,67 @@ func (c *EC2) AssociateDhcpOptions(input *AssociateDhcpOptionsInput) (*Associate return out, err } +const opAssociateIamInstanceProfile = "AssociateIamInstanceProfile" + +// AssociateIamInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the AssociateIamInstanceProfile operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// See AssociateIamInstanceProfile for usage and error information. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the AssociateIamInstanceProfile method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the AssociateIamInstanceProfileRequest method. +// req, resp := client.AssociateIamInstanceProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile +func (c *EC2) AssociateIamInstanceProfileRequest(input *AssociateIamInstanceProfileInput) (req *request.Request, output *AssociateIamInstanceProfileOutput) { + op := &request.Operation{ + Name: opAssociateIamInstanceProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateIamInstanceProfileInput{} + } + + output = &AssociateIamInstanceProfileOutput{} + req = c.newRequest(op, input, output) + return +} + +// AssociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud. +// +// Associates an IAM instance profile with a running or stopped instance. You +// cannot associate more than one IAM instance profile with an instance. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation AssociateIamInstanceProfile for usage and error information. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfile +func (c *EC2) AssociateIamInstanceProfile(input *AssociateIamInstanceProfileInput) (*AssociateIamInstanceProfileOutput, error) { + req, out := c.AssociateIamInstanceProfileRequest(input) + err := req.Send() + return out, err +} + const opAssociateRouteTable = "AssociateRouteTable" // AssociateRouteTableRequest generates a "aws/request.Request" representing the @@ -6592,6 +6653,66 @@ func (c *EC2) DescribeHosts(input *DescribeHostsInput) (*DescribeHostsOutput, er return out, err } +const opDescribeIamInstanceProfileAssociations = "DescribeIamInstanceProfileAssociations" + +// DescribeIamInstanceProfileAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeIamInstanceProfileAssociations operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// See DescribeIamInstanceProfileAssociations for usage and error information. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the DescribeIamInstanceProfileAssociations method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the DescribeIamInstanceProfileAssociationsRequest method. +// req, resp := client.DescribeIamInstanceProfileAssociationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociations +func (c *EC2) DescribeIamInstanceProfileAssociationsRequest(input *DescribeIamInstanceProfileAssociationsInput) (req *request.Request, output *DescribeIamInstanceProfileAssociationsOutput) { + op := &request.Operation{ + Name: opDescribeIamInstanceProfileAssociations, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeIamInstanceProfileAssociationsInput{} + } + + output = &DescribeIamInstanceProfileAssociationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeIamInstanceProfileAssociations API operation for Amazon Elastic Compute Cloud. +// +// Describes your IAM instance profile associations. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeIamInstanceProfileAssociations for usage and error information. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociations +func (c *EC2) DescribeIamInstanceProfileAssociations(input *DescribeIamInstanceProfileAssociationsInput) (*DescribeIamInstanceProfileAssociationsOutput, error) { + req, out := c.DescribeIamInstanceProfileAssociationsRequest(input) + err := req.Send() + return out, err +} + const opDescribeIdFormat = "DescribeIdFormat" // DescribeIdFormatRequest generates a "aws/request.Request" representing the @@ -7482,6 +7603,12 @@ func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req * Name: opDescribeNatGateways, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -7510,6 +7637,31 @@ func (c *EC2) DescribeNatGateways(input *DescribeNatGatewaysInput) (*DescribeNat return out, err } +// DescribeNatGatewaysPages iterates over the pages of a DescribeNatGateways operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeNatGateways method for more information on how to use this operation. +// +// Note: This operation can generate multiple requests to a service. +// +// // Example iterating over at most 3 pages of a DescribeNatGateways operation. +// pageNum := 0 +// err := client.DescribeNatGatewaysPages(params, +// func(page *DescribeNatGatewaysOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeNatGatewaysPages(input *DescribeNatGatewaysInput, fn func(p *DescribeNatGatewaysOutput, lastPage bool) (shouldContinue bool)) error { + page, _ := c.DescribeNatGatewaysRequest(input) + page.Handlers.Build.PushBack(request.MakeAddToUserAgentFreeFormHandler("Paginator")) + return page.EachPage(func(p interface{}, lastPage bool) bool { + return fn(p.(*DescribeNatGatewaysOutput), lastPage) + }) +} + const opDescribeNetworkAcls = "DescribeNetworkAcls" // DescribeNetworkAclsRequest generates a "aws/request.Request" representing the @@ -9713,6 +9865,78 @@ func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(p *Descr }) } +const opDescribeVolumesModifications = "DescribeVolumesModifications" + +// DescribeVolumesModificationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVolumesModifications operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// See DescribeVolumesModifications for usage and error information. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the DescribeVolumesModifications method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the DescribeVolumesModificationsRequest method. +// req, resp := client.DescribeVolumesModificationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications +func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModificationsInput) (req *request.Request, output *DescribeVolumesModificationsOutput) { + op := &request.Operation{ + Name: opDescribeVolumesModifications, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeVolumesModificationsInput{} + } + + output = &DescribeVolumesModificationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeVolumesModifications API operation for Amazon Elastic Compute Cloud. +// +// Reports the current modification status of EBS volumes. +// +// Current-generation EBS volumes support modification of attributes including +// type, size, and (for io1 volumes) IOPS provisioning while either attached +// to or detached from an instance. Following an action from the API or the +// console to modify a volume, the status of the modification may be modifying, +// optimizing, completed, or failed. If a volume has never been modified, then +// certain elements of the returned VolumeModification objects are null. +// +// You can also use CloudWatch Events to check the status of a modification +// to an EBS volume. For information about CloudWatch Events, see the Amazon +// CloudWatch Events User Guide (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html). +// For more information, see Monitoring Volume Modifications" (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeVolumesModifications for usage and error information. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications +func (c *EC2) DescribeVolumesModifications(input *DescribeVolumesModificationsInput) (*DescribeVolumesModificationsOutput, error) { + req, out := c.DescribeVolumesModificationsRequest(input) + err := req.Send() + return out, err +} + const opDescribeVpcAttribute = "DescribeVpcAttribute" // DescribeVpcAttributeRequest generates a "aws/request.Request" representing the @@ -10857,6 +11081,68 @@ func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*Disassociat return out, err } +const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" + +// DisassociateIamInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateIamInstanceProfile operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// See DisassociateIamInstanceProfile for usage and error information. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the DisassociateIamInstanceProfile method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the DisassociateIamInstanceProfileRequest method. +// req, resp := client.DisassociateIamInstanceProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile +func (c *EC2) DisassociateIamInstanceProfileRequest(input *DisassociateIamInstanceProfileInput) (req *request.Request, output *DisassociateIamInstanceProfileOutput) { + op := &request.Operation{ + Name: opDisassociateIamInstanceProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisassociateIamInstanceProfileInput{} + } + + output = &DisassociateIamInstanceProfileOutput{} + req = c.newRequest(op, input, output) + return +} + +// DisassociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud. +// +// Disassociates an IAM instance profile from a running or stopped instance. +// +// Use DescribeIamInstanceProfileAssociations to get the association ID. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DisassociateIamInstanceProfile for usage and error information. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile +func (c *EC2) DisassociateIamInstanceProfile(input *DisassociateIamInstanceProfileInput) (*DisassociateIamInstanceProfileOutput, error) { + req, out := c.DisassociateIamInstanceProfileRequest(input) + err := req.Send() + return out, err +} + const opDisassociateRouteTable = "DisassociateRouteTable" // DisassociateRouteTableRequest generates a "aws/request.Request" representing the @@ -12743,6 +13029,99 @@ func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifyS return out, err } +const opModifyVolume = "ModifyVolume" + +// ModifyVolumeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVolume operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// See ModifyVolume for usage and error information. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the ModifyVolume method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the ModifyVolumeRequest method. +// req, resp := client.ModifyVolumeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume +func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Request, output *ModifyVolumeOutput) { + op := &request.Operation{ + Name: opModifyVolume, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyVolumeInput{} + } + + output = &ModifyVolumeOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyVolume API operation for Amazon Elastic Compute Cloud. +// +// You can modify several parameters of an existing EBS volume, including volume +// size, volume type, and IOPS capacity. If your EBS volume is attached to a +// current-generation EC2 instance type, you may be able to apply these changes +// without stopping the instance or detaching the volume from it. For more information +// about modifying an EBS volume running Linux, see Modifying the Size, IOPS, +// or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). +// For more information about modifying an EBS volume running Windows, see Expanding +// the Storage Space of an EBS Volume on Windows (http://docs.aws.amazon.com/docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). +// +// When you complete a resize operation on your volume, you need to extend the +// volume's file-system size to take advantage of the new storage capacity. +// For information about extending a Linux file system, see Extending a Linux +// File System (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#recognize-expanded-volume-linux). +// For information about extending a Windows file system, see Extending a Windows +// File System (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows). +// +// You can use CloudWatch Events to check the status of a modification to an +// EBS volume. For information about CloudWatch Events, see the Amazon CloudWatch +// Events User Guide (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonCloudWatch/latest/events/WhatIsCloudWatchEvents.html). +// You can also track the status of a modification using the DescribeVolumesModifications +// (http://docs.aws.amazon.com/http:/docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVolumesModifications.html) +// API. For information about tracking status changes using either method, see +// Monitoring Volume Modifications" (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). +// +// With previous-generation volumes and instance types, resizing an EBS volume +// may require detaching and reattaching the volume or stopping and restarting +// the instance. For more information about modifying an EBS volume running +// Linux, see Modifying the Size, IOPS, or Type of an EBS Volume on Linux (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html). +// For more information about modifying an EBS volume running Windows, see Modifying +// the Size, IOPS, or Type of an EBS Volume on Windows (http://docs.aws.amazon.com/docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). +// +// If you reach the maximum volume modification rate per volume limit, you will +// need to wait at least six hours before applying further modifications to +// the affected EBS volume. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ModifyVolume for usage and error information. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume +func (c *EC2) ModifyVolume(input *ModifyVolumeInput) (*ModifyVolumeOutput, error) { + req, out := c.ModifyVolumeRequest(input) + err := req.Send() + return out, err +} + const opModifyVolumeAttribute = "ModifyVolumeAttribute" // ModifyVolumeAttributeRequest generates a "aws/request.Request" representing the @@ -13724,6 +14103,71 @@ func (c *EC2) ReleaseHosts(input *ReleaseHostsInput) (*ReleaseHostsOutput, error return out, err } +const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssociation" + +// ReplaceIamInstanceProfileAssociationRequest generates a "aws/request.Request" representing the +// client's request for the ReplaceIamInstanceProfileAssociation operation. The "output" return +// value can be used to capture response data after the request's "Send" method +// is called. +// +// See ReplaceIamInstanceProfileAssociation for usage and error information. +// +// Creating a request object using this method should be used when you want to inject +// custom logic into the request's lifecycle using a custom handler, or if you want to +// access properties on the request object before or after sending the request. If +// you just want the service response, call the ReplaceIamInstanceProfileAssociation method directly +// instead. +// +// Note: You must call the "Send" method on the returned request object in order +// to execute the request. +// +// // Example sending a request using the ReplaceIamInstanceProfileAssociationRequest method. +// req, resp := client.ReplaceIamInstanceProfileAssociationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation +func (c *EC2) ReplaceIamInstanceProfileAssociationRequest(input *ReplaceIamInstanceProfileAssociationInput) (req *request.Request, output *ReplaceIamInstanceProfileAssociationOutput) { + op := &request.Operation{ + Name: opReplaceIamInstanceProfileAssociation, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ReplaceIamInstanceProfileAssociationInput{} + } + + output = &ReplaceIamInstanceProfileAssociationOutput{} + req = c.newRequest(op, input, output) + return +} + +// ReplaceIamInstanceProfileAssociation API operation for Amazon Elastic Compute Cloud. +// +// Replaces an IAM instance profile for the specified running instance. You +// can use this action to change the IAM instance profile that's associated +// with an instance without having to disassociate the existing IAM instance +// profile first. +// +// Use DescribeIamInstanceProfileAssociations to get the association ID. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation ReplaceIamInstanceProfileAssociation for usage and error information. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation +func (c *EC2) ReplaceIamInstanceProfileAssociation(input *ReplaceIamInstanceProfileAssociationInput) (*ReplaceIamInstanceProfileAssociationOutput, error) { + req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) + err := req.Send() + return out, err +} + const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" // ReplaceNetworkAclAssociationRequest generates a "aws/request.Request" representing the @@ -14734,7 +15178,7 @@ func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Reques // IPv4 range of your subnet. // // * Not all instance types support IPv6 addresses. For more information, -// see Amazon EC2 Instance Types (http://aws.amazon.com/ec2/instance-types/). +// see Instance Types (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). // // * If you don't specify a security group ID, we use the default security // group. For more information, see Security Groups (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html). @@ -16231,6 +16675,83 @@ func (s AssociateDhcpOptionsOutput) GoString() string { return s.String() } +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfileRequest +type AssociateIamInstanceProfileInput struct { + _ struct{} `type:"structure"` + + // The IAM instance profile. + // + // IamInstanceProfile is a required field + IamInstanceProfile *IamInstanceProfileSpecification `type:"structure" required:"true"` + + // The ID of the instance. + // + // InstanceId is a required field + InstanceId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateIamInstanceProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateIamInstanceProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateIamInstanceProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateIamInstanceProfileInput"} + if s.IamInstanceProfile == nil { + invalidParams.Add(request.NewErrParamRequired("IamInstanceProfile")) + } + if s.InstanceId == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIamInstanceProfile sets the IamInstanceProfile field's value. +func (s *AssociateIamInstanceProfileInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *AssociateIamInstanceProfileInput { + s.IamInstanceProfile = v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *AssociateIamInstanceProfileInput) SetInstanceId(v string) *AssociateIamInstanceProfileInput { + s.InstanceId = &v + return s +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateIamInstanceProfileResult +type AssociateIamInstanceProfileOutput struct { + _ struct{} `type:"structure"` + + // Information about the IAM instance profile association. + IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` +} + +// String returns the string representation +func (s AssociateIamInstanceProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateIamInstanceProfileOutput) GoString() string { + return s.String() +} + +// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. +func (s *AssociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *AssociateIamInstanceProfileOutput { + s.IamInstanceProfileAssociation = v + return s +} + // Contains the parameters for AssociateRouteTable. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateRouteTableRequest type AssociateRouteTableInput struct { @@ -25213,6 +25734,113 @@ func (s *DescribeHostsOutput) SetNextToken(v string) *DescribeHostsOutput { return s } +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociationsRequest +type DescribeIamInstanceProfileAssociationsInput struct { + _ struct{} `type:"structure"` + + // One or more IAM instance profile associations. + AssociationIds []*string `locationName:"AssociationId" locationNameList:"AssociationId" type:"list"` + + // One or more filters. + // + // * instance-id - The ID of the instance. + // + // * state - The state of the association (associating | associated | disassociating + // | disassociated). + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token to request the next page of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeIamInstanceProfileAssociationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIamInstanceProfileAssociationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeIamInstanceProfileAssociationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeIamInstanceProfileAssociationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssociationIds sets the AssociationIds field's value. +func (s *DescribeIamInstanceProfileAssociationsInput) SetAssociationIds(v []*string) *DescribeIamInstanceProfileAssociationsInput { + s.AssociationIds = v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeIamInstanceProfileAssociationsInput) SetFilters(v []*Filter) *DescribeIamInstanceProfileAssociationsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeIamInstanceProfileAssociationsInput) SetMaxResults(v int64) *DescribeIamInstanceProfileAssociationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeIamInstanceProfileAssociationsInput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsInput { + s.NextToken = &v + return s +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIamInstanceProfileAssociationsResult +type DescribeIamInstanceProfileAssociationsOutput struct { + _ struct{} `type:"structure"` + + // Information about one or more IAM instance profile associations. + IamInstanceProfileAssociations []*IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociationSet" locationNameList:"item" type:"list"` + + // The token to use to retrieve the next page of results. This value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeIamInstanceProfileAssociationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIamInstanceProfileAssociationsOutput) GoString() string { + return s.String() +} + +// SetIamInstanceProfileAssociations sets the IamInstanceProfileAssociations field's value. +func (s *DescribeIamInstanceProfileAssociationsOutput) SetIamInstanceProfileAssociations(v []*IamInstanceProfileAssociation) *DescribeIamInstanceProfileAssociationsOutput { + s.IamInstanceProfileAssociations = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeIamInstanceProfileAssociationsOutput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsOutput { + s.NextToken = &v + return s +} + // Contains the parameters for DescribeIdFormat. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIdFormatRequest type DescribeIdFormatInput struct { @@ -30571,10 +31199,10 @@ type DescribeVolumesInput struct { // results in a single page along with a NextToken response element. The remaining // results of the initial request can be seen by sending another DescribeVolumes // request with the returned NextToken value. This value can be between 5 and - // 1000; if MaxResults is given a value larger than 1000, only 1000 results - // are returned. If this parameter is not used, then DescribeVolumes returns - // all results. You cannot specify this parameter and the volume IDs parameter - // in the same request. + // 500; if MaxResults is given a value larger than 500, only 500 results are + // returned. If this parameter is not used, then DescribeVolumes returns all + // results. You cannot specify this parameter and the volume IDs parameter in + // the same request. MaxResults *int64 `locationName:"maxResults" type:"integer"` // The NextToken value returned from a previous paginated DescribeVolumes request @@ -30627,6 +31255,105 @@ func (s *DescribeVolumesInput) SetVolumeIds(v []*string) *DescribeVolumesInput { return s } +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModificationsRequest +type DescribeVolumesModificationsInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // One or more filters. Supported filters: volume-id, modification-state, target-size, + // target-iops, target-volume-type, original-size, original-iops, original-volume-type, + // start-time. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results (up to a limit of 500) to be returned in a + // paginated request. + MaxResults *int64 `type:"integer"` + + // The nextToken value returned by a previous paginated request. + NextToken *string `type:"string"` + + // One or more volume IDs for which in-progress modifications will be described. + VolumeIds []*string `locationName:"VolumeId" locationNameList:"VolumeId" type:"list"` +} + +// String returns the string representation +func (s DescribeVolumesModificationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVolumesModificationsInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeVolumesModificationsInput) SetDryRun(v bool) *DescribeVolumesModificationsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeVolumesModificationsInput) SetFilters(v []*Filter) *DescribeVolumesModificationsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeVolumesModificationsInput) SetMaxResults(v int64) *DescribeVolumesModificationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeVolumesModificationsInput) SetNextToken(v string) *DescribeVolumesModificationsInput { + s.NextToken = &v + return s +} + +// SetVolumeIds sets the VolumeIds field's value. +func (s *DescribeVolumesModificationsInput) SetVolumeIds(v []*string) *DescribeVolumesModificationsInput { + s.VolumeIds = v + return s +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModificationsResult +type DescribeVolumesModificationsOutput struct { + _ struct{} `type:"structure"` + + // Token for pagination, null if there are no more results + NextToken *string `locationName:"nextToken" type:"string"` + + // A list of returned VolumeModification objects. + VolumesModifications []*VolumeModification `locationName:"volumeModificationSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeVolumesModificationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeVolumesModificationsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeVolumesModificationsOutput) SetNextToken(v string) *DescribeVolumesModificationsOutput { + s.NextToken = &v + return s +} + +// SetVolumesModifications sets the VolumesModifications field's value. +func (s *DescribeVolumesModificationsOutput) SetVolumesModifications(v []*VolumeModification) *DescribeVolumesModificationsOutput { + s.VolumesModifications = v + return s +} + // Contains the output of DescribeVolumes. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesResult type DescribeVolumesOutput struct { @@ -32356,6 +33083,69 @@ func (s DisassociateAddressOutput) GoString() string { return s.String() } +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfileRequest +type DisassociateIamInstanceProfileInput struct { + _ struct{} `type:"structure"` + + // The ID of the IAM instance profile association. + // + // AssociationId is a required field + AssociationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateIamInstanceProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateIamInstanceProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateIamInstanceProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateIamInstanceProfileInput"} + if s.AssociationId == nil { + invalidParams.Add(request.NewErrParamRequired("AssociationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssociationId sets the AssociationId field's value. +func (s *DisassociateIamInstanceProfileInput) SetAssociationId(v string) *DisassociateIamInstanceProfileInput { + s.AssociationId = &v + return s +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfileResult +type DisassociateIamInstanceProfileOutput struct { + _ struct{} `type:"structure"` + + // Information about the IAM instance profile association. + IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` +} + +// String returns the string representation +func (s DisassociateIamInstanceProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateIamInstanceProfileOutput) GoString() string { + return s.String() +} + +// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. +func (s *DisassociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *DisassociateIamInstanceProfileOutput { + s.IamInstanceProfileAssociation = v + return s +} + // Contains the parameters for DisassociateRouteTable. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTableRequest type DisassociateRouteTableInput struct { @@ -34787,6 +35577,67 @@ func (s *IamInstanceProfile) SetId(v string) *IamInstanceProfile { return s } +// Describes an association between an IAM instance profile and an instance. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IamInstanceProfileAssociation +type IamInstanceProfileAssociation struct { + _ struct{} `type:"structure"` + + // The ID of the association. + AssociationId *string `locationName:"associationId" type:"string"` + + // The IAM instance profile. + IamInstanceProfile *IamInstanceProfile `locationName:"iamInstanceProfile" type:"structure"` + + // The ID of the instance. + InstanceId *string `locationName:"instanceId" type:"string"` + + // The state of the association. + State *string `locationName:"state" type:"string" enum:"IamInstanceProfileAssociationState"` + + // The time the IAM instance profile was associated with the instance. + Timestamp *time.Time `locationName:"timestamp" type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s IamInstanceProfileAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IamInstanceProfileAssociation) GoString() string { + return s.String() +} + +// SetAssociationId sets the AssociationId field's value. +func (s *IamInstanceProfileAssociation) SetAssociationId(v string) *IamInstanceProfileAssociation { + s.AssociationId = &v + return s +} + +// SetIamInstanceProfile sets the IamInstanceProfile field's value. +func (s *IamInstanceProfileAssociation) SetIamInstanceProfile(v *IamInstanceProfile) *IamInstanceProfileAssociation { + s.IamInstanceProfile = v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *IamInstanceProfileAssociation) SetInstanceId(v string) *IamInstanceProfileAssociation { + s.InstanceId = &v + return s +} + +// SetState sets the State field's value. +func (s *IamInstanceProfileAssociation) SetState(v string) *IamInstanceProfileAssociation { + s.State = &v + return s +} + +// SetTimestamp sets the Timestamp field's value. +func (s *IamInstanceProfileAssociation) SetTimestamp(v time.Time) *IamInstanceProfileAssociation { + s.Timestamp = &v + return s +} + // Describes an IAM instance profile. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/IamInstanceProfileSpecification type IamInstanceProfileSpecification struct { @@ -39601,6 +40452,120 @@ func (s ModifyVolumeAttributeOutput) GoString() string { return s.String() } +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeRequest +type ModifyVolumeInput struct { + _ struct{} `type:"structure"` + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have + // the required permissions, the error response is DryRunOperation. Otherwise, + // it is UnauthorizedOperation. + DryRun *bool `type:"boolean"` + + // Target IOPS rate of the volume to be modified. + // + // Only valid for Provisioned IOPS SSD (io1) volumes. For more information about + // io1 IOPS configuration, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops + // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html#EBSVolumeTypes_piops). + Iops *int64 `type:"integer"` + + // Target size in GiB of the volume to be modified. Target volume size must + // be greater than or equal to than the existing size of the volume. For information + // about available EBS volume sizes, see http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html + // (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html). + // + // Default: If no size is specified, the existing size is retained. + Size *int64 `type:"integer"` + + // VolumeId is a required field + VolumeId *string `type:"string" required:"true"` + + // Target EBS volume type of the volume to be modified + // + // Valid values are io1 | gp2 | sc1 | st1 + // + // The API does not support modifications for volume type standard. You also + // cannot change the type of a volume to standard. + VolumeType *string `type:"string" enum:"VolumeType"` +} + +// String returns the string representation +func (s ModifyVolumeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVolumeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyVolumeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyVolumeInput"} + if s.VolumeId == nil { + invalidParams.Add(request.NewErrParamRequired("VolumeId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyVolumeInput) SetDryRun(v bool) *ModifyVolumeInput { + s.DryRun = &v + return s +} + +// SetIops sets the Iops field's value. +func (s *ModifyVolumeInput) SetIops(v int64) *ModifyVolumeInput { + s.Iops = &v + return s +} + +// SetSize sets the Size field's value. +func (s *ModifyVolumeInput) SetSize(v int64) *ModifyVolumeInput { + s.Size = &v + return s +} + +// SetVolumeId sets the VolumeId field's value. +func (s *ModifyVolumeInput) SetVolumeId(v string) *ModifyVolumeInput { + s.VolumeId = &v + return s +} + +// SetVolumeType sets the VolumeType field's value. +func (s *ModifyVolumeInput) SetVolumeType(v string) *ModifyVolumeInput { + s.VolumeType = &v + return s +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeResult +type ModifyVolumeOutput struct { + _ struct{} `type:"structure"` + + // A VolumeModification object. + VolumeModification *VolumeModification `locationName:"volumeModification" type:"structure"` +} + +// String returns the string representation +func (s ModifyVolumeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyVolumeOutput) GoString() string { + return s.String() +} + +// SetVolumeModification sets the VolumeModification field's value. +func (s *ModifyVolumeOutput) SetVolumeModification(v *VolumeModification) *ModifyVolumeOutput { + s.VolumeModification = v + return s +} + // Contains the parameters for ModifyVpcAttribute. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttributeRequest type ModifyVpcAttributeInput struct { @@ -42672,6 +43637,83 @@ func (s *ReleaseHostsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *ReleaseHost return s } +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociationRequest +type ReplaceIamInstanceProfileAssociationInput struct { + _ struct{} `type:"structure"` + + // The ID of the existing IAM instance profile association. + // + // AssociationId is a required field + AssociationId *string `type:"string" required:"true"` + + // The IAM instance profile. + // + // IamInstanceProfile is a required field + IamInstanceProfile *IamInstanceProfileSpecification `type:"structure" required:"true"` +} + +// String returns the string representation +func (s ReplaceIamInstanceProfileAssociationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceIamInstanceProfileAssociationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplaceIamInstanceProfileAssociationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplaceIamInstanceProfileAssociationInput"} + if s.AssociationId == nil { + invalidParams.Add(request.NewErrParamRequired("AssociationId")) + } + if s.IamInstanceProfile == nil { + invalidParams.Add(request.NewErrParamRequired("IamInstanceProfile")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssociationId sets the AssociationId field's value. +func (s *ReplaceIamInstanceProfileAssociationInput) SetAssociationId(v string) *ReplaceIamInstanceProfileAssociationInput { + s.AssociationId = &v + return s +} + +// SetIamInstanceProfile sets the IamInstanceProfile field's value. +func (s *ReplaceIamInstanceProfileAssociationInput) SetIamInstanceProfile(v *IamInstanceProfileSpecification) *ReplaceIamInstanceProfileAssociationInput { + s.IamInstanceProfile = v + return s +} + +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociationResult +type ReplaceIamInstanceProfileAssociationOutput struct { + _ struct{} `type:"structure"` + + // Information about the IAM instance profile association. + IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` +} + +// String returns the string representation +func (s ReplaceIamInstanceProfileAssociationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplaceIamInstanceProfileAssociationOutput) GoString() string { + return s.String() +} + +// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. +func (s *ReplaceIamInstanceProfileAssociationOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *ReplaceIamInstanceProfileAssociationOutput { + s.IamInstanceProfileAssociation = v + return s +} + // Contains the parameters for ReplaceNetworkAclAssociation. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociationRequest type ReplaceNetworkAclAssociationInput struct { @@ -49030,14 +50072,16 @@ type StateReason struct { // The message for the state change. // - // * Server.SpotInstanceTermination: A Spot instance was terminated due to - // an increase in the market price. + // * Server.InsufficientInstanceCapacity: There was insufficient instance + // capacity to satisfy the launch request. // // * Server.InternalError: An internal error occurred during instance launch, // resulting in termination. // - // * Server.InsufficientInstanceCapacity: There was insufficient instance - // capacity to satisfy the launch request. + // * Server.ScheduledStop: The instance was stopped due to a scheduled retirement. + // + // * Server.SpotInstanceTermination: A Spot instance was terminated due to + // an increase in the market price. // // * Client.InternalError: A client error caused the instance to terminate // on launch. @@ -50473,6 +51517,133 @@ func (s *VolumeDetail) SetSize(v int64) *VolumeDetail { return s } +// Describes the modification status of an EBS volume. +// +// If the volume has never been modified, some element values will be null. +// Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeModification +type VolumeModification struct { + _ struct{} `type:"structure"` + + // Modification completion or failure time. + EndTime *time.Time `locationName:"endTime" type:"timestamp" timestampFormat:"iso8601"` + + // Current state of modification. Possible values are modifying | optimizing + // | complete | failed. Modification state is null for unmodified volumes. + ModificationState *string `locationName:"modificationState" type:"string" enum:"VolumeModificationState"` + + // Original IOPS rate of the volume being modified. + OriginalIops *int64 `locationName:"originalIops" type:"integer"` + + // Original size of the volume being modified. + OriginalSize *int64 `locationName:"originalSize" type:"integer"` + + // Original EBS volume type of the volume being modified. + OriginalVolumeType *string `locationName:"originalVolumeType" type:"string" enum:"VolumeType"` + + // Modification progress from 0 to 100%. + Progress *int64 `locationName:"progress" type:"long"` + + // Modification start time + StartTime *time.Time `locationName:"startTime" type:"timestamp" timestampFormat:"iso8601"` + + // Generic status message on modification progress or failure. + StatusMessage *string `locationName:"statusMessage" type:"string"` + + // Target IOPS rate of the volume being modified. + TargetIops *int64 `locationName:"targetIops" type:"integer"` + + // Target size of the volume being modified. + TargetSize *int64 `locationName:"targetSize" type:"integer"` + + // Target EBS volume type of the volume being modified. + TargetVolumeType *string `locationName:"targetVolumeType" type:"string" enum:"VolumeType"` + + // ID of the volume being modified. + VolumeId *string `locationName:"volumeId" type:"string"` +} + +// String returns the string representation +func (s VolumeModification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VolumeModification) GoString() string { + return s.String() +} + +// SetEndTime sets the EndTime field's value. +func (s *VolumeModification) SetEndTime(v time.Time) *VolumeModification { + s.EndTime = &v + return s +} + +// SetModificationState sets the ModificationState field's value. +func (s *VolumeModification) SetModificationState(v string) *VolumeModification { + s.ModificationState = &v + return s +} + +// SetOriginalIops sets the OriginalIops field's value. +func (s *VolumeModification) SetOriginalIops(v int64) *VolumeModification { + s.OriginalIops = &v + return s +} + +// SetOriginalSize sets the OriginalSize field's value. +func (s *VolumeModification) SetOriginalSize(v int64) *VolumeModification { + s.OriginalSize = &v + return s +} + +// SetOriginalVolumeType sets the OriginalVolumeType field's value. +func (s *VolumeModification) SetOriginalVolumeType(v string) *VolumeModification { + s.OriginalVolumeType = &v + return s +} + +// SetProgress sets the Progress field's value. +func (s *VolumeModification) SetProgress(v int64) *VolumeModification { + s.Progress = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *VolumeModification) SetStartTime(v time.Time) *VolumeModification { + s.StartTime = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *VolumeModification) SetStatusMessage(v string) *VolumeModification { + s.StatusMessage = &v + return s +} + +// SetTargetIops sets the TargetIops field's value. +func (s *VolumeModification) SetTargetIops(v int64) *VolumeModification { + s.TargetIops = &v + return s +} + +// SetTargetSize sets the TargetSize field's value. +func (s *VolumeModification) SetTargetSize(v int64) *VolumeModification { + s.TargetSize = &v + return s +} + +// SetTargetVolumeType sets the TargetVolumeType field's value. +func (s *VolumeModification) SetTargetVolumeType(v string) *VolumeModification { + s.TargetVolumeType = &v + return s +} + +// SetVolumeId sets the VolumeId field's value. +func (s *VolumeModification) SetVolumeId(v string) *VolumeModification { + s.VolumeId = &v + return s +} + // Describes a volume status operation code. // Please also see https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/VolumeStatusAction type VolumeStatusAction struct { @@ -51862,6 +53033,20 @@ const ( HypervisorTypeXen = "xen" ) +const ( + // IamInstanceProfileAssociationStateAssociating is a IamInstanceProfileAssociationState enum value + IamInstanceProfileAssociationStateAssociating = "associating" + + // IamInstanceProfileAssociationStateAssociated is a IamInstanceProfileAssociationState enum value + IamInstanceProfileAssociationStateAssociated = "associated" + + // IamInstanceProfileAssociationStateDisassociating is a IamInstanceProfileAssociationState enum value + IamInstanceProfileAssociationStateDisassociating = "disassociating" + + // IamInstanceProfileAssociationStateDisassociated is a IamInstanceProfileAssociationState enum value + IamInstanceProfileAssociationStateDisassociated = "disassociated" +) + const ( // ImageAttributeNameDescription is a ImageAttributeName enum value ImageAttributeNameDescription = "description" @@ -52771,6 +53956,20 @@ const ( VolumeAttributeNameProductCodes = "productCodes" ) +const ( + // VolumeModificationStateModifying is a VolumeModificationState enum value + VolumeModificationStateModifying = "modifying" + + // VolumeModificationStateOptimizing is a VolumeModificationState enum value + VolumeModificationStateOptimizing = "optimizing" + + // VolumeModificationStateCompleted is a VolumeModificationState enum value + VolumeModificationStateCompleted = "completed" + + // VolumeModificationStateFailed is a VolumeModificationState enum value + VolumeModificationStateFailed = "failed" +) + const ( // VolumeStateCreating is a VolumeState enum value VolumeStateCreating = "creating" diff --git a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go index 94fab6d847..7917cbdaf9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go @@ -498,7 +498,7 @@ func (c *EC2) WaitUntilKeyPairExists(input *DescribeKeyPairsInput) error { Acceptors: []waiter.WaitAcceptor{ { State: "success", - Matcher: "pathAll", + Matcher: "path", Argument: "length(KeyPairs[].KeyName) > `0`", Expected: true, }, @@ -921,6 +921,39 @@ func (c *EC2) WaitUntilVpcExists(input *DescribeVpcsInput) error { return w.Wait() } +// WaitUntilVpcPeeringConnectionDeleted uses the Amazon EC2 API operation +// DescribeVpcPeeringConnections to wait for a condition to be met before returning. +// If the condition is not meet within the max attempt window an error will +// be returned. +func (c *EC2) WaitUntilVpcPeeringConnectionDeleted(input *DescribeVpcPeeringConnectionsInput) error { + waiterCfg := waiter.Config{ + Operation: "DescribeVpcPeeringConnections", + Delay: 15, + MaxAttempts: 40, + Acceptors: []waiter.WaitAcceptor{ + { + State: "success", + Matcher: "pathAll", + Argument: "VpcPeeringConnections[].Status.Code", + Expected: "deleted", + }, + { + State: "success", + Matcher: "error", + Argument: "", + Expected: "InvalidVpcPeeringConnectionID.NotFound", + }, + }, + } + + w := waiter.Waiter{ + Client: c, + Input: input, + Config: waiterCfg, + } + return w.Wait() +} + // WaitUntilVpcPeeringConnectionExists uses the Amazon EC2 API operation // DescribeVpcPeeringConnections to wait for a condition to be met before returning. // If the condition is not meet within the max attempt window an error will diff --git a/vendor/github.com/circonus-labs/circonus-gometrics/OPTIONS.md b/vendor/github.com/circonus-labs/circonus-gometrics/OPTIONS.md index 3926c3e638..1cd78d19e4 100644 --- a/vendor/github.com/circonus-labs/circonus-gometrics/OPTIONS.md +++ b/vendor/github.com/circonus-labs/circonus-gometrics/OPTIONS.md @@ -32,6 +32,7 @@ func main() { cfg.CheckManager.API.TokenKey = "" cfg.CheckManager.API.TokenApp = "circonus-gometrics" cfg.CheckManager.API.TokenURL = "https://api.circonus.com/v2" + cfg.CheckManager.API.CACert = nil // Check _, an := path.Split(os.Args[0]) @@ -72,6 +73,7 @@ func main() { | `cfg.CheckManager.API.TokenKey` | "" | [Circonus API Token key](https://login.circonus.com/user/tokens) | | `cfg.CheckManager.API.TokenApp` | "circonus-gometrics" | App associated with API token | | `cfg.CheckManager.API.URL` | "https://api.circonus.com/v2" | Circonus API URL | +| `cfg.CheckManager.API.CACert` | nil | [*x509.CertPool](https://golang.org/pkg/crypto/x509/#CertPool) with CA Cert to validate API endpoint using internal CA or self-signed certificates | |Check|| | `cfg.CheckManager.Check.ID` | "" | Check ID of previously created check. (*Note: **check id** not **check bundle id**.*) | | `cfg.CheckManager.Check.SubmissionURL` | "" | Submission URL of previously created check. | diff --git a/vendor/github.com/circonus-labs/circonus-gometrics/api/api.go b/vendor/github.com/circonus-labs/circonus-gometrics/api/api.go index 73480e4c42..e02be8d9b9 100644 --- a/vendor/github.com/circonus-labs/circonus-gometrics/api/api.go +++ b/vendor/github.com/circonus-labs/circonus-gometrics/api/api.go @@ -7,6 +7,8 @@ package api import ( "bytes" crand "crypto/rand" + "crypto/tls" + "crypto/x509" "errors" "fmt" "io/ioutil" @@ -14,6 +16,7 @@ import ( "math" "math/big" "math/rand" + "net" "net/http" "net/url" "os" @@ -72,6 +75,7 @@ type Config struct { URL string TokenKey string TokenApp string + CACert *x509.CertPool Log *log.Logger Debug bool } @@ -81,6 +85,7 @@ type API struct { apiURL *url.URL key TokenKeyType app TokenAppType + caCert *x509.CertPool Debug bool Log *log.Logger useExponentialBackoff bool @@ -135,6 +140,7 @@ func New(ac *Config) (*API, error) { apiURL: apiURL, key: key, app: app, + caCert: ac.CACert, Debug: ac.Debug, Log: ac.Log, useExponentialBackoff: false, @@ -287,6 +293,33 @@ func (a *API) apiCall(reqMethod string, reqPath string, data []byte) ([]byte, er req.Header.Add("X-Circonus-App-Name", string(a.app)) client := retryablehttp.NewClient() + if a.apiURL.Scheme == "https" && a.caCert != nil { + client.HTTPClient.Transport = &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, + TLSClientConfig: &tls.Config{RootCAs: a.caCert}, + DisableKeepAlives: true, + MaxIdleConnsPerHost: -1, + DisableCompression: true, + } + } else { + client.HTTPClient.Transport = &http.Transport{ + Proxy: http.ProxyFromEnvironment, + Dial: (&net.Dialer{ + Timeout: 30 * time.Second, + KeepAlive: 30 * time.Second, + }).Dial, + TLSHandshakeTimeout: 10 * time.Second, + DisableKeepAlives: true, + MaxIdleConnsPerHost: -1, + DisableCompression: true, + } + } + a.useExponentialBackoffmu.Lock() eb := a.useExponentialBackoff a.useExponentialBackoffmu.Unlock() diff --git a/vendor/github.com/circonus-labs/circonus-gometrics/api/graph.go b/vendor/github.com/circonus-labs/circonus-gometrics/api/graph.go index 0c3f168941..2d28653271 100644 --- a/vendor/github.com/circonus-labs/circonus-gometrics/api/graph.go +++ b/vendor/github.com/circonus-labs/circonus-gometrics/api/graph.go @@ -76,6 +76,7 @@ type GraphGuide struct { type GraphMetricCluster struct { AggregateFunc string `json:"aggregate_function,omitempty"` // string Axis string `json:"axis,omitempty"` // string + Color *string `json:"color,omitempty"` // string DataFormula *string `json:"data_formula"` // string or null Hidden bool `json:"hidden"` // boolean LegendFormula *string `json:"legend_formula"` // string or null diff --git a/vendor/github.com/coreos/etcd/clientv3/lease.go b/vendor/github.com/coreos/etcd/clientv3/lease.go index 71f7579393..6f70f6942a 100644 --- a/vendor/github.com/coreos/etcd/clientv3/lease.go +++ b/vendor/github.com/coreos/etcd/clientv3/lease.go @@ -144,16 +144,19 @@ type keepAlive struct { } func NewLease(c *Client) Lease { + return NewLeaseFromLeaseClient(RetryLeaseClient(c), c.cfg.DialTimeout+time.Second) +} + +func NewLeaseFromLeaseClient(remote pb.LeaseClient, keepAliveTimeout time.Duration) Lease { l := &lessor{ donec: make(chan struct{}), keepAlives: make(map[LeaseID]*keepAlive), - remote: RetryLeaseClient(c), - firstKeepAliveTimeout: c.cfg.DialTimeout + time.Second, + remote: remote, + firstKeepAliveTimeout: keepAliveTimeout, } if l.firstKeepAliveTimeout == time.Second { l.firstKeepAliveTimeout = defaultTTL } - l.stopCtx, l.stopCancel = context.WithCancel(context.Background()) return l } @@ -255,7 +258,7 @@ func (l *lessor) KeepAliveOnce(ctx context.Context, id LeaseID) (*LeaseKeepAlive for { resp, err := l.keepAliveOnce(ctx, id) if err == nil { - if resp.TTL == 0 { + if resp.TTL <= 0 { err = rpctypes.ErrLeaseNotFound } return resp, err @@ -407,7 +410,7 @@ func (l *lessor) recvKeepAlive(resp *pb.LeaseKeepAliveResponse) { } // send update to all channels - nextKeepAlive := time.Now().Add(1 + time.Duration(karesp.TTL/3)*time.Second) + nextKeepAlive := time.Now().Add(time.Duration(karesp.TTL+2) / 3 * time.Second) ka.deadline = time.Now().Add(time.Duration(karesp.TTL) * time.Second) for _, ch := range ka.chs { select { diff --git a/vendor/github.com/coreos/etcd/clientv3/op.go b/vendor/github.com/coreos/etcd/clientv3/op.go index 1e58b4088e..9f73c50bb4 100644 --- a/vendor/github.com/coreos/etcd/clientv3/op.go +++ b/vendor/github.com/coreos/etcd/clientv3/op.go @@ -211,6 +211,7 @@ func WithLease(leaseID LeaseID) OpOption { } // WithLimit limits the number of results to return from 'Get' request. +// If WithLimit is given a 0 limit, it is treated as no limit. func WithLimit(n int64) OpOption { return func(op *Op) { op.limit = n } } // WithRev specifies the store revision for 'Get' request. diff --git a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go b/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go index f4d2d36330..38bda5dd79 100644 --- a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go +++ b/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.pb.go @@ -232,7 +232,8 @@ type RangeRequest struct { // then the range request gets all keys prefixed with key. // If both key and range_end are '\0', then the range request returns all keys. RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,json=rangeEnd,proto3" json:"range_end,omitempty"` - // limit is a limit on the number of keys returned for the request. + // limit is a limit on the number of keys returned for the request. When limit is set to 0, + // it is treated as no limit. Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"` // revision is the point-in-time of the key-value store to use for the range. // If revision is less or equal to zero, the range is over the newest key-value store. diff --git a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.proto b/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.proto index 372dea9554..7bca90c151 100644 --- a/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.proto +++ b/vendor/github.com/coreos/etcd/etcdserver/etcdserverpb/rpc.proto @@ -356,7 +356,8 @@ message RangeRequest { // then the range request gets all keys prefixed with key. // If both key and range_end are '\0', then the range request returns all keys. bytes range_end = 2; - // limit is a limit on the number of keys returned for the request. + // limit is a limit on the number of keys returned for the request. When limit is set to 0, + // it is treated as no limit. int64 limit = 3; // revision is the point-in-time of the key-value store to use for the range. // If revision is less or equal to zero, the range is over the newest key-value store. diff --git a/vendor/github.com/coreos/go-semver/semver/semver.go b/vendor/github.com/coreos/go-semver/semver/semver.go index 110fc23e15..9c8072d1a1 100644 --- a/vendor/github.com/coreos/go-semver/semver/semver.go +++ b/vendor/github.com/coreos/go-semver/semver/semver.go @@ -224,6 +224,13 @@ func recursivePreReleaseCompare(versionA []string, versionB []string) int { bInt = true } + // Numeric identifiers always have lower precedence than non-numeric identifiers. + if aInt && !bInt { + return -1 + } else if !aInt && bInt { + return 1 + } + // Handle Integer Comparison if aInt && bInt { if aI > bI { diff --git a/vendor/github.com/fullsailor/pkcs7/pkcs7.go b/vendor/github.com/fullsailor/pkcs7/pkcs7.go index 705877512b..8d5af853ad 100644 --- a/vendor/github.com/fullsailor/pkcs7/pkcs7.go +++ b/vendor/github.com/fullsailor/pkcs7/pkcs7.go @@ -649,6 +649,12 @@ func (sd *SignedData) AddCertificate(cert *x509.Certificate) { sd.certs = append(sd.certs, cert) } +// Detach removes content from the signed data struct to make it a detached signature. +// This must be called right before Finish() +func (sd *SignedData) Detach() { + sd.sd.ContentInfo = contentInfo{ContentType: oidSignedData} +} + // Finish marshals the content and its signers func (sd *SignedData) Finish() ([]byte, error) { sd.sd.Certificates = marshalCertificates(sd.certs) diff --git a/vendor/github.com/go-ini/ini/README.md b/vendor/github.com/go-ini/ini/README.md index 8539af1175..85947422d7 100644 --- a/vendor/github.com/go-ini/ini/README.md +++ b/vendor/github.com/go-ini/ini/README.md @@ -1,4 +1,4 @@ -INI [![Build Status](https://travis-ci.org/go-ini/ini.svg?branch=master)](https://travis-ci.org/go-ini/ini) +INI [![Build Status](https://travis-ci.org/go-ini/ini.svg?branch=master)](https://travis-ci.org/go-ini/ini) [![Sourcegraph](https://sourcegraph.com/github.com/go-ini/ini/-/badge.svg)](https://sourcegraph.com/github.com/go-ini/ini?badge) === ![](https://avatars0.githubusercontent.com/u/10216035?v=3&s=200) diff --git a/vendor/github.com/gocql/gocql/AUTHORS b/vendor/github.com/gocql/gocql/AUTHORS index 11e57621ac..a8668b376e 100644 --- a/vendor/github.com/gocql/gocql/AUTHORS +++ b/vendor/github.com/gocql/gocql/AUTHORS @@ -85,3 +85,4 @@ Nathan Davies Bo Blanton Vincent Rischmann Jesse Claven +Derrick Wippler diff --git a/vendor/github.com/gocql/gocql/README.md b/vendor/github.com/gocql/gocql/README.md index a6b42d8115..2092fddec9 100644 --- a/vendor/github.com/gocql/gocql/README.md +++ b/vendor/github.com/gocql/gocql/README.md @@ -185,7 +185,7 @@ Ecosystem The following community maintained tools are known to integrate with gocql: -* [migrate](https://github.com/mattes/migrate) is a migration handling tool written in Go with Cassandra support. +* [journey](https://github.com/db-journey/journey) is a migration tool with Cassandra support. * [negronicql](https://github.com/mikebthun/negronicql) is gocql middleware for Negroni. * [cqlr](https://github.com/relops/cqlr) adds the ability to auto-bind a CQL iterator to a struct or to bind a struct to an INSERT statement. * [cqlc](http://relops.com/cqlc) generates gocql compliant code from your Cassandra schema so that you can write type safe CQL statements in Go with a natural query syntax. diff --git a/vendor/github.com/gocql/gocql/cluster.go b/vendor/github.com/gocql/gocql/cluster.go index 1134ab8080..2409c59b3b 100644 --- a/vendor/github.com/gocql/gocql/cluster.go +++ b/vendor/github.com/gocql/gocql/cluster.go @@ -46,6 +46,7 @@ type ClusterConfig struct { // versions the protocol selected is not defined (ie, it can be any of the supported in the cluster) ProtoVersion int Timeout time.Duration // connection timeout (default: 600ms) + ConnectTimeout time.Duration // initial connection timeout, used during initial dial to server (default: 600ms) Port int // port (default: 9042) Keyspace string // initial keyspace (optional) NumConns int // number of connections per host (default: 2) @@ -132,6 +133,7 @@ func NewCluster(hosts ...string) *ClusterConfig { Hosts: hosts, CQLVersion: "3.0.0", Timeout: 600 * time.Millisecond, + ConnectTimeout: 600 * time.Millisecond, Port: 9042, NumConns: 2, Consistency: Quorum, diff --git a/vendor/github.com/gocql/gocql/conn.go b/vendor/github.com/gocql/gocql/conn.go index f85e1d28f7..6c26005aea 100644 --- a/vendor/github.com/gocql/gocql/conn.go +++ b/vendor/github.com/gocql/gocql/conn.go @@ -93,13 +93,14 @@ type SslOptions struct { } type ConnConfig struct { - ProtoVersion int - CQLVersion string - Timeout time.Duration - Compressor Compressor - Authenticator Authenticator - Keepalive time.Duration - tlsConfig *tls.Config + ProtoVersion int + CQLVersion string + Timeout time.Duration + ConnectTimeout time.Duration + Compressor Compressor + Authenticator Authenticator + Keepalive time.Duration + tlsConfig *tls.Config } type ConnErrorHandler interface { @@ -167,7 +168,7 @@ func Connect(host *HostInfo, cfg *ConnConfig, errorHandler ConnErrorHandler, ses ) dialer := &net.Dialer{ - Timeout: cfg.Timeout, + Timeout: cfg.ConnectTimeout, } // TODO(zariel): handle ipv6 zone @@ -212,8 +213,8 @@ func Connect(host *HostInfo, cfg *ConnConfig, errorHandler ConnErrorHandler, ses ctx context.Context cancel func() ) - if c.timeout > 0 { - ctx, cancel = context.WithTimeout(context.Background(), c.timeout) + if cfg.ConnectTimeout > 0 { + ctx, cancel = context.WithTimeout(context.Background(), cfg.ConnectTimeout) } else { ctx, cancel = context.WithCancel(context.Background()) } diff --git a/vendor/github.com/gocql/gocql/connectionpool.go b/vendor/github.com/gocql/gocql/connectionpool.go index 7a306894af..af2a78b939 100644 --- a/vendor/github.com/gocql/gocql/connectionpool.go +++ b/vendor/github.com/gocql/gocql/connectionpool.go @@ -85,13 +85,14 @@ func connConfig(cfg *ClusterConfig) (*ConnConfig, error) { } return &ConnConfig{ - ProtoVersion: cfg.ProtoVersion, - CQLVersion: cfg.CQLVersion, - Timeout: cfg.Timeout, - Compressor: cfg.Compressor, - Authenticator: cfg.Authenticator, - Keepalive: cfg.SocketKeepalive, - tlsConfig: tlsConfig, + ProtoVersion: cfg.ProtoVersion, + CQLVersion: cfg.CQLVersion, + Timeout: cfg.Timeout, + ConnectTimeout: cfg.ConnectTimeout, + Compressor: cfg.Compressor, + Authenticator: cfg.Authenticator, + Keepalive: cfg.SocketKeepalive, + tlsConfig: tlsConfig, }, nil } @@ -395,8 +396,8 @@ func (pool *hostConnPool) fill() { // probably unreachable host pool.fillingStopped(true) - // this is calle with the connetion pool mutex held, this call will - // then recursivly try to lock it again. FIXME + // this is call with the connection pool mutex held, this call will + // then recursively try to lock it again. FIXME go pool.session.handleNodeDown(pool.host.Peer(), pool.port) return } diff --git a/vendor/github.com/gocql/gocql/helpers.go b/vendor/github.com/gocql/gocql/helpers.go index dca87b8d82..a580281917 100644 --- a/vendor/github.com/gocql/gocql/helpers.go +++ b/vendor/github.com/gocql/gocql/helpers.go @@ -250,6 +250,42 @@ func (iter *Iter) SliceMap() ([]map[string]interface{}, error) { // MapScan takes a map[string]interface{} and populates it with a row // that is returned from cassandra. +// +// Each call to MapScan() must be called with a new map object. +// During the call to MapScan() any pointers in the existing map +// are replaced with non pointer types before the call returns +// +// iter := session.Query(`SELECT * FROM mytable`).Iter() +// for { +// // New map each iteration +// row = make(map[string]interface{}) +// if !iter.MapScan(row) { +// break +// } +// // Do things with row +// if fullname, ok := row["fullname"]; ok { +// fmt.Printf("Full Name: %s\n", fullname) +// } +// } +// +// You can also pass pointers in the map before each call +// +// var fullName FullName // Implements gocql.Unmarshaler and gocql.Marshaler interfaces +// var address net.IP +// var age int +// iter := session.Query(`SELECT * FROM scan_map_table`).Iter() +// for { +// // New map each iteration +// row := map[string]interface{}{ +// "fullname": &fullName, +// "age": &age, +// "address": &address, +// } +// if !iter.MapScan(row) { +// break +// } +// fmt.Printf("First: %s Age: %d Address: %q\n", fullName.FirstName, age, address) +// } func (iter *Iter) MapScan(m map[string]interface{}) bool { if iter.err != nil { return false diff --git a/vendor/github.com/gocql/gocql/logger.go b/vendor/github.com/gocql/gocql/logger.go index 85817a6918..bd16d4134b 100644 --- a/vendor/github.com/gocql/gocql/logger.go +++ b/vendor/github.com/gocql/gocql/logger.go @@ -1,6 +1,10 @@ package gocql -import "log" +import ( + "bytes" + "fmt" + "log" +) type StdLogger interface { Print(v ...interface{}) @@ -8,6 +12,15 @@ type StdLogger interface { Println(v ...interface{}) } +type testLogger struct { + capture bytes.Buffer +} + +func (l *testLogger) Print(v ...interface{}) { fmt.Fprint(&l.capture, v...) } +func (l *testLogger) Printf(format string, v ...interface{}) { fmt.Fprintf(&l.capture, format, v...) } +func (l *testLogger) Println(v ...interface{}) { fmt.Fprintln(&l.capture, v...) } +func (l *testLogger) String() string { return l.capture.String() } + type defaultLogger struct{} func (l *defaultLogger) Print(v ...interface{}) { log.Print(v...) } diff --git a/vendor/github.com/golang/snappy/encode.go b/vendor/github.com/golang/snappy/encode.go index 8749689060..8d393e904b 100644 --- a/vendor/github.com/golang/snappy/encode.go +++ b/vendor/github.com/golang/snappy/encode.go @@ -138,7 +138,7 @@ func NewBufferedWriter(w io.Writer) *Writer { } } -// Writer is an io.Writer than can write Snappy-compressed bytes. +// Writer is an io.Writer that can write Snappy-compressed bytes. type Writer struct { w io.Writer err error diff --git a/vendor/github.com/google/go-github/LICENSE b/vendor/github.com/google/go-github/LICENSE index 5582e4af86..0a756594f6 100644 --- a/vendor/github.com/google/go-github/LICENSE +++ b/vendor/github.com/google/go-github/LICENSE @@ -30,7 +30,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Some documentation is taken from the GitHub Developer site , which is available under the following Creative -Commons Attribution 3.0 License. This applies only to the go-github source +Commons Attribution 3.0 License. This applies only to the go-github source code and would not apply to any compiled binaries. THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE diff --git a/vendor/github.com/google/go-github/github/activity_notifications.go b/vendor/github.com/google/go-github/github/activity_notifications.go index b538a7b4d8..5ae80ad6ce 100644 --- a/vendor/github.com/google/go-github/github/activity_notifications.go +++ b/vendor/github.com/google/go-github/github/activity_notifications.go @@ -67,7 +67,7 @@ func (s *ActivityService) ListNotifications(opt *NotificationListOptions) ([]*No return nil, resp, err } - return notifications, resp, err + return notifications, resp, nil } // ListRepositoryNotifications lists all notifications in a given repository @@ -92,7 +92,7 @@ func (s *ActivityService) ListRepositoryNotifications(owner, repo string, opt *N return nil, resp, err } - return notifications, resp, err + return notifications, resp, nil } type markReadOptions struct { @@ -148,7 +148,7 @@ func (s *ActivityService) GetThread(id string) (*Notification, *Response, error) return nil, resp, err } - return notification, resp, err + return notification, resp, nil } // MarkThreadRead marks the specified thread as read. @@ -183,7 +183,7 @@ func (s *ActivityService) GetThreadSubscription(id string) (*Subscription, *Resp return nil, resp, err } - return sub, resp, err + return sub, resp, nil } // SetThreadSubscription sets the subscription for the specified thread for the @@ -204,7 +204,7 @@ func (s *ActivityService) SetThreadSubscription(id string, subscription *Subscri return nil, resp, err } - return sub, resp, err + return sub, resp, nil } // DeleteThreadSubscription deletes the subscription for the specified thread diff --git a/vendor/github.com/google/go-github/github/activity_star.go b/vendor/github.com/google/go-github/github/activity_star.go index edf20e8c85..2d5becfaf7 100644 --- a/vendor/github.com/google/go-github/github/activity_star.go +++ b/vendor/github.com/google/go-github/github/activity_star.go @@ -49,18 +49,18 @@ func (s *ActivityService) ListStargazers(owner, repo string, opt *ListOptions) ( // ActivityListStarredOptions specifies the optional parameters to the // ActivityService.ListStarred method. type ActivityListStarredOptions struct { - // How to sort the repository list. Possible values are: created, updated, - // pushed, full_name. Default is "full_name". + // How to sort the repository list. Possible values are: created, updated, + // pushed, full_name. Default is "full_name". Sort string `url:"sort,omitempty"` - // Direction in which to sort repositories. Possible values are: asc, desc. + // Direction in which to sort repositories. Possible values are: asc, desc. // Default is "asc" when sort is "full_name", otherwise default is "desc". Direction string `url:"direction,omitempty"` ListOptions } -// ListStarred lists all the repos starred by a user. Passing the empty string +// ListStarred lists all the repos starred by a user. Passing the empty string // will list the starred repositories for the authenticated user. // // GitHub API docs: http://developer.github.com/v3/activity/starring/#list-repositories-being-starred diff --git a/vendor/github.com/google/go-github/github/activity_watching.go b/vendor/github.com/google/go-github/github/activity_watching.go index ac77657da1..22d56c54f4 100644 --- a/vendor/github.com/google/go-github/github/activity_watching.go +++ b/vendor/github.com/google/go-github/github/activity_watching.go @@ -46,7 +46,7 @@ func (s *ActivityService) ListWatchers(owner, repo string, opt *ListOptions) ([] return watchers, resp, nil } -// ListWatched lists the repositories the specified user is watching. Passing +// ListWatched lists the repositories the specified user is watching. Passing // the empty string will fetch watched repos for the authenticated user. // // GitHub API Docs: https://developer.github.com/v3/activity/watching/#list-repositories-being-watched @@ -77,7 +77,7 @@ func (s *ActivityService) ListWatched(user string, opt *ListOptions) ([]*Reposit } // GetRepositorySubscription returns the subscription for the specified -// repository for the authenticated user. If the authenticated user is not +// repository for the authenticated user. If the authenticated user is not // watching the repository, a nil Subscription is returned. // // GitHub API Docs: https://developer.github.com/v3/activity/watching/#get-a-repository-subscription @@ -97,7 +97,7 @@ func (s *ActivityService) GetRepositorySubscription(owner, repo string) (*Subscr return nil, resp, err } - return sub, resp, err + return sub, resp, nil } // SetRepositorySubscription sets the subscription for the specified repository @@ -122,7 +122,7 @@ func (s *ActivityService) SetRepositorySubscription(owner, repo string, subscrip return nil, resp, err } - return sub, resp, err + return sub, resp, nil } // DeleteRepositorySubscription deletes the subscription for the specified diff --git a/vendor/github.com/google/go-github/github/admin.go b/vendor/github.com/google/go-github/github/admin.go index 44d7a9fb64..f77b2a23fc 100644 --- a/vendor/github.com/google/go-github/github/admin.go +++ b/vendor/github.com/google/go-github/github/admin.go @@ -75,7 +75,7 @@ func (s *AdminService) UpdateUserLDAPMapping(user string, mapping *UserLDAPMappi return nil, resp, err } - return m, resp, err + return m, resp, nil } // UpdateTeamLDAPMapping updates the mapping between a GitHub team and an LDAP group. @@ -94,5 +94,5 @@ func (s *AdminService) UpdateTeamLDAPMapping(team int, mapping *TeamLDAPMapping) return nil, resp, err } - return m, resp, err + return m, resp, nil } diff --git a/vendor/github.com/google/go-github/github/authorizations.go b/vendor/github.com/google/go-github/github/authorizations.go index 9f2a1ecd76..b50de5eec7 100644 --- a/vendor/github.com/google/go-github/github/authorizations.go +++ b/vendor/github.com/google/go-github/github/authorizations.go @@ -114,7 +114,7 @@ func (a AuthorizationRequest) String() string { // AuthorizationUpdateRequest represents a request to update an authorization. // // Note that for any one update, you must only provide one of the "scopes" -// fields. That is, you may provide only one of "Scopes", or "AddScopes", or +// fields. That is, you may provide only one of "Scopes", or "AddScopes", or // "RemoveScopes". // // GitHub API docs: https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization @@ -170,7 +170,7 @@ func (s *AuthorizationsService) Get(id int) (*Authorization, *Response, error) { if err != nil { return nil, resp, err } - return a, resp, err + return a, resp, nil } // Create a new authorization for the specified OAuth application. @@ -189,7 +189,7 @@ func (s *AuthorizationsService) Create(auth *AuthorizationRequest) (*Authorizati if err != nil { return nil, resp, err } - return a, resp, err + return a, resp, nil } // GetOrCreateForApp creates a new authorization for the specified OAuth @@ -225,7 +225,7 @@ func (s *AuthorizationsService) GetOrCreateForApp(clientID string, auth *Authori return nil, resp, err } - return a, resp, err + return a, resp, nil } // Edit a single authorization. @@ -245,7 +245,7 @@ func (s *AuthorizationsService) Edit(id int, auth *AuthorizationUpdateRequest) ( return nil, resp, err } - return a, resp, err + return a, resp, nil } // Delete a single authorization. @@ -285,7 +285,7 @@ func (s *AuthorizationsService) Check(clientID string, token string) (*Authoriza return nil, resp, err } - return a, resp, err + return a, resp, nil } // Reset is used to reset a valid OAuth token without end user involvement. @@ -313,7 +313,7 @@ func (s *AuthorizationsService) Reset(clientID string, token string) (*Authoriza return nil, resp, err } - return a, resp, err + return a, resp, nil } // Revoke an authorization for an application. @@ -352,7 +352,7 @@ func (s *AuthorizationsService) ListGrants() ([]*Grant, *Response, error) { return nil, resp, err } - return grants, resp, err + return grants, resp, nil } // GetGrant gets a single OAuth application grant. @@ -371,7 +371,7 @@ func (s *AuthorizationsService) GetGrant(id int) (*Grant, *Response, error) { return nil, resp, err } - return grant, resp, err + return grant, resp, nil } // DeleteGrant deletes an OAuth application grant. Deleting an application's @@ -408,7 +408,7 @@ func (s *AuthorizationsService) CreateImpersonation(username string, authReq *Au if err != nil { return nil, resp, err } - return a, resp, err + return a, resp, nil } // DeleteImpersonation deletes an impersonation OAuth token. diff --git a/vendor/github.com/google/go-github/github/gists.go b/vendor/github.com/google/go-github/github/gists.go index 81f55b16f5..42771d4df9 100644 --- a/vendor/github.com/google/go-github/github/gists.go +++ b/vendor/github.com/google/go-github/github/gists.go @@ -180,7 +180,7 @@ func (s *GistsService) Get(id string) (*Gist, *Response, error) { return nil, resp, err } - return gist, resp, err + return gist, resp, nil } // GetRevision gets a specific revision of a gist. @@ -198,7 +198,7 @@ func (s *GistsService) GetRevision(id, sha string) (*Gist, *Response, error) { return nil, resp, err } - return gist, resp, err + return gist, resp, nil } // Create a gist for authenticated user. @@ -216,7 +216,7 @@ func (s *GistsService) Create(gist *Gist) (*Gist, *Response, error) { return nil, resp, err } - return g, resp, err + return g, resp, nil } // Edit a gist. @@ -234,7 +234,7 @@ func (s *GistsService) Edit(id string, gist *Gist) (*Gist, *Response, error) { return nil, resp, err } - return g, resp, err + return g, resp, nil } // ListCommits lists commits of a gist. @@ -322,7 +322,7 @@ func (s *GistsService) Fork(id string) (*Gist, *Response, error) { return nil, resp, err } - return g, resp, err + return g, resp, nil } // ListForks lists forks of a gist. diff --git a/vendor/github.com/google/go-github/github/gists_comments.go b/vendor/github.com/google/go-github/github/gists_comments.go index 71c1c01535..cab17e58f2 100644 --- a/vendor/github.com/google/go-github/github/gists_comments.go +++ b/vendor/github.com/google/go-github/github/gists_comments.go @@ -63,7 +63,7 @@ func (s *GistsService) GetComment(gistID string, commentID int) (*GistComment, * return nil, resp, err } - return c, resp, err + return c, resp, nil } // CreateComment creates a comment for a gist. @@ -82,7 +82,7 @@ func (s *GistsService) CreateComment(gistID string, comment *GistComment) (*Gist return nil, resp, err } - return c, resp, err + return c, resp, nil } // EditComment edits an existing gist comment. @@ -101,7 +101,7 @@ func (s *GistsService) EditComment(gistID string, commentID int, comment *GistCo return nil, resp, err } - return c, resp, err + return c, resp, nil } // DeleteComment deletes a gist comment. diff --git a/vendor/github.com/google/go-github/github/git_commits.go b/vendor/github.com/google/go-github/github/git_commits.go index 0bcad41d99..5a9f1640ba 100644 --- a/vendor/github.com/google/go-github/github/git_commits.go +++ b/vendor/github.com/google/go-github/github/git_commits.go @@ -30,7 +30,7 @@ type Commit struct { URL *string `json:"url,omitempty"` Verification *SignatureVerification `json:"verification,omitempty"` - // CommentCount is the number of GitHub comments on the commit. This + // CommentCount is the number of GitHub comments on the commit. This // is only populated for requests that fetch GitHub data like // Pulls.ListCommits, Repositories.ListCommits, etc. CommentCount *int `json:"comment_count,omitempty"` @@ -40,7 +40,7 @@ func (c Commit) String() string { return Stringify(c) } -// CommitAuthor represents the author or committer of a commit. The commit +// CommitAuthor represents the author or committer of a commit. The commit // author may not correspond to a GitHub User. type CommitAuthor struct { Date *time.Time `json:"date,omitempty"` @@ -74,7 +74,7 @@ func (s *GitService) GetCommit(owner string, repo string, sha string) (*Commit, return nil, resp, err } - return c, resp, err + return c, resp, nil } // createCommit represents the body of a CreateCommit request. @@ -123,5 +123,5 @@ func (s *GitService) CreateCommit(owner string, repo string, commit *Commit) (*C return nil, resp, err } - return c, resp, err + return c, resp, nil } diff --git a/vendor/github.com/google/go-github/github/git_refs.go b/vendor/github.com/google/go-github/github/git_refs.go index 16cbd6b3df..f8ff299646 100644 --- a/vendor/github.com/google/go-github/github/git_refs.go +++ b/vendor/github.com/google/go-github/github/git_refs.go @@ -61,7 +61,7 @@ func (s *GitService) GetRef(owner string, repo string, ref string) (*Reference, return nil, resp, err } - return r, resp, err + return r, resp, nil } // ReferenceListOptions specifies optional parameters to the @@ -98,7 +98,7 @@ func (s *GitService) ListRefs(owner, repo string, opt *ReferenceListOptions) ([] return nil, resp, err } - return rs, resp, err + return rs, resp, nil } // CreateRef creates a new ref in a repository. @@ -121,7 +121,7 @@ func (s *GitService) CreateRef(owner string, repo string, ref *Reference) (*Refe return nil, resp, err } - return r, resp, err + return r, resp, nil } // UpdateRef updates an existing ref in a repository. @@ -144,7 +144,7 @@ func (s *GitService) UpdateRef(owner string, repo string, ref *Reference, force return nil, resp, err } - return r, resp, err + return r, resp, nil } // DeleteRef deletes a ref from a repository. diff --git a/vendor/github.com/google/go-github/github/git_tags.go b/vendor/github.com/google/go-github/github/git_tags.go index 01b9cb2af2..86533a8f3d 100644 --- a/vendor/github.com/google/go-github/github/git_tags.go +++ b/vendor/github.com/google/go-github/github/git_tags.go @@ -20,7 +20,7 @@ type Tag struct { Verification *SignatureVerification `json:"verification,omitempty"` } -// createTagRequest represents the body of a CreateTag request. This is mostly +// createTagRequest represents the body of a CreateTag request. This is mostly // identical to Tag with the exception that the object SHA and Type are // top-level fields, rather than being nested inside a JSON object. type createTagRequest struct { diff --git a/vendor/github.com/google/go-github/github/git_trees.go b/vendor/github.com/google/go-github/github/git_trees.go index 9efa4b3806..5463c894bf 100644 --- a/vendor/github.com/google/go-github/github/git_trees.go +++ b/vendor/github.com/google/go-github/github/git_trees.go @@ -17,7 +17,7 @@ func (t Tree) String() string { return Stringify(t) } -// TreeEntry represents the contents of a tree structure. TreeEntry can +// TreeEntry represents the contents of a tree structure. TreeEntry can // represent either a blob, a commit (in the case of a submodule), or another // tree. type TreeEntry struct { @@ -53,7 +53,7 @@ func (s *GitService) GetTree(owner string, repo string, sha string, recursive bo return nil, resp, err } - return t, resp, err + return t, resp, nil } // createTree represents the body of a CreateTree request. @@ -62,7 +62,7 @@ type createTree struct { Entries []TreeEntry `json:"tree"` } -// CreateTree creates a new tree in a repository. If both a tree and a nested +// CreateTree creates a new tree in a repository. If both a tree and a nested // path modifying that tree are specified, it will overwrite the contents of // that tree with the new path contents and write a new tree out. // @@ -85,5 +85,5 @@ func (s *GitService) CreateTree(owner string, repo string, baseTree string, entr return nil, resp, err } - return t, resp, err + return t, resp, nil } diff --git a/vendor/github.com/google/go-github/github/github.go b/vendor/github.com/google/go-github/github/github.go index a58dbfb58d..90edc52e63 100644 --- a/vendor/github.com/google/go-github/github/github.go +++ b/vendor/github.com/google/go-github/github/github.go @@ -106,8 +106,8 @@ type Client struct { clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func. client *http.Client // HTTP client used to communicate with the API. - // Base URL for API requests. Defaults to the public GitHub API, but can be - // set to a domain endpoint to use with GitHub Enterprise. BaseURL should + // Base URL for API requests. Defaults to the public GitHub API, but can be + // set to a domain endpoint to use with GitHub Enterprise. BaseURL should // always be specified with a trailing slash. BaseURL *url.URL @@ -178,7 +178,7 @@ type RawOptions struct { Type RawType } -// addOptions adds the parameters in opt as URL query parameters to s. opt +// addOptions adds the parameters in opt as URL query parameters to s. opt // must be a struct whose fields may contain "url" tags. func addOptions(s string, opt interface{}) (string, error) { v := reflect.ValueOf(opt) @@ -200,8 +200,8 @@ func addOptions(s string, opt interface{}) (string, error) { return u.String(), nil } -// NewClient returns a new GitHub API client. If a nil httpClient is -// provided, http.DefaultClient will be used. To use API methods which require +// NewClient returns a new GitHub API client. If a nil httpClient is +// provided, http.DefaultClient will be used. To use API methods which require // authentication, provide an http.Client that will perform the authentication // for you (such as that provided by the golang.org/x/oauth2 library). func NewClient(httpClient *http.Client) *Client { @@ -235,7 +235,7 @@ func NewClient(httpClient *http.Client) *Client { // NewRequest creates an API request. A relative URL can be provided in urlStr, // in which case it is resolved relative to the BaseURL of the Client. -// Relative URLs should always be specified without a preceding slash. If +// Relative URLs should always be specified without a preceding slash. If // specified, the value pointed to by body is JSON encoded and included as the // request body. func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error) { @@ -295,14 +295,14 @@ func (c *Client) NewUploadRequest(urlStr string, reader io.Reader, size int64, m return req, nil } -// Response is a GitHub API response. This wraps the standard http.Response +// Response is a GitHub API response. This wraps the standard http.Response // returned from GitHub and provides convenient access to things like // pagination links. type Response struct { *http.Response // These fields provide the page values for paginating through a set of - // results. Any or all of these may be set to the zero value for + // results. Any or all of these may be set to the zero value for // responses that are not part of a paginated set, or for which there // are no additional pages. @@ -384,7 +384,7 @@ func parseRate(r *http.Response) Rate { } // Rate specifies the current rate limit for the client as determined by the -// most recent API call. If the client is used in a multi-user application, +// most recent API call. If the client is used in a multi-user application, // this rate may not always be up-to-date. // // Deprecated: Use the Response.Rate returned from most recent API call instead. @@ -396,11 +396,11 @@ func (c *Client) Rate() Rate { return rate } -// Do sends an API request and returns the API response. The API response is +// Do sends an API request and returns the API response. The API response is // JSON decoded and stored in the value pointed to by v, or returned as an -// error if an API error has occurred. If v implements the io.Writer +// error if an API error has occurred. If v implements the io.Writer // interface, the raw response body will be written to v, without attempting to -// first decode it. If rate limit is exceeded and reset time is in the future, +// first decode it. If rate limit is exceeded and reset time is in the future, // Do returns *RateLimitError immediately without making a network API call. func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) { rateLimitCategory := category(req.URL.Path) @@ -511,7 +511,7 @@ func (r *ErrorResponse) Error() string { } // TwoFactorAuthError occurs when using HTTP Basic Authentication for a user -// that has two-factor authentication enabled. The request can be reattempted +// that has two-factor authentication enabled. The request can be reattempted // by providing a one-time password in the request. type TwoFactorAuthError ErrorResponse @@ -609,7 +609,7 @@ func (e *Error) Error() string { // present. A response is considered an error if it has a status code outside // the 200 range or equal to 202 Accepted. // API error responses are expected to have either no response -// body, or a JSON response body that maps to ErrorResponse. Any other +// body, or a JSON response body that maps to ErrorResponse. Any other // response body will be silently ignored. // // The error type will be *RateLimitError for rate limit exceeded errors, @@ -658,15 +658,15 @@ func CheckResponse(r *http.Response) error { // parseBoolResponse determines the boolean result from a GitHub API response. // Several GitHub API methods return boolean responses indicated by the HTTP // status code in the response (true indicated by a 204, false indicated by a -// 404). This helper function will determine that result and hide the 404 -// error if present. Any other error will be returned through as-is. +// 404). This helper function will determine that result and hide the 404 +// error if present. Any other error will be returned through as-is. func parseBoolResponse(err error) (bool, error) { if err == nil { return true, nil } if err, ok := err.(*ErrorResponse); ok && err.Response.StatusCode == http.StatusNotFound { - // Simply false. In this one case, we do not pass the error through. + // Simply false. In this one case, we do not pass the error through. return false, nil } @@ -692,15 +692,15 @@ func (r Rate) String() string { // RateLimits represents the rate limits for the current client. type RateLimits struct { - // The rate limit for non-search API requests. Unauthenticated - // requests are limited to 60 per hour. Authenticated requests are + // The rate limit for non-search API requests. Unauthenticated + // requests are limited to 60 per hour. Authenticated requests are // limited to 5,000 per hour. // // GitHub API docs: https://developer.github.com/v3/#rate-limiting Core *Rate `json:"core"` - // The rate limit for search API requests. Unauthenticated requests - // are limited to 10 requests per minutes. Authenticated requests are + // The rate limit for search API requests. Unauthenticated requests + // are limited to 10 requests per minutes. Authenticated requests are // limited to 30 per minute. // // GitHub API docs: https://developer.github.com/v3/search/#rate-limit @@ -735,11 +735,13 @@ func category(path string) rateLimitCategory { // Deprecated: RateLimit is deprecated, use RateLimits instead. func (c *Client) RateLimit() (*Rate, *Response, error) { limits, resp, err := c.RateLimits() - if limits == nil { - return nil, nil, err + if err != nil { + return nil, resp, err } - - return limits.Core, resp, err + if limits == nil { + return nil, resp, errors.New("RateLimits returned nil limits and error; unable to extract Core rate limit") + } + return limits.Core, resp, nil } // RateLimits returns the rate limits for the current client. @@ -768,7 +770,7 @@ func (c *Client) RateLimits() (*RateLimits, *Response, error) { c.rateMu.Unlock() } - return response.Resources, resp, err + return response.Resources, resp, nil } /* @@ -838,7 +840,7 @@ func (t *UnauthenticatedRateLimitedTransport) transport() http.RoundTripper { } // BasicAuthTransport is an http.RoundTripper that authenticates all requests -// using HTTP Basic Authentication with the provided username and password. It +// using HTTP Basic Authentication with the provided username and password. It // additionally supports users who have two-factor authentication enabled on // their GitHub account. type BasicAuthTransport struct { diff --git a/vendor/github.com/google/go-github/github/gitignore.go b/vendor/github.com/google/go-github/github/gitignore.go index 3f1f565edb..d3a9c5ba7b 100644 --- a/vendor/github.com/google/go-github/github/gitignore.go +++ b/vendor/github.com/google/go-github/github/gitignore.go @@ -57,5 +57,5 @@ func (s GitignoresService) Get(name string) (*Gitignore, *Response, error) { return nil, resp, err } - return gitignore, resp, err + return gitignore, resp, nil } diff --git a/vendor/github.com/google/go-github/github/integration_installation.go b/vendor/github.com/google/go-github/github/integration_installation.go index aa59bfe4b5..b130470d39 100644 --- a/vendor/github.com/google/go-github/github/integration_installation.go +++ b/vendor/github.com/google/go-github/github/integration_installation.go @@ -42,5 +42,5 @@ func (s *IntegrationsService) ListRepos(opt *ListOptions) ([]*Repository, *Respo return nil, resp, err } - return r.Repositories, resp, err + return r.Repositories, resp, nil } diff --git a/vendor/github.com/google/go-github/github/issues.go b/vendor/github.com/google/go-github/github/issues.go index b14939e870..eb0a716952 100644 --- a/vendor/github.com/google/go-github/github/issues.go +++ b/vendor/github.com/google/go-github/github/issues.go @@ -68,22 +68,22 @@ type IssueRequest struct { // IssueListOptions specifies the optional parameters to the IssuesService.List // and IssuesService.ListByOrg methods. type IssueListOptions struct { - // Filter specifies which issues to list. Possible values are: assigned, - // created, mentioned, subscribed, all. Default is "assigned". + // Filter specifies which issues to list. Possible values are: assigned, + // created, mentioned, subscribed, all. Default is "assigned". Filter string `url:"filter,omitempty"` - // State filters issues based on their state. Possible values are: open, - // closed, all. Default is "open". + // State filters issues based on their state. Possible values are: open, + // closed, all. Default is "open". State string `url:"state,omitempty"` // Labels filters issues based on their label. Labels []string `url:"labels,comma,omitempty"` - // Sort specifies how to sort issues. Possible values are: created, updated, - // and comments. Default value is "created". + // Sort specifies how to sort issues. Possible values are: created, updated, + // and comments. Default value is "created". Sort string `url:"sort,omitempty"` - // Direction in which to sort issues. Possible values are: asc, desc. + // Direction in which to sort issues. Possible values are: asc, desc. // Default is "desc". Direction string `url:"direction,omitempty"` @@ -102,7 +102,7 @@ type PullRequestLinks struct { PatchURL *string `json:"patch_url,omitempty"` } -// List the issues for the authenticated user. If all is true, list issues +// List the issues for the authenticated user. If all is true, list issues // across all the user's visible repositories including owned, member, and // organization repositories; if false, list only owned and member // repositories. @@ -153,16 +153,16 @@ func (s *IssuesService) listIssues(u string, opt *IssueListOptions) ([]*Issue, * // IssueListByRepoOptions specifies the optional parameters to the // IssuesService.ListByRepo method. type IssueListByRepoOptions struct { - // Milestone limits issues for the specified milestone. Possible values are + // Milestone limits issues for the specified milestone. Possible values are // a milestone number, "none" for issues with no milestone, "*" for issues // with any milestone. Milestone string `url:"milestone,omitempty"` - // State filters issues based on their state. Possible values are: open, - // closed, all. Default is "open". + // State filters issues based on their state. Possible values are: open, + // closed, all. Default is "open". State string `url:"state,omitempty"` - // Assignee filters issues based on their assignee. Possible values are a + // Assignee filters issues based on their assignee. Possible values are a // user name, "none" for issues that are not assigned, "*" for issues with // any assigned user. Assignee string `url:"assignee,omitempty"` @@ -176,11 +176,11 @@ type IssueListByRepoOptions struct { // Labels filters issues based on their label. Labels []string `url:"labels,omitempty,comma"` - // Sort specifies how to sort issues. Possible values are: created, updated, - // and comments. Default value is "created". + // Sort specifies how to sort issues. Possible values are: created, updated, + // and comments. Default value is "created". Sort string `url:"sort,omitempty"` - // Direction in which to sort issues. Possible values are: asc, desc. + // Direction in which to sort issues. Possible values are: asc, desc. // Default is "desc". Direction string `url:"direction,omitempty"` diff --git a/vendor/github.com/google/go-github/github/issues_comments.go b/vendor/github.com/google/go-github/github/issues_comments.go index 7d46913991..afd0ff258c 100644 --- a/vendor/github.com/google/go-github/github/issues_comments.go +++ b/vendor/github.com/google/go-github/github/issues_comments.go @@ -30,10 +30,10 @@ func (i IssueComment) String() string { // IssueListCommentsOptions specifies the optional parameters to the // IssuesService.ListComments method. type IssueListCommentsOptions struct { - // Sort specifies how to sort comments. Possible values are: created, updated. + // Sort specifies how to sort comments. Possible values are: created, updated. Sort string `url:"sort,omitempty"` - // Direction in which to sort comments. Possible values are: asc, desc. + // Direction in which to sort comments. Possible values are: asc, desc. Direction string `url:"direction,omitempty"` // Since filters comments by time. @@ -42,7 +42,7 @@ type IssueListCommentsOptions struct { ListOptions } -// ListComments lists all comments on the specified issue. Specifying an issue +// ListComments lists all comments on the specified issue. Specifying an issue // number of 0 will return all comments on all issues for the repository. // // GitHub API docs: http://developer.github.com/v3/issues/comments/#list-comments-on-an-issue diff --git a/vendor/github.com/google/go-github/github/issues_events.go b/vendor/github.com/google/go-github/github/issues_events.go index 71cf61adb1..98f215c656 100644 --- a/vendor/github.com/google/go-github/github/issues_events.go +++ b/vendor/github.com/google/go-github/github/issues_events.go @@ -18,7 +18,7 @@ type IssueEvent struct { // The User that generated this event. Actor *User `json:"actor,omitempty"` - // Event identifies the actual type of Event that occurred. Possible + // Event identifies the actual type of Event that occurred. Possible // values are: // // closed @@ -91,7 +91,7 @@ func (s *IssuesService) ListIssueEvents(owner, repo string, number int, opt *Lis return nil, resp, err } - return events, resp, err + return events, resp, nil } // ListRepositoryEvents lists events for the specified repository. @@ -115,7 +115,7 @@ func (s *IssuesService) ListRepositoryEvents(owner, repo string, opt *ListOption return nil, resp, err } - return events, resp, err + return events, resp, nil } // GetEvent returns the specified issue event. @@ -135,7 +135,7 @@ func (s *IssuesService) GetEvent(owner, repo string, id int) (*IssueEvent, *Resp return nil, resp, err } - return event, resp, err + return event, resp, nil } // Rename contains details for 'renamed' events. diff --git a/vendor/github.com/google/go-github/github/issues_labels.go b/vendor/github.com/google/go-github/github/issues_labels.go index bd6b3258d7..46b2d6e2ac 100644 --- a/vendor/github.com/google/go-github/github/issues_labels.go +++ b/vendor/github.com/google/go-github/github/issues_labels.go @@ -113,7 +113,7 @@ func (s *IssuesService) DeleteLabel(owner string, repo string, name string) (*Re // ListLabelsByIssue lists all labels for an issue. // -// GitHub API docs: http://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository +// GitHub API docs: https://developer.github.com/v3/issues/labels/#list-labels-on-an-issue func (s *IssuesService) ListLabelsByIssue(owner string, repo string, number int, opt *ListOptions) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) u, err := addOptions(u, opt) @@ -137,7 +137,7 @@ func (s *IssuesService) ListLabelsByIssue(owner string, repo string, number int, // AddLabelsToIssue adds labels to an issue. // -// GitHub API docs: http://developer.github.com/v3/issues/labels/#list-all-labels-for-this-repository +// GitHub API docs: https://developer.github.com/v3/issues/labels/#add-labels-to-an-issue func (s *IssuesService) AddLabelsToIssue(owner string, repo string, number int, labels []string) ([]*Label, *Response, error) { u := fmt.Sprintf("repos/%v/%v/issues/%d/labels", owner, repo, number) req, err := s.client.NewRequest("POST", u, labels) diff --git a/vendor/github.com/google/go-github/github/licenses.go b/vendor/github.com/google/go-github/github/licenses.go index a1fec94674..5340e617c7 100644 --- a/vendor/github.com/google/go-github/github/licenses.go +++ b/vendor/github.com/google/go-github/github/licenses.go @@ -96,5 +96,5 @@ func (s *LicensesService) Get(licenseName string) (*License, *Response, error) { return nil, resp, err } - return license, resp, err + return license, resp, nil } diff --git a/vendor/github.com/google/go-github/github/migrations_source_import.go b/vendor/github.com/google/go-github/github/migrations_source_import.go index 451b13e765..d593e40523 100644 --- a/vendor/github.com/google/go-github/github/migrations_source_import.go +++ b/vendor/github.com/google/go-github/github/migrations_source_import.go @@ -39,7 +39,7 @@ type Import struct { // repository. To see a list of these files, call LargeFiles. LargeFilesCount *int `json:"large_files_count,omitempty"` - // Identifies the current status of an import. An import that does not + // Identifies the current status of an import. An import that does not // have errors will progress through these steps: // // detecting - the "detection" step of the import is in progress @@ -101,7 +101,7 @@ type Import struct { HumanName *string `json:"human_name,omitempty"` // When the importer finds several projects or repositories at the - // provided URLs, this will identify the available choices. Call + // provided URLs, this will identify the available choices. Call // UpdateImport with the selected Import value. ProjectChoices []Import `json:"project_choices,omitempty"` } @@ -160,7 +160,7 @@ func (s *MigrationService) StartImport(owner, repo string, in *Import) (*Import, return nil, resp, err } - return out, resp, err + return out, resp, nil } // ImportProgress queries for the status and progress of an ongoing repository import. @@ -182,7 +182,7 @@ func (s *MigrationService) ImportProgress(owner, repo string) (*Import, *Respons return nil, resp, err } - return out, resp, err + return out, resp, nil } // UpdateImport initiates a repository import. @@ -204,7 +204,7 @@ func (s *MigrationService) UpdateImport(owner, repo string, in *Import) (*Import return nil, resp, err } - return out, resp, err + return out, resp, nil } // CommitAuthors gets the authors mapped from the original repository. @@ -260,11 +260,11 @@ func (s *MigrationService) MapCommitAuthor(owner, repo string, id int, author *S return nil, resp, err } - return out, resp, err + return out, resp, nil } // SetLFSPreference sets whether imported repositories should use Git LFS for -// files larger than 100MB. Only the UseLFS field on the provided Import is +// files larger than 100MB. Only the UseLFS field on the provided Import is // used. // // GitHub API docs: https://developer.github.com/v3/migration/source_imports/#set-git-lfs-preference @@ -284,7 +284,7 @@ func (s *MigrationService) SetLFSPreference(owner, repo string, in *Import) (*Im return nil, resp, err } - return out, resp, err + return out, resp, nil } // LargeFiles lists files larger than 100MB found during the import. diff --git a/vendor/github.com/google/go-github/github/misc.go b/vendor/github.com/google/go-github/github/misc.go index 89e1501fe4..0cdb3f7789 100644 --- a/vendor/github.com/google/go-github/github/misc.go +++ b/vendor/github.com/google/go-github/github/misc.go @@ -13,7 +13,7 @@ import ( // MarkdownOptions specifies optional parameters to the Markdown method. type MarkdownOptions struct { - // Mode identifies the rendering mode. Possible values are: + // Mode identifies the rendering mode. Possible values are: // markdown - render a document as plain Markdown, just like // README files are rendered. // @@ -25,7 +25,7 @@ type MarkdownOptions struct { // Default is "markdown". Mode string - // Context identifies the repository context. Only taken into account + // Context identifies the repository context. Only taken into account // when rendering as "gfm". Context string } @@ -125,7 +125,7 @@ func (c *Client) APIMeta() (*APIMeta, *Response, error) { } // Octocat returns an ASCII art octocat with the specified message in a speech -// bubble. If message is empty, a random zen phrase is used. +// bubble. If message is empty, a random zen phrase is used. func (c *Client) Octocat(message string) (string, *Response, error) { u := "octocat" if message != "" { diff --git a/vendor/github.com/google/go-github/github/orgs.go b/vendor/github.com/google/go-github/github/orgs.go index 696c2b763a..0f2ac965b6 100644 --- a/vendor/github.com/google/go-github/github/orgs.go +++ b/vendor/github.com/google/go-github/github/orgs.go @@ -57,7 +57,7 @@ func (o Organization) String() string { return Stringify(o) } -// Plan represents the payment plan for an account. See plans at https://github.com/plans. +// Plan represents the payment plan for an account. See plans at https://github.com/plans. type Plan struct { Name *string `json:"name,omitempty"` Space *int `json:"space,omitempty"` @@ -101,10 +101,10 @@ func (s *OrganizationsService) ListAll(opt *OrganizationsListOptions) ([]*Organi if err != nil { return nil, resp, err } - return orgs, resp, err + return orgs, resp, nil } -// List the organizations for a user. Passing the empty string will list +// List the organizations for a user. Passing the empty string will list // organizations for the authenticated user. // // GitHub API docs: http://developer.github.com/v3/orgs/#list-user-organizations @@ -150,7 +150,7 @@ func (s *OrganizationsService) Get(org string) (*Organization, *Response, error) return nil, resp, err } - return organization, resp, err + return organization, resp, nil } // Edit an organization. @@ -169,5 +169,5 @@ func (s *OrganizationsService) Edit(name string, org *Organization) (*Organizati return nil, resp, err } - return o, resp, err + return o, resp, nil } diff --git a/vendor/github.com/google/go-github/github/orgs_hooks.go b/vendor/github.com/google/go-github/github/orgs_hooks.go index 4926311e0a..6dc1052172 100644 --- a/vendor/github.com/google/go-github/github/orgs_hooks.go +++ b/vendor/github.com/google/go-github/github/orgs_hooks.go @@ -62,7 +62,7 @@ func (s *OrganizationsService) CreateHook(org string, hook *Hook) (*Hook, *Respo return nil, resp, err } - return h, resp, err + return h, resp, nil } // EditHook updates a specified Hook. diff --git a/vendor/github.com/google/go-github/github/orgs_members.go b/vendor/github.com/google/go-github/github/orgs_members.go index ea8a358059..f7bb88419b 100644 --- a/vendor/github.com/google/go-github/github/orgs_members.go +++ b/vendor/github.com/google/go-github/github/orgs_members.go @@ -48,8 +48,8 @@ type ListMembersOptions struct { // organization), list only publicly visible members. PublicOnly bool `url:"-"` - // Filter members returned in the list. Possible values are: - // 2fa_disabled, all. Default is "all". + // Filter members returned in the list. Possible values are: + // 2fa_disabled, all. Default is "all". Filter string `url:"filter,omitempty"` // Role filters members returned by their role in the organization. @@ -64,7 +64,7 @@ type ListMembersOptions struct { ListOptions } -// ListMembers lists the members for an organization. If the authenticated +// ListMembers lists the members for an organization. If the authenticated // user is an owner of the organization, this will return both concealed and // public members, otherwise it will only return public members. // @@ -196,7 +196,7 @@ func (s *OrganizationsService) ListOrgMemberships(opt *ListOrgMembershipsOptions return nil, resp, err } - return memberships, resp, err + return memberships, resp, nil } // GetOrgMembership gets the membership for a user in a specified organization. @@ -224,7 +224,7 @@ func (s *OrganizationsService) GetOrgMembership(user, org string) (*Membership, return nil, resp, err } - return membership, resp, err + return membership, resp, nil } // EditOrgMembership edits the membership for user in specified organization. @@ -254,10 +254,10 @@ func (s *OrganizationsService) EditOrgMembership(user, org string, membership *M return nil, resp, err } - return m, resp, err + return m, resp, nil } -// RemoveOrgMembership removes user from the specified organization. If the +// RemoveOrgMembership removes user from the specified organization. If the // user has been invited to the organization, this will cancel their invitation. // // GitHub API docs: https://developer.github.com/v3/orgs/members/#remove-organization-membership diff --git a/vendor/github.com/google/go-github/github/orgs_teams.go b/vendor/github.com/google/go-github/github/orgs_teams.go index ce8cbec80c..f4d668149d 100644 --- a/vendor/github.com/google/go-github/github/orgs_teams.go +++ b/vendor/github.com/google/go-github/github/orgs_teams.go @@ -10,7 +10,7 @@ import ( "time" ) -// Team represents a team within a GitHub organization. Teams are used to +// Team represents a team within a GitHub organization. Teams are used to // manage access to an organization's repositories. type Team struct { ID *int `json:"id,omitempty"` @@ -20,9 +20,9 @@ type Team struct { Slug *string `json:"slug,omitempty"` // Permission is deprecated when creating or editing a team in an org - // using the new GitHub permission model. It no longer identifies the + // using the new GitHub permission model. It no longer identifies the // permission a team has on its repos, but only specifies the default - // permission a repo is initially added with. Avoid confusion by + // permission a repo is initially added with. Avoid confusion by // specifying a permission value when calling AddTeamRepo. Permission *string `json:"permission,omitempty"` @@ -99,7 +99,7 @@ func (s *OrganizationsService) GetTeam(team int) (*Team, *Response, error) { return nil, resp, err } - return t, resp, err + return t, resp, nil } // CreateTeam creates a new team within an organization. @@ -118,7 +118,7 @@ func (s *OrganizationsService) CreateTeam(org string, team *Team) (*Team, *Respo return nil, resp, err } - return t, resp, err + return t, resp, nil } // EditTeam edits a team. @@ -137,7 +137,7 @@ func (s *OrganizationsService) EditTeam(id int, team *Team) (*Team, *Response, e return nil, resp, err } - return t, resp, err + return t, resp, nil } // DeleteTeam deletes a team. @@ -156,8 +156,8 @@ func (s *OrganizationsService) DeleteTeam(team int) (*Response, error) { // OrganizationListTeamMembersOptions specifies the optional parameters to the // OrganizationsService.ListTeamMembers method. type OrganizationListTeamMembersOptions struct { - // Role filters members returned by their role in the team. Possible - // values are "all", "member", "maintainer". Default is "all". + // Role filters members returned by their role in the team. Possible + // values are "all", "member", "maintainer". Default is "all". Role string `url:"role,omitempty"` ListOptions @@ -227,7 +227,7 @@ func (s *OrganizationsService) ListTeamRepos(team int, opt *ListOptions) ([]*Rep return repos, resp, nil } -// IsTeamRepo checks if a team manages the specified repository. If the +// IsTeamRepo checks if a team manages the specified repository. If the // repository is managed by team, a Repository is returned which includes the // permissions team has for that repo. // @@ -247,7 +247,7 @@ func (s *OrganizationsService) IsTeamRepo(team int, owner string, repo string) ( return nil, resp, err } - return repository, resp, err + return repository, resp, nil } // OrganizationAddTeamRepoOptions specifies the optional parameters to the @@ -263,7 +263,7 @@ type OrganizationAddTeamRepoOptions struct { Permission string `json:"permission,omitempty"` } -// AddTeamRepo adds a repository to be managed by the specified team. The +// AddTeamRepo adds a repository to be managed by the specified team. The // specified repository must be owned by the organization to which the team // belongs, or a direct fork of a repository owned by the organization. // @@ -279,7 +279,7 @@ func (s *OrganizationsService) AddTeamRepo(team int, owner string, repo string, } // RemoveTeamRepo removes a repository from being managed by the specified -// team. Note that this does not delete the repository, it just removes it +// team. Note that this does not delete the repository, it just removes it // from the team. // // GitHub API docs: http://developer.github.com/v3/orgs/teams/#remove-team-repo @@ -332,13 +332,13 @@ func (s *OrganizationsService) GetTeamMembership(team int, user string) (*Member return nil, resp, err } - return t, resp, err + return t, resp, nil } // OrganizationAddTeamMembershipOptions does stuff specifies the optional // parameters to the OrganizationsService.AddTeamMembership method. type OrganizationAddTeamMembershipOptions struct { - // Role specifies the role the user should have in the team. Possible + // Role specifies the role the user should have in the team. Possible // values are: // member - a normal member of the team // maintainer - a team maintainer. Able to add/remove other team @@ -380,7 +380,7 @@ func (s *OrganizationsService) AddTeamMembership(team int, user string, opt *Org return nil, resp, err } - return t, resp, err + return t, resp, nil } // RemoveTeamMembership removes a user from a team. diff --git a/vendor/github.com/google/go-github/github/projects.go b/vendor/github.com/google/go-github/github/projects.go index 2330056680..766f002801 100644 --- a/vendor/github.com/google/go-github/github/projects.go +++ b/vendor/github.com/google/go-github/github/projects.go @@ -51,7 +51,7 @@ func (s *ProjectsService) GetProject(id int) (*Project, *Response, error) { return nil, resp, err } - return project, resp, err + return project, resp, nil } // ProjectOptions specifies the parameters to the @@ -83,7 +83,7 @@ func (s *ProjectsService) UpdateProject(id int, opt *ProjectOptions) (*Project, return nil, resp, err } - return project, resp, err + return project, resp, nil } // DeleteProject deletes a GitHub Project from a repository. @@ -137,7 +137,7 @@ func (s *ProjectsService) ListProjectColumns(projectID int, opt *ListOptions) ([ return nil, resp, err } - return columns, resp, err + return columns, resp, nil } // GetProjectColumn gets a column of a GitHub Project for a repo. @@ -159,7 +159,7 @@ func (s *ProjectsService) GetProjectColumn(id int) (*ProjectColumn, *Response, e return nil, resp, err } - return column, resp, err + return column, resp, nil } // ProjectColumnOptions specifies the parameters to the @@ -189,7 +189,7 @@ func (s *ProjectsService) CreateProjectColumn(projectID int, opt *ProjectColumnO return nil, resp, err } - return column, resp, err + return column, resp, nil } // UpdateProjectColumn updates a column of a GitHub Project. @@ -211,7 +211,7 @@ func (s *ProjectsService) UpdateProjectColumn(columnID int, opt *ProjectColumnOp return nil, resp, err } - return column, resp, err + return column, resp, nil } // DeleteProjectColumn deletes a column from a GitHub Project. @@ -290,7 +290,7 @@ func (s *ProjectsService) ListProjectCards(columnID int, opt *ListOptions) ([]*P return nil, resp, err } - return cards, resp, err + return cards, resp, nil } // GetProjectCard gets a card in a column of a GitHub Project. @@ -312,7 +312,7 @@ func (s *ProjectsService) GetProjectCard(columnID int) (*ProjectCard, *Response, return nil, resp, err } - return card, resp, err + return card, resp, nil } // ProjectCardOptions specifies the parameters to the @@ -347,7 +347,7 @@ func (s *ProjectsService) CreateProjectCard(columnID int, opt *ProjectCardOption return nil, resp, err } - return card, resp, err + return card, resp, nil } // UpdateProjectCard updates a card of a GitHub Project. @@ -369,7 +369,7 @@ func (s *ProjectsService) UpdateProjectCard(cardID int, opt *ProjectCardOptions) return nil, resp, err } - return card, resp, err + return card, resp, nil } // DeleteProjectCard deletes a card from a GitHub Project. diff --git a/vendor/github.com/google/go-github/github/pulls.go b/vendor/github.com/google/go-github/github/pulls.go index d3a9ae8a94..4f65e24894 100644 --- a/vendor/github.com/google/go-github/github/pulls.go +++ b/vendor/github.com/google/go-github/github/pulls.go @@ -69,8 +69,8 @@ type PullRequestBranch struct { // PullRequestListOptions specifies the optional parameters to the // PullRequestsService.List method. type PullRequestListOptions struct { - // State filters pull requests based on their state. Possible values are: - // open, closed. Default is "open". + // State filters pull requests based on their state. Possible values are: + // open, closed. Default is "open". State string `url:"state,omitempty"` // Head filters pull requests by head user and branch name in the format of: diff --git a/vendor/github.com/google/go-github/github/pulls_comments.go b/vendor/github.com/google/go-github/github/pulls_comments.go index 51518f0579..0595389023 100644 --- a/vendor/github.com/google/go-github/github/pulls_comments.go +++ b/vendor/github.com/google/go-github/github/pulls_comments.go @@ -37,10 +37,10 @@ func (p PullRequestComment) String() string { // PullRequestListCommentsOptions specifies the optional parameters to the // PullRequestsService.ListComments method. type PullRequestListCommentsOptions struct { - // Sort specifies how to sort comments. Possible values are: created, updated. + // Sort specifies how to sort comments. Possible values are: created, updated. Sort string `url:"sort,omitempty"` - // Direction in which to sort comments. Possible values are: asc, desc. + // Direction in which to sort comments. Possible values are: asc, desc. Direction string `url:"direction,omitempty"` // Since filters comments by time. @@ -49,7 +49,7 @@ type PullRequestListCommentsOptions struct { ListOptions } -// ListComments lists all comments on the specified pull request. Specifying a +// ListComments lists all comments on the specified pull request. Specifying a // pull request number of 0 will return all comments on all pull requests for // the repository. // diff --git a/vendor/github.com/google/go-github/github/repos.go b/vendor/github.com/google/go-github/github/repos.go index 019a731b58..bbf4068fea 100644 --- a/vendor/github.com/google/go-github/github/repos.go +++ b/vendor/github.com/google/go-github/github/repos.go @@ -151,7 +151,7 @@ type RepositoryListOptions struct { ListOptions } -// List the repositories for a user. Passing the empty string will list +// List the repositories for a user. Passing the empty string will list // repositories for the authenticated user. // // GitHub API docs: http://developer.github.com/v3/repos/#list-user-repositories @@ -187,8 +187,8 @@ func (s *RepositoriesService) List(user string, opt *RepositoryListOptions) ([]* // RepositoryListByOrgOptions specifies the optional parameters to the // RepositoriesService.ListByOrg method. type RepositoryListByOrgOptions struct { - // Type of repositories to list. Possible values are: all, public, private, - // forks, sources, member. Default is "all". + // Type of repositories to list. Possible values are: all, public, private, + // forks, sources, member. Default is "all". Type string `url:"type,omitempty"` ListOptions @@ -253,8 +253,8 @@ func (s *RepositoriesService) ListAll(opt *RepositoryListAllOptions) ([]*Reposit return repos, resp, nil } -// Create a new repository. If an organization is specified, the new -// repository will be created under that org. If the empty string is +// Create a new repository. If an organization is specified, the new +// repository will be created under that org. If the empty string is // specified, it will be created for the authenticated user. // // GitHub API docs: http://developer.github.com/v3/repos/#create diff --git a/vendor/github.com/google/go-github/github/repos_collaborators.go b/vendor/github.com/google/go-github/github/repos_collaborators.go index a19a14abcb..6a6f39d519 100644 --- a/vendor/github.com/google/go-github/github/repos_collaborators.go +++ b/vendor/github.com/google/go-github/github/repos_collaborators.go @@ -87,7 +87,7 @@ type RepositoryAddCollaboratorOptions struct { // push - team members can pull and push, but not administer this repository // admin - team members can pull, push and administer this repository // - // Default value is "push". This option is only valid for organization-owned repositories. + // Default value is "push". This option is only valid for organization-owned repositories. Permission string `json:"permission,omitempty"` } diff --git a/vendor/github.com/google/go-github/github/repos_comments.go b/vendor/github.com/google/go-github/github/repos_comments.go index 7abedc8429..6efd18c650 100644 --- a/vendor/github.com/google/go-github/github/repos_comments.go +++ b/vendor/github.com/google/go-github/github/repos_comments.go @@ -103,7 +103,7 @@ func (s *RepositoriesService) CreateComment(owner, repo, sha string, comment *Re return nil, resp, err } - return c, resp, err + return c, resp, nil } // GetComment gets a single comment from a repository. @@ -125,7 +125,7 @@ func (s *RepositoriesService) GetComment(owner, repo string, id int) (*Repositor return nil, resp, err } - return c, resp, err + return c, resp, nil } // UpdateComment updates the body of a single comment. @@ -144,7 +144,7 @@ func (s *RepositoriesService) UpdateComment(owner, repo string, id int, comment return nil, resp, err } - return c, resp, err + return c, resp, nil } // DeleteComment deletes a single comment from a repository. diff --git a/vendor/github.com/google/go-github/github/repos_commits.go b/vendor/github.com/google/go-github/github/repos_commits.go index bc0fbf9bec..8920072c09 100644 --- a/vendor/github.com/google/go-github/github/repos_commits.go +++ b/vendor/github.com/google/go-github/github/repos_commits.go @@ -151,10 +151,10 @@ func (s *RepositoriesService) GetCommit(owner, repo, sha string) (*RepositoryCom return nil, resp, err } - return commit, resp, err + return commit, resp, nil } -// GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is +// GetCommitSHA1 gets the SHA-1 of a commit reference. If a last-known SHA1 is // supplied and no new commits have occurred, a 304 Unmodified response is returned. // // GitHub API docs: https://developer.github.com/v3/repos/commits/#get-the-sha-1-of-a-commit-reference @@ -177,7 +177,7 @@ func (s *RepositoriesService) GetCommitSHA1(owner, repo, ref, lastSHA string) (s return "", resp, err } - return buf.String(), resp, err + return buf.String(), resp, nil } // CompareCommits compares a range of commits with each other. @@ -198,5 +198,5 @@ func (s *RepositoriesService) CompareCommits(owner, repo string, base, head stri return nil, resp, err } - return comp, resp, err + return comp, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_contents.go b/vendor/github.com/google/go-github/github/repos_contents.go index 7b08cf04af..fdbc90441d 100644 --- a/vendor/github.com/google/go-github/github/repos_contents.go +++ b/vendor/github.com/google/go-github/github/repos_contents.go @@ -117,7 +117,7 @@ func (s *RepositoriesService) GetReadme(owner, repo string, opt *RepositoryConte if err != nil { return nil, resp, err } - return readme, resp, err + return readme, resp, nil } // DownloadContents returns an io.ReadCloser that reads the contents of the @@ -196,7 +196,7 @@ func (s *RepositoriesService) CreateFile(owner, repo, path string, opt *Reposito if err != nil { return nil, resp, err } - return createResponse, resp, err + return createResponse, resp, nil } // UpdateFile updates a file in a repository at the given path and returns the @@ -214,7 +214,7 @@ func (s *RepositoriesService) UpdateFile(owner, repo, path string, opt *Reposito if err != nil { return nil, resp, err } - return updateResponse, resp, err + return updateResponse, resp, nil } // DeleteFile deletes a file from a repository and returns the commit. @@ -232,7 +232,7 @@ func (s *RepositoriesService) DeleteFile(owner, repo, path string, opt *Reposito if err != nil { return nil, resp, err } - return deleteResponse, resp, err + return deleteResponse, resp, nil } // archiveFormat is used to define the archive type when calling GetArchiveLink. diff --git a/vendor/github.com/google/go-github/github/repos_deployments.go b/vendor/github.com/google/go-github/github/repos_deployments.go index 32a9a2588b..72dc05cb62 100644 --- a/vendor/github.com/google/go-github/github/repos_deployments.go +++ b/vendor/github.com/google/go-github/github/repos_deployments.go @@ -99,7 +99,7 @@ func (s *RepositoriesService) GetDeployment(owner, repo string, deploymentID int return nil, resp, err } - return deployment, resp, err + return deployment, resp, nil } // CreateDeployment creates a new deployment for a repository. @@ -122,7 +122,7 @@ func (s *RepositoriesService) CreateDeployment(owner, repo string, request *Depl return nil, resp, err } - return d, resp, err + return d, resp, nil } // DeploymentStatus represents the status of a @@ -195,7 +195,7 @@ func (s *RepositoriesService) GetDeploymentStatus(owner, repo string, deployment return nil, resp, err } - return d, resp, err + return d, resp, nil } // CreateDeploymentStatus creates a new status for a deployment. @@ -218,5 +218,5 @@ func (s *RepositoriesService) CreateDeploymentStatus(owner, repo string, deploym return nil, resp, err } - return d, resp, err + return d, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_forks.go b/vendor/github.com/google/go-github/github/repos_forks.go index 986559d36e..556308075c 100644 --- a/vendor/github.com/google/go-github/github/repos_forks.go +++ b/vendor/github.com/google/go-github/github/repos_forks.go @@ -10,8 +10,8 @@ import "fmt" // RepositoryListForksOptions specifies the optional parameters to the // RepositoriesService.ListForks method. type RepositoryListForksOptions struct { - // How to sort the forks list. Possible values are: newest, oldest, - // watchers. Default is "newest". + // How to sort the forks list. Possible values are: newest, oldest, + // watchers. Default is "newest". Sort string `url:"sort,omitempty"` ListOptions @@ -75,5 +75,5 @@ func (s *RepositoriesService) CreateFork(owner, repo string, opt *RepositoryCrea return nil, resp, err } - return fork, resp, err + return fork, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_hooks.go b/vendor/github.com/google/go-github/github/repos_hooks.go index 25f50b2778..d7a48af77a 100644 --- a/vendor/github.com/google/go-github/github/repos_hooks.go +++ b/vendor/github.com/google/go-github/github/repos_hooks.go @@ -11,9 +11,9 @@ import ( ) // WebHookPayload represents the data that is received from GitHub when a push -// event hook is triggered. The format of these payloads pre-date most of the +// event hook is triggered. The format of these payloads pre-date most of the // GitHub v3 API, so there are lots of minor incompatibilities with the types -// defined in the rest of the API. Therefore, several types are duplicated +// defined in the rest of the API. Therefore, several types are duplicated // here to account for these differences. // // GitHub API docs: https://help.github.com/articles/post-receive-hooks @@ -55,7 +55,7 @@ func (w WebHookCommit) String() string { } // WebHookAuthor represents the author or committer of a commit, as specified -// in a WebHookCommit. The commit author may not correspond to a GitHub User. +// in a WebHookCommit. The commit author may not correspond to a GitHub User. type WebHookAuthor struct { Email *string `json:"email,omitempty"` Name *string `json:"name,omitempty"` @@ -99,7 +99,7 @@ func (s *RepositoriesService) CreateHook(owner, repo string, hook *Hook) (*Hook, return nil, resp, err } - return h, resp, err + return h, resp, nil } // ListHooks lists all Hooks for the specified repository. @@ -190,7 +190,7 @@ func (s *RepositoriesService) TestHook(owner, repo string, id int) (*Response, e return s.client.Do(req, nil) } -// ListServiceHooks is deprecated. Use Client.ListServiceHooks instead. +// ListServiceHooks is deprecated. Use Client.ListServiceHooks instead. func (s *RepositoriesService) ListServiceHooks() ([]*ServiceHook, *Response, error) { return s.client.ListServiceHooks() } diff --git a/vendor/github.com/google/go-github/github/repos_invitations.go b/vendor/github.com/google/go-github/github/repos_invitations.go index f2806d11cf..e80b946314 100644 --- a/vendor/github.com/google/go-github/github/repos_invitations.go +++ b/vendor/github.com/google/go-github/github/repos_invitations.go @@ -46,7 +46,7 @@ func (s *RepositoriesService) ListInvitations(repoID int, opt *ListOptions) ([]* return nil, resp, err } - return invites, resp, err + return invites, resp, nil } // DeleteInvitation deletes a repository invitation. diff --git a/vendor/github.com/google/go-github/github/repos_keys.go b/vendor/github.com/google/go-github/github/repos_keys.go index f8f4f48e5e..da628ac088 100644 --- a/vendor/github.com/google/go-github/github/repos_keys.go +++ b/vendor/github.com/google/go-github/github/repos_keys.go @@ -50,7 +50,7 @@ func (s *RepositoriesService) GetKey(owner string, repo string, id int) (*Key, * return nil, resp, err } - return key, resp, err + return key, resp, nil } // CreateKey adds a deploy key for a repository. @@ -70,7 +70,7 @@ func (s *RepositoriesService) CreateKey(owner string, repo string, key *Key) (*K return nil, resp, err } - return k, resp, err + return k, resp, nil } // EditKey edits a deploy key. @@ -90,7 +90,7 @@ func (s *RepositoriesService) EditKey(owner string, repo string, id int, key *Ke return nil, resp, err } - return k, resp, err + return k, resp, nil } // DeleteKey deletes a deploy key. diff --git a/vendor/github.com/google/go-github/github/repos_merging.go b/vendor/github.com/google/go-github/github/repos_merging.go index 31f8313ea7..f9aefb49b5 100644 --- a/vendor/github.com/google/go-github/github/repos_merging.go +++ b/vendor/github.com/google/go-github/github/repos_merging.go @@ -33,5 +33,5 @@ func (s *RepositoriesService) Merge(owner, repo string, request *RepositoryMerge return nil, resp, err } - return commit, resp, err + return commit, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_pages.go b/vendor/github.com/google/go-github/github/repos_pages.go index ddd830155b..e4bb6d8811 100644 --- a/vendor/github.com/google/go-github/github/repos_pages.go +++ b/vendor/github.com/google/go-github/github/repos_pages.go @@ -52,7 +52,7 @@ func (s *RepositoriesService) GetPagesInfo(owner, repo string) (*Pages, *Respons return nil, resp, err } - return site, resp, err + return site, resp, nil } // ListPagesBuilds lists the builds for a GitHub Pages site. @@ -71,7 +71,7 @@ func (s *RepositoriesService) ListPagesBuilds(owner, repo string) ([]*PagesBuild return nil, resp, err } - return pages, resp, err + return pages, resp, nil } // GetLatestPagesBuild fetches the latest build information for a GitHub pages site. @@ -90,7 +90,7 @@ func (s *RepositoriesService) GetLatestPagesBuild(owner, repo string) (*PagesBui return nil, resp, err } - return build, resp, err + return build, resp, nil } // GetPageBuild fetches the specific build information for a GitHub pages site. @@ -109,7 +109,7 @@ func (s *RepositoriesService) GetPageBuild(owner, repo string, id int) (*PagesBu return nil, resp, err } - return build, resp, err + return build, resp, nil } // RequestPageBuild requests a build of a GitHub Pages site without needing to push new commit. @@ -131,5 +131,5 @@ func (s *RepositoriesService) RequestPageBuild(owner, repo string) (*PagesBuild, return nil, resp, err } - return build, resp, err + return build, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_projects.go b/vendor/github.com/google/go-github/github/repos_projects.go index 137f89d141..dc9227c389 100644 --- a/vendor/github.com/google/go-github/github/repos_projects.go +++ b/vendor/github.com/google/go-github/github/repos_projects.go @@ -31,7 +31,7 @@ func (s *RepositoriesService) ListProjects(owner, repo string, opt *ListOptions) return nil, resp, err } - return projects, resp, err + return projects, resp, nil } // CreateProject creates a GitHub Project for the specified repository. @@ -53,5 +53,5 @@ func (s *RepositoriesService) CreateProject(owner, repo string, opt *ProjectOpti return nil, resp, err } - return project, resp, err + return project, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_releases.go b/vendor/github.com/google/go-github/github/repos_releases.go index 72d95eb538..3c9f0e49f6 100644 --- a/vendor/github.com/google/go-github/github/repos_releases.go +++ b/vendor/github.com/google/go-github/github/repos_releases.go @@ -119,7 +119,7 @@ func (s *RepositoriesService) getSingleRelease(url string) (*RepositoryRelease, if err != nil { return nil, resp, err } - return release, resp, err + return release, resp, nil } // CreateRelease adds a new release for a repository. @@ -138,7 +138,7 @@ func (s *RepositoriesService) CreateRelease(owner, repo string, release *Reposit if err != nil { return nil, resp, err } - return r, resp, err + return r, resp, nil } // EditRelease edits a repository release. @@ -157,7 +157,7 @@ func (s *RepositoriesService) EditRelease(owner, repo string, id int, release *R if err != nil { return nil, resp, err } - return r, resp, err + return r, resp, nil } // DeleteRelease delete a single release from a repository. @@ -212,7 +212,7 @@ func (s *RepositoriesService) GetReleaseAsset(owner, repo string, id int) (*Rele if err != nil { return nil, resp, err } - return asset, resp, err + return asset, resp, nil } // DownloadReleaseAsset downloads a release asset or returns a redirect URL. @@ -275,7 +275,7 @@ func (s *RepositoriesService) EditReleaseAsset(owner, repo string, id int, relea if err != nil { return nil, resp, err } - return asset, resp, err + return asset, resp, nil } // DeleteReleaseAsset delete a single release asset from a repository. @@ -321,5 +321,5 @@ func (s *RepositoriesService) UploadReleaseAsset(owner, repo string, id int, opt if err != nil { return nil, resp, err } - return asset, resp, err + return asset, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_stats.go b/vendor/github.com/google/go-github/github/repos_stats.go index 8657bd797d..5ed1dec412 100644 --- a/vendor/github.com/google/go-github/github/repos_stats.go +++ b/vendor/github.com/google/go-github/github/repos_stats.go @@ -58,7 +58,7 @@ func (s *RepositoriesService) ListContributorsStats(owner, repo string) ([]*Cont return nil, resp, err } - return contributorStats, resp, err + return contributorStats, resp, nil } // WeeklyCommitActivity represents the weekly commit activity for a repository. @@ -97,11 +97,11 @@ func (s *RepositoriesService) ListCommitActivity(owner, repo string) ([]*WeeklyC return nil, resp, err } - return weeklyCommitActivity, resp, err + return weeklyCommitActivity, resp, nil } // ListCodeFrequency returns a weekly aggregate of the number of additions and -// deletions pushed to a repository. Returned WeeklyStats will contain +// deletions pushed to a repository. Returned WeeklyStats will contain // additions and deletions, but not total commits. // // If this is the first time these statistics are requested for the given @@ -177,7 +177,7 @@ func (s *RepositoriesService) ListParticipation(owner, repo string) (*Repository return nil, resp, err } - return participation, resp, err + return participation, resp, nil } // PunchCard represents the number of commits made during a given hour of a diff --git a/vendor/github.com/google/go-github/github/repos_statuses.go b/vendor/github.com/google/go-github/github/repos_statuses.go index 1056eeeb8b..c0b64e628d 100644 --- a/vendor/github.com/google/go-github/github/repos_statuses.go +++ b/vendor/github.com/google/go-github/github/repos_statuses.go @@ -15,11 +15,11 @@ type RepoStatus struct { ID *int `json:"id,omitempty"` URL *string `json:"url,omitempty"` - // State is the current state of the repository. Possible values are: + // State is the current state of the repository. Possible values are: // pending, success, error, or failure. State *string `json:"state,omitempty"` - // TargetURL is the URL of the page representing this status. It will be + // TargetURL is the URL of the page representing this status. It will be // linked from the GitHub UI to allow users to see the source of the status. TargetURL *string `json:"target_url,omitempty"` @@ -39,7 +39,7 @@ func (r RepoStatus) String() string { } // ListStatuses lists the statuses of a repository at the specified -// reference. ref can be a SHA, a branch name, or a tag name. +// reference. ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: http://developer.github.com/v3/repos/statuses/#list-statuses-for-a-specific-ref func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOptions) ([]*RepoStatus, *Response, error) { @@ -64,7 +64,7 @@ func (s *RepositoriesService) ListStatuses(owner, repo, ref string, opt *ListOpt } // CreateStatus creates a new status for a repository at the specified -// reference. Ref can be a SHA, a branch name, or a tag name. +// reference. Ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: http://developer.github.com/v3/repos/statuses/#create-a-status func (s *RepositoriesService) CreateStatus(owner, repo, ref string, status *RepoStatus) (*RepoStatus, *Response, error) { @@ -80,12 +80,12 @@ func (s *RepositoriesService) CreateStatus(owner, repo, ref string, status *Repo return nil, resp, err } - return repoStatus, resp, err + return repoStatus, resp, nil } // CombinedStatus represents the combined status of a repository at a particular reference. type CombinedStatus struct { - // State is the combined state of the repository. Possible values are: + // State is the combined state of the repository. Possible values are: // failure, pending, or success. State *string `json:"state,omitempty"` @@ -103,7 +103,7 @@ func (s CombinedStatus) String() string { } // GetCombinedStatus returns the combined status of a repository at the specified -// reference. ref can be a SHA, a branch name, or a tag name. +// reference. ref can be a SHA, a branch name, or a tag name. // // GitHub API docs: https://developer.github.com/v3/repos/statuses/#get-the-combined-status-for-a-specific-ref func (s *RepositoriesService) GetCombinedStatus(owner, repo, ref string, opt *ListOptions) (*CombinedStatus, *Response, error) { @@ -124,5 +124,5 @@ func (s *RepositoriesService) GetCombinedStatus(owner, repo, ref string, opt *Li return nil, resp, err } - return status, resp, err + return status, resp, nil } diff --git a/vendor/github.com/google/go-github/github/repos_traffic.go b/vendor/github.com/google/go-github/github/repos_traffic.go index 0713c7303f..67341b953d 100644 --- a/vendor/github.com/google/go-github/github/repos_traffic.go +++ b/vendor/github.com/google/go-github/github/repos_traffic.go @@ -110,7 +110,7 @@ func (s *RepositoriesService) ListTrafficViews(owner, repo string, opt *TrafficB return nil, resp, err } - return trafficViews, resp, err + return trafficViews, resp, nil } // ListTrafficClones get total number of clones for the last 14 days and breaks it down either per day or week for the last 14 days. @@ -134,5 +134,5 @@ func (s *RepositoriesService) ListTrafficClones(owner, repo string, opt *Traffic return nil, resp, err } - return trafficClones, resp, err + return trafficClones, resp, nil } diff --git a/vendor/github.com/google/go-github/github/search.go b/vendor/github.com/google/go-github/github/search.go index 8fd9430110..c2b9827ccf 100644 --- a/vendor/github.com/google/go-github/github/search.go +++ b/vendor/github.com/google/go-github/github/search.go @@ -19,7 +19,7 @@ type SearchService service // SearchOptions specifies optional parameters to the SearchService methods. type SearchOptions struct { - // How to sort the search results. Possible values are: + // How to sort the search results. Possible values are: // - for repositories: stars, fork, updated // - for commits: author-date, committer-date // - for code: indexed diff --git a/vendor/github.com/google/go-github/github/strings.go b/vendor/github.com/google/go-github/github/strings.go index 38577236c3..431e1cc6c1 100644 --- a/vendor/github.com/google/go-github/github/strings.go +++ b/vendor/github.com/google/go-github/github/strings.go @@ -16,7 +16,7 @@ import ( var timestampType = reflect.TypeOf(Timestamp{}) // Stringify attempts to create a reasonable string representation of types in -// the GitHub library. It does things like resolve pointers to their values +// the GitHub library. It does things like resolve pointers to their values // and omits struct fields with nil values. func Stringify(message interface{}) string { var buf bytes.Buffer diff --git a/vendor/github.com/google/go-github/github/users.go b/vendor/github.com/google/go-github/github/users.go index cd305a973f..f18df37df8 100644 --- a/vendor/github.com/google/go-github/github/users.go +++ b/vendor/github.com/google/go-github/github/users.go @@ -68,7 +68,7 @@ func (u User) String() string { return Stringify(u) } -// Get fetches a user. Passing the empty string will fetch the authenticated +// Get fetches a user. Passing the empty string will fetch the authenticated // user. // // GitHub API docs: http://developer.github.com/v3/users/#get-a-single-user @@ -90,7 +90,7 @@ func (s *UsersService) Get(user string) (*User, *Response, error) { return nil, resp, err } - return uResp, resp, err + return uResp, resp, nil } // GetByID fetches a user. @@ -109,7 +109,7 @@ func (s *UsersService) GetByID(id int) (*User, *Response, error) { return nil, resp, err } - return user, resp, err + return user, resp, nil } // Edit the authenticated user. @@ -128,7 +128,7 @@ func (s *UsersService) Edit(user *User) (*User, *Response, error) { return nil, resp, err } - return uResp, resp, err + return uResp, resp, nil } // UserListOptions specifies optional parameters to the UsersService.ListAll @@ -184,7 +184,7 @@ func (s *UsersService) ListInvitations() ([]*RepositoryInvitation, *Response, er return nil, resp, err } - return invites, resp, err + return invites, resp, nil } // AcceptInvitation accepts the currently-open repository invitation for the diff --git a/vendor/github.com/google/go-github/github/users_followers.go b/vendor/github.com/google/go-github/github/users_followers.go index 123b1c1069..d5a97e2178 100644 --- a/vendor/github.com/google/go-github/github/users_followers.go +++ b/vendor/github.com/google/go-github/github/users_followers.go @@ -7,7 +7,7 @@ package github import "fmt" -// ListFollowers lists the followers for a user. Passing the empty string will +// ListFollowers lists the followers for a user. Passing the empty string will // fetch followers for the authenticated user. // // GitHub API docs: http://developer.github.com/v3/users/followers/#list-followers-of-a-user @@ -37,7 +37,7 @@ func (s *UsersService) ListFollowers(user string, opt *ListOptions) ([]*User, *R return users, resp, nil } -// ListFollowing lists the people that a user is following. Passing the empty +// ListFollowing lists the people that a user is following. Passing the empty // string will list people the authenticated user is following. // // GitHub API docs: http://developer.github.com/v3/users/followers/#list-users-followed-by-another-user @@ -67,7 +67,7 @@ func (s *UsersService) ListFollowing(user string, opt *ListOptions) ([]*User, *R return users, resp, nil } -// IsFollowing checks if "user" is following "target". Passing the empty +// IsFollowing checks if "user" is following "target". Passing the empty // string for "user" will check if the authenticated user is following "target". // // GitHub API docs: http://developer.github.com/v3/users/followers/#check-if-you-are-following-a-user diff --git a/vendor/github.com/google/go-github/github/users_gpg_keys.go b/vendor/github.com/google/go-github/github/users_gpg_keys.go index 08cfbed57c..1576365f5b 100644 --- a/vendor/github.com/google/go-github/github/users_gpg_keys.go +++ b/vendor/github.com/google/go-github/github/users_gpg_keys.go @@ -58,7 +58,7 @@ func (s *UsersService) ListGPGKeys() ([]*GPGKey, *Response, error) { return nil, resp, err } - return keys, resp, err + return keys, resp, nil } // GetGPGKey gets extended details for a single GPG key. It requires authentication @@ -81,7 +81,7 @@ func (s *UsersService) GetGPGKey(id int) (*GPGKey, *Response, error) { return nil, resp, err } - return key, resp, err + return key, resp, nil } // CreateGPGKey creates a GPG key. It requires authenticatation via Basic Auth @@ -106,7 +106,7 @@ func (s *UsersService) CreateGPGKey(armoredPublicKey string) (*GPGKey, *Response return nil, resp, err } - return key, resp, err + return key, resp, nil } // DeleteGPGKey deletes a GPG key. It requires authentication via Basic Auth or diff --git a/vendor/github.com/google/go-github/github/users_keys.go b/vendor/github.com/google/go-github/github/users_keys.go index 59b1dc27d2..dbb8ecba83 100644 --- a/vendor/github.com/google/go-github/github/users_keys.go +++ b/vendor/github.com/google/go-github/github/users_keys.go @@ -20,7 +20,7 @@ func (k Key) String() string { return Stringify(k) } -// ListKeys lists the verified public keys for a user. Passing the empty +// ListKeys lists the verified public keys for a user. Passing the empty // string will fetch keys for the authenticated user. // // GitHub API docs: http://developer.github.com/v3/users/keys/#list-public-keys-for-a-user @@ -67,7 +67,7 @@ func (s *UsersService) GetKey(id int) (*Key, *Response, error) { return nil, resp, err } - return key, resp, err + return key, resp, nil } // CreateKey adds a public key for the authenticated user. @@ -87,7 +87,7 @@ func (s *UsersService) CreateKey(key *Key) (*Key, *Response, error) { return nil, resp, err } - return k, resp, err + return k, resp, nil } // DeleteKey deletes a public key. diff --git a/vendor/github.com/hashicorp/consul/api/api.go b/vendor/github.com/hashicorp/consul/api/api.go index 9a59b724cb..f6fe5a1bde 100644 --- a/vendor/github.com/hashicorp/consul/api/api.go +++ b/vendor/github.com/hashicorp/consul/api/api.go @@ -2,6 +2,7 @@ package api import ( "bytes" + "context" "crypto/tls" "crypto/x509" "encoding/json" @@ -79,6 +80,11 @@ type QueryOptions struct { // metadata key/value pairs. Currently, only one key/value pair can // be provided for filtering. NodeMeta map[string]string + + // RelayFactor is used in keyring operations to cause reponses to be + // relayed back to the sender through N other random nodes. Must be + // a value from 0 to 5 (inclusive). + RelayFactor uint8 } // WriteOptions are used to parameterize a write @@ -90,6 +96,11 @@ type WriteOptions struct { // Token is used to provide a per-request ACL token // which overrides the agent's default token. Token string + + // RelayFactor is used in keyring operations to cause reponses to be + // relayed back to the sender through N other random nodes. Must be + // a value from 0 to 5 (inclusive). + RelayFactor uint8 } // QueryMeta is used to return meta data about a query @@ -336,13 +347,22 @@ func NewClient(config *Config) (*Client, error) { config.HttpClient = defConfig.HttpClient } - if parts := strings.SplitN(config.Address, "unix://", 2); len(parts) == 2 { - trans := cleanhttp.DefaultTransport() - trans.Dial = func(_, _ string) (net.Conn, error) { - return net.Dial("unix", parts[1]) - } - config.HttpClient = &http.Client{ - Transport: trans, + parts := strings.SplitN(config.Address, "://", 2) + if len(parts) == 2 { + switch parts[0] { + case "http": + case "https": + config.Scheme = "https" + case "unix": + trans := cleanhttp.DefaultTransport() + trans.DialContext = func(_ context.Context, _, _ string) (net.Conn, error) { + return net.Dial("unix", parts[1]) + } + config.HttpClient = &http.Client{ + Transport: trans, + } + default: + return nil, fmt.Errorf("Unknown protocol scheme: %s", parts[0]) } config.Address = parts[1] } @@ -396,6 +416,9 @@ func (r *request) setQueryOptions(q *QueryOptions) { r.params.Add("node-meta", key+":"+value) } } + if q.RelayFactor != 0 { + r.params.Set("relay-factor", strconv.Itoa(int(q.RelayFactor))) + } } // durToMsec converts a duration to a millisecond specified string. If the @@ -437,6 +460,9 @@ func (r *request) setWriteOptions(q *WriteOptions) { if q.Token != "" { r.header.Set("X-Consul-Token", q.Token) } + if q.RelayFactor != 0 { + r.params.Set("relay-factor", strconv.Itoa(int(q.RelayFactor))) + } } // toHTTP converts the request to an HTTP request diff --git a/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go b/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go index 74be85e9d7..7d8a57c280 100644 --- a/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go +++ b/vendor/github.com/hashicorp/go-cleanhttp/cleanhttp.go @@ -7,8 +7,8 @@ import ( "time" ) -// DefaultTransport returns a new http.Transport with the same default values -// as http.DefaultTransport, but with idle connections and keepalives disabled. +// DefaultTransport returns a new http.Transport with similar default values to +// http.DefaultTransport, but with idle connections and keepalives disabled. func DefaultTransport() *http.Transport { transport := DefaultPooledTransport() transport.DisableKeepAlives = true @@ -45,10 +45,10 @@ func DefaultClient() *http.Client { } } -// DefaultPooledClient returns a new http.Client with the same default values -// as http.Client, but with a shared Transport. Do not use this function -// for transient clients as it can leak file descriptors over time. Only use -// this for clients that will be re-used for the same host(s). +// DefaultPooledClient returns a new http.Client with similar default values to +// http.Client, but with a shared Transport. Do not use this function for +// transient clients as it can leak file descriptors over time. Only use this +// for clients that will be re-used for the same host(s). func DefaultPooledClient() *http.Client { return &http.Client{ Transport: DefaultPooledTransport(), diff --git a/vendor/github.com/lib/pq/conn.go b/vendor/github.com/lib/pq/conn.go index 15ebdefdbd..e240efa03d 100644 --- a/vendor/github.com/lib/pq/conn.go +++ b/vendor/github.com/lib/pq/conn.go @@ -664,9 +664,12 @@ func (cn *conn) simpleQuery(q string) (res *rows, err error) { res = &rows{ cn: cn, } - if t == 'C' { - res.result, res.tag = cn.parseComplete(r.string()) - } + } + // Set the result and tag to the last command complete if there wasn't a + // query already run. Although queries usually return from here and cede + // control to Next, a query with zero results does not. + if t == 'C' && res.colNames == nil { + res.result, res.tag = cn.parseComplete(r.string()) } res.done = true case 'Z': diff --git a/vendor/github.com/mattn/go-isatty/README.md b/vendor/github.com/mattn/go-isatty/README.md index 74845de4a2..8e4365f45e 100644 --- a/vendor/github.com/mattn/go-isatty/README.md +++ b/vendor/github.com/mattn/go-isatty/README.md @@ -1,5 +1,7 @@ # go-isatty +[![Build Status](https://travis-ci.org/mattn/go-isatty.svg?branch=master)](https://travis-ci.org/mattn/go-isatty) [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) + isatty for golang ## Usage @@ -16,6 +18,8 @@ import ( func main() { if isatty.IsTerminal(os.Stdout.Fd()) { fmt.Println("Is Terminal") + } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { + fmt.Println("Is Cygwin/MSYS2 Terminal") } else { fmt.Println("Is Not Terminal") } @@ -28,10 +32,16 @@ func main() { $ go get github.com/mattn/go-isatty ``` -# License +## License MIT -# Author +## Author Yasuhiro Matsumoto (a.k.a mattn) + +## Thanks + +* k-takata: base idea for IsCygwinTerminal + + https://github.com/k-takata/go-iscygpty diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go new file mode 100644 index 0000000000..616832d23e --- /dev/null +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -0,0 +1,9 @@ +// +build !windows appengine + +package isatty + +// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 +// terminal. This is also always false on this environment. +func IsCygwinTerminal(fd uintptr) bool { + return false +} diff --git a/vendor/github.com/mattn/go-isatty/isatty_windows.go b/vendor/github.com/mattn/go-isatty/isatty_windows.go index 83c398b16d..af51cbcaa4 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_windows.go +++ b/vendor/github.com/mattn/go-isatty/isatty_windows.go @@ -4,12 +4,30 @@ package isatty import ( + "strings" "syscall" + "unicode/utf16" "unsafe" ) -var kernel32 = syscall.NewLazyDLL("kernel32.dll") -var procGetConsoleMode = kernel32.NewProc("GetConsoleMode") +const ( + fileNameInfo uintptr = 2 + fileTypePipe = 3 +) + +var ( + kernel32 = syscall.NewLazyDLL("kernel32.dll") + procGetConsoleMode = kernel32.NewProc("GetConsoleMode") + procGetFileInformationByHandleEx = kernel32.NewProc("GetFileInformationByHandleEx") + procGetFileType = kernel32.NewProc("GetFileType") +) + +func init() { + // Check if GetFileInformationByHandleEx is available. + if procGetFileInformationByHandleEx.Find() != nil { + procGetFileInformationByHandleEx = nil + } +} // IsTerminal return true if the file descriptor is terminal. func IsTerminal(fd uintptr) bool { @@ -17,3 +35,60 @@ func IsTerminal(fd uintptr) bool { r, _, e := syscall.Syscall(procGetConsoleMode.Addr(), 2, fd, uintptr(unsafe.Pointer(&st)), 0) return r != 0 && e == 0 } + +// Check pipe name is used for cygwin/msys2 pty. +// Cygwin/MSYS2 PTY has a name like: +// \{cygwin,msys}-XXXXXXXXXXXXXXXX-ptyN-{from,to}-master +func isCygwinPipeName(name string) bool { + token := strings.Split(name, "-") + if len(token) < 5 { + return false + } + + if token[0] != `\msys` && token[0] != `\cygwin` { + return false + } + + if token[1] == "" { + return false + } + + if !strings.HasPrefix(token[2], "pty") { + return false + } + + if token[3] != `from` && token[3] != `to` { + return false + } + + if token[4] != "master" { + return false + } + + return true +} + +// IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 +// terminal. +func IsCygwinTerminal(fd uintptr) bool { + if procGetFileInformationByHandleEx == nil { + return false + } + + // Cygwin/msys's pty is a pipe. + ft, _, e := syscall.Syscall(procGetFileType.Addr(), 1, fd, 0, 0) + if ft != fileTypePipe || e != 0 { + return false + } + + var buf [2 + syscall.MAX_PATH]uint16 + r, _, e := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), + 4, fd, fileNameInfo, uintptr(unsafe.Pointer(&buf)), + uintptr(len(buf)*2), 0, 0) + if r == 0 || e != 0 { + return false + } + + l := *(*uint32)(unsafe.Pointer(&buf)) + return isCygwinPipeName(string(utf16.Decode(buf[2 : 2+l/2]))) +} diff --git a/vendor/github.com/mitchellh/cli/cli.go b/vendor/github.com/mitchellh/cli/cli.go index 79390f2314..353edb6c29 100644 --- a/vendor/github.com/mitchellh/cli/cli.go +++ b/vendor/github.com/mitchellh/cli/cli.go @@ -25,7 +25,7 @@ import ( // // * We use longest prefix matching to find a matching subcommand. This // means if you register "foo bar" and the user executes "cli foo qux", -// the "foo" commmand will be executed with the arg "qux". It is up to +// the "foo" command will be executed with the arg "qux". It is up to // you to handle these args. One option is to just return the special // help return code `RunResultHelp` to display help and exit. // diff --git a/vendor/github.com/ryanuber/columnize/columnize.go b/vendor/github.com/ryanuber/columnize/columnize.go index 915716a107..bff014fac7 100644 --- a/vendor/github.com/ryanuber/columnize/columnize.go +++ b/vendor/github.com/ryanuber/columnize/columnize.go @@ -83,9 +83,9 @@ func stringFormat(c *Config, widths []int, columns int) string { // elementsFromLine returns a list of elements, each representing a single // item which will belong to a column of output. func elementsFromLine(config *Config, line string) []interface{} { - seperated := strings.Split(line, config.Delim) - elements := make([]interface{}, len(seperated)) - for i, field := range seperated { + separated := strings.Split(line, config.Delim) + elements := make([]interface{}, len(separated)) + for i, field := range separated { value := strings.TrimSpace(field) // Apply the empty value, if configured. diff --git a/vendor/github.com/ugorji/go/codec/json.go b/vendor/github.com/ugorji/go/codec/json.go index 5bb3896289..463cae3dba 100644 --- a/vendor/github.com/ugorji/go/codec/json.go +++ b/vendor/github.com/ugorji/go/codec/json.go @@ -310,6 +310,8 @@ func (e *jsonEncDriver) quoteStr(s string) { w.writen1('"') start := 0 for i := 0; i < len(s); { + // encode all bytes < 0x20 (except \r, \n). + // also encode < > & to prevent security holes when served to some browsers. if b := s[i]; b < utf8.RuneSelf { if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' { i++ @@ -331,9 +333,14 @@ func (e *jsonEncDriver) quoteStr(s string) { w.writen2('\\', 'f') case '\t': w.writen2('\\', 't') + case '<', '>', '&': + if e.h.HTMLCharsAsIs { + w.writen1(b) + } else { + w.writestr(`\u00`) + w.writen2(hex[b>>4], hex[b&0xF]) + } default: - // encode all bytes < 0x20 (except \r, \n). - // also encode < > & to prevent security holes when served to some browsers. w.writestr(`\u00`) w.writen2(hex[b>>4], hex[b&0xF]) } @@ -352,7 +359,7 @@ func (e *jsonEncDriver) quoteStr(s string) { continue } // U+2028 is LINE SEPARATOR. U+2029 is PARAGRAPH SEPARATOR. - // Both technically valid JSON, but bomb on JSONP, so fix here. + // Both technically valid JSON, but bomb on JSONP, so fix here unconditionally. if c == '\u2028' || c == '\u2029' { if start < i { w.writestr(s[start:i]) @@ -1173,6 +1180,12 @@ type JsonHandle struct { // containing the exact integer representation as a decimal. // - else encode all integers as a json number (default) IntegerAsString uint8 + + // HTMLCharsAsIs controls how to encode some special characters to html: < > & + // + // By default, we encode them as \uXXX + // to prevent security holes when served from some browsers. + HTMLCharsAsIs bool } func (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { diff --git a/vendor/github.com/ugorji/go/codec/test.py b/vendor/github.com/ugorji/go/codec/test.py index c0ad20b34c..f983d9d9e6 100755 --- a/vendor/github.com/ugorji/go/codec/test.py +++ b/vendor/github.com/ugorji/go/codec/test.py @@ -34,7 +34,7 @@ def get_test_data_list(): True, u"null", None, - u"someday", + u"some&day>some _$i && gofmt < _$i > $i rm _$i done @@ -280,7 +282,7 @@ esac syscall_goos="syscall_bsd.go $syscall_goos" ;; esac - if [ -n "$mksyscall" ]; then echo "$mksyscall $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; fi + if [ -n "$mksyscall" ]; then echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go"; fi ;; esac if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 7e6276b9c3..374c052904 100755 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -114,11 +114,13 @@ includes_Linux=' #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -312,6 +314,7 @@ ccflags="$@" $2 ~ /^IN_/ || $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ || + $2 ~ /^FALLOC_/ || $2 == "ICMPV6_FILTER" || $2 == "SOMAXCONN" || $2 == "NAME_MAX" || @@ -341,6 +344,8 @@ ccflags="$@" $2 ~ /^(BPF|DLT)_/ || $2 ~ /^CLOCK_/ || $2 ~ /^CAN_/ || + $2 ~ /^ALG_/ || + $2 ~ /^SPLICE_/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", $2, $2)} $2 ~ /^__WCOREFLAG$/ {next} @@ -456,7 +461,7 @@ main(void) printf("\t%d: \"%s\",\n", e, buf); } printf("}\n\n"); - + printf("\n\n// Signal table\n"); printf("var signals = [...]string {\n"); qsort(signals, nelem(signals), sizeof signals[0], intcmp); diff --git a/vendor/golang.org/x/sys/unix/mksyscall.pl b/vendor/golang.org/x/sys/unix/mksyscall.pl index b1e7766dae..34f8ef829b 100755 --- a/vendor/golang.org/x/sys/unix/mksyscall.pl +++ b/vendor/golang.org/x/sys/unix/mksyscall.pl @@ -29,6 +29,7 @@ my $openbsd = 0; my $netbsd = 0; my $dragonfly = 0; my $arm = 0; # 64-bit value should use (even, odd)-pair +my $tags = ""; # build tags if($ARGV[0] eq "-b32") { $_32bit = "big-endian"; @@ -57,14 +58,14 @@ if($ARGV[0] eq "-arm") { $arm = 1; shift; } - -if($ARGV[0] =~ /^-/) { - print STDERR "usage: mksyscall.pl [-b32 | -l32] [file ...]\n"; - exit 1; +if($ARGV[0] eq "-tags") { + shift; + $tags = $ARGV[0]; + shift; } -if($ENV{'GOARCH'} eq "" || $ENV{'GOOS'} eq "") { - print STDERR "GOARCH or GOOS not defined in environment\n"; +if($ARGV[0] =~ /^-/) { + print STDERR "usage: mksyscall.pl [-b32 | -l32] [-tags x,y] [file ...]\n"; exit 1; } @@ -132,7 +133,6 @@ while(<>) { # Prepare arguments to Syscall. my @args = (); - my @uses = (); my $n = 0; foreach my $p (@in) { my ($name, $type) = parseparam($p); @@ -143,14 +143,12 @@ while(<>) { $text .= "\t_p$n, $errvar = BytePtrFromString($name)\n"; $text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; push @args, "uintptr(unsafe.Pointer(_p$n))"; - push @uses, "use(unsafe.Pointer(_p$n))"; $n++; } elsif($type eq "string") { print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; $text .= "\tvar _p$n *byte\n"; $text .= "\t_p$n, _ = BytePtrFromString($name)\n"; push @args, "uintptr(unsafe.Pointer(_p$n))"; - push @uses, "use(unsafe.Pointer(_p$n))"; $n++; } elsif($type =~ /^\[\](.*)/) { # Convert slice into pointer, length. @@ -185,7 +183,7 @@ while(<>) { } } elsif($type eq "int64" && $_32bit ne "") { if(@args % 2 && $arm) { - # arm abi specifies 64-bit argument uses + # arm abi specifies 64-bit argument uses # (even, odd) pair push @args, "0" } @@ -278,11 +276,8 @@ while(<>) { } else { $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n"; } - foreach my $use (@uses) { - $text .= "\t$use\n"; - } $text .= $body; - + if ($plan9 && $ret[2] eq "e1") { $text .= "\tif int32(r0) == -1 {\n"; $text .= "\t\terr = e1\n"; @@ -307,7 +302,7 @@ print <) { # Prepare arguments to Syscall. my @args = (); - my @uses = (); my $n = 0; foreach my $p (@in) { my ($name, $type) = parseparam($p); @@ -149,14 +149,12 @@ while(<>) { $text .= "\t_p$n, $errvar = $strconvfunc($name)\n"; $text .= "\tif $errvar != nil {\n\t\treturn\n\t}\n"; push @args, "uintptr(unsafe.Pointer(_p$n))"; - push @uses, "use(unsafe.Pointer(_p$n))"; $n++; } elsif($type eq "string") { print STDERR "$ARGV:$.: $func uses string arguments, but has no error return\n"; $text .= "\tvar _p$n $strconvtype\n"; $text .= "\t_p$n, _ = $strconvfunc($name)\n"; push @args, "uintptr(unsafe.Pointer(_p$n))"; - push @uses, "use(unsafe.Pointer(_p$n))"; $n++; } elsif($type =~ /^\[\](.*)/) { # Convert slice into pointer, length. @@ -243,9 +241,6 @@ while(<>) { } else { $text .= "\t$ret[0], $ret[1], $ret[2] := $call\n"; } - foreach my $use (@uses) { - $text .= "\t$use\n"; - } $text .= $body; if ($do_errno) { @@ -265,7 +260,7 @@ print < 13 { + return nil, 0, EINVAL + } + if len(sa.Name) > 63 { + return nil, 0, EINVAL + } + + sa.raw.Family = AF_ALG + sa.raw.Feat = sa.Feature + sa.raw.Mask = sa.Mask + + typ, err := ByteSliceFromString(sa.Type) + if err != nil { + return nil, 0, err + } + name, err := ByteSliceFromString(sa.Name) + if err != nil { + return nil, 0, err + } + + copy(sa.raw.Type[:], typ) + copy(sa.raw.Name[:], name) + + return unsafe.Pointer(&sa.raw), SizeofSockaddrALG, nil +} + func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, error) { switch rsa.Addr.Family { case AF_NETLINK: @@ -1019,6 +1118,25 @@ func Munmap(b []byte) (err error) { //sys Mlockall(flags int) (err error) //sys Munlockall() (err error) +// Vmsplice splices user pages from a slice of Iovecs into a pipe specified by fd, +// using the specified flags. +func Vmsplice(fd int, iovs []Iovec, flags int) (int, error) { + n, _, errno := Syscall6( + SYS_VMSPLICE, + uintptr(fd), + uintptr(unsafe.Pointer(&iovs[0])), + uintptr(len(iovs)), + uintptr(flags), + 0, + 0, + ) + if errno != 0 { + return 0, syscall.Errno(errno) + } + + return int(n), nil +} + /* * Unimplemented */ @@ -1146,7 +1264,6 @@ func Munmap(b []byte) (err error) { // Utimensat // Vfork // Vhangup -// Vmsplice // Vserver // Waitid // _Sysctl diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go index 5ed801369d..be77d24a4a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -73,7 +73,6 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, func Fstatfs(fd int, buf *Statfs_t) (err error) { _, _, e := Syscall(SYS_FSTATFS64, uintptr(fd), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) - use(unsafe.Pointer(buf)) if e != 0 { err = errnoErr(e) } @@ -86,7 +85,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return err } _, _, e := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(p)), unsafe.Sizeof(*buf), uintptr(unsafe.Pointer(buf))) - use(unsafe.Pointer(p)) if e != 0 { err = errnoErr(e) } diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go index 81c5f47322..1708a4bbf9 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -132,7 +132,6 @@ func (cmsg *Cmsghdr) SetLen(length int) { func mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)} r0, _, e1 := Syscall(SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0) - use(unsafe.Pointer(&mmap_args[0])) xaddr = uintptr(r0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index 554a823426..246131d2af 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -111,7 +111,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) { bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf)) } r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags)) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = e1 diff --git a/vendor/golang.org/x/sys/unix/types_linux.go b/vendor/golang.org/x/sys/unix/types_linux.go index f3d8f90ee2..a08f7fb472 100644 --- a/vendor/golang.org/x/sys/unix/types_linux.go +++ b/vendor/golang.org/x/sys/unix/types_linux.go @@ -59,6 +59,7 @@ package unix #include #include #include +#include #ifdef TCSETS2 // On systems that have "struct termios2" use this as type Termios. @@ -221,6 +222,8 @@ type RawSockaddrHCI C.struct_sockaddr_hci type RawSockaddrCAN C.struct_sockaddr_can +type RawSockaddrALG C.struct_sockaddr_alg + type RawSockaddr C.struct_sockaddr type RawSockaddrAny C.struct_sockaddr_any @@ -262,6 +265,7 @@ const ( SizeofSockaddrNetlink = C.sizeof_struct_sockaddr_nl SizeofSockaddrHCI = C.sizeof_struct_sockaddr_hci SizeofSockaddrCAN = C.sizeof_struct_sockaddr_can + SizeofSockaddrALG = C.sizeof_struct_sockaddr_alg SizeofLinger = C.sizeof_struct_linger SizeofIPMreq = C.sizeof_struct_ip_mreq SizeofIPMreqn = C.sizeof_struct_ip_mreqn diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index b40d0299b5..5759f794be 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -53,6 +53,13 @@ const ( AF_UNSPEC = 0x0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 ARPHRD_ARCNET = 0x7 @@ -385,6 +392,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1292,6 +1305,10 @@ const ( SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 9f0600ccbd..88c6ac604b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -53,6 +53,13 @@ const ( AF_UNSPEC = 0x0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 ARPHRD_ARCNET = 0x7 @@ -385,6 +392,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1293,6 +1306,10 @@ const ( SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index 647a796e39..2ee1536912 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -52,6 +52,13 @@ const ( AF_UNSPEC = 0x0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 ARPHRD_ARCNET = 0x7 @@ -370,6 +377,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1216,6 +1229,10 @@ const ( SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index a6d1e1fa34..767b166289 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -54,6 +54,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 ARPHRD_ARCNET = 0x7 @@ -399,6 +406,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1348,6 +1361,10 @@ const ( SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index e4fb9ad579..677abd169a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -52,6 +52,13 @@ const ( AF_UNSPEC = 0x0 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 ARPHRD_ARCNET = 0x7 @@ -375,6 +382,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1267,6 +1280,10 @@ const ( SO_TIMESTAMPING = 0x25 SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x1008 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 36535b242d..46dba956e9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -56,6 +56,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_6LOWPAN = 0x339 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 @@ -374,6 +381,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x2000 @@ -1363,6 +1376,10 @@ const ( SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 112f05de56..ee94a6e501 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -56,6 +56,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_6LOWPAN = 0x339 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 @@ -374,6 +381,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FLUSHO = 0x2000 @@ -1363,6 +1376,10 @@ const ( SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 0f5ee22375..974b375f98 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -57,6 +57,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_6LOWPAN = 0x339 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 @@ -411,6 +418,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1438,6 +1451,10 @@ const ( SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x29 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 4e4193951b..ce4607d874 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -54,6 +54,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_6LOWPAN = 0x339 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 @@ -401,6 +408,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1416,6 +1429,10 @@ const ( SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 407e6b5392..729ef75016 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -54,6 +54,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 ARPHRD_ARCNET = 0x7 @@ -397,6 +404,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1415,6 +1428,10 @@ const ( SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 40c9b87931..68c9ec669b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -56,6 +56,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_6LOWPAN = 0x339 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 @@ -407,6 +414,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1470,6 +1483,10 @@ const ( SO_TIMESTAMPNS = 0x23 SO_TYPE = 0x3 SO_WIFI_STATUS = 0x29 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 62680ed8aa..4c56e2ffaf 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -57,6 +57,13 @@ const ( AF_VSOCK = 0x28 AF_WANPIPE = 0x19 AF_X25 = 0x9 + ALG_OP_DECRYPT = 0x0 + ALG_OP_ENCRYPT = 0x1 + ALG_SET_AEAD_ASSOCLEN = 0x4 + ALG_SET_AEAD_AUTHSIZE = 0x5 + ALG_SET_IV = 0x2 + ALG_SET_KEY = 0x1 + ALG_SET_OP = 0x3 ARPHRD_6LOWPAN = 0x339 ARPHRD_ADAPT = 0x108 ARPHRD_APPLETLK = 0x8 @@ -415,6 +422,12 @@ const ( EXTA = 0xe EXTB = 0xf EXTPROC = 0x10000 + FALLOC_FL_COLLAPSE_RANGE = 0x8 + FALLOC_FL_INSERT_RANGE = 0x20 + FALLOC_FL_KEEP_SIZE = 0x1 + FALLOC_FL_NO_HIDE_STALE = 0x4 + FALLOC_FL_PUNCH_HOLE = 0x2 + FALLOC_FL_ZERO_RANGE = 0x10 FD_CLOEXEC = 0x1 FD_SETSIZE = 0x400 FF0 = 0x0 @@ -1511,6 +1524,10 @@ const ( SO_TIMESTAMPNS = 0x21 SO_TYPE = 0x1008 SO_WIFI_STATUS = 0x25 + SPLICE_F_GIFT = 0x8 + SPLICE_F_MORE = 0x4 + SPLICE_F_MOVE = 0x1 + SPLICE_F_NONBLOCK = 0x2 S_BLKSIZE = 0x200 S_IEXEC = 0x40 S_IFBLK = 0x6000 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go index 031034a345..e48f4a5c1c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go +// mksyscall.pl -l32 -tags darwin,386 syscall_bsd.go syscall_darwin.go syscall_darwin_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build 386,darwin +// +build darwin,386 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -307,7 +305,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -333,7 +330,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -349,7 +345,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -365,7 +360,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -381,7 +375,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -397,7 +390,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -449,8 +441,6 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { return } _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -727,7 +717,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -748,8 +737,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -775,7 +762,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -791,7 +777,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -807,7 +792,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -823,7 +807,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -907,7 +890,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -924,7 +906,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -998,7 +979,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1020,8 +1000,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1037,7 +1015,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1053,7 +1030,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1120,7 +1096,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1227,7 +1202,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1243,7 +1217,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1264,8 +1237,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1291,7 +1262,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1315,7 +1285,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1331,7 +1300,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1347,7 +1315,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index ee96f78bad..672ada0e44 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go +// mksyscall.pl -tags darwin,amd64 syscall_bsd.go syscall_darwin.go syscall_darwin_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build amd64,darwin +// +build darwin,amd64 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -307,7 +305,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -333,7 +330,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -349,7 +345,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -365,7 +360,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -381,7 +375,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -397,7 +390,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -449,8 +441,6 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { return } _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -727,7 +717,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -748,8 +737,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -775,7 +762,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -791,7 +777,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -807,7 +792,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -823,7 +807,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -907,7 +890,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -924,7 +906,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -998,7 +979,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1020,8 +1000,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1037,7 +1015,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1053,7 +1030,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1120,7 +1096,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1227,7 +1202,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1243,7 +1217,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1264,8 +1237,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1291,7 +1262,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1315,7 +1285,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1331,7 +1300,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1347,7 +1315,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1423,7 +1390,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go index e52cd0d54c..d516409dbe 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go +// mksyscall.pl -l32 -tags darwin,arm syscall_bsd.go syscall_darwin.go syscall_darwin_arm.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build arm,darwin +// +build darwin,arm package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -307,7 +305,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -333,7 +330,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -349,7 +345,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -365,7 +360,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -381,7 +375,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -397,7 +390,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -449,8 +441,6 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { return } _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -558,7 +548,7 @@ func Fsync(fd int) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { - _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), 0) + _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } @@ -727,7 +717,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -748,8 +737,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -775,7 +762,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -791,7 +777,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -807,7 +792,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -823,7 +807,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -907,7 +890,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -924,7 +906,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -941,7 +922,7 @@ func Pread(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := Syscall6(SYS_PREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -958,7 +939,7 @@ func Pwrite(fd int, p []byte, offset int64) (n int, err error) { } else { _p0 = unsafe.Pointer(&_zero) } - r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), 0, 0) + r0, _, e1 := Syscall6(SYS_PWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(offset), uintptr(offset>>32), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -998,7 +979,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1020,8 +1000,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1037,7 +1015,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1053,7 +1030,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1063,8 +1039,8 @@ func Rmdir(path string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { - r0, _, e1 := Syscall(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(whence)) - newoffset = int64(r0) + r0, r1, e1 := Syscall6(SYS_LSEEK, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(whence), 0, 0) + newoffset = int64(int64(r1)<<32 | int64(r0)) if e1 != 0 { err = errnoErr(e1) } @@ -1120,7 +1096,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1227,7 +1202,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1243,7 +1217,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1264,8 +1237,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1290,8 +1261,7 @@ func Truncate(path string, length int64) (err error) { if err != nil { return } - _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) + _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) if e1 != 0 { err = errnoErr(e1) } @@ -1315,7 +1285,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1331,7 +1300,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1347,7 +1315,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1374,7 +1341,7 @@ func write(fd int, p []byte) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := Syscall6(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) + r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 9863ef99e3..e97759c357 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go +// mksyscall.pl -tags darwin,arm64 syscall_bsd.go syscall_darwin.go syscall_darwin_arm64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build arm64,darwin +// +build darwin,arm64 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -307,7 +305,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -333,7 +330,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -349,7 +345,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -365,7 +360,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -381,7 +375,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -397,7 +390,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -449,8 +441,6 @@ func Exchangedata(path1 string, path2 string, options int) (err error) { return } _, _, e1 := Syscall(SYS_EXCHANGEDATA, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(options)) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -727,7 +717,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -748,8 +737,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -775,7 +762,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -791,7 +777,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -807,7 +792,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -823,7 +807,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -907,7 +890,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -924,7 +906,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -998,7 +979,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1020,8 +1000,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1037,7 +1015,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1053,7 +1030,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1120,7 +1096,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1227,7 +1202,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1243,7 +1217,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1264,8 +1237,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1291,7 +1262,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1315,7 +1285,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1331,7 +1300,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1347,7 +1315,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go index 78de48dcf3..3e9d82a27e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go @@ -1,7 +1,7 @@ -// mksyscall.pl -dragonfly syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go +// mksyscall.pl -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build amd64,dragonfly +// +build dragonfly,amd64 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -321,7 +319,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -347,7 +344,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -363,7 +359,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -379,7 +374,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +389,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -411,7 +404,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -739,7 +731,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -760,8 +751,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -787,7 +776,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -803,7 +791,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -819,7 +806,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -835,7 +821,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -929,7 +914,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -946,7 +930,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -986,7 +969,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1008,8 +990,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1025,7 +1005,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1041,7 +1020,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1108,7 +1086,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1225,7 +1202,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1241,7 +1217,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1262,8 +1237,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1289,7 +1262,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1313,7 +1285,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1329,7 +1300,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1345,7 +1315,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go index fade994dcf..f53801ceef 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go +// mksyscall.pl -l32 -tags freebsd,386 syscall_bsd.go syscall_freebsd.go syscall_freebsd_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build 386,freebsd +// +build freebsd,386 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -287,7 +285,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -313,7 +310,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -329,7 +325,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -345,7 +340,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -361,7 +355,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -377,7 +370,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -431,7 +423,6 @@ func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbyt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -448,7 +439,6 @@ func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbyt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -465,7 +455,6 @@ func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -497,8 +486,6 @@ func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -520,8 +507,6 @@ func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -543,8 +528,6 @@ func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err err return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -560,7 +543,6 @@ func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) ( return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -582,8 +564,6 @@ func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -605,8 +585,6 @@ func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -628,8 +606,6 @@ func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err err return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -645,7 +621,6 @@ func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) ( return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -946,7 +921,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -967,8 +941,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -994,7 +966,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1010,7 +981,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1026,7 +996,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1042,7 +1011,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1136,7 +1104,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1153,7 +1120,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1227,7 +1193,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1249,8 +1214,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1266,7 +1229,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1282,7 +1244,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1349,7 +1310,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1466,7 +1426,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1482,7 +1441,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1503,8 +1461,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1530,7 +1486,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1554,7 +1509,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1570,7 +1524,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1586,7 +1539,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go index c28281e83e..55b07412cb 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go +// mksyscall.pl -tags freebsd,amd64 syscall_bsd.go syscall_freebsd.go syscall_freebsd_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build amd64,freebsd +// +build freebsd,amd64 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -287,7 +285,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -313,7 +310,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -329,7 +325,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -345,7 +340,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -361,7 +355,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -377,7 +370,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -431,7 +423,6 @@ func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbyt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -448,7 +439,6 @@ func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbyt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -465,7 +455,6 @@ func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -497,8 +486,6 @@ func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -520,8 +507,6 @@ func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -543,8 +528,6 @@ func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err err return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -560,7 +543,6 @@ func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) ( return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -582,8 +564,6 @@ func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -605,8 +585,6 @@ func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -628,8 +606,6 @@ func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err err return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -645,7 +621,6 @@ func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) ( return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -946,7 +921,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -967,8 +941,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -994,7 +966,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1010,7 +981,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1026,7 +996,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1042,7 +1011,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1136,7 +1104,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1153,7 +1120,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1227,7 +1193,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1249,8 +1214,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1266,7 +1229,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1282,7 +1244,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1349,7 +1310,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1466,7 +1426,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1482,7 +1441,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1503,8 +1461,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1530,7 +1486,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1554,7 +1509,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1570,7 +1524,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1586,7 +1539,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go index a18ba5c88b..0e9b42bf4f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 -arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go +// mksyscall.pl -l32 -arm -tags freebsd,arm syscall_bsd.go syscall_freebsd.go syscall_freebsd_arm.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build arm,freebsd +// +build freebsd,arm package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -287,7 +285,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -313,7 +310,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -329,7 +325,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -345,7 +340,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -361,7 +355,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -377,7 +370,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -431,7 +423,6 @@ func ExtattrGetFd(fd int, attrnamespace int, attrname string, data uintptr, nbyt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -448,7 +439,6 @@ func ExtattrSetFd(fd int, attrnamespace int, attrname string, data uintptr, nbyt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -465,7 +455,6 @@ func ExtattrDeleteFd(fd int, attrnamespace int, attrname string) (err error) { return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FD, uintptr(fd), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p0))) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -497,8 +486,6 @@ func ExtattrGetFile(file string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -520,8 +507,6 @@ func ExtattrSetFile(file string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -543,8 +528,6 @@ func ExtattrDeleteFile(file string, attrnamespace int, attrname string) (err err return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -560,7 +543,6 @@ func ExtattrListFile(file string, attrnamespace int, data uintptr, nbytes int) ( return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_FILE, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -582,8 +564,6 @@ func ExtattrGetLink(link string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_GET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -605,8 +585,6 @@ func ExtattrSetLink(link string, attrnamespace int, attrname string, data uintpt return } r0, _, e1 := Syscall6(SYS_EXTATTR_SET_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1)), uintptr(data), uintptr(nbytes), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -628,8 +606,6 @@ func ExtattrDeleteLink(link string, attrnamespace int, attrname string) (err err return } _, _, e1 := Syscall(SYS_EXTATTR_DELETE_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -645,7 +621,6 @@ func ExtattrListLink(link string, attrnamespace int, data uintptr, nbytes int) ( return } r0, _, e1 := Syscall6(SYS_EXTATTR_LIST_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(attrnamespace), uintptr(data), uintptr(nbytes), 0, 0) - use(unsafe.Pointer(_p0)) ret = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -946,7 +921,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -967,8 +941,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -994,7 +966,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1010,7 +981,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1026,7 +996,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1042,7 +1011,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1136,7 +1104,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1153,7 +1120,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1227,7 +1193,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -1249,8 +1214,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1266,7 +1229,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1282,7 +1244,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1349,7 +1310,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1466,7 +1426,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1482,7 +1441,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1503,8 +1461,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1530,7 +1486,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1554,7 +1509,6 @@ func Undelete(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1570,7 +1524,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1586,7 +1539,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index fa92387b1a..a01725b8ed 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 syscall_linux.go syscall_linux_386.go +// mksyscall.pl -l32 -tags linux,386 syscall_linux.go syscall_linux_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build 386,linux +// +build linux,386 package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1351,7 +1317,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1367,7 +1332,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1499,7 +1463,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1525,7 +1488,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), uintptr(length), uintptr(length>>32)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1652,7 +1614,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index b34d5c26f0..1c1b25e675 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_linux.go syscall_linux_amd64.go +// mksyscall.pl -tags linux,amd64 syscall_linux.go syscall_linux_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build amd64,linux +// +build linux,amd64 package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1368,7 +1334,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1394,7 +1359,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1578,7 +1542,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1594,7 +1557,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1620,7 +1582,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1826,7 +1787,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index 2e5cb39845..2359fd715b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 -arm syscall_linux.go syscall_linux_arm.go +// mksyscall.pl -l32 -arm -tags linux,arm syscall_linux.go syscall_linux_arm.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build arm,linux +// +build linux,arm package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1480,7 +1446,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN32, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1506,7 +1471,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1625,7 +1589,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1712,7 +1675,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 0d584cc0de..c3dbcad4b0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_linux.go syscall_linux_arm64.go +// mksyscall.pl -tags linux,arm64 syscall_linux.go syscall_linux_arm64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build arm64,linux +// +build linux,arm64 package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1255,7 +1221,6 @@ func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1501,7 +1466,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1527,7 +1491,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index a18e0b1712..3fd164a9d9 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -1,7 +1,7 @@ -// mksyscall.pl -b32 -arm syscall_linux.go syscall_linux_mipsx.go +// mksyscall.pl -b32 -arm -tags linux,mips syscall_linux.go syscall_linux_mipsx.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build mips,linux +// +build linux,mips package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1280,7 +1246,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1453,7 +1418,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length>>32), uintptr(length), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1700,7 +1664,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1726,7 +1689,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1742,7 +1704,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index bf6f3603ba..a26cad4139 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_linux.go syscall_linux_mips64x.go +// mksyscall.pl -tags linux,mips64 syscall_linux.go syscall_linux_mips64x.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build mips64,linux +// +build linux,mips64 package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1307,7 +1273,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1501,7 +1466,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1527,7 +1491,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1743,7 +1706,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1779,7 +1741,6 @@ func lstat(path string, st *stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1795,7 +1756,6 @@ func stat(path string, st *stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index 8c86bd70b3..7cc92ad484 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_linux.go syscall_linux_mips64x.go +// mksyscall.pl -tags linux,mips64le syscall_linux.go syscall_linux_mips64x.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build mips64le,linux +// +build linux,mips64le package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1307,7 +1273,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1501,7 +1466,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1527,7 +1491,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1743,7 +1706,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1779,7 +1741,6 @@ func lstat(path string, st *stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1795,7 +1756,6 @@ func stat(path string, st *stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(st)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index 645e00ebd6..79f26e5b21 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 -arm syscall_linux.go syscall_linux_mipsx.go +// mksyscall.pl -l32 -arm -tags linux,mipsle syscall_linux.go syscall_linux_mipsx.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build mipsle,linux +// +build linux,mipsle package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1280,7 +1246,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1453,7 +1418,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall6(SYS_TRUNCATE64, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1700,7 +1664,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1726,7 +1689,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1742,7 +1704,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index f5d488b4a5..27befca49c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_linux.go syscall_linux_ppc64x.go +// mksyscall.pl -tags linux,ppc64 syscall_linux.go syscall_linux_ppc64x.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build ppc64,linux +// +build linux,ppc64 package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1358,7 +1324,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1384,7 +1349,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1568,7 +1532,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1584,7 +1547,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1610,7 +1572,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1837,7 +1798,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index 5183711ec8..0dc288e23e 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_linux.go syscall_linux_ppc64x.go +// mksyscall.pl -tags linux,ppc64le syscall_linux.go syscall_linux_ppc64x.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build ppc64le,linux +// +build linux,ppc64le package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1358,7 +1324,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1384,7 +1349,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1568,7 +1532,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1584,7 +1547,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1610,7 +1572,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1837,7 +1798,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index 4c7ed08cc4..33c086b5ef 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -1,7 +1,7 @@ -// mksyscall.pl syscall_linux.go syscall_linux_s390x.go +// mksyscall.pl -tags linux,s390x syscall_linux.go syscall_linux_s390x.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build s390x,linux +// +build linux,s390x package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1348,7 +1314,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1364,7 +1329,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1538,7 +1502,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1554,7 +1517,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1580,7 +1542,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1627,7 +1588,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index beb83e4fdc..071b85c93a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -1,7 +1,7 @@ // mksyscall.pl syscall_linux.go syscall_linux_sparc64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build sparc64,linux +// +build package unix @@ -26,8 +26,6 @@ func Linkat(olddirfd int, oldpath string, newdirfd int, newpath string, flags in return } _, _, e1 := Syscall6(SYS_LINKAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -43,7 +41,6 @@ func openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := Syscall6(SYS_OPENAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -77,7 +74,6 @@ func Readlinkat(dirfd int, path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_READLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf)), 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -99,8 +95,6 @@ func Symlinkat(oldpath string, newdirfd int, newpath string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINKAT, uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1))) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -116,7 +110,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNLINKAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -132,7 +125,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -148,7 +140,6 @@ func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -212,7 +203,6 @@ func reboot(magic1 uint, magic2 uint, cmd int, arg string) (err error) { return } _, _, e1 := Syscall6(SYS_REBOOT, uintptr(magic1), uintptr(magic2), uintptr(cmd), uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -238,9 +228,6 @@ func mount(source string, target string, fstype string, flags uintptr, data *byt return } _, _, e1 := Syscall6(SYS_MOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(unsafe.Pointer(_p2)), uintptr(flags), uintptr(unsafe.Pointer(data)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) - use(unsafe.Pointer(_p2)) if e1 != 0 { err = errnoErr(e1) } @@ -256,7 +243,6 @@ func Acct(path string) (err error) { return } _, _, e1 := Syscall(SYS_ACCT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -283,7 +269,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -299,7 +284,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -395,7 +379,6 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FACCESSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -441,7 +424,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -457,7 +439,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := Syscall6(SYS_FCHOWNAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -609,8 +590,6 @@ func Getxattr(path string, attr string, dest []byte) (sz int, err error) { _p2 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(dest)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -627,7 +606,6 @@ func InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err e return } r0, _, e1 := Syscall(SYS_INOTIFY_ADD_WATCH, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(mask)) - use(unsafe.Pointer(_p0)) watchdesc = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -699,7 +677,6 @@ func Listxattr(path string, dest []byte) (sz int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_LISTXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(dest))) - use(unsafe.Pointer(_p0)) sz = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -716,7 +693,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIRAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -732,7 +708,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall6(SYS_MKNODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -763,8 +738,6 @@ func PivotRoot(newroot string, putold string) (err error) { return } _, _, e1 := Syscall(SYS_PIVOT_ROOT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -822,8 +795,6 @@ func Removexattr(path string, attr string) (err error) { return } _, _, e1 := Syscall(SYS_REMOVEXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -844,8 +815,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := Syscall6(SYS_RENAMEAT, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -955,8 +924,6 @@ func Setxattr(path string, attr string, data []byte, flags int) (err error) { _p2 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SETXATTR, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(_p2), uintptr(len(data)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1039,7 +1006,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UMOUNT2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1338,7 +1304,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1364,7 +1329,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1548,7 +1512,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1564,7 +1527,6 @@ func Statfs(path string, buf *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1590,7 +1552,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1806,7 +1767,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := Syscall(SYS_UTIME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go index b16e1d0ee3..3182345ece 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 -netbsd syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go +// mksyscall.pl -l32 -netbsd -tags netbsd,386 syscall_bsd.go syscall_netbsd.go syscall_netbsd_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build 386,netbsd +// +build netbsd,386 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -304,7 +302,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -330,7 +327,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -346,7 +342,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -362,7 +357,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -378,7 +372,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -394,7 +387,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -687,7 +679,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -708,8 +699,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -735,7 +724,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -751,7 +739,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -767,7 +754,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -783,7 +769,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -877,7 +862,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -894,7 +878,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -968,7 +951,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -990,8 +972,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1007,7 +987,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1023,7 +1002,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1171,7 +1149,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1192,8 +1169,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1219,7 +1194,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1243,7 +1217,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1259,7 +1232,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go index b63667da9c..74ba8189a5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go @@ -1,7 +1,7 @@ -// mksyscall.pl -netbsd syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go +// mksyscall.pl -netbsd -tags netbsd,amd64 syscall_bsd.go syscall_netbsd.go syscall_netbsd_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build amd64,netbsd +// +build netbsd,amd64 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -304,7 +302,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -330,7 +327,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -346,7 +342,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -362,7 +357,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -378,7 +372,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -394,7 +387,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -687,7 +679,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -708,8 +699,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -735,7 +724,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -751,7 +739,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -767,7 +754,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -783,7 +769,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -877,7 +862,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -894,7 +878,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -968,7 +951,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -990,8 +972,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1007,7 +987,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1023,7 +1002,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1171,7 +1149,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1192,8 +1169,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1219,7 +1194,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1243,7 +1217,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1259,7 +1232,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go index b0d19038d2..1f346e2f52 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 -arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go +// mksyscall.pl -l32 -arm -tags netbsd,arm syscall_bsd.go syscall_netbsd.go syscall_netbsd_arm.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build arm,netbsd +// +build netbsd,arm package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -304,7 +302,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -330,7 +327,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -346,7 +342,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -362,7 +357,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -378,7 +372,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -394,7 +387,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -687,7 +679,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -708,8 +699,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -735,7 +724,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -751,7 +739,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -767,7 +754,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -783,7 +769,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -877,7 +862,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -894,7 +878,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -968,7 +951,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -990,8 +972,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1007,7 +987,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1023,7 +1002,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1171,7 +1149,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1192,8 +1169,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1219,7 +1194,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1243,7 +1217,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1259,7 +1232,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index f91a5b8564..ca3e813926 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1,7 +1,7 @@ -// mksyscall.pl -l32 -openbsd syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go +// mksyscall.pl -l32 -openbsd -tags openbsd,386 syscall_bsd.go syscall_openbsd.go syscall_openbsd_386.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build 386,openbsd +// +build openbsd,386 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -302,7 +300,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -328,7 +325,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -344,7 +340,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -360,7 +355,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -376,7 +370,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -392,7 +385,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -695,7 +687,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -716,8 +707,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -743,7 +732,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -759,7 +747,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -775,7 +762,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -791,7 +777,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -885,7 +870,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -902,7 +886,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -976,7 +959,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -998,8 +980,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1015,7 +995,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1031,7 +1010,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1098,7 +1076,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1215,7 +1192,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1231,7 +1207,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1252,8 +1227,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1279,7 +1252,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall6(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length), uintptr(length>>32), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1303,7 +1275,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1319,7 +1290,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index 2e8d59d724..bf63d552ed 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1,7 +1,7 @@ -// mksyscall.pl -openbsd syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go +// mksyscall.pl -openbsd -tags openbsd,amd64 syscall_bsd.go syscall_openbsd.go syscall_openbsd_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build amd64,openbsd +// +build openbsd,amd64 package unix @@ -222,7 +222,6 @@ func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) - use(_p0) if e1 != 0 { err = errnoErr(e1) } @@ -238,7 +237,6 @@ func utimes(path string, timeval *[2]Timeval) (err error) { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -302,7 +300,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -328,7 +325,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -344,7 +340,6 @@ func Chflags(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -360,7 +355,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -376,7 +370,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -392,7 +385,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -695,7 +687,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -716,8 +707,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -743,7 +732,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -759,7 +747,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -775,7 +762,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -791,7 +777,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -885,7 +870,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -902,7 +886,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -976,7 +959,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = errnoErr(e1) @@ -998,8 +980,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1015,7 +995,6 @@ func Revoke(path string) (err error) { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1031,7 +1010,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1098,7 +1076,6 @@ func Setlogin(name string) (err error) { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1215,7 +1192,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1231,7 +1207,6 @@ func Statfs(path string, stat *Statfs_t) (err error) { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1252,8 +1227,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = errnoErr(e1) } @@ -1279,7 +1252,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1303,7 +1275,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } @@ -1319,7 +1290,6 @@ func Unmount(path string, flags int) (err error) { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index c0ecfc044a..bdf140b180 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -1,7 +1,7 @@ -// mksyscall_solaris.pl syscall_solaris.go syscall_solaris_amd64.go +// mksyscall_solaris.pl -tags solaris,amd64 syscall_solaris.go syscall_solaris_amd64.go // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT -// +build amd64,solaris +// +build solaris,amd64 package unix @@ -442,7 +442,6 @@ func utimes(path string, times *[2]Timeval) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimes)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -456,7 +455,6 @@ func utimensat(fd int, path string, times *[2]Timespec, flag int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procutimensat)), 4, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flag), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -530,7 +528,6 @@ func Access(path string, mode uint32) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procAccess)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -552,7 +549,6 @@ func Chdir(path string) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -566,7 +562,6 @@ func Chmod(path string, mode uint32) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChmod)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -580,7 +575,6 @@ func Chown(path string, uid int, gid int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -594,7 +588,6 @@ func Chroot(path string) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procChroot)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -616,7 +609,6 @@ func Creat(path string, mode uint32) (fd int, err error) { return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procCreat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = e1 @@ -669,7 +661,6 @@ func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchmodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -691,7 +682,6 @@ func Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procFchownat)), 5, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), uintptr(flags), 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -838,7 +828,6 @@ func Lchown(path string, uid int, gid int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLchown)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid), 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -857,8 +846,6 @@ func Link(path string, link string) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = e1 } @@ -880,7 +867,6 @@ func Lstat(path string, stat *Stat_t) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procLstat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -906,7 +892,6 @@ func Mkdir(path string, mode uint32) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdir)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -920,7 +905,6 @@ func Mkdirat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkdirat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -934,7 +918,6 @@ func Mkfifo(path string, mode uint32) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifo)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -948,7 +931,6 @@ func Mkfifoat(dirfd int, path string, mode uint32) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMkfifoat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -962,7 +944,6 @@ func Mknod(path string, mode uint32, dev int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknod)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -976,7 +957,6 @@ func Mknodat(dirfd int, path string, mode uint32, dev int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procMknodat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev), 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -1050,7 +1030,6 @@ func Open(path string, mode int, perm uint32) (fd int, err error) { return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpen)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm), 0, 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = e1 @@ -1065,7 +1044,6 @@ func Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error) return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procOpenat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), uintptr(mode), 0, 0) - use(unsafe.Pointer(_p0)) fd = int(r0) if e1 != 0 { err = e1 @@ -1080,7 +1058,6 @@ func Pathconf(path string, name int) (val int, err error) { return } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procPathconf)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) val = int(r0) if e1 != 0 { err = e1 @@ -1146,7 +1123,6 @@ func Readlink(path string, buf []byte) (n int, err error) { _p1 = &buf[0] } r0, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procReadlink)), 3, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), uintptr(len(buf)), 0, 0, 0) - use(unsafe.Pointer(_p0)) n = int(r0) if e1 != 0 { err = e1 @@ -1166,8 +1142,6 @@ func Rename(from string, to string) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRename)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = e1 } @@ -1186,8 +1160,6 @@ func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err e return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRenameat)), 4, uintptr(olddirfd), uintptr(unsafe.Pointer(_p0)), uintptr(newdirfd), uintptr(unsafe.Pointer(_p1)), 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = e1 } @@ -1201,7 +1173,6 @@ func Rmdir(path string) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procRmdir)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -1325,7 +1296,6 @@ func Stat(path string, stat *Stat_t) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procStat)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -1344,8 +1314,6 @@ func Symlink(path string, link string) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procSymlink)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) - use(unsafe.Pointer(_p1)) if e1 != 0 { err = e1 } @@ -1376,7 +1344,6 @@ func Truncate(path string, length int64) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procTruncate)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(length), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -1420,7 +1387,6 @@ func Unmount(target string, flags int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procumount)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -1434,7 +1400,6 @@ func Unlink(path string) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlink)), 1, uintptr(unsafe.Pointer(_p0)), 0, 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -1448,7 +1413,6 @@ func Unlinkat(dirfd int, path string, flags int) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUnlinkat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } @@ -1470,7 +1434,6 @@ func Utime(path string, buf *Utimbuf) (err error) { return } _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&procUtime)), 2, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0) - use(unsafe.Pointer(_p0)) if e1 != 0 { err = e1 } diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index a3631053c7..29b9bf3353 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -210,6 +210,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -334,6 +342,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index 0573e6cd24..b72cf8ee80 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -212,6 +212,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -338,6 +346,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 0578b53964..d5c8bb67b5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -214,6 +214,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -338,6 +346,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 808e04669a..24bd089487 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -213,6 +213,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -339,6 +347,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 2eaff573d0..c5a41ab2d5 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -213,6 +213,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -336,6 +344,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 73e4b76c0c..3947c44258 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -213,6 +213,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -338,6 +346,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 479ca3e1b8..de8f9c4745 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -213,6 +213,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -338,6 +346,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 7617a69d02..5a8957f174 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -213,6 +213,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -336,6 +344,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 2db548b905..4b8752944f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -214,6 +214,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -340,6 +348,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 4bfdcc0aca..40d51d9707 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -214,6 +214,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]uint8 @@ -340,6 +348,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index 435cd792f8..13f6ea0061 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -213,6 +213,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -338,6 +346,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 439f96914f..31a97b3c99 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -218,6 +218,14 @@ type RawSockaddrCAN struct { Addr [8]byte } +type RawSockaddrALG struct { + Family uint16 + Type [14]uint8 + Feat uint32 + Mask uint32 + Name [64]uint8 +} + type RawSockaddr struct { Family uint16 Data [14]int8 @@ -343,6 +351,7 @@ const ( SizeofSockaddrNetlink = 0xc SizeofSockaddrHCI = 0x6 SizeofSockaddrCAN = 0x10 + SizeofSockaddrALG = 0x58 SizeofLinger = 0x8 SizeofIPMreq = 0x8 SizeofIPMreqn = 0xc diff --git a/vendor/google.golang.org/api/gensupport/header.go b/vendor/google.golang.org/api/gensupport/header.go new file mode 100644 index 0000000000..cb5e67c77a --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/header.go @@ -0,0 +1,22 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "fmt" + "runtime" + "strings" +) + +// GoogleClientHeader returns the value to use for the x-goog-api-client +// header, which is used internally by Google. +func GoogleClientHeader(generatorVersion, clientElement string) string { + elts := []string{"gl-go/" + strings.Replace(runtime.Version(), " ", "_", -1)} + if clientElement != "" { + elts = append(elts, clientElement) + } + elts = append(elts, fmt.Sprintf("gdcl/%s", generatorVersion)) + return strings.Join(elts, " ") +} diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go index 0f1d094a77..849d52f9b0 100644 --- a/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -78,9 +78,10 @@ func New(client *http.Client) (*Service, error) { } type Service struct { - client *http.Client - BasePath string // API endpoint base URL - UserAgent string // optional additional User-Agent fragment + client *http.Client + BasePath string // API endpoint base URL + UserAgent string // optional additional User-Agent fragment + GoogleClientHeaderElement string // client header fragment, for Google use only BucketAccessControls *BucketAccessControlsService @@ -102,6 +103,10 @@ func (s *Service) userAgent() string { return googleapi.UserAgent + " " + s.UserAgent } +func (s *Service) clientHeader() string { + return gensupport.GoogleClientHeader("20170210", s.GoogleClientHeaderElement) +} + func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService { rs := &BucketAccessControlsService{s: s} return rs @@ -1438,6 +1443,7 @@ func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}") @@ -1556,6 +1562,7 @@ func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, err reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -1693,6 +1700,7 @@ func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) if err != nil { @@ -1836,6 +1844,7 @@ func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, er reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -1968,6 +1977,7 @@ func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, e reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) if err != nil { @@ -2112,6 +2122,7 @@ func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol) if err != nil { @@ -2268,6 +2279,7 @@ func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}") @@ -2417,6 +2429,7 @@ func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -2625,6 +2638,7 @@ func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket) if err != nil { @@ -2851,6 +2865,7 @@ func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -3101,6 +3116,7 @@ func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) if err != nil { @@ -3370,6 +3386,7 @@ func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2) if err != nil { @@ -3567,6 +3584,7 @@ func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) if err != nil { @@ -3664,6 +3682,7 @@ func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Res reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}") @@ -3782,6 +3801,7 @@ func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Respon reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -3920,6 +3940,7 @@ func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Res reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) if err != nil { @@ -4080,6 +4101,7 @@ func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Respo reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -4224,6 +4246,7 @@ func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Resp reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) if err != nil { @@ -4368,6 +4391,7 @@ func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Res reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) if err != nil { @@ -4521,6 +4545,7 @@ func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}") @@ -4663,6 +4688,7 @@ func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, err reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -4824,6 +4850,7 @@ func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) if err != nil { @@ -4991,6 +5018,7 @@ func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, er reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -5147,6 +5175,7 @@ func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, e reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) if err != nil { @@ -5315,6 +5344,7 @@ func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol) if err != nil { @@ -5511,6 +5541,7 @@ func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest) if err != nil { @@ -5823,6 +5854,7 @@ func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) if err != nil { @@ -6131,6 +6163,7 @@ func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil c.urlParams_.Set("alt", alt) urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}") @@ -6331,6 +6364,7 @@ func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -6673,6 +6707,7 @@ func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) if err != nil { @@ -7005,6 +7040,7 @@ func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) if c.ifNoneMatch_ != "" { reqHeaders.Set("If-None-Match", c.ifNoneMatch_) } @@ -7274,6 +7310,7 @@ func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) if err != nil { @@ -7623,6 +7660,7 @@ func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.object) if err != nil { @@ -7955,6 +7993,7 @@ func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2) if err != nil { @@ -8233,6 +8272,7 @@ func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders[k] = v } reqHeaders.Set("User-Agent", c.s.userAgent()) + reqHeaders.Set("x-goog-api-client", c.s.clientHeader()) var body io.Reader = nil body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) if err != nil { diff --git a/vendor/google.golang.org/grpc/call.go b/vendor/google.golang.org/grpc/call.go index ba17721901..81b52be294 100644 --- a/vendor/google.golang.org/grpc/call.go +++ b/vendor/google.golang.org/grpc/call.go @@ -42,6 +42,7 @@ import ( "golang.org/x/net/context" "golang.org/x/net/trace" "google.golang.org/grpc/codes" + "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/transport" ) @@ -85,6 +86,9 @@ func recvResponse(ctx context.Context, dopts dialOptions, t transport.ClientTran dopts.copts.StatsHandler.HandleRPC(ctx, inPayload) } c.trailerMD = stream.Trailer() + if peer, ok := peer.FromContext(stream.Context()); ok { + c.peer = peer + } return nil } diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index 146166a738..459ce0b641 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -263,6 +263,15 @@ func WithStreamInterceptor(f StreamClientInterceptor) DialOption { } } +// WithAuthority returns a DialOption that specifies the value to be used as +// the :authority pseudo-header. This value only works with WithInsecure and +// has no effect if TransportCredentials are present. +func WithAuthority(a string) DialOption { + return func(o *dialOptions) { + o.copts.Authority = a + } +} + // Dial creates a client connection to the given target. func Dial(target string, opts ...DialOption) (*ClientConn, error) { return DialContext(context.Background(), target, opts...) @@ -321,6 +330,8 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * creds := cc.dopts.copts.TransportCredentials if creds != nil && creds.Info().ServerName != "" { cc.authority = creds.Info().ServerName + } else if cc.dopts.insecure && cc.dopts.copts.Authority != "" { + cc.authority = cc.dopts.copts.Authority } else { colonPos := strings.LastIndex(target, ":") if colonPos == -1 { diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index 65dc5af57d..7332395028 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -32,6 +32,7 @@ */ // Package metadata define the structure of the metadata supported by gRPC library. +// Please refer to http://www.grpc.io/docs/guides/wire.html for more information about custom-metadata. package metadata // import "google.golang.org/grpc/metadata" import ( @@ -82,6 +83,7 @@ func DecodeKeyValue(k, v string) (string, string, error) { type MD map[string][]string // New creates a MD from given key-value map. +// Keys are automatically converted to lowercase. And for keys having "-bin" as suffix, their values will be applied Base64 encoding. func New(m map[string]string) MD { md := MD{} for k, v := range m { @@ -93,6 +95,7 @@ func New(m map[string]string) MD { // Pairs returns an MD formed by the mapping of key, value ... // Pairs panics if len(kv) is odd. +// Keys are automatically converted to lowercase. And for keys having "-bin" as suffix, their values will be appplied Base64 encoding. func Pairs(kv ...string) MD { if len(kv)%2 == 1 { panic(fmt.Sprintf("metadata: Pairs got the odd number of input pairs for metadata: %d", len(kv))) diff --git a/vendor/google.golang.org/grpc/rpc_util.go b/vendor/google.golang.org/grpc/rpc_util.go index fa69d58cb9..d98a88376b 100644 --- a/vendor/google.golang.org/grpc/rpc_util.go +++ b/vendor/google.golang.org/grpc/rpc_util.go @@ -48,6 +48,7 @@ import ( "golang.org/x/net/context" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" "google.golang.org/grpc/stats" "google.golang.org/grpc/transport" ) @@ -140,6 +141,7 @@ type callInfo struct { failFast bool headerMD metadata.MD trailerMD metadata.MD + peer *peer.Peer traceInfo traceInfo // in trace.go } @@ -183,12 +185,20 @@ func Trailer(md *metadata.MD) CallOption { }) } +// Peer returns a CallOption that retrieves peer information for a +// unary RPC. +func Peer(peer *peer.Peer) CallOption { + return afterCall(func(c *callInfo) { + *peer = *c.peer + }) +} + // FailFast configures the action to take when an RPC is attempted on broken // connections or unreachable servers. If failfast is true, the RPC will fail // immediately. Otherwise, the RPC client will block the call until a // connection is available (or the call is canceled or times out) and will retry // the call if it fails due to a transient error. Please refer to -// https://github.com/grpc/grpc/blob/master/doc/fail_fast.md +// https://github.com/grpc/grpc/blob/master/doc/fail_fast.md. Note: failFast is default to true. func FailFast(failFast bool) CallOption { return beforeCall(func(c *callInfo) error { c.failFast = failFast diff --git a/vendor/google.golang.org/grpc/transport/transport.go b/vendor/google.golang.org/grpc/transport/transport.go index d465991823..caee54a801 100644 --- a/vendor/google.golang.org/grpc/transport/transport.go +++ b/vendor/google.golang.org/grpc/transport/transport.go @@ -374,6 +374,9 @@ func NewServerTransport(protocol string, conn net.Conn, config *ServerConfig) (S type ConnectOptions struct { // UserAgent is the application user agent. UserAgent string + // Authority is the :authority pseudo-header to use. This field has no effect if + // TransportCredentials is set. + Authority string // Dialer specifies how to dial a network address. Dialer func(context.Context, string) (net.Conn, error) // FailOnNonTempDialError specifies if gRPC fails on non-temporary dial errors. diff --git a/vendor/gopkg.in/yaml.v2/scannerc.go b/vendor/gopkg.in/yaml.v2/scannerc.go index 25808000f2..2c9d5111f9 100644 --- a/vendor/gopkg.in/yaml.v2/scannerc.go +++ b/vendor/gopkg.in/yaml.v2/scannerc.go @@ -9,7 +9,7 @@ import ( // ************ // // The following notes assume that you are familiar with the YAML specification -// (http://yaml.org/spec/cvs/current.html). We mostly follow it, although in +// (http://yaml.org/spec/1.2/spec.html). We mostly follow it, although in // some cases we are less restrictive that it requires. // // The process of transforming a YAML stream into a sequence of events is diff --git a/vendor/vendor.json b/vendor/vendor.json index ed61078f52..91112a4c60 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -21,26 +21,26 @@ { "checksumSHA1": "ZLRh6zW4/DnVsGpgtt+ZiIaEFKc=", "path": "cloud.google.com/go/compute/metadata", - "revision": "ce650573d812270c64426f3df9fd220324d24b2f", - "revisionTime": "2017-02-02T22:37:47Z" + "revision": "0b87d14d90086b53a97dfbd66f3000f7f112b494", + "revisionTime": "2017-02-16T01:11:53Z" }, { "checksumSHA1": "4iounbuF7SMZdx/MlKSUuhnV848=", "path": "cloud.google.com/go/internal", - "revision": "ce650573d812270c64426f3df9fd220324d24b2f", - "revisionTime": "2017-02-02T22:37:47Z" + "revision": "0b87d14d90086b53a97dfbd66f3000f7f112b494", + "revisionTime": "2017-02-16T01:11:53Z" }, { "checksumSHA1": "W2xJ0+fvugRhRi1PMi64bYofBbU=", "path": "cloud.google.com/go/internal/optional", - "revision": "ce650573d812270c64426f3df9fd220324d24b2f", - "revisionTime": "2017-02-02T22:37:47Z" + "revision": "0b87d14d90086b53a97dfbd66f3000f7f112b494", + "revisionTime": "2017-02-16T01:11:53Z" }, { - "checksumSHA1": "qBDDOQVU1mGqC4sbqo9AEtj5lRc=", + "checksumSHA1": "MJSEDjd8OT7lz9wIemq8zz7R4ok=", "path": "cloud.google.com/go/storage", - "revision": "ce650573d812270c64426f3df9fd220324d24b2f", - "revisionTime": "2017-02-02T22:37:47Z" + "revision": "0b87d14d90086b53a97dfbd66f3000f7f112b494", + "revisionTime": "2017-02-16T01:11:53Z" }, { "checksumSHA1": "rK3ght7KTtHGdm0V4+U7fv9+tUU=", @@ -49,10 +49,10 @@ "revisionTime": "2017-02-08T01:01:20Z" }, { - "checksumSHA1": "+iqm7AOLDPpSck+/LAyvra0Rv98=", + "checksumSHA1": "W/iDPqbPMS1ZDGpXVJIST55OAuY=", "path": "github.com/Jeffail/gabs", - "revision": "235106e63529b2743d680b351fa2677fd496ce1e", - "revisionTime": "2017-01-16T15:24:31Z" + "revision": "ede33bf4edd022d9d8693603bb9af6c1cbadcfae", + "revisionTime": "2017-02-15T20:05:58Z" }, { "checksumSHA1": "t+uej2kiyqRyQYguygI8t9nJH2w=", @@ -115,196 +115,196 @@ "revisionTime": "2017-01-04T21:11:26Z" }, { - "checksumSHA1": "y0Can905NJMOHoJ+MQwb5XrsfLQ=", + "checksumSHA1": "aJVyZtSrQjYG/HuVHOlthf7Ep7A=", "path": "github.com/aws/aws-sdk-go/aws", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "Y9W+4GimK4Fuxq+vyIskVYFRnX4=", "path": "github.com/aws/aws-sdk-go/aws/awserr", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "yyYr41HZ1Aq0hWc3J5ijXwYEcac=", "path": "github.com/aws/aws-sdk-go/aws/awsutil", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { - "checksumSHA1": "7cQU8tU9hBgsG23XZmko1GePqjQ=", + "checksumSHA1": "iThCyNRL/oQFD9CF2SYgBGl+aww=", "path": "github.com/aws/aws-sdk-go/aws/client", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "ieAJ+Cvp/PKv1LpUEnUXpc3OI6E=", "path": "github.com/aws/aws-sdk-go/aws/client/metadata", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "Fl8vRSCY0MbM04cmiz/0MID+goA=", "path": "github.com/aws/aws-sdk-go/aws/corehandlers", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "zu5C95rmCZff6NYZb62lEaT5ibE=", "path": "github.com/aws/aws-sdk-go/aws/credentials", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "u3GOAJLmdvbuNUeUEcZSEAOeL/0=", "path": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "NUJUTWlc1sV8b7WjfiYc4JZbXl0=", "path": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "4Ipx+5xN0gso+cENC2MHMWmQlR4=", "path": "github.com/aws/aws-sdk-go/aws/credentials/stscreds", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "lqh3fG7wCochvB4iHAZJuhhEJW0=", "path": "github.com/aws/aws-sdk-go/aws/defaults", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "/EXbk/z2TWjWc1Hvb4QYs3Wmhb8=", "path": "github.com/aws/aws-sdk-go/aws/ec2metadata", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { - "checksumSHA1": "C06le+qt2NiJ0YoYWl6Cva3KzZ4=", + "checksumSHA1": "JTrzEDPXL3pUUH+dMCixz9T9rLY=", "path": "github.com/aws/aws-sdk-go/aws/endpoints", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "M78rTxU55Qagqr3MYj91im2031E=", "path": "github.com/aws/aws-sdk-go/aws/request", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { - "checksumSHA1": "/qrYhYWKtQA7Rxthy4YP8EnfIn8=", + "checksumSHA1": "bYywgCKzqJQtFsL+XpuVRELYsgw=", "path": "github.com/aws/aws-sdk-go/aws/session", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "0FvPLvkBUpTElfUc/FZtPsJfuV0=", "path": "github.com/aws/aws-sdk-go/aws/signer/v4", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "wk7EyvDaHwb5qqoOP/4d3cV0708=", "path": "github.com/aws/aws-sdk-go/private/protocol", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "1QmQ3FqV37w0Zi44qv8pA1GeR0A=", "path": "github.com/aws/aws-sdk-go/private/protocol/ec2query", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "O6hcK24yI6w7FA+g4Pbr+eQ7pys=", "path": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "R00RL5jJXRYq1iiK1+PGvMfvXyM=", "path": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "ZqY5RWavBLWTo6j9xqdyBEaNFRk=", "path": "github.com/aws/aws-sdk-go/private/protocol/query", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "hqTEmgtchF9SwVTW0IQId2eLUKM=", "path": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "szZSLm3BlYkL3vqlZhNAlYk8iwM=", "path": "github.com/aws/aws-sdk-go/private/protocol/rest", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "ODo+ko8D6unAxZuN1jGzMcN4QCc=", "path": "github.com/aws/aws-sdk-go/private/protocol/restxml", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "lZ1z4xAbT8euCzKoAsnEYic60VE=", "path": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "Eo9yODN5U99BK0pMzoqnBm7PCrY=", "path": "github.com/aws/aws-sdk-go/private/waiter", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "nz8TKu6v2dXW8kvHln2VguNmUuw=", "path": "github.com/aws/aws-sdk-go/service/dynamodb", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "JO4oie1uPoST8lsP4iWbHlOkVZc=", "path": "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { - "checksumSHA1": "uCGLl0X4oRuWBAeM59aTVI/gELs=", + "checksumSHA1": "MCyzbsgz1wWscxzKT9rOLxgTFJQ=", "path": "github.com/aws/aws-sdk-go/service/ec2", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "vtaKEwBXDiWg000PcDBPbnOZEoY=", "path": "github.com/aws/aws-sdk-go/service/iam", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "eEWM4wKzVbRqAwIy3MdMCDUGs2s=", "path": "github.com/aws/aws-sdk-go/service/s3", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "Knj17ZMPWkGYTm2hZxEgnuboMM4=", "path": "github.com/aws/aws-sdk-go/service/sts", - "revision": "b5d549c8b24bf097dc539a63c4f91e6122740e3a", - "revisionTime": "2017-02-08T02:57:25Z" + "revision": "2d3b3bc3aae6a09a9b194aa6eb71326fcbe2e918", + "revisionTime": "2017-02-16T22:28:40Z" }, { "checksumSHA1": "Isa9x3nvIJ12hvgdvUUBty+yplU=", @@ -313,28 +313,28 @@ "revisionTime": "2016-10-13T10:26:35Z" }, { - "checksumSHA1": "R8vLE6DoLZoRjKz+KkdqVvRPmDY=", + "checksumSHA1": "kt/CWQprMoLxtA+ue3cZ3j+v0cY=", "path": "github.com/circonus-labs/circonus-gometrics", - "revision": "fb2909576d0526b70e3efa0ef10737b92f57f15a", - "revisionTime": "2017-02-01T21:08:33Z" + "revision": "61bd3320eb4dbe36c3e5d6b8de6069d719c1d05b", + "revisionTime": "2017-02-09T19:00:14Z" }, { - "checksumSHA1": "oEXgJ7z0zYOadJ43C08mpFU2Oe0=", + "checksumSHA1": "X/XSu5kveuq3fPIeArLqFUQiA9g=", "path": "github.com/circonus-labs/circonus-gometrics/api", - "revision": "fb2909576d0526b70e3efa0ef10737b92f57f15a", - "revisionTime": "2017-02-01T21:08:33Z" + "revision": "61bd3320eb4dbe36c3e5d6b8de6069d719c1d05b", + "revisionTime": "2017-02-09T19:00:14Z" }, { "checksumSHA1": "bQhz/fcyZPmuHSH2qwC4ZtATy5c=", "path": "github.com/circonus-labs/circonus-gometrics/api/config", - "revision": "fb2909576d0526b70e3efa0ef10737b92f57f15a", - "revisionTime": "2017-02-01T21:08:33Z" + "revision": "61bd3320eb4dbe36c3e5d6b8de6069d719c1d05b", + "revisionTime": "2017-02-09T19:00:14Z" }, { "checksumSHA1": "6hvd+YFb1eWFkc3pVcnOPPa2OVw=", "path": "github.com/circonus-labs/circonus-gometrics/checkmgr", - "revision": "fb2909576d0526b70e3efa0ef10737b92f57f15a", - "revisionTime": "2017-02-01T21:08:33Z" + "revision": "61bd3320eb4dbe36c3e5d6b8de6069d719c1d05b", + "revisionTime": "2017-02-09T19:00:14Z" }, { "checksumSHA1": "VbfeVqeOM+dTNxCmpvmYS0LwQn0=", @@ -345,86 +345,86 @@ { "checksumSHA1": "7uspQtEpYuBxaxrBTcxa+ZfiuJo=", "path": "github.com/coreos/etcd/auth/authpb", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "Zgqp9pp3G4cSZbepa6tzhNeHZOI=", "path": "github.com/coreos/etcd/client", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { - "checksumSHA1": "7ZPGsN6he3ThvRBxtday3T/uyes=", + "checksumSHA1": "W6XuZi6mVb4FoR+L0A1z+6HqQKo=", "path": "github.com/coreos/etcd/clientv3", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "tHT9JXi1O4YtDEJJTPMDwtyf8lQ=", "path": "github.com/coreos/etcd/clientv3/concurrency", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "lY/Ca8yCqHV9cv0BQU88br59VeI=", "path": "github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { - "checksumSHA1": "KtZXQeJEDvaMXiqxG1DKUw+BdJ8=", + "checksumSHA1": "LYsCyIHMs+etSiWMrtKwQT5LOpU=", "path": "github.com/coreos/etcd/etcdserver/etcdserverpb", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "PAnQN6F8iZuIfu9HHOORyVFaaOA=", "path": "github.com/coreos/etcd/mvcc/mvccpb", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "ga3jt9r+dQBMSXG0gnpNcXp2xYA=", "path": "github.com/coreos/etcd/pkg/fileutil", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "mKIXx1kDwmVmdIpZ3pJtRBuUKso=", "path": "github.com/coreos/etcd/pkg/pathutil", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "rMyIh9PsSvPs6Yd+YgKITQzQJx8=", "path": "github.com/coreos/etcd/pkg/tlsutil", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "HBfN6B8eoiy/zsUr74DaRkcyFmg=", "path": "github.com/coreos/etcd/pkg/transport", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "gx1gJIMU6T0UNQ0bPZ/drQ8cpCI=", "path": "github.com/coreos/etcd/pkg/types", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { "checksumSHA1": "sp2FkEyaIGiQFOEZCTDkBZgyHOs=", "path": "github.com/coreos/etcd/version", - "revision": "9b72c8ba1ba484802e155c9f6f0ddc21e9c256ce", - "revisionTime": "2017-02-07T20:09:37Z" + "revision": "a5cf7fdc87304f079769055792e0e9137c72952b", + "revisionTime": "2017-02-16T21:42:49Z" }, { - "checksumSHA1": "butr+Orbf1fd1hcLqNXYwUDAjcI=", + "checksumSHA1": "nux9tCYmTA5bOCVODF3Rqzcu60U=", "path": "github.com/coreos/go-semver/semver", - "revision": "9474efc580562cce8f761659fbce31b6feb8ce88", - "revisionTime": "2016-12-05T21:41:38Z" + "revision": "5e3acbb5668c4c3deb4842615c4098eb61fb6b1e", + "revisionTime": "2017-02-09T20:17:57Z" }, { "checksumSHA1": "d50/+u/LFlXvEV10HiEoXB9OsGg=", @@ -463,10 +463,10 @@ "revisionTime": "2017-01-03T08:10:50Z" }, { - "checksumSHA1": "lepNuxdZKQX0WAxQ+vIShREr0XI=", + "checksumSHA1": "wP7Xw4W1DUgRAOLkXMAlGGGTgaU=", "path": "github.com/fullsailor/pkcs7", - "revision": "cedaa6c8ea14493515fcf950eabba5eb1530c349", - "revisionTime": "2016-12-02T22:11:50Z" + "revision": "eb67e7e564b9eae64dc7d95fae0784d6086a5fc4", + "revisionTime": "2017-02-09T01:19:05Z" }, { "checksumSHA1": "muGVyM8mY3/gcap6kr4Ib3F5Xn4=", @@ -481,10 +481,10 @@ "revisionTime": "2016-12-05T22:32:45Z" }, { - "checksumSHA1": "ZTmM9OdSvpQCKasJnXH9PYzHq+M=", + "checksumSHA1": "Tql4AI8dMzK1TFtT9fqHpmowxh8=", "path": "github.com/go-ini/ini", - "revision": "e3c2d47c61e5333f9aa2974695dd94396eb69c75", - "revisionTime": "2017-01-23T09:11:46Z" + "revision": "ee900ca565931451fe4e4409bcbd4316331cec1c", + "revisionTime": "2017-02-09T04:24:15Z" }, { "checksumSHA1": "ezktpcI0As/fZ0rN7BnBNtUfIsQ=", @@ -499,28 +499,28 @@ "revisionTime": "2016-12-24T12:10:19Z" }, { - "checksumSHA1": "BIjIlroEERTrbJrmR/wCPdy8chg=", + "checksumSHA1": "7BEKq0xoRvV1whMiWU0aV3WubXE=", "path": "github.com/gocql/gocql", - "revision": "4d2d1ac71932f7c4a6c7feb0d654462e4116c58b", - "revisionTime": "2017-01-22T20:58:45Z" + "revision": "1f874493e9e5aebe46b312593cbd9cb5d3946eda", + "revisionTime": "2017-02-15T00:22:50Z" }, { "checksumSHA1": "Z3N6HDGWcvcNu0FloZRq54uO3h4=", "path": "github.com/gocql/gocql/internal/lru", - "revision": "4d2d1ac71932f7c4a6c7feb0d654462e4116c58b", - "revisionTime": "2017-01-22T20:58:45Z" + "revision": "1f874493e9e5aebe46b312593cbd9cb5d3946eda", + "revisionTime": "2017-02-15T00:22:50Z" }, { "checksumSHA1": "ctK9mwZKnt/8dHxx2Ef6nZTljZs=", "path": "github.com/gocql/gocql/internal/murmur", - "revision": "4d2d1ac71932f7c4a6c7feb0d654462e4116c58b", - "revisionTime": "2017-01-22T20:58:45Z" + "revision": "1f874493e9e5aebe46b312593cbd9cb5d3946eda", + "revisionTime": "2017-02-15T00:22:50Z" }, { "checksumSHA1": "tZQDfMMTKrYMXqen0zjJWLtOf1A=", "path": "github.com/gocql/gocql/internal/streams", - "revision": "4d2d1ac71932f7c4a6c7feb0d654462e4116c58b", - "revisionTime": "2017-01-22T20:58:45Z" + "revision": "1f874493e9e5aebe46b312593cbd9cb5d3946eda", + "revisionTime": "2017-02-15T00:22:50Z" }, { "checksumSHA1": "APDDi2ohrU7OkChQCekD9tSVUhs=", @@ -535,16 +535,16 @@ "revisionTime": "2016-11-17T03:31:26Z" }, { - "checksumSHA1": "P/YMhqTnQl9HbvyC72rBhe/N32I=", + "checksumSHA1": "p/8vSviYF91gFflhrt5vkyksroo=", "path": "github.com/golang/snappy", - "revision": "7db9049039a047d955fe8c19b83c8ff5abd765c7", - "revisionTime": "2017-01-19T01:47:23Z" + "revision": "553a641470496b2327abcac10b36396bd98e45c9", + "revisionTime": "2017-02-15T23:32:05Z" }, { - "checksumSHA1": "Bn+jLz/gDn8d6apEb70H9fvMOec=", + "checksumSHA1": "6Yh1CCJastWomA9rnAtQNbh8seQ=", "path": "github.com/google/go-github/github", - "revision": "27c7c32b6d369610435bd2ad7b4d8554f235eb01", - "revisionTime": "2016-12-16T23:18:18Z" + "revision": "dfd20fd7fa6edec56447fcb049acd5e17a78ec2e", + "revisionTime": "2017-02-15T21:36:29Z" }, { "checksumSHA1": "p3IB18uJRs4dL2K5yx24MrLYE9A=", @@ -583,16 +583,16 @@ "revisionTime": "2016-01-25T11:53:50Z" }, { - "checksumSHA1": "ygEjA1d52B1RDmZu8+1WTwkrYDQ=", + "checksumSHA1": "AQMAS0aD5VifN0ugbv8xNTt7mM4=", "path": "github.com/hashicorp/consul/api", - "revision": "e4d6687fa2699365e284e8e14ecda49c201739a9", - "revisionTime": "2017-02-08T06:39:05Z" + "revision": "4e380758b6bdcaa0e0df85bba85b04e7ddbec177", + "revisionTime": "2017-02-16T22:07:44Z" }, { "checksumSHA1": "HDRi8BjyCm/zCYGA8l/40GMuWN8=", "path": "github.com/hashicorp/consul/lib", - "revision": "e4d6687fa2699365e284e8e14ecda49c201739a9", - "revisionTime": "2017-02-08T06:39:05Z" + "revision": "4e380758b6bdcaa0e0df85bba85b04e7ddbec177", + "revisionTime": "2017-02-16T22:07:44Z" }, { "checksumSHA1": "cdOCt0Yb+hdErz8NAQqayxPmRsY=", @@ -601,10 +601,10 @@ "revisionTime": "2014-10-28T05:47:10Z" }, { - "checksumSHA1": "6ihdHMkDfFx/rJ1A36com2F6bQk=", + "checksumSHA1": "b8F628srIitj5p7Y130xc9k0QWs=", "path": "github.com/hashicorp/go-cleanhttp", - "revision": "a45970658e51fea2c41445ff0f7e07106d007617", - "revisionTime": "2017-02-11T00:33:01Z" + "revision": "3573b8b52aa7b37b9358d966a898feb387f62437", + "revisionTime": "2017-02-11T01:34:15Z" }, { "checksumSHA1": "TNlVzNR1OaajcNi3CbQ3bGbaLGU=", @@ -729,8 +729,8 @@ { "checksumSHA1": "E3Xcanc9ouQwL+CZGOUyA/+giLg=", "path": "github.com/hashicorp/serf/coordinate", - "revision": "dc8758d008b010bb1fd613e58c3b280efc484ab7", - "revisionTime": "2017-02-06T20:14:30Z" + "revision": "050c56d31a1ff2ebc50e3f4810fdff7e7563f6c8", + "revisionTime": "2017-02-16T21:32:28Z" }, { "checksumSHA1": "ZhK6IO2XN81Y+3RAjTcVm1Ic7oU=", @@ -817,28 +817,28 @@ "revisionTime": "2017-02-06T19:27:00Z" }, { - "checksumSHA1": "zcEtH7VUcRFCeEMKmVwtj0/k9sI=", + "checksumSHA1": "FZem1OXCd+ogu1yeG11GMlGiGVA=", "path": "github.com/lib/pq", - "revision": "0477eb88c5ca4009cb281f13c90633375b6a9987", - "revisionTime": "2017-02-06T20:06:38Z" + "revision": "ba5d4f7a35561e22fbdf7a39aa0070f4d460cfc0", + "revisionTime": "2017-02-13T22:10:49Z" }, { "checksumSHA1": "xppHi82MLqVx1eyQmbhTesAEjx8=", "path": "github.com/lib/pq/oid", - "revision": "0477eb88c5ca4009cb281f13c90633375b6a9987", - "revisionTime": "2017-02-06T20:06:38Z" + "revision": "ba5d4f7a35561e22fbdf7a39aa0070f4d460cfc0", + "revisionTime": "2017-02-13T22:10:49Z" }, { "checksumSHA1": "I4njd26dG5hxFT2nawuByM4pxzY=", "path": "github.com/mattn/go-colorable", - "revision": "d228849504861217f796da67fae4f6e347643f15", - "revisionTime": "2016-11-03T16:00:40Z" + "revision": "5411d3eea5978e6cdc258b30de592b60df6aba96", + "revisionTime": "2017-02-10T17:28:01Z" }, { - "checksumSHA1": "xZuhljnmBysJPta/lMyYmJdujCg=", + "checksumSHA1": "Jyv1TH1YHrCVewmVE8FgSh1+92s=", "path": "github.com/mattn/go-isatty", - "revision": "30a891c33c7cde7b02a981314b4228ec99380cca", - "revisionTime": "2016-11-23T14:36:37Z" + "revision": "dda3de49cbfcec471bd7a70e6cc01fcc3ff90109", + "revisionTime": "2017-02-16T23:59:08Z" }, { "checksumSHA1": "CIK3BBNX3nuUQCmNqTQydNfMNKI=", @@ -859,10 +859,10 @@ "revisionTime": "2017-02-02T07:45:48Z" }, { - "checksumSHA1": "6zsRRzJoi5zxQMp6iV/2EraRxPA=", + "checksumSHA1": "W6WsJ7dtBT0coA3S5FpGR0k4IEU=", "path": "github.com/mitchellh/cli", - "revision": "16bda1254c1d199d9f10a4b90060eda75221a006", - "revisionTime": "2017-02-01T16:57:07Z" + "revision": "494eb006fe29e9dc75fea6da4df4818f7e046b73", + "revisionTime": "2017-02-08T07:23:55Z" }, { "checksumSHA1": "kSmDazz+cokgcHQT7q56Na+IBe0=", @@ -907,10 +907,10 @@ "revisionTime": "2017-01-12T15:04:04Z" }, { - "checksumSHA1": "Yqr9OQ7AuIB1N0HMbSxqEoVQG+k=", + "checksumSHA1": "ZOhewV1DsQjTYlx8a+ifrZki2Vg=", "path": "github.com/ryanuber/columnize", - "revision": "0fbbb3f0e3fbdc5bae7c6cd5f6c1887ebfb76360", - "revisionTime": "2016-12-20T21:49:20Z" + "revision": "ddeb643de91b4ee0d9d87172c931a4ea3d81d49a", + "revisionTime": "2017-02-08T17:17:27Z" }, { "checksumSHA1": "5SYLEhADhdBVZAGPVHWggQl7H8k=", @@ -931,208 +931,208 @@ "revisionTime": "2016-10-03T17:19:47Z" }, { - "checksumSHA1": "Y/JfHdFBJJxsRAEor6fh1iGPn9g=", + "checksumSHA1": "CoxdaTYdPZNJXr8mJfLxye428N0=", "path": "github.com/ugorji/go/codec", - "revision": "d23841a297e5489e787e72fceffabf9d2994b52a", - "revisionTime": "2017-01-21T19:05:58Z" + "revision": "c88ee250d0221a57af388746f5cf03768c21d6e2", + "revisionTime": "2017-02-15T20:11:44Z" }, { "checksumSHA1": "vE43s37+4CJ2CDU6TlOUOYE0K9c=", "path": "golang.org/x/crypto/bcrypt", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "JsJdKXhz87gWenMwBeejTOeNE7k=", "path": "golang.org/x/crypto/blowfish", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "C1KKOxFoW7/W/NFNpiXK+boguNo=", "path": "golang.org/x/crypto/curve25519", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "wGb//LjBPNxYHqk+dcLo7BjPXK8=", "path": "golang.org/x/crypto/ed25519", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "LXFcVx8I587SnWmKycSDEq9yvK8=", "path": "golang.org/x/crypto/ed25519/internal/edwards25519", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "4D8hxMIaSDEW5pCQk22Xj4DcDh4=", "path": "golang.org/x/crypto/hkdf", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "MCeXr2RNeiG1XG6V+er1OR0qyeo=", "path": "golang.org/x/crypto/md4", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { - "checksumSHA1": "oN2GzDGBWk8bL8rGUOGlfb0GbD4=", + "checksumSHA1": "fsrFs762jlaILyqqQImS1GfvIvw=", "path": "golang.org/x/crypto/ssh", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "SJ3Ma3Ozavxpbh1usZWBCnzMKIc=", "path": "golang.org/x/crypto/ssh/agent", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "xiderUuvye8Kpn7yX3niiJg32bE=", "path": "golang.org/x/crypto/ssh/terminal", - "revision": "22ddb68eccda408bbf17759ac18d3120ce0d4f3f", - "revisionTime": "2017-02-07T22:51:51Z" + "revision": "453249f01cfeb54c3d549ddb75ff152ca243f9d8", + "revisionTime": "2017-02-08T20:51:15Z" }, { "checksumSHA1": "Y+HGqEkYM15ir+J93MEaHdyFy0c=", "path": "golang.org/x/net/context", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "WHc3uByvGaMcnSoI21fhzYgbOgg=", "path": "golang.org/x/net/context/ctxhttp", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "LC+mzxnIrUS9Kr4s7shpY+A9J2o=", "path": "golang.org/x/net/http2", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "G3e2/HrQjRy2Ml9lfX0e3AGRWWE=", "path": "golang.org/x/net/http2/hpack", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "GIGmSrYACByf5JDIP9ByBZksY80=", "path": "golang.org/x/net/idna", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "UxahDzW2v4mf/+aFxruuupaoIwo=", "path": "golang.org/x/net/internal/timeseries", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "3xyuaSNmClqG4YWC7g0isQIbUTc=", "path": "golang.org/x/net/lex/httplex", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "GQHKESPeCcAsnerZPtHadvKUIzs=", "path": "golang.org/x/net/trace", - "revision": "236b8f043b920452504e263bc21d354427127473", - "revisionTime": "2017-02-06T03:21:01Z" + "revision": "b4690f45fa1cafc47b1c280c2e75116efe40cc13", + "revisionTime": "2017-02-15T08:41:58Z" }, { "checksumSHA1": "Zt7DIRCaUg5qfhfxyR1wCA+EjCE=", "path": "golang.org/x/oauth2", - "revision": "4464e7848382e6f39db55097f70e1460bdf944b3", - "revisionTime": "2016-06-04T04:11:54Z" + "revision": "b9780ec78894ab900c062d58ee3076cd9b2a4501", + "revisionTime": "2017-02-14T22:24:16Z" }, { "checksumSHA1": "1TbkNRLtD4BFSBT1+dZ19RbGd/g=", "path": "golang.org/x/oauth2/google", - "revision": "4464e7848382e6f39db55097f70e1460bdf944b3", - "revisionTime": "2016-06-04T04:11:54Z" + "revision": "b9780ec78894ab900c062d58ee3076cd9b2a4501", + "revisionTime": "2017-02-14T22:24:16Z" }, { - "checksumSHA1": "P+95/2BHoySnSCQdS6Enn3WQOyc=", + "checksumSHA1": "gChvVZYdb6Bw/vjIpfYJfNvXPoU=", "path": "golang.org/x/oauth2/internal", - "revision": "4464e7848382e6f39db55097f70e1460bdf944b3", - "revisionTime": "2016-06-04T04:11:54Z" + "revision": "b9780ec78894ab900c062d58ee3076cd9b2a4501", + "revisionTime": "2017-02-14T22:24:16Z" }, { "checksumSHA1": "huVltYnXdRFDJLgp/ZP9IALzG7g=", "path": "golang.org/x/oauth2/jws", - "revision": "4464e7848382e6f39db55097f70e1460bdf944b3", - "revisionTime": "2016-06-04T04:11:54Z" + "revision": "b9780ec78894ab900c062d58ee3076cd9b2a4501", + "revisionTime": "2017-02-14T22:24:16Z" }, { "checksumSHA1": "/eV4E08BY+f1ZikiR7OOMJAj3m0=", "path": "golang.org/x/oauth2/jwt", - "revision": "4464e7848382e6f39db55097f70e1460bdf944b3", - "revisionTime": "2016-06-04T04:11:54Z" + "revision": "b9780ec78894ab900c062d58ee3076cd9b2a4501", + "revisionTime": "2017-02-14T22:24:16Z" }, { - "checksumSHA1": "uTQtOqR0ePMMcvuvAIksiIZxhqU=", + "checksumSHA1": "ruEvGIBt119UK7KTkoNaYnYhZuI=", "path": "golang.org/x/sys/unix", - "revision": "7a6e5648d140666db5d920909e082ca00a87ba2c", - "revisionTime": "2017-02-01T04:15:14Z" + "revision": "075e574b89e4c2d22f2286a7e2b919519c6f3547", + "revisionTime": "2017-02-16T21:06:26Z" }, { - "checksumSHA1": "a1NkriuA/uk+Wv6yCFzxz4LIaDg=", + "checksumSHA1": "C7k1pbU/WU4CBoBwA4EBUnV/iek=", "path": "google.golang.org/api/gensupport", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "BWKmb7kGYbfbvXO6E7tCpTh9zKE=", "path": "google.golang.org/api/googleapi", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "1K0JxrUfDqAB3MyRiU1LKjfHyf4=", "path": "google.golang.org/api/googleapi/internal/uritemplates", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "Mr2fXhMRzlQCgANFm91s536pG7E=", "path": "google.golang.org/api/googleapi/transport", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "GAKy8Id2Qx7BI0kZPRjGn1RjVQo=", "path": "google.golang.org/api/internal", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "slcGOTGSdukEPPSN81Q5WZGmhog=", "path": "google.golang.org/api/iterator", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "hZ9zds+/FPwSGEiti5lGaZL3e6w=", "path": "google.golang.org/api/option", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { - "checksumSHA1": "xygm9BwoCg7vc0PPgAPdxNKJ38c=", + "checksumSHA1": "fxbPUw1XvbSMz6Atx6OOMkRdJ0g=", "path": "google.golang.org/api/storage/v1", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "VRcIlsL2liHgqTdy5ad7gqdARHU=", "path": "google.golang.org/api/transport", - "revision": "3d017632ea100549bbb3ae74c567d59f437ece0f", - "revisionTime": "2017-02-06T17:55:50Z" + "revision": "bc20c61134e1d25265dd60049f5735381e79b631", + "revisionTime": "2017-02-10T21:56:36Z" }, { "checksumSHA1": "8K4KAebYh3WnPh0swPzOgl1pRD0=", @@ -1207,76 +1207,76 @@ "revisionTime": "2017-02-06T20:30:24Z" }, { - "checksumSHA1": "mEyChIkG797MtkrJQXW8X/qZ0l0=", + "checksumSHA1": "8Z43m+zNTbxHUHQPMUNirEp1BLg=", "path": "google.golang.org/grpc", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "08icuA15HRkdYCt6H+Cs90RPQsY=", "path": "google.golang.org/grpc/codes", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "AGkvu7gY1jWK7v5s9a8qLlH2gcQ=", "path": "google.golang.org/grpc/credentials", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "bg3wIPzajKt3QZfTG70EPaxDtpk=", "path": "google.golang.org/grpc/credentials/oauth", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "3Lt5hNAG8qJAYSsNghR5uA1zQns=", "path": "google.golang.org/grpc/grpclog", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "T3Q0p8kzvXFnRkMaK/G8mCv6mc0=", "path": "google.golang.org/grpc/internal", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { - "checksumSHA1": "XXpD8+S3gLrfmCLOf+RbxblOQkU=", + "checksumSHA1": "T05Mzg3hEv2Vxao9hZn0Kv+nwUQ=", "path": "google.golang.org/grpc/metadata", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "4GSUFhOQ0kdFlBH4D5OTeKy78z0=", "path": "google.golang.org/grpc/naming", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "3RRoLeH6X2//7tVClOVzxW2bY+E=", "path": "google.golang.org/grpc/peer", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "wzkOAxlah+y75EpH0QVgzb8hdfc=", "path": "google.golang.org/grpc/stats", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "N0TftT6/CyWqp6VRi2DqDx60+Fo=", "path": "google.golang.org/grpc/tap", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { - "checksumSHA1": "yHpUeGwKoqqwd3cbEp3lkcnvft0=", + "checksumSHA1": "b9RDUPOmWBfHe9cM8UVilfyF/vE=", "path": "google.golang.org/grpc/transport", - "revision": "2a6bf6142e96942e4fb9c0dfb157ee5d3cecafaa", - "revisionTime": "2017-02-08T00:26:47Z" + "revision": "d0c32ee6a441117d49856d6120ca9552af413ee0", + "revisionTime": "2017-02-16T00:36:43Z" }, { "checksumSHA1": "wSu8owMAP7GixsYoSZ4CmKUVhnU=", @@ -1327,10 +1327,10 @@ "revisionTime": "2016-10-18T17:13:38Z" }, { - "checksumSHA1": "QpWY2ygzClg3Bw+GHjD7yXlcTxw=", + "checksumSHA1": "0KwOlQV1dNUh9X8t+5s7nX5bqfk=", "path": "gopkg.in/yaml.v2", - "revision": "4c78c975fe7c825c6d1466c42be594d1d6f3aba6", - "revisionTime": "2017-01-25T14:37:19Z" + "revision": "a3f3340b5840cee44f372bddb5880fcbc419b46a", + "revisionTime": "2017-02-08T14:18:51Z" }, { "checksumSHA1": "s7O2cNvVNkPwgHs4+rfyDscl9Xw=", diff --git a/website/source/docs/internals/replication.html.md b/website/source/docs/internals/replication.html.md new file mode 100644 index 0000000000..437997436d --- /dev/null +++ b/website/source/docs/internals/replication.html.md @@ -0,0 +1,149 @@ +--- +layout: "docs" +page_title: "Replication" +sidebar_current: "docs-internals-replication" +description: |- + Learn about the details of multi-datacenter replication within Vault. +--- + +# Replication (Vault Enterprise) + +Vault Enterprise 0.7 adds support for multi-datacenter replication. Before +using this feature, it is useful to understand the intended use cases, design +goals, and high level architecture. + +Replication is based on a primary/secondary (1:N) model with asynchronous +replication, focusing on high availability for global deployments. The +trade-offs made in the design and implementation of replication reflect these +high level goals. + +# Use Cases + +Vault replication is based on a number of common use cases: + +* **Multi-Datacenter Deployments**: A common challenge is providing Vault to + applications across many datacenters in a highly-available manner. Running a + single Vault cluster imposes high latency of access for remote clients, + availability loss or outages during connectivity failures, and limits + scalability. + +* **Backup Sites**: Implementing a robust business continuity plan around the + loss of a primary datacenter requires the ability to quickly and easily fail + to a hot backup site. + +* **Scaling Throughput**: Applications that use Vault for + Encryption-as-a-Service or cryptographic offload may generate a very high + volume of requests for Vault. Replicating keys between multiple clusters + allows load to be distributed across additional servers to scale request + throughput. + +# Design Goals + +Based on the use cases for Vault Replication, we had a number of design goals +for the implementation: + +* **Availability**: Global deployments of Vault require high levels of + availability, and can tolerate reduced consistency. During full connectivity, + replication is nearly real-time between the primary and secondary clusters. + Degraded connectivity between a primary and secondary does not impact the + primary's ability to service requests, and the secondary will continue to + service reads on last-known data. + +* **Conflict Free**: Certain replication techniques allow for potential write + conflicts to take place. Particularly, any active/active configuration where + writes are allowed to multiple sites require a conflict resolution strategy. + This varies from techniques that allow for data loss like last-write-wins, or + techniques that require manual operator resolution like allowing multiple + values per key. We avoid the possibility of conflicts to ensure there is no + data loss or manual intervention required. + +* **Transparent to Clients**: Vault replication should be transparent to + clients of Vault, so that existing thin clients work unmodified. The Vault + servers handle the logic of request forwarding to the primary when necessary, + and multi-hop routing is performed internally to ensure requests are + processed. + +* **Simple to Operate**: Operating a replicated cluster should be simple to + avoid administrative overhead and potentially introducing security gaps. + Setup of replication is very simple, and secondaries can handle being + arbitrarily behind the primary, avoiding the need for operator intervention + to copy data or snapshot the primary. + +# Architecture + +The architecture of Vault replication is based on the design goals, focusing on +the intended use cases. When replication is enabled, a cluster is set as either +a _primary_ or _secondary_. The primary cluster is authoritative, and is the +only cluster allowed to perform actions that write to the underlying data +storage, such as modifying policies or secrets. Secondary clusters can service +all other operations, such as reading secrets or sending data through +`transit`, and forward any writes to the primary cluster. Disallowing multiple +primaries ensures the cluster is conflict free and has an authoritative state. + +The primary cluster uses log shipping to replicate changes to all of the +secondaries. This ensures writes are visible globally in near real-time when +there is full network connectivity. If a secondary is down or unable to +communicate with the primary, writes are not blocked on the primary and reads +are still serviced on the secondary. This ensures the availability of Vault. +When the secondary is initialized or recovers from degraded connectivity it +will automatically reconcile with the primary. + +Lastly, clients can speak to any Vault server without a thick client. If a +client is communicating with a standby instance, the request is automatically +forwarded to a active instance. Secondary clusters will service reads locally +and forward any write requests to the primary cluster. The primary cluster is +able to service all request types. + +An important optimization Vault makes is to avoid replication of tokens or +leases between clusters. Policies and secrets are the minority of data managed +by Vault and tend to be relatively stable. Tokens and leases are much more +dynamic, as they are created and expire rapidly. Keeping tokens and leases +locally reduces the amount of data that needs to be replicated, and distributes +the work of TTL management between the clusters. The caveat is that clients +will need to re-authenticate if they switch the Vault cluster they are +communicating with. + +# Implementation Details + +It is important to understand the high-level architecture of replication to +ensure the trade-offs are appropriate for your use case. The implementation +details may be useful for those who are curious or want to understand more +about the performance characteristics or failure scenarios. + +Using replication requires a storage backend that supports transactional +updates, such as Consul. This allows multiple key/value updates to be +performed atomically. Replication uses this to maintain a +[Write-Ahead-Log][wal] (WAL) of all updates, so that the key update happens +atomically with the WAL entry creation. The WALs are then used to perform log +shipping between the Vault clusters. When a secondary is closely synchronized +with a primary, Vault directly streams new WALs to be applied, providing near +real-time replication. A bounded set of WALs are maintained for the +secondaries, and older WALs are garbage collected automatically. + +When a secondary is initialized or is too far behind the primary there may not +be enough WALs to synchronize. To handle this scenario, Vault maintains a +[merkle index][merkle] of the encrypted keys. Any time a key is updated or +deleted, the merkle index is updated to reflect the change. When a secondary +needs to reconcile with a primary, they compare their merkle indexes to +determine which keys are out of sync. The structure of the index allows this to +be done very efficiently, usually requiring only two round trips and a small +amount of data. The secondary uses this information to reconcile and then +switches back into WAL streaming mode. + +Performance is an important concern for Vault, so WAL entries are batched and +the merkle index is not flushed to disk with every operation. Instead, the +index is updated in memory for every operation and asynchronously flushed to +disk. As a result, a crash or power loss may cause the merkle index to become +out of sync with the underlying keys. Vault uses the [ARIES][aries] recovery +algorithm to ensure the consistency of the index under those failure +conditions. + +Log shipping traditionally requires the WAL stream to be synchronized, which +can introduce additional complexity when a new primary cluster is promoted. +Vault uses the merkle index as the source of truth, allowing the WAL streams to +be completely distinct and unsynchronized. This simplifies administration of +Vault Replication for operators. + +[wal]: https://en.wikipedia.org/wiki/Write-ahead_logging +[merkle]: https://en.wikipedia.org/wiki/Merkle_tree +[aries]: https://en.wikipedia.org/wiki/Algorithms_for_Recovery_and_Isolation_Exploiting_Semantics diff --git a/website/source/docs/secrets/pki/index.html.md b/website/source/docs/secrets/pki/index.html.md index 8e65d10516..985cbcdb33 100644 --- a/website/source/docs/secrets/pki/index.html.md +++ b/website/source/docs/secrets/pki/index.html.md @@ -1229,6 +1229,12 @@ subpath for interactive help output. This sets the OU (OrganizationalUnit) values in the subject field of issued certificates. This is a comma-separated string. +
  • + organization + optional + This sets the O (Organization) values in the subject field of issued + certificates. This is a comma-separated string. +
  • diff --git a/website/source/intro/vs/hsm.html.md b/website/source/intro/vs/hsm.html.md index 616dfb9dba..d203690cbb 100644 --- a/website/source/intro/vs/hsm.html.md +++ b/website/source/intro/vs/hsm.html.md @@ -28,7 +28,7 @@ with a significant advantage in that they conform to government-mandated compliance requirements (e.g. FIPS 140), which often require specific hardware protections and security models in addition to software. -Vault doesn't replace an HSM. Instead, they can be complimentary; a compliant +Vault doesn't replace an HSM. Instead, they can be complementary; a compliant HSM can protect Vault's master key to help Vault comply with regulatory requirements, and Vault can provide easy client APIs for tasks such as encryption and decryption. diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index 2a06df33ce..018945341b 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -11,7 +11,7 @@