summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2014-07-02 13:35:57 +0200
committerPavel Březina <pbrezina@redhat.com>2014-07-02 13:35:57 +0200
commit5e935be55e48fa43c2ca27c7dd78a0ff584222b4 (patch)
tree525603d476c6dbfa7cd2cd49417ad8b6d3c44e54
parent039cac6c891797f43dc8b5cecd388057ab888623 (diff)
downloadopenlmi-providers-sssd.zip
openlmi-providers-sssd.tar.gz
openlmi-providers-sssd.tar.xz
service list may be emptysssd
-rw-r--r--src/sssd/sssd_domains.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/sssd/sssd_domains.c b/src/sssd/sssd_domains.c
index 3f8d418..a226e27 100644
--- a/src/sssd/sssd_domains.c
+++ b/src/sssd/sssd_domains.c
@@ -57,14 +57,6 @@ sssd_domain_get_attrs(sss_sifp_attr **attrs,
error = sss_sifp_find_attr_as_string(attrs, "provider", &out->provider);
check_sss_sifp_error(error, ret, SSSD_METHOD_ERROR_FAILED, done);
- error = sss_sifp_find_attr_as_string_array(attrs, "primary_servers",
- &out->num_primary, &out->primary_servers);
- check_sss_sifp_error(error, ret, SSSD_METHOD_ERROR_FAILED, done);
-
- error = sss_sifp_find_attr_as_string_array(attrs, "backup_servers",
- &out->num_backup, &out->backup_servers);
- check_sss_sifp_error(error, ret, SSSD_METHOD_ERROR_FAILED, done);
-
error = sss_sifp_find_attr_as_uint32(attrs, "min_id", &out->min_id);
check_sss_sifp_error(error, ret, SSSD_METHOD_ERROR_FAILED, done);
@@ -99,6 +91,21 @@ sssd_domain_get_attrs(sss_sifp_attr **attrs,
&out->parent_domain);
check_sss_sifp_error(error, ret, SSSD_METHOD_ERROR_FAILED, done);
+ /* server list may be empty */
+ error = sss_sifp_find_attr_as_string_array(attrs, "primary_servers",
+ &out->num_primary, &out->primary_servers);
+ if (error != SSS_SIFP_OK && error != SSS_SIFP_ATTR_NULL) {
+ ret = SSSD_METHOD_ERROR_FAILED;
+ goto done;
+ }
+
+ error = sss_sifp_find_attr_as_string_array(attrs, "backup_servers",
+ &out->num_backup, &out->backup_servers);
+ if (error != SSS_SIFP_OK && error != SSS_SIFP_ATTR_NULL) {
+ ret = SSSD_METHOD_ERROR_FAILED;
+ goto done;
+ }
+
ret = SSSD_METHOD_ERROR_OK;
done: