krb5_keytab.c revision 41f13bb048dbc4241dcfc024cdc3ec535510ba6b
/*
SSSD
Kerberos 5 Backend Module -- keytab related utilities
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2014 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 "util/sss_krb5.h"
#include "providers/krb5/krb5_common.h"
{
if (kerr != 0) {
return kerr;
}
&cursor)) == 0) {
if (kerr != 0) {
if (kt_err != 0) {
"krb5_kt_end_seq_get failed with [%d], ignored.\n",
kt_err);
}
return kerr;
}
if (kerr != 0) {
if (kt_err != 0) {
"krb5_kt_end_seq_get failed with [%d], ignored.\n",
kt_err);
}
return kerr;
}
}
if (kerr != 0) {
return kerr;
}
/* check if we got any errors from krb5_kt_next_entry */
return kt_err;
}
return 0;
}
const char *inp_keytab_file,
char **_mem_name,
{
char keytab_name[MAX_KEYTAB_NAME_LEN];
char *sep;
char *tmp_mem_name = NULL;
const char *keytab_file;
if (keytab_file == NULL) {
sizeof(default_keytab_name));
if (kerr != 0) {
return kerr;
}
}
if (kerr != 0) {
return kerr;
}
if (kerr != 0) {
goto done;
}
if (kerr != 0) {
goto done;
}
"Keytab name [%s] does not have delimiter[:] .\n", keytab_name);
goto done;
}
goto done;
}
kerr = 0;
goto done;
}
goto done;
}
if (tmp_mem_name == NULL) {
goto done;
}
if (kerr != 0) {
mem_name);
goto done;
}
if (kerr != 0) {
goto done;
}
if (kerr != 0) {
goto done;
}
/* krb5_kt_add_entry() adds new entries into MEMORY keytabs at the
* beginning and not at the end as for FILE keytabs. Since we want to keep
* the processing order we have to copy the MEMORY keytab again to retain
* the order from the FILE keytab. */
if (kerr != 0) {
goto done;
}
if (_mem_keytab != NULL) {
}
kerr = 0;
done:
if (kerr != 0) {
}
}
}
return kerr;
}