libc/winsup/cygwin/userinfo.h

41 lines
653 B
C
Raw Normal View History

/* userinfo.h
This file is part of Cygwin.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
details. */
#pragma once
enum fetch_user_arg_type_t {
SID_arg,
NAME_arg,
ID_arg,
* ldap.h: Remove index macros. (class cyg_ldap): Remove members srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Remove private method taking index argument. (cyg_ldap::get_num_attribute): Ditto. Add method taking attribute name. (cyg_ldap::get_primary_gid): Adjust to aforementioned change. (cyg_ldap::get_unix_uid): Ditto. (cyg_ldap::get_unix_gid): Ditto. * ldap.cc: Throughout, use msg and entry in place of srch_msg and srch_entry. (std_user_attr): Add sAMAccountName and objectSid. (group_attr): Ditto. (cyg_ldap::close): Drop handling of srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Move earlier in file. (cyg_ldap::get_num_attribute): Ditto. (cyg_ldap::enumerate_ad_accounts): Add comments for clarity. Use group_attr or user_attr rather than sid_attr to fetch all desired attributes for an account right away. (cyg_ldap::next_account): Store found SID in last_fetched_sid to skip calls to fetch_ad_account from fetch_account_from_windows. (cyg_ldap::get_string_attribute): Remove method taking index argument. (cyg_ldap::get_num_attribute): Ditto. * pwdgrp.h (class pg_ent): Fix formatting. Add member dom. * passwd.cc (pg_ent::enumerate_ad): Store current flat domain name in dom. Construct fetch_acc_t argument from LDAP attributes and call fetch_account_from_windows with that. * userinfo.h (enum fetch_user_arg_type_t): Rename FULL_grp_arg to FULL_acc_arg. Change throughout. (struct fetch_acc_t): Rename from fetch_full_grp_t. Change throughout. (struct fetch_user_arg_t): Rename full_grp to full_acc. Change throughout.
2015-02-24 21:52:57 +01:00
FULL_acc_arg,
};
#ifdef __INSIDE_CYGWIN__
* ldap.h: Remove index macros. (class cyg_ldap): Remove members srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Remove private method taking index argument. (cyg_ldap::get_num_attribute): Ditto. Add method taking attribute name. (cyg_ldap::get_primary_gid): Adjust to aforementioned change. (cyg_ldap::get_unix_uid): Ditto. (cyg_ldap::get_unix_gid): Ditto. * ldap.cc: Throughout, use msg and entry in place of srch_msg and srch_entry. (std_user_attr): Add sAMAccountName and objectSid. (group_attr): Ditto. (cyg_ldap::close): Drop handling of srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Move earlier in file. (cyg_ldap::get_num_attribute): Ditto. (cyg_ldap::enumerate_ad_accounts): Add comments for clarity. Use group_attr or user_attr rather than sid_attr to fetch all desired attributes for an account right away. (cyg_ldap::next_account): Store found SID in last_fetched_sid to skip calls to fetch_ad_account from fetch_account_from_windows. (cyg_ldap::get_string_attribute): Remove method taking index argument. (cyg_ldap::get_num_attribute): Ditto. * pwdgrp.h (class pg_ent): Fix formatting. Add member dom. * passwd.cc (pg_ent::enumerate_ad): Store current flat domain name in dom. Construct fetch_acc_t argument from LDAP attributes and call fetch_account_from_windows with that. * userinfo.h (enum fetch_user_arg_type_t): Rename FULL_grp_arg to FULL_acc_arg. Change throughout. (struct fetch_acc_t): Rename from fetch_full_grp_t. Change throughout. (struct fetch_user_arg_t): Rename full_grp to full_acc. Change throughout.
2015-02-24 21:52:57 +01:00
struct fetch_acc_t {
cygpsid sid;
PUNICODE_STRING name;
PUNICODE_STRING dom;
SID_NAME_USE acc_type;
};
struct fetch_user_arg_t
{
fetch_user_arg_type_t type;
union {
cygpsid *sid;
const char *name;
uint32_t id;
* ldap.h: Remove index macros. (class cyg_ldap): Remove members srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Remove private method taking index argument. (cyg_ldap::get_num_attribute): Ditto. Add method taking attribute name. (cyg_ldap::get_primary_gid): Adjust to aforementioned change. (cyg_ldap::get_unix_uid): Ditto. (cyg_ldap::get_unix_gid): Ditto. * ldap.cc: Throughout, use msg and entry in place of srch_msg and srch_entry. (std_user_attr): Add sAMAccountName and objectSid. (group_attr): Ditto. (cyg_ldap::close): Drop handling of srch_msg and srch_entry. (cyg_ldap::get_string_attribute): Move earlier in file. (cyg_ldap::get_num_attribute): Ditto. (cyg_ldap::enumerate_ad_accounts): Add comments for clarity. Use group_attr or user_attr rather than sid_attr to fetch all desired attributes for an account right away. (cyg_ldap::next_account): Store found SID in last_fetched_sid to skip calls to fetch_ad_account from fetch_account_from_windows. (cyg_ldap::get_string_attribute): Remove method taking index argument. (cyg_ldap::get_num_attribute): Ditto. * pwdgrp.h (class pg_ent): Fix formatting. Add member dom. * passwd.cc (pg_ent::enumerate_ad): Store current flat domain name in dom. Construct fetch_acc_t argument from LDAP attributes and call fetch_account_from_windows with that. * userinfo.h (enum fetch_user_arg_type_t): Rename FULL_grp_arg to FULL_acc_arg. Change throughout. (struct fetch_acc_t): Rename from fetch_full_grp_t. Change throughout. (struct fetch_user_arg_t): Rename full_grp to full_acc. Change throughout.
2015-02-24 21:52:57 +01:00
fetch_acc_t *full_acc;
};
/* Only used in fetch_account_from_file/line. */
size_t len;
};
#endif