mirror of
https://github.com/NAStools/zerotierone.git
synced 2025-08-19 21:04:09 -07:00
Clean up authtoken CGI
This commit is contained in:
parent
c4546ac7e0
commit
784b1b95ff
1 changed files with 8 additions and 4 deletions
12
debian/readynas/authtoken.c
vendored
12
debian/readynas/authtoken.c
vendored
|
@ -3,14 +3,18 @@
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
FILE *f;
|
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");
|
printf("Content-Type: text/plain\n\n");
|
||||||
|
|
||||||
while ((c=fgetc(f))!=EOF)
|
size_t ret = fread(c, 1, sizeof(c), f);
|
||||||
printf("%c", c);
|
if(!ret)
|
||||||
|
return 1;
|
||||||
|
fwrite(c, ret, 1, stdout);
|
||||||
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue