19d3aba12c70528708be9440aca66038a291f29eYassir Elley AD GPO Backend Module -- perform SMB and CSE processing in a child process
19d3aba12c70528708be9440aca66038a291f29eYassir Elley Yassir Elley <yelley@redhat.com>
19d3aba12c70528708be9440aca66038a291f29eYassir Elley Copyright (C) 2013 Red Hat
19d3aba12c70528708be9440aca66038a291f29eYassir Elley This program is free software; you can redistribute it and/or modify
19d3aba12c70528708be9440aca66038a291f29eYassir Elley it under the terms of the GNU General Public License as published by
19d3aba12c70528708be9440aca66038a291f29eYassir Elley the Free Software Foundation; either version 3 of the License, or
19d3aba12c70528708be9440aca66038a291f29eYassir Elley (at your option) any later version.
19d3aba12c70528708be9440aca66038a291f29eYassir Elley This program is distributed in the hope that it will be useful,
19d3aba12c70528708be9440aca66038a291f29eYassir Elley but WITHOUT ANY WARRANTY; without even the implied warranty of
19d3aba12c70528708be9440aca66038a291f29eYassir Elley MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19d3aba12c70528708be9440aca66038a291f29eYassir Elley GNU General Public License for more details.
19d3aba12c70528708be9440aca66038a291f29eYassir Elley You should have received a copy of the GNU General Public License
19d3aba12c70528708be9440aca66038a291f29eYassir Elley along with this program. If not, see <http://www.gnu.org/licenses/>.
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* cached_gpt_version */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley SAFEALIGN_COPY_UINT32_CHECK(&cached_gpt_version, buf + p, size, &p);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "cached_gpt_version: %d\n", cached_gpt_version);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* smb_server */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_server length: %d\n", len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ibuf->smb_server = talloc_strndup(ibuf, (char *)(buf + p), len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_server: %s\n", ibuf->smb_server);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* smb_share */
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_share length: %d\n", len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ibuf->smb_share = talloc_strndup(ibuf, (char *)(buf + p), len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_share: %s\n", ibuf->smb_share);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* smb_path */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_path length: %d\n", len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ibuf->smb_path = talloc_strndup(ibuf, (char *)(buf + p), len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_path: %s\n", ibuf->smb_path);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* smb_cse_suffix */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley SAFEALIGN_COPY_UINT32_CHECK(&len, buf + p, size, &p);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_cse_suffix length: %d\n", len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ibuf->smb_cse_suffix = talloc_strndup(ibuf, (char *)(buf + p), len);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley if (ibuf->smb_cse_suffix == NULL) return ENOMEM;
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_cse_suffix: %s\n", ibuf->smb_cse_suffix);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley /* A buffer with the following structure must be created:
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * uint32_t sysvol_gpt_version (required)
19d3aba12c70528708be9440aca66038a291f29eYassir Elley * uint32_t status of the request (required)
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley DEBUG(SSSDBG_TRACE_FUNC, "result [%d]\n", result);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* sysvol_gpt_version */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley SAFEALIGN_SET_UINT32(&r->buf[p], sysvol_gpt_version, &p);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley /* result */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = pack_buffer(r, sysvol_gpt_version, result);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "pack_buffer failed\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "r->size: %zu\n", r->size);
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley const char * pShare,
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley /* since we are using kerberos for authentication, we simply return */
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley * This function prepares the gpo_cache by:
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - parsing the input_smb_path into its component directories
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley * - creating each component directory (if it doesn't already exist)
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elleystatic errno_t prepare_gpo_cache(TALLOC_CTX *mem_ctx,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley smb_path_with_suffix = talloc_strdup(mem_ctx, input_smb_path_with_suffix);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_path_with_suffix: %s\n", smb_path_with_suffix);
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley current_dir = talloc_strdup(mem_ctx, cache_dir);
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley for (i = 0; i < num_dirs; i++) {
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley current_dir = talloc_asprintf(mem_ctx, "%s/%s", current_dir, first);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
2fec5f131ff3086d50e9e06e24951aa9f7d6ab5eJakub Hrozek DEBUG(SSSDBG_TRACE_FUNC, "Storing GPOs in %s\n", current_dir);
d0e0cf6ee47ab538efc47c7882f498f1b5e0f0c7Lukas Slebodnik if ((mkdir(current_dir, 0700)) < 0 && errno != EEXIST) {
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley * This function stores the input buf to a local file, whose file path
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * is constructed by concatenating:
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * GPO_CACHE_PATH,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * input smb_path,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * input smb_cse_suffix
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * Note that the backend will later read the file from the same file path.
b47449d8596d9573ff13e74b6984d080b414715aYassir Elleystatic errno_t gpo_cache_store_file(const char *smb_path,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley talloc_asprintf(tmp_ctx, "%s%s", smb_path, smb_cse_suffix);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* create component directories of smb_path, if needed */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = prepare_gpo_cache(tmp_ctx, GPO_CACHE_PATH, smb_path_with_suffix);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "prepare_gpo_cache failed [%d][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley filename = talloc_asprintf(tmp_ctx, GPO_CACHE_PATH"%s", smb_path_with_suffix);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley tmp_name = talloc_asprintf(tmp_ctx, "%sXXXXXX", filename);
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
3954cd07dae78bf79136f0854472757d1ed26897Jakub Hrozek "sss_unique_file failed [%d][%s].\n", ret, strerror(ret));
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley "write failed [%d][%s].\n", ret, strerror(ret));
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley "Write error, wrote [%zd] bytes, expected [%d]\n",
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley ret = fchmod(fd, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley "fchmod failed [%d][%s].\n", ret, strerror(ret));
32381402a4a9afc003782c9e2301fc59c9bda2a9Yassir Elley "rename failed [%d][%s].\n", ret, strerror(ret));
3954cd07dae78bf79136f0854472757d1ed26897Jakub Hrozek DEBUG(SSSDBG_CRIT_FAILURE, "Error encountered: %d.\n", ret);
3954cd07dae78bf79136f0854472757d1ed26897Jakub Hrozek "close failed [%d][%s].\n", fret, strerror(fret));
b47449d8596d9573ff13e74b6984d080b414715aYassir Elleyparse_ini_file_with_libini(struct ini_cfgobj *ini_config,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = ini_get_config_valueobj(INI_GENERAL_SECTION, GPT_INI_VERSION,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "ini_get_config_valueobj failed [%d][%s]\n", ret, strerror(ret));
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "section/name not found: [%s][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley gpt_version = ini_get_int32_config_value(vobj, 0, -1, &ret);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "ini_get_int32_config_value failed [%d][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * This function parses the GPT_INI file stored in the gpo_cache, and uses the
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * results to populate the output parameters ...
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ini_filename = talloc_asprintf(tmp_ctx, GPO_CACHE_PATH"%s%s",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "ini_filename:%s\n", ini_filename);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "ini_config_create failed [%d][%s]\n", ret, strerror(ret));
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = ini_config_file_open(ini_filename, 0, &file_ctx);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "ini_config_file_open failed [%d][%s]\n", ret, strerror(ret));
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = ini_config_parse(file_ctx, INI_STOP_ON_NONE, 0, 0, ini_config);
dad416a9b0095e1c423b7da65db7c636fa69e614Michal Židek "[%s]: ini_config_parse failed [%d][%s]\n",
dad416a9b0095e1c423b7da65db7c636fa69e614Michal Židek /* Now get specific errors if there are any */
dad416a9b0095e1c423b7da65db7c636fa69e614Michal Židek lret = ini_config_get_errors(ini_config, &errors);
dad416a9b0095e1c423b7da65db7c636fa69e614Michal Židek "Failed to get specific parse error [%d][%s]\n", lret,
dad416a9b0095e1c423b7da65db7c636fa69e614Michal Židek for (int i = 0; errors[i]; i++) {
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = parse_ini_file_with_libini(ini_config, &gpt_version);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "parse_ini_file_with_libini failed [%d][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "Error encountered: %d.\n", ret);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * This function uses the input smb uri components to download a sysvol file
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * (e.g. INI file, policy file, etc) and store it to the GPO_CACHE directory.
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley smb_uri = talloc_asprintf(tmp_ctx, "%s%s%s%s", smb_server,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "smb_uri: %s\n", smb_uri);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley file = smbc_getFunctionOpen(smbc_ctx)(smbc_ctx, smb_uri, O_RDONLY, 0755);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "smbc_getFunctionOpen failed [%d][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley buf = talloc_array(tmp_ctx, uint8_t, SMB_BUFFER_SIZE);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_array failed.\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley buflen = smbc_getFunctionRead(smbc_ctx)(smbc_ctx, file, buf, SMB_BUFFER_SIZE);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "smbc_getFunctionRead failed [%d][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_ALL, "smb_buflen: %d\n", buflen);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = gpo_cache_store_file(smb_path, smb_cse_suffix, buf, buflen);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "gpo_cache_store_file failed [%d][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * Using its smb_uri components and cached_gpt_version inputs, this function
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * does several things:
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - it downloads the GPT_INI file to GPO_CACHE
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - it parses the sysvol_gpt_version field from the GPT_INI file
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - if the sysvol_gpt_version is greater than the cached_gpt_version
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - it downloads the policy file to GPO_CACHE
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - it doesn't retrieve the policy file
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - in this case, the backend will use the existing policy file in GPO_CACHE
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - it returns the sysvol_gpt_version in the _sysvol_gpt_version output param
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * Note that if the cached_gpt_version sent by the backend is -1 (to indicate
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * that no gpt_version has been set in the cache for the corresponding gpo_guid),
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * then the parsed sysvol_gpt_version (which must be at least 0) will be greater
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * than the cached_gpt_version, thereby triggering a fresh download.
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * Note that the backend will later do the following:
f91029dd8d7dbc026a5c73e222926db957240cb4Yuri Chornoivan * - backend will save the sysvol_gpt_version to sysdb cache
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley * - backend will read the policy file from the GPO_CACHE
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "Could not allocate new smbc context\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley smbc_setFunctionAuthData(smbc_ctx, sssd_krb_get_auth_data_fn);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* Initialize the context using the previously specified options */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "Could not initialize smbc context\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* download ini file */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = copy_smb_file_to_gpo_cache(smbc_ctx, smb_server, smb_share, smb_path,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "copy_smb_file_to_gpo_cache failed [%d][%s]\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = ad_gpo_parse_ini_file(smb_path, &sysvol_gpt_version);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "Cannot parse ini file: [%d][%s]\n", ret, strerror(ret));
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "sysvol_gpt_version: %d\n", sysvol_gpt_version);
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley /* download policy file */
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = copy_smb_file_to_gpo_cache(smbc_ctx, smb_server, smb_share,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "copy_smb_file_to_gpo_cache failed [%d][%s]\n",
19d3aba12c70528708be9440aca66038a291f29eYassir Elley {"debug-level", 'd', POPT_ARG_INT, &debug_level, 0,
19d3aba12c70528708be9440aca66038a291f29eYassir Elley {"debug-timestamps", 0, POPT_ARG_INT, &debug_timestamps, 0,
19d3aba12c70528708be9440aca66038a291f29eYassir Elley {"debug-microseconds", 0, POPT_ARG_INT, &debug_microseconds, 0,
19d3aba12c70528708be9440aca66038a291f29eYassir Elley _("An open file descriptor for the debug logs"), NULL},
b31b0a468ddbc9be4fc78289e5a0a108c31ec620Sumit Bose {"debug-to-stderr", 0, POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN,
b31b0a468ddbc9be4fc78289e5a0a108c31ec620Sumit Bose _("Send the debug output to stderr directly."), NULL },
19d3aba12c70528708be9440aca66038a291f29eYassir Elley /* Set debug level to invalid value so we can decide if -d 0 was used. */
19d3aba12c70528708be9440aca66038a291f29eYassir Elley pc = poptGetContext(argv[0], argc, argv, long_options, 0);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley debug_prg_name = talloc_asprintf(NULL, "[sssd[gpo_child[%d]]]", getpid());
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed.\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "set_debug_file_from_fd failed.\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "gpo_child started.\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_new failed.\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley buf = talloc_size(main_ctx, sizeof(uint8_t)*IN_BUF_SIZE);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_size failed.\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley ibuf = talloc_zero(main_ctx, struct input_buffer);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "talloc_zero failed.\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "context initialized\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley len = sss_atomic_read_s(STDIN_FILENO, buf, IN_BUF_SIZE);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "read failed [%d][%s].\n", ret, strerror(ret));
19d3aba12c70528708be9440aca66038a291f29eYassir Elley "unpack_buffer failed.[%d][%s].\n", ret, strerror(ret));
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "performing smb operations\n");
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley result = perform_smb_operations(ibuf->cached_gpt_version,
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley "perform_smb_operations failed.[%d][%s].\n",
b47449d8596d9573ff13e74b6984d080b414715aYassir Elley ret = prepare_response(main_ctx, sysvol_gpt_version, result, &resp);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "prepare_response failed. [%d][%s].\n",
f00a61b6079d8de81432077a59daf015d85800d2Jakub Hrozek written = sss_atomic_write_s(AD_GPO_CHILD_OUT_FILENO, resp->buf, resp->size);
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "write failed [%d][%s].\n", ret,
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "Expected to write %zu bytes, wrote %zu\n",
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_TRACE_FUNC, "gpo_child completed successfully\n");
19d3aba12c70528708be9440aca66038a291f29eYassir Elley DEBUG(SSSDBG_CRIT_FAILURE, "gpo_child failed!\n");