summaryrefslogtreecommitdiff
path: root/src/providers/krb5
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2013-05-12 12:29:21 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-06-07 00:14:12 +0200
commit7119f0c483049a8850d3075c0b1062f35200a538 (patch)
tree7be03fca0634dda1406df2b9bde387ca7c89877e /src/providers/krb5
parent7527ec8ab2b79ec576ace2da9e2c158b849adfa6 (diff)
downloadsssd-7119f0c483049a8850d3075c0b1062f35200a538.tar.gz
sssd-7119f0c483049a8850d3075c0b1062f35200a538.tar.bz2
sssd-7119f0c483049a8850d3075c0b1062f35200a538.zip
Do not obfuscate calls with booleans
Instead of using boolean variables to denote whether the call is adding a primary or a secondary server, use a function wrapper that tells what it's doing by its name.
Diffstat (limited to 'src/providers/krb5')
-rw-r--r--src/providers/krb5/krb5_common.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/providers/krb5/krb5_common.c b/src/providers/krb5/krb5_common.c
index 940cc373..e60e6e0e 100644
--- a/src/providers/krb5/krb5_common.c
+++ b/src/providers/krb5/krb5_common.c
@@ -470,11 +470,11 @@ static void krb5_resolve_callback(void *private_data, struct fo_server *server)
return;
}
-errno_t krb5_servers_init(struct be_ctx *ctx,
- struct krb5_service *service,
- const char *service_name,
- const char *servers,
- bool primary)
+static errno_t _krb5_servers_init(struct be_ctx *ctx,
+ struct krb5_service *service,
+ const char *service_name,
+ const char *servers,
+ bool primary)
{
TALLOC_CTX *tmp_ctx;
char **list = NULL;
@@ -597,6 +597,20 @@ done:
return ret;
}
+static inline errno_t
+krb5_primary_servers_init(struct be_ctx *ctx, struct krb5_service *service,
+ const char *service_name, const char *servers)
+{
+ return _krb5_servers_init(ctx, service, service_name, servers, true);
+}
+
+static inline errno_t
+krb5_backup_servers_init(struct be_ctx *ctx, struct krb5_service *service,
+ const char *service_name, const char *servers)
+{
+ return _krb5_servers_init(ctx, service, service_name, servers, false);
+}
+
static int krb5_user_data_cmp(void *ud1, void *ud2)
{
return strcasecmp((char*) ud1, (char*) ud2);
@@ -647,13 +661,14 @@ int krb5_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
primary_servers = BE_SRV_IDENTIFIER;
}
- ret = krb5_servers_init(ctx, service, service_name, primary_servers, true);
+ ret = krb5_primary_servers_init(ctx, service, service_name, primary_servers);
if (ret != EOK) {
goto done;
}
if (backup_servers) {
- ret = krb5_servers_init(ctx, service, service_name, backup_servers, false);
+ ret = krb5_backup_servers_init(ctx, service, service_name,
+ backup_servers);
if (ret != EOK) {
goto done;
}