]> ruderich.org/simon Gitweb - nsscash/nsscash.git/blobdiff - group.go
nss: Makefile: fix typo in LD_PRELOAD variable name
[nsscash/nsscash.git] / group.go
index 02502f62a147464eee533c8ce3a3ec1683fb0748..b7f7d1b8e8b9c4ce71252570c5d9cc6182b972d9 100644 (file)
--- 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")
        }