Пример #1
0
static NTSTATUS idmap_pdb_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids)
{
	int i;

	for (i = 0; ids[i]; i++) {
		if (pdb_sid_to_id(ids[i]->sid, &ids[i]->xid)) {
			ids[i]->status = ID_MAPPED;
		} else {
			/* Query Failed */
			ids[i]->status = ID_UNMAPPED;
		}
	}

	return NT_STATUS_OK;
}
Пример #2
0
static NTSTATUS idmap_pdb_sids_to_unixids(struct idmap_domain *dom, struct id_map **ids)
{
	int i;

	if (! dom->initialized) {
		return NT_STATUS_UNSUCCESSFUL;
	}

	for (i = 0; ids[i]; i++) {
		enum lsa_SidType type;
		union unid_t id;
		
		if (pdb_sid_to_id(ids[i]->sid, &id, &type)) {
			switch (type) {
			case SID_NAME_USER:
				ids[i]->xid.id = id.uid;
				ids[i]->xid.type = ID_TYPE_UID;
				ids[i]->status = ID_MAPPED;
				break;

			case SID_NAME_DOM_GRP:
			case SID_NAME_ALIAS:
			case SID_NAME_WKN_GRP:
				ids[i]->xid.id = id.gid;
				ids[i]->xid.type = ID_TYPE_GID;
				ids[i]->status = ID_MAPPED;
				break;

			default: /* ?? */
				/* make sure it is marked as unmapped */
				ids[i]->status = ID_UNKNOWN;
				break;
			}
		} else {
			/* Query Failed */
			ids[i]->status = ID_UNMAPPED;
		}
	}

	return NT_STATUS_OK;
}