]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR: fix the verify functions for anonymous users, fixes #2623
authorJaroslav Kysela <perex@perex.cz>
Sun, 18 Jan 2015 10:25:26 +0000 (11:25 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sun, 18 Jan 2015 10:25:26 +0000 (11:25 +0100)
src/dvr/dvr.h

index be8fdfb9f415dd4a154b8dc4290945b812bf87c2..13358a2d496ab4bac9e3cb3e2c97c08b2abe6e10 100644 (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;
 }