Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
access: optimization for the webroot ticket patch
  • Loading branch information
perexg committed Nov 23, 2014
1 parent 25e4873 commit d6bfd1f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/access.c
Expand Up @@ -149,15 +149,20 @@ access_t *
access_ticket_verify2(const char *id, const char *resource)
{
access_ticket_t *at;
char buf[256], *r;

if((at = access_ticket_find(id)) == NULL)
return NULL;

char buf[256];
strcpy(buf, tvheadend_webroot ?: "");
strcat(buf, at->at_resource);
if (tvheadend_webroot) {
strcpy(buf, tvheadend_webroot);
strcat(buf, at->at_resource);
r = buf;
} else {
r = at->at_resource;
}

if(strcmp(buf, resource))
if(strcmp(r, resource))
return NULL;

return access_copy(at->at_access);
Expand Down

0 comments on commit d6bfd1f

Please sign in to comment.