pacsrv_cmd.c revision d29d5d9e0e9ee0396a46f4375092644f29024f25
/*
SSSD
PAC Responder
Copyright (C) Sumit Bose <sbose@redhat.com> 2012
Jan Zeleny <jzeleny@redhat.com> 2012
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/>.
*/
{
int ret;
/* async processing, just return here */
return EOK;
}
return ret;
}
return EOK;
}
struct pac_req_ctx {
const char *domain_name;
const char *user_name;
char *fq_name;
struct sss_domain_info *dom;
struct PAC_LOGON_INFO *logon_info;
struct dom_sid2 *domain_sid;
struct pac_dom_grps *gids;
struct grp_info *current_grp_list;
struct pac_dom_grps *add_gids;
struct grp_info **del_grp_list;
};
struct pac_req_ctx *pr_ctx,
struct grp_info **_current_grp_list);
struct sss_domain_info *grp_dom);
{
int ret;
struct pac_req_ctx *pr_ctx;
struct tevent_req *req;
return ENOMEM;
}
return EINVAL;
}
&pr_ctx->logon_info);
goto done;
}
goto done;
}
goto done;
}
/* To be compatible with winbind based lookups we have to use lower case
* names only, effectively making the domain case-insenvitive. */
goto done;
}
} else {
}
goto done;
}
done:
}
}
{
struct pac_req_ctx);
int ret;
goto done;
}
goto done;
}
done:
}
}
{
int ret;
struct tevent_req *req;
struct dom_sid *my_dom_sid;
struct local_mapping_ranges *my_range_map;
/* this is a subdomain so we need to search for the fully qualified
* name in the database */
goto done;
}
goto done;
}
goto done;
}
&my_dom_sid, &my_range_map);
goto done;
}
goto done;
}
goto done;
}
goto done;
}
done:
return ret;
}
struct pac_req_ctx *pr_ctx,
struct grp_info **_current_grp_list)
{
int ret;
size_t current_grp_count = 0;
size_t c;
const char *tmp_str;
goto done;
}
goto done;
}
goto done;
}
/* First result is the user entry then the groups follow */
if (current_grp_list == NULL) {
goto done;
}
for (c = 0; c < current_grp_count; c++) {
current_grp_list[c].gid =
SYSDB_GIDNUM, 0);
if (current_grp_list[c].gid == 0) {
goto done;
}
tmp_str);
goto done;
}
}
goto done;
}
}
}
done:
return ret;
}
{
int ret;
struct ldb_message *msg;
goto done;
}
goto done;
}
goto done;
}
goto done;
}
} else {
goto done;
}
goto done;
}
goto done;
}
done:
return ret;
}
struct pac_save_memberships_state {
struct pac_req_ctx *pr_ctx;
struct sss_domain_info *group_dom;
};
static errno_t
{
struct pac_save_memberships_state *state;
struct tevent_req *req;
return NULL;
}
goto done;
}
/* Remote users are members of local groups */
} else {
}
goto done;
}
}
done:
}
return req;
}
static errno_t
{
int ret;
int sret;
size_t c;
struct pac_req_ctx *pr_ctx;
bool in_transaction = false;
if (pr_ctx->del_grp_count == 0) {
return EOK;
}
return EINVAL;
}
return ENOMEM;
}
if (user_attrs == NULL) {
goto done;
}
goto done;
}
in_transaction = true;
for (c = 0; c < pr_ctx->del_grp_count; c++) {
goto done;
}
goto done;
}
}
}
goto done;
}
goto done;
}
in_transaction = false;
done:
if (in_transaction) {
}
}
return ret;
}
{
struct sss_domain_info *grp_dom;
struct tevent_req *subreq;
struct pac_save_memberships_state *state;
struct pac_req_ctx *pr_ctx;
if (pr_ctx->add_gid_count == 0) {
return EOK;
}
return EINVAL;
}
continue;
}
}
continue;
grp_dom, true,
goto done;
}
return EAGAIN;
} else {
goto done;
}
}
done:
return ret;
}
{
struct tevent_req *req;
struct pac_save_memberships_state *state;
char *err_msg;
struct sss_domain_info *grp_dom;
&err_msg);
goto error;
}
goto error;
}
}
goto error;
}
return;
}
static errno_t
{
struct sysdb_attrs *user_attrs;
struct ldb_message *group;
const char *orig_group_dn;
return ENOMEM;
}
"failed [%d][%s].\n",
goto done;
}
goto done;
}
if (orig_group_dn != NULL) {
if (user_attrs == NULL) {
goto done;
}
goto done;
}
goto done;
}
}
done:
return ret;
}
{
return EOK;
}
{
}
struct cli_protocol_version *register_cli_protocol_version(void)
{
static struct cli_protocol_version pac_cli_protocol_version[] = {
{1, "2011-04-12", "initial version"},
};
return pac_cli_protocol_version;
}
static struct sss_cmd_table pac_cmds[] = {
{SSS_CLI_NULL, NULL}
};
struct sss_cmd_table *get_pac_cmds(void) {
return pac_cmds;
}