func AddNamespaceRangesUser(name string) (int, int, error) {
	// Find unused uid, gid pair
	uid, err := findUnusedUID(baseUID)
	if err != nil {
		return -1, -1, fmt.Errorf("Unable to find unused UID: %v", err)
	}
	gid, err := findUnusedGID(baseGID)
	if err != nil {
		return -1, -1, fmt.Errorf("Unable to find unused GID: %v", err)
	}

	// First add the group that we will use
	if err := addGroup(name, gid); err != nil {
		return -1, -1, fmt.Errorf("Error adding group %q: %v", name, err)
	}
	// Add the user as a member of the group
	if err := addUser(name, uid, name); err != nil {
		return -1, -1, fmt.Errorf("Error adding user %q: %v", name, err)
	}
	return uid, gid, nil
}
// AddNamespaceRangesUser takes a name and finds an unused uid, gid pair
// and calls the appropriate helper function to add the group and then
// the user to the group in /etc/group and /etc/passwd respectively.
// This new user's /etc/sub{uid,gid} ranges will be used for user namespace
// mapping ranges in containers.
AddNamespaceRangesUser takes a name and finds an unused uid, gid pair
and calls the appropriate helper function to add the group and then
the user to the group in /etc/group and /etc/passwd respectively.
This new user's /etc/sub{uid,gid} ranges will be used for user namespace
mapping ranges in containers.
// AddNamespaceRangesUser takes a name and finds an unused uid gid pair // and calls the appropriate helper function to add the group and then // the user to the group in / etc / group and / etc / passwd respectively . // This new user ' s / etc / sub { uid gid } ranges will be used for user namespace // mapping ranges in containers .
func AddNamespaceRangesUser(name string) (int, int, error) {
	uid, err := findUnusedUID(baseUID)
	if err != nil {
		return -1, -1, fmt.Errorf("Unable to find unused UID: %v", err)
	}
	gid, err := findUnusedGID(baseGID)
	if err != nil {
		return -1, -1, fmt.Errorf("Unable to find unused GID: %v", err)
	}
	if err := addGroup(name, gid); err != nil {
		return -1, -1, fmt.Errorf("Error adding group %q: %v", name, err)
	}
	if err := addUser(name, uid, name); err != nil {
		return -1, -1, fmt.Errorf("Error adding user %q: %v", name, err)
	}
	return uid, gid, nil
}
func AddNamespaceRangesUser ( name string ) ( int , int , error ) { uid , err := findUnusedUID ( baseUID ) if err != nil { return - 1 , - 1 , fmt . Errorf ( " " , err ) } gid , err := findUnusedGID ( baseGID ) if err != nil { return - 1 , - 1 , fmt . Errorf ( " " , err ) } if err := addGroup ( name , gid ) ; err != nil { return - 1 , - 1 , fmt . Errorf ( " " , name , err ) } if err := addUser ( name , uid , name ) ; err != nil { return - 1 , - 1 , fmt . Errorf ( " " , name , err ) } return uid , gid , nil }
AddNamespaceRangesUser takes a name and finds an unused uid, gid pair
and calls the appropriate helper function to add the group and then
the user to the group in /etc/group and /etc/passwd respectively.
AddNamespaceRangesUser takes a name and finds an unused uid gid pair and calls the appropriate helper function to add the group and then the user to the group in / etc / group and / etc / passwd respectively .
// Find unused uid, gid pair // First add the group that we will use // Add the user as a member of the group