Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortnames (#470) (#471) #472

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,15 @@ int session_config_init(char *base, char *ca_cert, char *client_cert, bool grace
filesystem_domain = strndup(uri.hostText.first, uri.hostText.afterLast - uri.hostText.first);
filesystem_port = strndup(uri.portText.first, uri.portText.afterLast - uri.portText.first);
firstdot = strchr(uri.hostText.first, '.');
// If we change the format of the base, this logic might no longer find the cluster
if (firstdot) {
filesystem_cluster = strndup(uri.hostText.first, firstdot - uri.hostText.first);
}
else {
/* Failure */
log_print(LOG_CRIT, SECTION_SESSION_DEFAULT, "session_config_init: error on uriParse finding cluster name: %s", base);
asprintf(&filesystem_cluster, "unknown");
// If using shortnames, make the cluster the same as the domain.
filesystem_cluster = g_strdup(filesystem_domain);
log_print(LOG_NOTICE, SECTION_SESSION_DEFAULT, "session_config_init: no cluster name in base: %s; using %s",
base, filesystem_cluster);
}
uriFreeUriMembersA(&uri);

Expand Down