X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=group.go;h=b7f7d1b8e8b9c4ce71252570c5d9cc6182b972d9;hb=1254d2cd5f83548f0c2df436b40e4a8c73bb0b0e;hp=02502f62a147464eee533c8ce3a3ec1683fb0748;hpb=839f07d7b3130efc613d7d3fa8ed71a7d8d5fd7f;p=nsscash%2Fnsscash.git diff --git a/group.go b/group.go index 02502f6..b7f7d1b 100644 --- a/group.go +++ b/group.go @@ -39,6 +39,8 @@ type Group struct { Gid uint64 Members []string } + +// Go does not support slices in map keys; therefore, use this separate struct type GroupKey struct { Name string Passwd string @@ -209,7 +211,8 @@ func SerializeGroups(w io.Writer, grs []Group) error { } // Sanity check - if indexOrig.Len() != indexId.Len() || + if len(grs)*8 != indexOrig.Len() || + indexOrig.Len() != indexId.Len() || indexId.Len() != indexName.Len() { return fmt.Errorf("indexes have inconsistent length") }