135 cusr->user.check_group = (user_check_group_f)cached_user_check_group; |
135 cusr->user.check_group = (user_check_group_f)cached_user_check_group; |
136 cusr->user.free = (user_free_f)cached_user_unref; |
136 cusr->user.free = (user_free_f)cached_user_unref; |
137 |
137 |
138 cusr->authdb = strdup(authdb); |
138 cusr->authdb = strdup(authdb); |
139 cusr->password = strdup(password); |
139 cusr->password = strdup(password); |
140 cusr->groups = calloc(numgroups, sizeof(sstr_t)); |
140 cusr->groups = numgroups ? calloc(numgroups, sizeof(sstr_t)) : NULL; |
141 cusr->numgroups = numgroups; |
141 cusr->numgroups = numgroups; |
142 for(int i=0;i<numgroups;i++) { |
142 for(int i=0;i<numgroups;i++) { |
143 cusr->groups[i] = sstrdup(sstr(groups[i])); |
143 cusr->groups[i] = sstrdup(sstr(groups[i])); |
144 } |
144 } |
145 cusr->ref = 1; |
145 cusr->ref = 1; |