krb5_common.c revision 40dd828529cf01291daf0f075b850783409e8c05
a945f35eff8b6a88009ce73de6d4c862ce58de3cslive Kerberos Provider Common Functions
356cf74f7c5d5d2ff4dae567ebeb8dc23e8bcd21nd Sumit Bose <sbose@redhat.com>
97a9a944b5887e91042b019776c41d5dd74557aferikabele Copyright (C) 2008-2009 Red Hat
d9acf35ddaf5792bb76f8b0cc47b26cd51482abaslive This program is free software; you can redistribute it and/or modify
d9acf35ddaf5792bb76f8b0cc47b26cd51482abaslive it under the terms of the GNU General Public License as published by
97a9a944b5887e91042b019776c41d5dd74557aferikabele the Free Software Foundation; either version 3 of the License, or
06ba4a61654b3763ad65f52283832ebf058fdf1cslive (at your option) any later version.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive This program is distributed in the hope that it will be useful,
06ba4a61654b3763ad65f52283832ebf058fdf1cslive but WITHOUT ANY WARRANTY; without even the implied warranty of
06ba4a61654b3763ad65f52283832ebf058fdf1cslive MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
117c1f888a14e73cdd821dc6c23eb0411144a41cnd GNU General Public License for more details.
67a715b4352c3e25bff32fccad48350180393f5end You should have received a copy of the GNU General Public License
d9acf35ddaf5792bb76f8b0cc47b26cd51482abaslive along with this program. If not, see <http://www.gnu.org/licenses/>.
06ba4a61654b3763ad65f52283832ebf058fdf1cslive/* krb5 profile functions */
67a715b4352c3e25bff32fccad48350180393f5enderrno_t check_and_export_lifetime(struct dp_option *opts, const int opt_id,
67a715b4352c3e25bff32fccad48350180393f5end const char *env_name)
06ba4a61654b3763ad65f52283832ebf058fdf1cslive bool free_str = false;
97a9a944b5887e91042b019776c41d5dd74557aferikabele DEBUG(SSSDBG_CRIT_FAILURE, "talloc_asprintf failed\n");
06ba4a61654b3763ad65f52283832ebf058fdf1cslive DEBUG(SSSDBG_CRIT_FAILURE, "dp_opt_set_string failed\n");
67a715b4352c3e25bff32fccad48350180393f5end if (ret != 0) {
06ba4a61654b3763ad65f52283832ebf058fdf1cslive DEBUG(SSSDBG_CRIT_FAILURE, "Invalid value [%s] for a lifetime.\n", str);
06ba4a61654b3763ad65f52283832ebf058fdf1cslive DEBUG(SSSDBG_OP_FAILURE, "setenv [%s] failed.\n", env_name);
return ret;
#ifdef HAVE_KRB5_CC_COLLECTION
/* source default_ccache_name from krb5.conf */
char **ccname)
profile_t p;
long ret;
if (!value) {
goto done;
goto done;
done:
return ret;
char **ccname)
"in sssd.conf if you want to change the default\n");
return ERR_NOT_FOUND;
int ret;
const char *realm;
const char *dummy;
char *use_fast_str;
char *fast_principal;
char *ccname;
if (!tmp_ctx) {
goto done;
goto done;
goto done;
goto done;
goto done;
"in sssd.conf, it is recommended to set default_ccache_name "
"in krb5.conf instead so that a system default is used\n");
if (!ccname) {
goto done;
goto done;
if (!ccname) {
goto done;
goto done;
if (!ccname) {
goto done;
goto done;
done:
return ret;
return ret;
return ret;
return EOK;
int ret;
return ENOMEM;
goto done;
goto done;
done:
return ret;
const char *service)
int ret;
return EINVAL;
return EINVAL;
return ENOMEM;
goto done;
goto done;
goto done;
errno = 0;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
char *address;
char *safe_address;
int ret;
if (!krb5_service) {
if (!srvaddr) {
address);
const char *service_name,
const char *servers,
bool primary)
char *port_str;
long port;
char *server_spec;
char *endptr;
if (!tmp_ctx) {
return ENOMEM;
goto done;
for (i = 0; list[i]; i++) {
if (!server_spec) {
goto done;
if (!primary) {
list[i]);
if (ret) {
goto done;
port = 0;
++port_str;
errno = 0;
if (errno != 0) {
goto done;
goto done;
goto done;
port_str);
goto done;
goto done;
goto done;
goto done;
done:
return ret;
static inline errno_t
static inline errno_t
const char *service_name,
const char *primary_servers,
const char *backup_servers,
const char *realm,
bool use_kdcinfo,
int ret;
if (!tmp_ctx) {
return ENOMEM;
if (!service) {
goto done;
goto done;
goto done;
goto done;
if (!primary_servers) {
goto done;
if (backup_servers) {
goto done;
goto done;
done:
return ret;
int ret;
char *file;
return ENOMEM;
errno = 0;
return ENOMEM;
errno = 0;
return EOK;
int ret;
struct remove_info_files_ctx);
int signum,
int count,
void *siginfo,
void *private_data)
int ret;
orderly_shutdown(0);
int ret;
const char *krb5_realm;
return EINVAL;
return ENOMEM;
goto done;
goto done;
NULL);
goto done;
done:
return ret;
const char *krb5_realm;
char *sig_realm;
return EINVAL;
return ENOMEM;
return ENOMEM;
return EOK;
char *upn;
char *name;
return ENOMEM;
goto done;
goto done;
goto done;
done:
return ret;
bool *different_realm)
char *at_sign;
return EINVAL;
return EINVAL;
*different_realm = false;
*different_realm = true;
return EOK;