Example #1
0
func NewGroup(sysGroup system.Group) *Group {
	groupname := sysGroup.Groupname()
	exists, _ := sysGroup.Exists()
	gid, _ := sysGroup.Gid()
	return &Group{
		Groupname: groupname,
		Exists:    exists.(bool),
		Gid:       gid.(string),
	}
}
Example #2
0
func NewGroup(sysGroup system.Group, ignoreList []string) *Group {
	groupname := sysGroup.Groupname()
	exists, _ := sysGroup.Exists()
	g := &Group{
		Groupname: groupname,
		Exists:    exists.(bool),
	}
	if !contains(ignoreList, "stderr") {
		gid, _ := sysGroup.Gid()
		g.Gid = gid.(string)
	}
	return g
}
Example #3
0
func NewGroup(sysGroup system.Group, config util.Config) (*Group, error) {
	groupname := sysGroup.Groupname()
	exists, _ := sysGroup.Exists()
	g := &Group{
		Groupname: groupname,
		Exists:    exists.(bool),
	}
	if !contains(config.IgnoreList, "stderr") {
		gid, _ := sysGroup.Gid()
		g.Gid = gid.(string)
	}
	return g, nil
}
Example #4
0
func NewGroup(sysGroup system.Group, config util.Config) (*Group, error) {
	groupname := sysGroup.Groupname()
	exists, _ := sysGroup.Exists()
	g := &Group{
		Groupname: groupname,
		Exists:    exists,
	}
	if !contains(config.IgnoreList, "stderr") {
		if gid, err := sysGroup.GID(); err == nil {
			g.GID = gid
		}
	}
	return g, nil
}