krb5_common.c revision 387349ae092f6dbeb8e4bca291a772695836629c
/*
SSSD
Kerberos Provider Common Functions
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2008-2009 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 <unistd.h>
#include <netdb.h>
#include <ctype.h>
#include "providers/dp_backend.h"
#include "providers/krb5/krb5_common.h"
#include "providers/krb5/krb5_opts.h"
#include "providers/krb5/krb5_utils.h"
const char *env_name)
{
int ret;
char *str;
bool free_str = false;
return EOK;
}
return ENOMEM;
}
free_str = true;
goto done;
}
}
if (ret != 0) {
goto done;
}
goto done;
}
done:
if (free_str) {
}
return ret;
}
struct sss_domain_info *dom,
{
int ret;
const char *realm;
const char *dummy;
char *use_fast_str;
char *fast_principal;
enum sss_krb5_cc_type cc_be;
return ret;
}
}
}
return ret;
}
return ret;
}
if (use_fast_str != NULL) {
return ret;
}
} else {
if (fast_principal != NULL) {
}
}
}
}
}
} else {
}
}
}
"using the KDC or defaults.\n"));
}
return EINVAL;
}
switch (cc_be) {
case SSS_KRB5_TYPE_FILE:
if (dummy[0] != '/') {
break;
}
"missing an explicit type, but is an absolute "
"path specifier. Assuming FILE:\n"));
return ret;
}
break;
#ifdef HAVE_KRB5_DIRCACHE
case SSS_KRB5_TYPE_DIR:
break;
#endif
default:
return EINVAL;
break;
}
return EOK;
}
int opt_id)
{
char *krb5_servers = NULL;
if (krb5_servers == NULL) {
return ret;
}
if (krb5_servers != NULL)
{
return ret;
}
krb5_servers));
DEBUG(0, ("Your configuration uses the deprecated option 'krb5_kdcip' "
"to specify the KDC. Please change the configuration to use "
"the 'krb5_server' option instead.\n"));
}
}
return EOK;
}
{
int ret;
return ENOMEM;
}
goto done;
}
/* If there is no KDC, try the deprecated krb5_kdcip option, too */
/* FIXME - this can be removed in a future version */
goto done;
}
done:
}
return ret;
}
const char *service)
{
int ret;
int fd = -1;
char *krb5info_name = NULL;
int server_len;
return EINVAL;
}
} else {
return EINVAL;
}
return ENOMEM;
}
goto done;
}
if (krb5info_name == NULL) {
goto done;
}
if (fd == -1) {
goto done;
}
errno = 0;
if (written == -1) {
goto done;
}
if (written != server_len) {
("Write error, wrote [%d] bytes, expected [%d]\n",
written, server_len));
goto done;
}
if (ret == -1) {
goto done;
}
if (ret == -1) {
goto done;
}
if (ret == -1) {
goto done;
}
done:
return ret;
}
{
struct krb5_service *krb5_service;
struct resolv_hostent *srvaddr;
char *address;
char *safe_address;
int ret;
return;
}
if (!krb5_service) {
return;
}
if (!srvaddr) {
return;
}
return;
}
address);
if (safe_address == NULL) {
return;
}
if (safe_address == NULL) {
return;
}
krb5_service->name);
}
return;
}
const char *service_name, const char *servers,
{
struct krb5_service *service;
int ret;
int i;
char *port_str;
long port;
char *server_spec;
char *endptr;
if (!tmp_ctx) {
return ENOMEM;
}
if (!service) {
goto done;
}
goto done;
}
goto done;
}
goto done;
}
if (!servers) {
}
goto done;
}
for (i = 0; list[i]; i++) {
if (!server_spec) {
goto done;
}
if (be_fo_is_srv_identifier(server_spec)) {
BE_FO_PROTO_UDP, true, NULL);
if (ret) {
DEBUG(0, ("Failed to add server\n"));
goto done;
}
continue;
}
port = 0;
} else {
*port_str = '\0';
++port_str;
errno = 0;
if (errno != 0) {
goto done;
}
if (*endptr != '\0') {
goto done;
}
goto done;
}
port_str));
goto done;
}
} else {
goto done;
}
}
list[i]);
DEBUG(0, ("Failed to add server\n"));
goto done;
}
}
goto done;
}
done:
}
return ret;
}
{
int ret;
char *file;
return ENOMEM;
}
errno = 0;
if (ret == -1) {
}
return ENOMEM;
}
errno = 0;
if (ret == -1) {
}
return EOK;
}
void remove_krb5_info_files_callback(void *pvt)
{
int ret;
struct remove_info_files_ctx);
"krb5 info files will not be removed, because "
"it is unclear if they will be recreated properly.\n"));
return;
}
"krb5 info files will not be removed, because "
"it is unclear if they will be recreated properly.\n"));
return;
}
}
return;
}
}
}
struct tevent_signal *se,
int signum,
int count,
void *siginfo,
void *private_data)
{
char *realm = (char *)private_data;
int ret;
}
}
{
int ret;
struct remove_info_files_ctx *ctx;
const char *krb5_realm;
return EINVAL;
}
return ENOMEM;
}
if (krb5_realm == NULL) {
goto done;
}
goto done;
}
} else {
}
NULL);
goto done;
}
done:
}
return ret;
}
{
const char *krb5_realm;
char *sig_realm;
struct tevent_signal *sige;
BlockSignals(false, SIGTERM);
if (krb5_realm == NULL) {
return EINVAL;
}
return ENOMEM;
}
return ENOMEM;
}
return EOK;
}
{
const char *realm;
char *upn;
return ENOENT;
}
/* NOTE: this is a hack, works only in some environments */
return ENOMEM;
}
return EOK;
}