/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "responder/nss/nss_protocol.h"
static errno_t
struct sss_domain_info *domain,
struct ldb_message *msg,
struct sized_string **_name)
{
const char *name;
/* Check object class. */
return ERR_INTERNAL;
}
/* Get fields. */
"Incomplete group object for %s[%u]! Skipping\n",
return EINVAL;
}
/* Convert to sized strings. */
"sized_output_name failed, skipping [%d]: %s\n",
return ret;
}
return EOK;
}
static struct ldb_message_element *
struct ldb_message *msg)
{
if (domain->ignore_group_members) {
return NULL;
}
/* Unconditionally prefer OVERRIDE_PREFIX SYSDB_MEMBERUID, it
* might contain override names from the default view. */
}
return el;
}
static struct ldb_message_element *
struct ldb_message *msg,
const char *group_name)
{
if (domain->ignore_group_members) {
return NULL;
}
return NULL;
}
&& el->num_values != 0) {
"Domain has a view [%s] but group [%s] still has "
return NULL;
}
return el;
}
static errno_t
struct sss_domain_info *domain,
struct ldb_message *msg,
const char *group_name,
{
const char *member_name;
int i, j;
return ENOMEM;
}
num_members = 0;
continue;
}
for (j = 0; j < el->num_values; j++) {
if (nss_ctx->filter_users_in_groups) {
"Group [%s] member [%s] filtered out! "
continue;
}
}
goto done;
}
goto done;
}
num_members++;
}
}
done:
return ret;
}
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result)
{
char *members;
int i;
return ENOMEM;
}
/* First two fields (length and reserved), filled up later. */
return ret;
}
num_results = 0;
/* Password field content. */
continue;
}
/* Adjust packet size: gid, num_members + string fields. */
goto done;
}
/* Fill packet. */
/* Remember pointer to number of members field. */
rp_num_members = rp;
rp_members = rp;
/* Fill members. */
goto done;
}
num_results++;
/* Do not store entry in memory cache during enumeration or when
* requested. */
if (!cmd_ctx->enumeration
"Failed to store group %s (%s) in mem-cache [%d]: %s!\n",
}
}
}
done:
return ret;
}
return EOK;
}
struct nss_cmd_ctx *cmd_ctx,
struct sss_packet *packet,
struct cache_req_result *result)
{
const char *posix;
int i;
return ENOENT;
}
/* num_results, reserved + gids */
return ret;
}
0);
/* If the GID of the original primary group is available but equal to the
* current primary GID it must not be added. */
/* First message is user, skip it. */
num_results = 0;
0);
if (gid == 0) {
continue;
} else {
"Incomplete group object [%s] for initgroups! "
goto done;
}
}
num_results++;
/* Do not add the GID of the original primary group if the user is
* already an explicit member of the group. */
orig_gid = 0;
}
}
if (orig_gid == 0) {
/* Initialize allocated memory to be safe and make Valgrind happy. */
} else {
/* Insert original primary group into the result. */
num_results++;
}
if (nss_ctx->initgr_mc_ctx
"Failed to store initgroups %s (%s) in mem-cache [%d]: %s!\n",
}
}
done:
return ret;
}
return EOK;
}