Lines Matching refs:psid
984 static BOOL fetch_sid_from_uid_cache(DOM_SID *psid, uid_t uid)
990 *psid = pc->sid;
992 (unsigned int)uid, sid_string_static(psid)));
1004 static BOOL fetch_uid_from_cache( uid_t *puid, const DOM_SID *psid )
1009 if (sid_compare(&pc->sid, psid) == 0) {
1012 (unsigned int)*puid, sid_string_static(psid)));
1024 void store_uid_sid_cache(const DOM_SID *psid, uid_t uid)
1030 if ( sid_check_is_in_unix_users( psid ) )
1052 sid_copy(&pc->sid, psid);
1061 static BOOL fetch_sid_from_gid_cache(DOM_SID *psid, gid_t gid)
1067 *psid = pc->sid;
1069 (unsigned int)gid, sid_string_static(psid)));
1081 static BOOL fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid)
1086 if (sid_compare(&pc->sid, psid) == 0) {
1089 (unsigned int)*pgid, sid_string_static(psid)));
1101 void store_gid_sid_cache(const DOM_SID *psid, gid_t gid)
1107 if ( sid_check_is_in_unix_groups( psid ) )
1129 sid_copy(&pc->sid, psid);
1133 sid_string_static(psid)));
1142 static void legacy_uid_to_sid(DOM_SID *psid, uid_t uid)
1147 ZERO_STRUCTP(psid);
1155 sid_copy(psid, get_global_sam_sid());
1156 sid_append_rid(psid, rid);
1162 uid_to_unix_users_sid(uid, psid);
1166 sid_string_static(psid)));
1168 store_uid_sid_cache(psid, uid);
1176 static void legacy_gid_to_sid(DOM_SID *psid, gid_t gid)
1180 ZERO_STRUCTP(psid);
1183 ret = pdb_gid_to_sid(gid, psid);
1193 gid_to_unix_groups_sid(gid, psid);
1197 sid_string_static(psid)));
1199 store_gid_sid_cache(psid, gid);
1207 static BOOL legacy_sid_to_uid(const DOM_SID *psid, uid_t *puid)
1212 if (sid_peek_check_rid(get_global_sam_sid(), psid, &rid)) {
1217 ret = pdb_sid_to_id(psid, &id, &type);
1223 sid_string_static(psid),
1234 DEBUG(10,("LEGACY: mapping failed for sid %s\n", sid_string_static(psid)));
1238 DEBUG(10,("LEGACY: sid %s -> uid %u\n", sid_string_static(psid),
1241 store_uid_sid_cache(psid, *puid);
1250 static BOOL legacy_sid_to_gid(const DOM_SID *psid, gid_t *pgid)
1257 if ((sid_check_is_in_builtin(psid) ||
1258 sid_check_is_in_wellknown_domain(psid))) {
1262 ret = pdb_getgrsid(&map, *psid);
1269 DEBUG(10,("LEGACY: mapping failed for sid %s\n", sid_string_static(psid)));
1273 if (sid_peek_check_rid(get_global_sam_sid(), psid, &rid)) {
1277 ret = pdb_sid_to_id(psid, &id, &type);
1284 sid_string_static(psid),
1295 DEBUG(10,("LEGACY: mapping failed for sid %s\n", sid_string_static(psid)));
1299 DEBUG(10,("LEGACY: sid %s -> gid %u\n", sid_string_static(psid),
1302 store_gid_sid_cache(psid, *pgid);
1311 void uid_to_sid(DOM_SID *psid, uid_t uid)
1313 ZERO_STRUCTP(psid);
1315 if (fetch_sid_from_uid_cache(psid, uid))
1318 if (!winbind_uid_to_sid(psid, uid)) {
1320 legacy_uid_to_sid(psid, uid);
1330 (unsigned int)uid, sid_string_static(psid)));
1332 store_uid_sid_cache(psid, uid);
1340 void gid_to_sid(DOM_SID *psid, gid_t gid)
1342 ZERO_STRUCTP(psid);
1344 if (fetch_sid_from_gid_cache(psid, gid))
1347 if (!winbind_gid_to_sid(psid, gid)) {
1349 legacy_gid_to_sid(psid, gid);
1359 (unsigned int)gid, sid_string_static(psid)));
1361 store_gid_sid_cache(psid, gid);
1369 BOOL sid_to_uid(const DOM_SID *psid, uid_t *puid)
1374 if (fetch_uid_from_cache(puid, psid))
1377 if (fetch_gid_from_cache(&gid, psid)) {
1383 if (sid_peek_check_rid(&global_sid_Unix_Users, psid, &rid)) {
1388 DEBUG(10,("sid %s -> uid %u\n", sid_string_static(psid),
1393 if (!winbind_sid_to_uid(puid, psid)) {
1395 return legacy_sid_to_uid(psid, puid);
1399 sid_string_static(psid)));
1406 DEBUG(10,("sid %s -> uid %u\n", sid_string_static(psid),
1409 store_uid_sid_cache(psid, *puid);
1418 BOOL sid_to_gid(const DOM_SID *psid, gid_t *pgid)
1423 if (fetch_gid_from_cache(pgid, psid))
1426 if (fetch_uid_from_cache(&uid, psid))
1431 if (sid_peek_check_rid(&global_sid_Unix_Groups, psid, &rid)) {
1436 DEBUG(10,("sid %s -> gid %u\n", sid_string_static(psid),
1444 if ( !winbind_sid_to_gid(pgid, psid) ) {
1446 return legacy_sid_to_gid(psid, pgid);
1450 sid_string_static(psid)));
1454 DEBUG(10,("sid %s -> gid %u\n", sid_string_static(psid),
1457 store_gid_sid_cache(psid, *pgid);