DVR: fix the verify functions for anonymous users, fixes #2623

This commit is contained in:
Jaroslav Kysela 2015-01-18 11:25:26 +01:00
parent 60f959ba59
commit 7006b9fd88

View file

@ -473,11 +473,9 @@ htsmsg_t *dvr_entry_class_duration_list(void *o, const char *not_set, int max, i
static inline int dvr_entry_verify(dvr_entry_t *de, access_t *a, int readonly)
{
if (!a->aa_username || !de->de_owner)
return -1;
if (readonly && !access_verify2(a, ACCESS_ALL_RECORDER))
return 0;
if (strcmp(de->de_owner, a->aa_username))
if (strcmp(de->de_owner ?: "", a->aa_username ?: ""))
return -1;
return 0;
}
@ -549,9 +547,7 @@ void dvr_autorec_update(void);
static inline int dvr_autorec_entry_verify(dvr_autorec_entry_t *dae, access_t *a)
{
if (!a->aa_username || !dae->dae_owner)
return -1;
if (strcmp(dae->dae_owner, a->aa_username))
if (strcmp(dae->dae_owner ?: "", a->aa_username ?: ""))
return -1;
return 0;
}
@ -593,9 +589,7 @@ void dvr_timerec_update(void);
static inline int dvr_timerec_entry_verify(dvr_timerec_entry_t *dte, access_t *a)
{
if (!a->aa_username || !dte->dte_owner)
return -1;
if (strcmp(dte->dte_owner, a->aa_username))
if (strcmp(dte->dte_owner ?: "", a->aa_username ?: ""))
return -1;
return 0;
}