ad_common.c revision bb4172259e04925ffc3a92e4450029634d295134
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco Stephen Gallagher <sgallagh@redhat.com>
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco Copyright (C) 2012 Red Hat
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco This program is free software; you can redistribute it and/or modify
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco it under the terms of the GNU General Public License as published by
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco the Free Software Foundation; either version 3 of the License, or
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco (at your option) any later version.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco This program is distributed in the hope that it will be useful,
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco but WITHOUT ANY WARRANTY; without even the implied warranty of
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco GNU General Public License for more details.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco You should have received a copy of the GNU General Public License
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco along with this program. If not, see <http://www.gnu.org/licenses/>.
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco /* If the AD domain name wasn't explicitly set, assume that it
eb32a77fdb57f20c042b7b79b28a4fb4060cb949Lubos Kosco * matches the SSSD domain name
if (!domain) {
goto done;
if (!server) {
if (gret != 0) {
goto done;
goto done;
if (!realm) {
goto done;
goto done;
goto done;
done:
return ret;
static errno_t
const char *servers,
bool primary)
size_t i;
char **list;
char *ad_domain;
goto done;
for (i = 0; list[i]; i++) {
if (!primary) {
list[i]));
goto done;
false, sdata);
goto done;
goto done;
false, sdata);
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
static inline errno_t
static inline errno_t
const char *primary_servers,
const char *backup_servers,
char *realm;
if (!service) {
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
if (!realm) {
goto done;
goto done;
if (!primary_servers) {
goto done;
if (backup_servers) {
goto done;
return ret;
goto done;
done:
return ret;
char *address;
const char *safe_address;
char *new_uri;
const char *srv_name;
if (!tmp_ctx) {
if (!service) {
goto done;
if (!srvaddr) {
goto done;
goto done;
goto done;
if (!new_uri) {
goto done;
goto done;
sizeof(struct sockaddr_storage));
goto done;
goto done;
address);
goto done;
done:
const char *conf_path,
char *krb5_realm;
char *keytab_path;
if (!id_opts) {
goto done;
NULL);
goto done;
goto done;
goto done;
if (!krb5_realm) {
goto done;
krb5_realm));
if (keytab_path) {
keytab_path));
goto done;
goto done;
goto done;
goto done;
goto done;
goto done;
done:
return ret;
char *default_search_base;
size_t o;
if (default_search_base) {
search_base_options[o])) {
goto done;
search_base_options[o])));
done:
return ret;
const char *ad_servers;
const char *krb5_realm;
&krb5_options);
goto done;
ad_servers));
if (!krb5_realm) {
goto done;
krb5_realm));
done:
return ret;
return ret;
return EOK;