Lines Matching refs:sib

48 static int smb_idmap_batch_binsid(smb_idmap_batch_t *sib);
73 smb_idmap_batch_t sib; in smb_idmap_getsid() local
76 stat = smb_idmap_batch_create(&sib, 1, SMB_IDMAP_ID2SID); in smb_idmap_getsid()
80 stat = smb_idmap_batch_getsid(sib.sib_idmaph, &sib.sib_maps[0], in smb_idmap_getsid()
84 smb_idmap_batch_destroy(&sib); in smb_idmap_getsid()
89 stat = smb_idmap_batch_getmappings(&sib, NULL); in smb_idmap_getsid()
92 smb_idmap_batch_destroy(&sib); in smb_idmap_getsid()
96 *sid = smb_sid_dup(sib.sib_maps[0].sim_sid); in smb_idmap_getsid()
98 smb_idmap_batch_destroy(&sib); in smb_idmap_getsid()
111 smb_idmap_batch_t sib; in smb_idmap_getid() local
115 stat = smb_idmap_batch_create(&sib, 1, SMB_IDMAP_SID2ID); in smb_idmap_getid()
119 sim = &sib.sib_maps[0]; in smb_idmap_getid()
121 stat = smb_idmap_batch_getid(sib.sib_idmaph, sim, sid, *id_type); in smb_idmap_getid()
123 smb_idmap_batch_destroy(&sib); in smb_idmap_getid()
128 stat = smb_idmap_batch_getmappings(&sib, NULL); in smb_idmap_getid()
131 smb_idmap_batch_destroy(&sib); in smb_idmap_getid()
136 smb_idmap_batch_destroy(&sib); in smb_idmap_getid()
147 smb_idmap_batch_create(smb_idmap_batch_t *sib, uint16_t nmap, int flags) in smb_idmap_batch_create() argument
151 if (!sib) in smb_idmap_batch_create()
154 bzero(sib, sizeof (smb_idmap_batch_t)); in smb_idmap_batch_create()
155 stat = idmap_get_create(&sib->sib_idmaph); in smb_idmap_batch_create()
162 sib->sib_flags = flags; in smb_idmap_batch_create()
163 sib->sib_nmap = nmap; in smb_idmap_batch_create()
164 sib->sib_size = nmap * sizeof (smb_idmap_t); in smb_idmap_batch_create()
165 sib->sib_maps = malloc(sib->sib_size); in smb_idmap_batch_create()
166 if (!sib->sib_maps) in smb_idmap_batch_create()
169 bzero(sib->sib_maps, sib->sib_size); in smb_idmap_batch_create()
179 smb_idmap_batch_destroy(smb_idmap_batch_t *sib) in smb_idmap_batch_destroy() argument
183 if (sib == NULL) in smb_idmap_batch_destroy()
186 if (sib->sib_idmaph) { in smb_idmap_batch_destroy()
187 idmap_get_destroy(sib->sib_idmaph); in smb_idmap_batch_destroy()
188 sib->sib_idmaph = NULL; in smb_idmap_batch_destroy()
191 if (sib->sib_maps == NULL) in smb_idmap_batch_destroy()
194 if (sib->sib_flags & SMB_IDMAP_ID2SID) { in smb_idmap_batch_destroy()
199 for (i = 0; i < sib->sib_nmap; i++) { in smb_idmap_batch_destroy()
200 smb_sid_free(sib->sib_maps[i].sim_sid); in smb_idmap_batch_destroy()
201 free(sib->sib_maps[i].sim_domsid); in smb_idmap_batch_destroy()
203 } else if (sib->sib_flags & SMB_IDMAP_SID2ID) { in smb_idmap_batch_destroy()
208 for (i = 0; i < sib->sib_nmap; i++) { in smb_idmap_batch_destroy()
209 free(sib->sib_maps[i].sim_domsid); in smb_idmap_batch_destroy()
213 if (sib->sib_size && sib->sib_maps) { in smb_idmap_batch_destroy()
214 free(sib->sib_maps); in smb_idmap_batch_destroy()
215 sib->sib_maps = NULL; in smb_idmap_batch_destroy()
351 smb_idmap_batch_getmappings(smb_idmap_batch_t *sib, in smb_idmap_batch_getmappings() argument
358 if ((stat = idmap_get_mappings(sib->sib_idmaph)) != IDMAP_SUCCESS) { in smb_idmap_batch_getmappings()
366 for (i = 0, sim = sib->sib_maps; i < sib->sib_nmap; i++, sim++) { in smb_idmap_batch_getmappings()
368 sib->sib_nerr++; in smb_idmap_batch_getmappings()
370 errcb(sib, sim); in smb_idmap_batch_getmappings()
371 if ((sib->sib_flags & SMB_IDMAP_SKIP_ERRS) == 0) { in smb_idmap_batch_getmappings()
377 if (smb_idmap_batch_binsid(sib) != 0) in smb_idmap_batch_getmappings()
391 smb_idmap_batch_binsid(smb_idmap_batch_t *sib) in smb_idmap_batch_binsid() argument
397 if (sib->sib_flags & SMB_IDMAP_SID2ID) in smb_idmap_batch_binsid()
401 sim = sib->sib_maps; in smb_idmap_batch_binsid()
402 for (i = 0; i < sib->sib_nmap; sim++, i++) { in smb_idmap_batch_binsid()