* autoload.cc (LsaLookupSids): Import.
* cygserver_pwdgrp.h: Include userinfo.h. Drop workaround defining fetch_user_arg_type_t locally. * grp.cc (internal_getgrsid_cachedonly): New function. (internal_getgrfull): Ditto. (internal_getgroups): Rearrange function. Center around fetching all cached group info first, calling LsaLookupSids on all so far non-cached groups second. Pass all available info to new internal_getgrfull call. * pwdgrp.h: Include userinfo.h. Move definitions of fetch_user_arg_type_t and fetch_user_arg_t there. (pwdgrp::add_group_from_windows): Declare with getting full group info. Called from internal_getgrfull. * uinfo.cc (pwdgrp::add_group_from_windows): Define. (pwdgrp::fetch_account_from_line): Add default case. (pwdgrp::fetch_account_from_file): Ditto. (pwdgrp::fetch_account_from_windows): Handle FULL_grp_arg. (client_request_pwdgrp::client_request_pwdgrp): Add default case. * userinfo.h: New header. (enum fetch_user_arg_type_t): Add FULL_grp_arg. (struct fetch_full_grp_t): New datatype.
This commit is contained in:
38
winsup/cygwin/userinfo.h
Normal file
38
winsup/cygwin/userinfo.h
Normal file
@ -0,0 +1,38 @@
|
||||
/* userinfo.h
|
||||
|
||||
Copyright 2015 Red Hat inc.
|
||||
|
||||
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,
|
||||
FULL_grp_arg,
|
||||
};
|
||||
|
||||
struct fetch_full_grp_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;
|
||||
fetch_full_grp_t *full_grp;
|
||||
};
|
||||
/* Only used in fetch_account_from_file/line. */
|
||||
size_t len;
|
||||
};
|
Reference in New Issue
Block a user