access_t *a = calloc(1, sizeof(*a));
access_entry_t *ae;
- if (username) {
+ if (username && username[0]) {
a->aa_username = strdup(username);
a->aa_representative = strdup(username);
} else {
SHA_CTX shactx;
uint8_t d[20];
- if (username) {
+ if (username && username[0]) {
a->aa_username = strdup(username);
a->aa_representative = strdup(username);
} else {
return a;
}
+ if (username[0] == '\0')
+ return a;
+
TAILQ_FOREACH(ae, &access_entries, ae_link) {
if(!ae->ae_enabled)
if((username = htsmsg_get_str(m, "username")) == NULL)
return 0;
- if(strcmp(htsp->htsp_username ?: "", username)) {
- tvhlog(LOG_INFO, "htsp", "%s: Identified as user %s",
- htsp->htsp_logname, username);
- tvh_str_update(&htsp->htsp_username, username);
- htsp_update_logname(htsp);
- notify_reload("connections");
- }
-
if(!htsmsg_get_bin(m, "digest", &digest, &digestlen)) {
rights = access_get_hashed(username, digest, htsp->htsp_challenge,
htsp->htsp_granted_access->aa_rights) !=
htsp->htsp_granted_access->aa_rights;
- tvhlog(LOG_INFO, "htsp", "%s: Identified as user %s",
+ tvhlog(LOG_INFO, "htsp", "%s: Identified as user '%s'",
htsp->htsp_logname, username);
tvh_str_update(&htsp->htsp_username, username);
htsp_update_logname(htsp);
} else {
- tvhlog(LOG_INFO, "htsp", "%s: Identified as user %s (unverified)",
+ tvhlog(LOG_INFO, "htsp", "%s: Identified as user '%s' (unverified)",
htsp->htsp_logname, username);
tvh_str_update(&htsp->htsp_username, username);
htsp_update_logname(htsp);