From 3727e2c35f9c959e039cb4027edd3c0a6fa4e612 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Marchal?= Date: Sun, 27 Dec 2009 15:31:53 +0000 Subject: [PATCH] Added missing Require keyword --- auth.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/auth.c b/auth.c index ab16a40..e79b881 100644 --- a/auth.c +++ b/auth.c @@ -37,7 +37,7 @@ void htaccess(const char *name) sprintf(htname,"%s/%s/.htaccess",dirname,name); if((fp_auth=fopen(htname,"w"))==NULL) { - fprintf(stderr, "SARG: (auth) %s: %s\n",text[45],htname); + fprintf(stderr, "SARG: (auth) %s: %s - %s\n",text[45],htname,strerror(errno)); exit(1); } @@ -46,19 +46,13 @@ void htaccess(const char *name) printf("SARG: The \"Require\" entry of your sarg.conf file is too long for your %s file.\n",htname); exit(1); } - fputs("AuthUserFile ",fp_auth); - fputs(AuthUserFile,fp_auth); - fputs("\n",fp_auth); - fputs("AuthName ",fp_auth); + fprintf(fp_auth,"AuthUserFile %s\n",AuthUserFile); if(strchr(AuthName,'\"') == 0) - fputs("\"",fp_auth); - fputs(AuthName,fp_auth); - if(strchr(AuthName,'\"') == 0) - fputs("\"",fp_auth); - fputs("\n",fp_auth); - fputs("AuthType ",fp_auth); - fputs(AuthType,fp_auth); - fputs("\n\n",fp_auth); + fprintf(fp_auth,"AuthName \"%s\"\n",AuthName); + else + fprintf(fp_auth,"AuthName %s\n",AuthName); + fprintf(fp_auth,"AuthType %s\n",AuthType); + fputs("\nRequire ",fp_auth); fputs(buf,fp_auth); fputs(name,fp_auth); fputs("\n\n",fp_auth); -- 2.47.3