예제 #1
0
func setupDataDir(dataDir string) error {
	gid, err := group.LookupGid("rkt")
	if err != nil {
		return err
	}

	if err := createDirStructure(dataDir, gid); err != nil {
		return err
	}

	casDbPath := filepath.Join(dataDir, "cas", "db")
	if err := setCasDbFilesPermissions(casDbPath, gid, casDbPerm); err != nil {
		return err
	}

	if err := createDbFiles(casDbPath, gid, casDbPerm); err != nil {
		return err
	}

	return nil
}
예제 #2
0
파일: group.go 프로젝트: blablacar/dgr
// LookupGid reads the group file and returns the gid of the group
// specified by groupName.
func LookupGid(groupName string) (gid int, err error) {
	return group.LookupGid(groupName)
}