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 }
// 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) }