ad_gpo.c revision 818c55be478ca2539a86567280114e823d79a51f
97018cf5fa25b494adffd7e9b4e87320dae6bf47Christian Maeder Yassir Elley <yelley@redhat.com>
306763c67bb99228487345b32ab8c5c6cd41f23cChristian Maeder Copyright (C) 2013 Red Hat
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder This program is free software; you can redistribute it and/or modify
e6d40133bc9f858308654afb1262b8b483ec5922Till Mossakowski it under the terms of the GNU General Public License as published by
679d3f541f7a9ede4079e045f7758873bb901872Till Mossakowski the Free Software Foundation; either version 3 of the License, or
679d3f541f7a9ede4079e045f7758873bb901872Till Mossakowski (at your option) any later version.
306763c67bb99228487345b32ab8c5c6cd41f23cChristian Maeder This program is distributed in the hope that it will be useful,
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
4c8d3c5a9e938633f6147b5a595b9b93bfca99e6Christian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder GNU General Public License for more details.
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian Maeder You should have received a copy of the GNU General Public License
f69658e57cba7ecb37c0d84181f4c563215c2534Till Mossakowski along with this program. If not, see <http://www.gnu.org/licenses/>.
d420c2a27c4dfa0a9c8031449db2e1a89ad2cc3aChristian Maeder * This file implements the following pair of *public* functions (see header):
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder * ad_gpo_access_send/recv: provides client-side GPO processing
1842453990fed8a1bd7a5ac792d7982c1d2bfcd5Christian Maeder * This file also implements the following pairs of *private* functions (which
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian Maeder * are used by the public functions):
ba904a15082557e939db689fcfba0c68c9a4f740Christian Maeder * ad_gpo_process_som_send/recv: populate list of gp_som objects
e182d0ec56025d97d74829cac75ee31eec12b093Maciek Makowski * ad_gpo_process_gpo_send/recv: populate list of gp_gpo objects
697e63e30aa3c309a1ef1f9357745111f8dfc5a9Christian Maeder * ad_gpo_process_cse_send/recv: retrieve policy file data
c4040537e6f2153af475dd8b07260a1ee9a56ac0Christian Maeder/* == gpo-ldap constants =================================================== */
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder#define AD_AT_CONFIG_NC "configurationNamingContext"
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder#define AD_AT_NT_SEC_DESC "nTSecurityDescriptor"
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder#define AD_AT_FILE_SYS_PATH "gPCFileSysPath"
1e3950d5c1f0e041dd7677856e43f07796567d5bChristian Maeder#define AD_AT_MACHINE_EXT_NAMES "gPCMachineExtensionNames"
21dae7237ac384abdb94a81e00b3f099873ec623Till Mossakowski#define AD_AT_FUNC_VERSION "gPCFunctionalityVersion"
b03274844ecd270f9e9331f51cc4236a33e2e671Christian Maeder#define UAC_WORKSTATION_TRUST_ACCOUNT 0x00001000
a1c6679d00e15a949730ab640159e0adc5b0e3e7Christian Maeder#define AD_AGP_GUID "edacfd8f-ffb3-11d1-b41d-00a0c968f939"
2604ffeb18ba727a1c9a683f86629c4ce01b06acChristian Maeder#define AD_AUTHENTICATED_USERS_SID "S-1-5-11"
4fc3dccf009f8ad9522960e54ab7a5c3d601e342Klaus Luettich/* == gpo-smb constants ==================================================== */
4fc3dccf009f8ad9522960e54ab7a5c3d601e342Klaus Luettich#define ALLOW_LOGON_INTERACTIVE "SeInteractiveLogonRight"
4fc3dccf009f8ad9522960e54ab7a5c3d601e342Klaus Luettich#define DENY_LOGON_INTERACTIVE "SeDenyInteractiveLogonRight"
4fc3dccf009f8ad9522960e54ab7a5c3d601e342Klaus Luettich#define ALLOW_LOGON_REMOTE_INTERACTIVE "SeRemoteInteractiveLogonRight"
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder#define DENY_LOGON_REMOTE_INTERACTIVE "SeDenyRemoteInteractiveLogonRight"
f0e85ee7e4accfc01f46aa0363acc59fcd248e8aTill Mossakowski#define ALLOW_LOGON_NETWORK "SeNetworkLogonRight"
f0e85ee7e4accfc01f46aa0363acc59fcd248e8aTill Mossakowski#define DENY_LOGON_NETWORK "SeDenyNetworkLogonRight"
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian Maeder#define ALLOW_LOGON_BATCH "SeBatchLogonRight"
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder#define DENY_LOGON_BATCH "SeDenyBatchLogonRight"
c4040537e6f2153af475dd8b07260a1ee9a56ac0Christian Maeder#define ALLOW_LOGON_SERVICE "SeServiceLogonRight"
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder#define DENY_LOGON_SERVICE "SeDenyServiceLogonRight"
4b0e0613129ebfc53e3e87985c20a537da91d18dChristian Maeder#define GP_EXT_GUID_SECURITY "{827D319E-6EAC-11D2-A4EA-00C04F79F83A}"
4b0e0613129ebfc53e3e87985c20a537da91d18dChristian Maeder#define GP_EXT_GUID_SECURITY_SUFFIX "/Machine/Microsoft/Windows NT/SecEdit/GptTmpl.inf"
a3a7d8b3cdf05c8040c62dbcf9a15dc5042cd721Christian Maeder#define GPO_CHILD SSSD_LIBEXEC_PATH"/gpo_child"
e97bcfa4f74907e1a5ccfc3bc1509d1849cda603Christian Maeder/* fd used by the gpo_child process for logging */
ff21411cdf7c6d8d3acebbdebeade1d5ac502b83Christian Maeder/* == common data structures and declarations ============================= */
bcd35fcdda4233c42766519772b2e9fbab57f975Christian Maederstruct tevent_req *ad_gpo_process_som_send(TALLOC_CTX *mem_ctx,
be8b8876edf3d7138ddd39a4ec07d857dde5bbb5Christian Maederint ad_gpo_process_som_recv(struct tevent_req *req,
254df6f22d01eacf7c57b85729e0445747b630d9Christian Maederstruct tevent_req *ad_gpo_process_gpo_send(TALLOC_CTX *mem_ctx,
b83ff3749d99d03b641adee264b781039a551addChristian Maederint ad_gpo_process_gpo_recv(struct tevent_req *req,
17d4f8c5576d93f36cafe68161cdb960ec49ce7cChristian Maederstruct tevent_req *ad_gpo_process_cse_send(TALLOC_CTX *mem_ctx,
26ed2a19326560786ff94dfc462309d6d5d862a8Heng Jiangint ad_gpo_process_cse_recv(struct tevent_req *req);
21dae7237ac384abdb94a81e00b3f099873ec623Till Mossakowski/* == ad_gpo_parse_map_options and helpers ==================================*/
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder#define GPO_GDM_FINGERPRINT "gdm-fingerprint"
4b0e0613129ebfc53e3e87985c20a537da91d18dChristian Maederconst char *gpo_map_interactive_defaults[] =
4b0e0613129ebfc53e3e87985c20a537da91d18dChristian Maeder GPO_GDM_FINGERPRINT, GPO_GDM_PASSWORD, GPO_GDM_SMARTCARD, GPO_KDM, NULL};
4b0e0613129ebfc53e3e87985c20a537da91d18dChristian Maederconst char *gpo_map_remote_interactive_defaults[] = {GPO_SSHD, NULL};
26ed2a19326560786ff94dfc462309d6d5d862a8Heng Jiangconst char *gpo_map_network_defaults[] = {GPO_FTP, GPO_SAMBA, NULL};
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian Maederconst char *gpo_map_batch_defaults[] = {GPO_CROND, NULL};
7297175957c5ad3c0498032190b1dee9ec5fb873Christian Maederconst char *gpo_map_service_defaults[] = {NULL};
4b0e0613129ebfc53e3e87985c20a537da91d18dChristian Maederconst char *gpo_map_permit_defaults[] = {GPO_SUDO, GPO_SUDO_I,
1b05bdb88b90d3c947351f262d7ae7d68f0a4a6fTill Mossakowskiconst char *gpo_map_deny_defaults[] = {NULL};
948f37fdb71c544ff4c907bc5863702648cf36e4Christian Maederstruct gpo_map_option_entry gpo_map_option_entries[] = {
948f37fdb71c544ff4c907bc5863702648cf36e4Christian Maeder {GPO_MAP_INTERACTIVE, AD_GPO_MAP_INTERACTIVE, gpo_map_interactive_defaults,
1e3950d5c1f0e041dd7677856e43f07796567d5bChristian Maeder ALLOW_LOGON_INTERACTIVE, DENY_LOGON_INTERACTIVE},
7f7460e7095628f3437b116ee78d3043d11f8febChristian Maeder {GPO_MAP_REMOTE_INTERACTIVE, AD_GPO_MAP_REMOTE_INTERACTIVE,
89ab08979dc23d72e9e09c8990a8c44847041d6fChristian Maeder ALLOW_LOGON_REMOTE_INTERACTIVE, DENY_LOGON_REMOTE_INTERACTIVE},
89ab08979dc23d72e9e09c8990a8c44847041d6fChristian Maeder {GPO_MAP_NETWORK, AD_GPO_MAP_NETWORK, gpo_map_network_defaults,
1e3950d5c1f0e041dd7677856e43f07796567d5bChristian Maeder {GPO_MAP_BATCH, AD_GPO_MAP_BATCH, gpo_map_batch_defaults,
89ab08979dc23d72e9e09c8990a8c44847041d6fChristian Maeder {GPO_MAP_SERVICE, AD_GPO_MAP_SERVICE, gpo_map_service_defaults,
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder {GPO_MAP_PERMIT, AD_GPO_MAP_PERMIT, gpo_map_permit_defaults, NULL, NULL},
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder {GPO_MAP_DENY, AD_GPO_MAP_DENY, gpo_map_deny_defaults, NULL, NULL},
5a87ed846cc38cb0e3adf8f736d95614d3e724a3Christian Maederconst char* gpo_map_type_string(int gpo_map_type)
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder case GPO_MAP_INTERACTIVE: return "Interactive";
1f315f2e146d15c0aec01f7ae076708bbac29796Christian Maeder case GPO_MAP_REMOTE_INTERACTIVE: return "Remote Interactive";
3bcf8bbafdda23d3c6be2deec9e68f98223b78c1Christian Maederstatic inline bool
3bcf8bbafdda23d3c6be2deec9e68f98223b78c1Christian Maederad_gpo_service_in_list(char **list, size_t nlist, const char *str)
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder for (i = 0; i < nlist; i++) {
5a87ed846cc38cb0e3adf8f736d95614d3e724a3Christian Maeder return (i < nlist) ? true : false;
4a8f990902448d0562fbe1a98ce685ddbd531d38Christian Maederad_gpo_parse_map_option_helper(enum gpo_map_type gpo_map_type,
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder hret = hash_lookup(options_table, &key, &val);
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder if (hret != HASH_SUCCESS && hret != HASH_ERROR_KEY_NOT_FOUND) {
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder DEBUG(SSSDBG_OP_FAILURE, "Error checking hash table: [%s]\n",
7688e20f844fe88f75c04016841ebb5e5e3d927fChristian Maeder /* handle unexpected case where mapping for key already exists */
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder /* mapping for key exists for same map type; no error */
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder "PAM service %s maps to %s multiple times\n", key.str,
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder /* mapping for key exists for different map type; error! */
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder "PAM service %s maps to both %s and %s\n", key.str,
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder gpo_map_type_string(val.i), gpo_map_type_string(gpo_map_type));
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder /* handle expected case where mapping for key doesn't already exist */
996a56a455d65cfac4ddedd44fd90cfc1ea849aeChristian Maeder hret = hash_enter(options_table, &key, &val);
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder DEBUG(SSSDBG_OP_FAILURE, "Error checking hash table: [%s]\n",
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maederad_gpo_parse_map_option(TALLOC_CTX *mem_ctx,
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder DEBUG(SSSDBG_TRACE_ALL, "gpo_map_type: %s\n",
54fb645be0a806e7fd3c0eed5691c2153eb8d518Christian Maeder ret = split_on_separator(tmp_ctx, conf_str, ',', true, true,
1b05bdb88b90d3c947351f262d7ae7d68f0a4a6fTill Mossakowski "Cannot parse list of service names %s: %d\n", conf_str, ret);
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder add_list = talloc_zero_array(tmp_ctx, char *, conf_list_size);
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder remove_list = talloc_zero_array(tmp_ctx, char *, conf_list_size);
ef2affdc0cdf3acd5c051597c04ab9b08a346a7dChristian Maeder if (add_list == NULL || remove_list == NULL) {
c092fcac4b8f5c524c22ca579189c4487c13edf7Christian Maeder for (i = 0; i < conf_list_size; i++) {
fb7c3ffc41767729db506ad0ac1262ecfb5febf8Christian Maeder switch (conf_list[i][0]) {
8528053a6a766c3614276df0f59fb2a2e8ab6d18Christian Maeder DEBUG(SSSDBG_CRIT_FAILURE, "ad_gpo_map values must start with"
8528053a6a766c3614276df0f59fb2a2e8ab6d18Christian Maeder "either '+' (for adding service) or '-' (for removing service), "
2afae0880da7ca73c9376fd4d653ab19833fe858Christian Maeder "got '%s'\n",
3ea571db6dd6e0c42d02de4e56648c7cd86a3734Christian Maeder /* Start by adding explicitly added services ('+') to hashtable */
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder for (i = 0; i < ai; i++) {
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder /* if the service is explicitly configured to be removed, skip it */
3bcf8bbafdda23d3c6be2deec9e68f98223b78c1Christian Maeder if (ad_gpo_service_in_list(remove_list, ri, add_list[i])) {
3ea571db6dd6e0c42d02de4e56648c7cd86a3734Christian Maeder ret = ad_gpo_parse_map_option_helper(gpo_map_type, key, options_table);
3ea571db6dd6e0c42d02de4e56648c7cd86a3734Christian Maeder DEBUG(SSSDBG_OP_FAILURE, "Invalid configuration: %d\n", ret);
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder DEBUG(SSSDBG_TRACE_ALL, "Explicitly added service: %s\n", key.str);
ddd8734e5b3802a1a6c908af6b1e870af76c932dChristian Maeder /* Add defaults to hashtable */
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder for (i = 0; defaults[i]; i++) {
e5fae0f42a23c12fce5389f405659d4e5dce73a4Christian Maeder /* if the service is explicitly configured to be removed, skip it */
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder if (ad_gpo_service_in_list(remove_list, ri, defaults[i])) {
16023c23c9d17743033afd994ad11c386d17b376Christian Maeder key.str = talloc_strdup(mem_ctx, defaults[i]);
5c13d1acd6298569a5574c07c833cd3fdac4ae4cChristian Maeder ret = ad_gpo_parse_map_option_helper(gpo_map_type, key, options_table);
c616e681da8c052b62e14247fea522da099ac0e4Christian Maeder DEBUG(SSSDBG_OP_FAILURE, "Invalid configuration: %d\n", ret);
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maeder DEBUG(SSSDBG_TRACE_ALL, "Default service (not explicitly removed): %s\n",
95c3e5d11dcee331dc3876a9bf0c1d6daa38e2caChristian Maederad_gpo_parse_map_options(struct ad_access_ctx *access_ctx)
84a30e66aef85cc54d3dd6f8e408729007fe8809Christian Maeder for (i = 0; i < GPO_MAP_NUM_OPTS; i++) {
84a30e66aef85cc54d3dd6f8e408729007fe8809Christian Maeder struct gpo_map_option_entry entry = gpo_map_option_entries[i];
84a30e66aef85cc54d3dd6f8e408729007fe8809Christian Maeder char *entry_config = dp_opt_get_string(access_ctx->ad_options,
cd34f330714d6b3ef21a314ea98842c4b8c2fcedCui Jian ret = ad_gpo_parse_map_option(access_ctx, entry.gpo_map_type,
cd34f330714d6b3ef21a314ea98842c4b8c2fcedCui Jian DEBUG(SSSDBG_OP_FAILURE, "Invalid configuration: %d\n", ret);
5efed683fd173e9d53bd5f1929ba5b0c8a228710Christian Maeder /* default right (applicable for services without any mapping) */
2c08058468dab64c89a8eae51b56f9afb8b6cb71Cui Jian dp_opt_get_string(access_ctx->ad_options, AD_GPO_DEFAULT_RIGHT);
2d2826f9db2c17275f91b0104940a60a2f9fd44dChristian Maeder DEBUG(SSSDBG_TRACE_ALL, "gpo_default_right_config: %s\n",
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder /* if default right not set in config, set them to DENY */
22250d2b3c9f86fe19cba665d71c301de03db142Christian Maeder } else if (strncasecmp(gpo_default_right_config, "interactive",
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder } else if (strncasecmp(gpo_default_right_config, "remote_interactive",
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder gpo_default_right = GPO_MAP_REMOTE_INTERACTIVE;
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder } else if (strncasecmp(gpo_default_right_config, "network",
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder } else if (strncasecmp(gpo_default_right_config, "batch",
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder } else if (strncasecmp(gpo_default_right_config, "service",
3d4e57e86d8aee818b589cd1029838e0accade55Christian Maeder } else if (strncasecmp(gpo_default_right_config, "permit",
7688e20f844fe88f75c04016841ebb5e5e3d927fChristian Maeder } else if (strncasecmp(gpo_default_right_config, "deny",
goto fail;
fail:
return ret;
/* == ad_gpo_access_send/recv helpers =======================================*/
static errno_t
const char *user,
const char **_user_sid,
const char ***_group_sids,
int *_group_size)
int ret = 0;
int num_group_sids = 0;
goto done;
return ret;
return ret;
goto done;
for (i = 0; i < num_group_sids; i++) {
goto done;
goto done;
return EOK;
done:
return ret;
static errno_t
const char **group_sids,
int group_size,
bool *_included)
bool included = false;
return EFAULT;
if (included) {
*_included = true;
return EOK;
for (i = 0; i < group_size; i++) {
return EFAULT;
if (included) {
*_included = true;
return EOK;
*_included = false;
return EOK;
const char *user_sid,
const char **group_sids,
int group_size)
bool agp_included = false;
bool included = false;
int ret = 0;
return AD_GPO_ACE_NEUTRAL;
return AD_GPO_ACE_DENIED;
if (!included) {
return AD_GPO_ACE_NEUTRAL;
agp_included = true;
agp_included = false;
if (agp_included) {
return AD_GPO_ACE_ALLOWED;
return AD_GPO_ACE_DENIED;
return AD_GPO_ACE_DENIED;
const char *user_sid,
const char **group_sids,
int group_size,
bool *_dacl_access_allowed)
if (num_aces == 0) {
*_dacl_access_allowed = false;
return EOK;
switch (ace_status) {
case AD_GPO_ACE_NEUTRAL:
case AD_GPO_ACE_ALLOWED:
*_dacl_access_allowed = true;
return EOK;
case AD_GPO_ACE_DENIED:
*_dacl_access_allowed = false;
return EOK;
*_dacl_access_allowed = false;
return EOK;
static errno_t
const char *user,
int num_candidate_gpos,
int *_num_dacl_filtered_gpos)
int ret = 0;
int group_size = 0;
int gpo_dn_idx = 0;
bool access_allowed = false;
goto done;
goto done;
struct gp_gpo *,
goto done;
for (i = 0; i < num_candidate_gpos; i++) {
access_allowed = false;
access_allowed = true;
if (access_allowed) {
gpo_dn_idx++;
done:
return ret;
const char **gpo_cse_guids,
int num_gpo_cse_guids)
for (i = 0; i < num_gpo_cse_guids; i++) {
static errno_t
const char *cse_guid,
int *_num_cse_filtered_gpos)
int ret = 0;
int gpo_dn_idx = 0;
bool included;
goto done;
struct gp_gpo *,
goto done;
for (i = 0; i < num_dacl_filtered_gpos; i++) {
if (included) {
gpo_dn_idx++;
done:
return ret;
int privilege_size,
const char *user_sid,
const char **group_sids,
int group_size)
for (i = 0; i < privilege_size; i++) {
for (j = 0; j < group_size; j++) {
static errno_t
const char *policy_setting_key,
char **_policy_setting_value)
int ret;
const char *policy_setting_value;
if (ret != 0) {
goto done;
goto done;
if (ret != 0) {
goto done;
if (policy_setting_value[0]) {
if (!*_policy_setting_value) {
goto done;
done:
return ret;
static errno_t
const char *filename)
int ret;
goto done;
if (ret != 0) {
goto done;
if (ret != 0) {
goto done;
if (ret != 0) {
goto done;
for (i = 0; i < GPO_MAP_NUM_OPTS; i++) {
&allow_value);
goto done;
goto done;
&deny_value);
goto done;
goto done;
done:
return ret;
static errno_t
const char *user,
char **allowed_sids,
int allowed_size,
char **denied_sids,
int denied_size)
const char *user_sid;
const char **group_sids;
int group_size = 0;
bool access_granted = false;
bool access_denied = false;
int ret;
for (j= 0; j < allowed_size; j++) {
for (j= 0; j < denied_size; j++) {
goto done;
for (j= 0; j < group_size; j++) {
group_sids[j]);
if (allowed_size == 0) {
access_granted = true;
return EOK;
switch (gpo_mode) {
return ERR_ACCESS_DENIED;
return EOK;
return EINVAL;
done:
if (ret) {
return ret;
const char *key,
char ***_sids_list,
int *_sids_list_size)
int ret;
const char *value;
int sids_list_size;
goto done;
sids_list_size = 0;
goto done;
for (i = 0; i < sids_list_size; i++) {
sids_list[i]++;
done:
return ret;
static errno_t
const char *user,
int ret;
char **allow_sids;
int allow_size ;
char **deny_sids;
int deny_size;
goto done;
goto done;
goto done;
done:
return ret;
/* == ad_gpo_access_send/recv implementation ================================*/
struct ad_gpo_access_state {
char *server_hostname;
int timeout;
const char *user;
int gpo_timeout_option;
const char *ad_hostname;
const char *target_dn;
int cse_gpo_index;
struct tevent_req *
const char *user,
const char *service)
int hret;
return NULL;
goto immediately;
goto immediately;
goto immediately;
goto immediately;
goto immediately;
goto immediately;
goto immediately;
return req;
static errno_t
const char *user,
user,
domain);
goto done;
done:
return ret;
char *filter;
char *sam_account_name;
char *domain_dn;
int dp_error;
char *server_uri;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
int ret;
int dp_error;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
int ret;
goto done;
som_list);
goto done;
done:
int ret;
int dp_error;
int num_candidate_gpos = 0;
const char **cse_filtered_gpo_guids;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
switch (ret) {
case ENOENT:
goto done;
done:
static errno_t
bool send_to_child = true;
int cached_gpt_version = 0;
return ENOMEM;
&res);
send_to_child = false;
return ret;
return EAGAIN;
* with the user_sid/group_sids of interest.
int ret;
goto done;
goto done;
goto done;
done:
return EOK;
/* == ad_gpo_process_som_send/recv helpers ================================= */
static errno_t
const char *dn,
const char **_parent_dn)
int ret;
goto done;
done:
return ret;
static errno_t
const char *target_dn,
int *_num_soms,
int ret;
int rdn_count = 0;
int som_idx = 0;
goto done;
goto done;
goto done;
if (rdn_count == 0) {
goto done;
goto done;
goto done;
goto done;
som_idx++;
done:
return ret;
static errno_t
const char *som_dn,
char *raw_gplink_value,
bool allow_enforced_only)
char *ptr;
char *first;
char *last;
char *dn;
char *gplink_options;
int ret;
int gplink_count = 0;
int num_enabled = 0;
return EINVAL;
goto done;
ptr++;
gplink_count++;
if (gplink_count == 0) {
goto done;
goto done;
num_enabled = 0;
for (i = 0; i < gplink_count; i++) {
goto done;
last++;
goto done;
if (errno != 0) {
goto done;
goto done;
goto done;
if (gplink_number == 0) {
num_enabled++;
num_enabled++;
goto done;
done:
return ret;
/* == ad_gpo_process_som_send/recv implementation ========================== */
struct ad_gpo_process_som_state {
int timeout;
bool allow_enforced_only;
char *site_name;
char *site_dn;
int som_index;
int num_soms;
struct tevent_req *
int timeout,
const char *target_dn,
const char *domain_name)
return NULL;
goto immediately;
goto immediately;
goto immediately;
return req;
int ret;
char *site;
* retrieved at that point (see https://fedorahosted.org/sssd/ticket/2276)
int ret;
int dp_error;
const char *configNC;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
static errno_t
return ENOMEM;
return EAGAIN;
int ret;
int dp_error;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
allow_enforced_only = 0;
if (errno != 0) {
goto done;
(char *)raw_gplink_value,
goto done;
if (allow_enforced_only) {
done:
return EOK;
/* == ad_gpo_process_gpo_send/recv helpers ================================= */
static errno_t
int *_num_candidate_gpos)
int num_candidate_gpos = 0;
int gpo_dn_idx = 0;
int num_enforced = 0;
int enforced_idx = 0;
int num_unenforced = 0;
int unenforced_idx = 0;
int ret;
goto done;
while (som_list[i]) {
goto done;
num_enforced++;
if (num_candidate_gpos == 0) {
*_num_candidate_gpos = 0;
goto done;
goto done;
goto done;
while (som_list[i]) {
goto done;
goto done;
enforced_idx++;
goto done;
struct gp_gpo *,
goto done;
gpo_dn_idx = 0;
goto done;
goto done;
gpo_dn_idx++;
for (i = 0; i < num_enforced; i++) {
goto done;
goto done;
gpo_dn_idx++;
done:
return ret;
* server_hostname = "adserver.foo.com", then
* _smb_server = "smb://adserver.foo.com"
* _smb_path = "/foo.com/..."
* For example, input_path = "\\foo.com\SysVol" is not a valid input_path,
static errno_t
char *server_hostname,
char *input_path,
const char **_smb_server,
const char **_smb_share,
const char **_smb_path)
char *ptr;
int ret;
int num_seps = 0;
goto done;
num_seps++;
ptr++;
ptr++;
ptr++;
if (num_seps == 0) {
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
static errno_t
char *raw_machine_ext_names_value,
const char ***_gpo_cse_guids,
int *_num_gpo_cse_guids)
char *ptr;
char *first;
char *last;
char *cse_guid;
char *tool_guid;
const char **gpo_cse_guids;
int ret;
int num_gpo_cse_guids = 0;
return EINVAL;
goto done;
ptr++;
if (num_gpo_cse_guids == 0) {
goto done;
goto done;
for (i = 0; i < num_gpo_cse_guids; i++) {
last++;
first ++;
for (i = 0; i < num_gpo_cse_guids; i++) {
done:
return ret;
enum ndr_err_code
struct security_descriptor *r);
return EINVAL;
&sd);
return EINVAL;
return EOK;
/* == ad_gpo_process_gpo_send/recv implementation ========================== */
struct ad_gpo_process_gpo_state {
char *server_hostname;
int timeout;
int num_candidate_gpos;
int gpo_index;
struct tevent_req *
char *server_hostname,
int timeout,
return NULL;
goto immediately;
goto immediately;
return req;
static errno_t
return ENOMEM;
return EAGAIN;
int ret;
int dp_error;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
(char *)raw_machine_ext_names,
goto done;
done:
int *num_candidate_gpos)
return EOK;
/* == ad_gpo_process_cse_send/recv helpers ================================= */
static errno_t
const char *smb_server,
const char *smb_share,
const char *smb_path,
const char *smb_cse_suffix,
int cached_gpt_version,
int smb_server_length;
int smb_share_length;
int smb_path_length;
return ENOMEM;
return ENOMEM;
rp = 0;
return EOK;
static errno_t
int ret;
size_t p = 0;
return ret;
/* == ad_gpo_process_cse_send/recv implementation ========================== */
struct ad_gpo_process_cse_state {
int gpo_timeout_option;
const char *gpo_guid;
const char *smb_path;
const char *smb_cse_suffix;
struct tevent_req *
bool send_to_child,
const char *gpo_guid,
const char *smb_server,
const char *smb_share,
const char *smb_path,
const char *smb_cse_suffix,
int cached_gpt_version,
int gpo_timeout_option)
return NULL;
if (!send_to_child) {
goto immediately;
goto immediately;
goto immediately;
goto immediately;
goto immediately;
return req;
return req;
int ret;
int ret;
} else if (child_result != 0){
return EOK;
static errno_t
int ret;
return err;
return err;
return err;
return ret;
return err;
return EOK;