489:921f83a8943f | 490:d218607f5a7e |
---|---|
50 if(!keyfile) { | 50 if(!keyfile) { |
51 return NULL; | 51 return NULL; |
52 } | 52 } |
53 keyfile->authdb.get_user = keyfile_get_user; | 53 keyfile->authdb.get_user = keyfile_get_user; |
54 keyfile->authdb.use_cache = 0; | 54 keyfile->authdb.use_cache = 0; |
55 keyfile->users = cxHashMapCreate(a, 16); | 55 keyfile->users = cxHashMapCreate(a, CX_STORE_POINTERS, 16); |
56 return keyfile; | 56 return keyfile; |
57 } | 57 } |
58 | 58 |
59 int keyfile_add_user( | 59 int keyfile_add_user( |
60 Keyfile *keyfile, | 60 Keyfile *keyfile, |
62 enum KeyfileHashType hash_type, | 62 enum KeyfileHashType hash_type, |
63 cxmutstr hash, | 63 cxmutstr hash, |
64 cxmutstr *groups, | 64 cxmutstr *groups, |
65 size_t ngroups) | 65 size_t ngroups) |
66 { | 66 { |
67 CxAllocator *a = keyfile->users->allocator; | 67 const CxAllocator *a = keyfile->users->allocator; |
68 | 68 |
69 if(hash.length < 12) { | 69 if(hash.length < 12) { |
70 // hash too short | 70 // hash too short |
71 // TODO: log | 71 // TODO: log |
72 return -1; | 72 return -1; |