// Update password of a host/pool on management server.
504122
func (c *Client) UpdateHostPassword(p *UpdateHostPasswordParameter) (*Result, error) {
	obj, err := c.Request("updateHostPassword", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Result), err
}
67853
func (m *manager) updateCached(cert *tls.Certificate) {
	m.certAccessLock.Lock()
	defer m.certAccessLock.Unlock()
	m.serverHealth = true
	m.cert = cert
}
288379
func SetPassword(file, name, password string, hashAlgorithm HashAlgorithm) error {
	_, err := os.Stat(file)
	passwords := HashedPasswords(map[string]string{})
	if err == nil {
		passwords, err = ParseHtpasswdFile(file)
		if err != nil {
			return err
		}
	}
	err = passwords.SetPassword(name, password, hashAlgorithm)
	if err != nil {
		return err
	}
	return passwords.WriteToFile(file)
}
1098793
func UpdateHost(conn client.Connection, h host.Host) error {
	pth := path.Join("/hosts", h.ID)

	logger := plog.WithFields(log.Fields{
		"poolid": h.PoolID,
		"hostid": h.ID,
		"zkpath": pth,
	})

	node := &HostNode{Host: &host.Host{}}
	if err := conn.Get(pth, node); err != nil {
		logger.WithError(err).Debug("Could not find host entry in zookeeper")
		return err
	}

	node.Host = &h

	if err := conn.Set(pth, node); err != nil {
		logger.WithError(err).Debug("Could not update host entry in zookeeper")
		return err
	}

	logger.Debug("Updated entry to host in zookeeper")
	return nil
}
424222
func UpdateHostInfo(h Host) (Host, error) {
	currentHost, err := currentHost(h.IPAddr, h.RPCPort, h.PoolID)
	if err != nil {
		return Host{}, err
	}

	//update the passed in *copy* so we don't have to deal with new non hardware fields later on
	h.Name = currentHost.Name
	h.Memory = currentHost.Memory
	h.Cores = currentHost.Cores
	h.KernelRelease = currentHost.KernelRelease
	h.KernelVersion = currentHost.KernelVersion
	h.PrivateNetwork = currentHost.PrivateNetwork
	h.ServiceD = currentHost.ServiceD

	return h, nil
}
123090
func (ESX5Driver) UpdateVMX(_, password string, port int, data map[string]string) {
	// Do not set remotedisplay.vnc.ip - this breaks ESXi.
	data["remotedisplay.vnc.enabled"] = "TRUE"
	data["remotedisplay.vnc.port"] = fmt.Sprintf("%d", port)
	if len(password) > 0 {
		data["remotedisplay.vnc.password"] = password
	}
}
1088536
func (r Network_Storage_Allowed_Host_IpAddress) SetCredentialPassword(password *string) (resp bool, err error) {
	params := []interface{}{
		password,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Storage_Allowed_Host_IpAddress", "setCredentialPassword", params, &r.Options, &resp)
	return
}
546381
func (s *IPDirectionalPoolsService) Update(k IPDirectionalPoolKey, val interface{}) (*http.Response, error) {
	return s.client.put(k.URI(), val, nil)
}
279929
func (e *Engine) ChangePassword(ctx context.Context, newPassword string) (*primitive.UserPassword, *primitive.MasterKey, *primitive.LoginPublicKey, error) {
	// We need to re-use the master key
	cmk, err := e.unsealMasterKey(ctx)
	defer cmk.Destroy()
	if err != nil {
		return nil, nil, nil, err
	}

	// Encrypt the new password and re-encrypt the original master key
	b := cmk.Buffer()
	pw, master, err := EncryptPasswordObject(ctx, newPassword, &b)
	if err != nil {
		return nil, nil, nil, err
	}

	// Now derive LoginKeypair
	s, err := base64.NewFromString(pw.Salt)
	if err != nil {
		return nil, nil, nil, err
	}

	keypair, err := DeriveLoginKeypair(ctx, []byte(newPassword), s)
	if err != nil {
		return nil, nil, nil, err
	}

	return pw, master, &primitive.LoginPublicKey{
		Salt:  keypair.Salt(),
		Value: keypair.PublicKey(),
		Alg:   EdDSA,
	}, nil
}
938590
func (term *Terminal) Password(prefix string) (string, error) {
	var err error
	var input string

	for input == "" {
		input, err = term.GetPassword(prefix)
		if err != nil && err != io.EOF {
			return "", err
		}
	}

	return input, nil
}
797940
func (spec *ConnectionSpec) Password(password string) *ConnectionSpec {
	spec.password = password
	return spec
}
993804
func (_m *FacadeInterface) UpdateHost(ctx datastore.Context, entity *host.Host) error {
	ret := _m.Called(ctx, entity)

	var r0 error
	if rf, ok := ret.Get(0).(func(datastore.Context, *host.Host) error); ok {
		r0 = rf(ctx, entity)
	} else {
		r0 = ret.Error(0)
	}

	return r0
}
594947
func (*Service) UpdateVM(c context.Context, req *crimson.UpdateVMRequest) (*crimson.VM, error) {
	return updateVM(c, req.Vm, req.UpdateMask)
}
486734
func (p *Proxy) UpdateSecrets(cert *tls.Certificate, caPool *x509.CertPool, s secrets.Secrets, certPEM, keyPEM string) {
	p.Lock()
	defer p.Unlock()

	p.certificate = cert
	p.ca = caPool
}
442083
func PasswordSalt(password string) string {
	pass := []byte(password)
	salt, _ := bcrypt.GenerateFromPassword(pass, bcrypt.DefaultCost)
	return string(salt)
}
1062743
func (c *Client) Update(ctx context.Context, u *chronograf.User) error {
	// Only allow one type of change at a time. If it is a password
	// change then do it and return without any changes to permissions
	if u.Passwd != "" {
		return c.updatePassword(ctx, u.Name, u.Passwd)
	}

	user, err := c.Get(ctx, chronograf.UserQuery{Name: &u.Name})
	if err != nil {
		return err
	}

	revoke, add := Difference(u.Permissions, user.Permissions)
	for _, a := range add {
		if err := c.grantPermission(ctx, u.Name, a); err != nil {
			return err
		}
	}

	for _, r := range revoke {
		if err := c.revokePermission(ctx, u.Name, r); err != nil {
			return err
		}
	}
	return nil
}
876144
func (_class PoolUpdateClass) Precheck(sessionID SessionRef, self PoolUpdateRef, host HostRef) (_retval LivepatchStatus, _err error) {
	_method := "pool_update.precheck"
	_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf("%s(%s)", _method, "session_id"), sessionID)
	if _err != nil {
		return
	}
	_selfArg, _err := convertPoolUpdateRefToXen(fmt.Sprintf("%s(%s)", _method, "self"), self)
	if _err != nil {
		return
	}
	_hostArg, _err := convertHostRefToXen(fmt.Sprintf("%s(%s)", _method, "host"), host)
	if _err != nil {
		return
	}
	_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg, _hostArg)
	if _err != nil {
		return
	}
	_retval, _err = convertEnumLivepatchStatusToGo(_method + " -> ", _result.Value)
	return
}