/*
SSSD
Secrets Responder
Copyright (C) Simo Sorce <ssorce@redhat.com> 2016
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 <popt.h>
#include "responder/common/responder.h"
#include "resolv/async_resolv.h"
/* The number of secrets in the /kcm hive should be quite small,
* but the secret size must be large because one secret in the /kcm
* hive holds the whole ccache which consists of several credentials
*/
const char *section_config_path,
int default_max_payload,
{
int ret;
"Failed to get container nesting level for %s\n",
return ret;
}
"a->max_secrets);
"Failed to get maximum number of entries for %s\n",
return ret;
}
"a->max_uid_secrets);
"Failed to get maximum number of per-UID entries for %s\n",
return ret;
}
"Failed to get payload's maximum size for an entry in %s\n",
return ret;
}
return EOK;
}
const char *hive_name,
struct sec_hive_config *hive_config,
int default_max_payload)
{
int ret;
return ENOMEM;
}
goto done;
}
&hive_config->quota);
"Cannot read quota settings for %s [%d]: %s\n",
goto done;
}
|| (sctx->max_payload_size != 0
/* If the quota is unlimited or it's larger than what
* we already have, save the total limit so we know how much to
* accept from clients
*/
}
done:
return ret;
}
{
int ret;
"Failed to get file descriptors limit\n");
goto fail;
}
/* Set the global max_payload to ridiculously small value so that either 0 (unlimited)
* or any sensible value overwrite it
*/
/* Read the global quota first -- this should be removed in a future release */
/* Note that this sets the defaults for the sec_config quota to be used
* in sec_get_hive_config()
*/
"Failed to get legacy global quotas\n");
goto fail;
}
/* Read the per-hive configuration */
"secrets",
&sctx->sec_config,
"Failed to get configuration of the secrets hive\n");
goto fail;
}
"kcm",
&sctx->kcm_config,
"Failed to get configuration of the secrets hive\n");
goto fail;
}
"Cannot get the client idle timeout [%d]: %s\n",
goto fail;
}
/* Ensure that the client timeout is at least ten seconds */
}
goto fail;
}
fail:
return ret;
}
{
/* mark that we are shutting down the responder, so it is propagated
* into underlying contexts that are freed right before rctx */
rctx->shutting_down = true;
return 0;
}
struct tevent_context *ev,
struct confdb_ctx *cdb)
{
int ret;
if (!rctx) {
return ENOMEM;
}
rctx->shutting_down = false;
if (!sctx) {
goto fail;
}
goto fail;
}
/* Set up file descriptor limits */
return EOK;
fail:
return ret;
}
{
int opt;
int ret;
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
/* set up things like debug, signals, daemonization, etc. */
debug_log_file = "sssd_secrets";
&main_ctx);
ret = die_if_parent_died();
/* This is not fatal, don't return */
"Could not set up to exit when parent process does\n");
}
/* loop on main */
return 0;
}