Skip to content

Commit

Permalink
Clean up authtoken CGI
Browse files Browse the repository at this point in the history
  • Loading branch information
NAStools committed Dec 9, 2016
1 parent c4546ac commit 784b1b9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions debian/readynas/authtoken.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@

int main() {
FILE *f;
char c;
char c[32];

f=fopen("/apps/nastools-zerotier-one/var/authtoken.secret","rt");
f=fopen("/apps/nastools-zerotier-one/var/authtoken.secret","r");
if(!f)
return 1;

printf("Content-Type: text/plain\n\n");

while ((c=fgetc(f))!=EOF)
printf("%c", c);
size_t ret = fread(c, 1, sizeof(c), f);
if(!ret)
return 1;
fwrite(c, ret, 1, stdout);

fclose(f);
return 0;
Expand Down

0 comments on commit 784b1b9

Please sign in to comment.