Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: fix the verify functions for anonymous users, fixes #2623
  • Loading branch information
perexg committed Jan 18, 2015
1 parent 60f959b commit 7006b9f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/dvr/dvr.h
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 7006b9f

Please sign in to comment.