// ChownByName is a wrapper around ChownId that allows changing user and group by name.
772029
func ChownByName(filePath, usr, grp string) error {
	var uid, gid int
	var err error

	if uid, err = GetUid(usr); err != nil {
		return err
	}

	if gid, err = GetGid(grp); err != nil {
		return err
	}

	return Chown(filePath, uid, gid)
}
808590
func (s *CreateVocabularyInput) SetVocabularyName(v string) *CreateVocabularyInput {
	s.VocabularyName = &v
	return s
}
708826
func (s *PutKeyPolicyInput) SetPolicyName(v string) *PutKeyPolicyInput {
	s.PolicyName = &v
	return s
}
384267
func (s *CreatePolicyInput) SetPolicyName(v string) *CreatePolicyInput {
	s.PolicyName = &v
	return s
}
1096576
func (s *DomainJoinInfo) SetDirectoryName(v string) *DomainJoinInfo {
	s.DirectoryName = &v
	return s
}
1296939
func (s *GetGroupPolicyOutput) SetPolicyName(v string) *GetGroupPolicyOutput {
	s.PolicyName = &v
	return s
}
933619
func (mount *MountInfo) Chown(path string, user uint32, group uint32) error {
	cPath := C.CString(path)
	defer C.free(unsafe.Pointer(cPath))

	ret := C.ceph_chown(mount.mount, cPath, C.int(user), C.int(group))
	if ret != 0 {
		log.Errorf("Chown: Failed to chown :%s", path)
		return cephError(ret)
	}
	return nil
}
586102
func (s *GetRepositoryInput) SetRepositoryName(v string) *GetRepositoryInput {
	s.RepositoryName = &v
	return s
}
1294704
func (Ctx *Context) CpupoolFindByName(name string) (info CpupoolInfo, found bool) {
	plist := Ctx.ListCpupool()

	for i := range plist {
		if plist[i].PoolName == name {
			found = true
			info = plist[i]
			return
		}
	}
	return
}
403739
func (s *PutUserPolicyInput) SetPolicyName(v string) *PutUserPolicyInput {
	s.PolicyName = &v
	return s
}
1301776
func (s *ListPolicyVersionsInput) SetPolicyName(v string) *ListPolicyVersionsInput {
	s.PolicyName = &v
	return s
}
740938
func (s *CreatePolicyVersionInput) SetPolicyName(v string) *CreatePolicyVersionInput {
	s.PolicyName = &v
	return s
}
1006412
func (s *GetUserPolicyInput) SetPolicyName(v string) *GetUserPolicyInput {
	s.PolicyName = &v
	return s
}
1000284
func (s *Target) SetRepositoryName(v string) *Target {
	s.RepositoryName = &v
	return s
}
136690
func MaybeChownDirRecursiveToMinikubeUser(dir string) error {
	if os.Getenv("CHANGE_MINIKUBE_NONE_USER") != "" && os.Getenv("SUDO_USER") != "" {
		username := os.Getenv("SUDO_USER")
		usr, err := user.Lookup(username)
		if err != nil {
			return errors.Wrap(err, "Error looking up user")
		}
		uid, err := strconv.Atoi(usr.Uid)
		if err != nil {
			return errors.Wrapf(err, "Error parsing uid for user: %s", username)
		}
		gid, err := strconv.Atoi(usr.Gid)
		if err != nil {
			return errors.Wrapf(err, "Error parsing gid for user: %s", username)
		}
		if err := ChownR(dir, uid, gid); err != nil {
			return errors.Wrapf(err, "Error changing ownership for: %s", dir)
		}
	}
	return nil
}
380519
func (s *SetLoadBalancerPoliciesForBackendServerInput) SetLoadBalancerName(v string) *SetLoadBalancerPoliciesForBackendServerInput {
	s.LoadBalancerName = &v
	return s
}
216428
func (s *CreateLBCookieStickinessPolicyInput) SetPolicyName(v string) *CreateLBCookieStickinessPolicyInput {
	s.PolicyName = &v
	return s
}