src/server/daemon/auth.c

changeset 79
f48cea237ec3
parent 77
f1cff81e425a
child 91
fac51f87def0
equal deleted inserted replaced
78:3578977d29a3 79:f48cea237ec3
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;

mercurial