From: Frédéric Marchal Date: Sun, 27 Dec 2009 16:02:47 +0000 (+0000) Subject: The %u doesn't have to be the last item of the Require statement in sarg.conf. X-Git-Tag: v2_2_7~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=095a969e9ffe70aa7cd4bc77a5f654a0ff2ff534;p=thirdparty%2Fsarg.git The %u doesn't have to be the last item of the Require statement in sarg.conf. --- diff --git a/auth.c b/auth.c index e79b881..932dabf 100644 --- a/auth.c +++ b/auth.c @@ -30,7 +30,7 @@ void htaccess(const char *name) { char htname[MAXLEN]; FILE *fp_auth; - struct getwordstruct gwarea; + int i; if(!UserAuthentication) return; @@ -41,11 +41,6 @@ void htaccess(const char *name) exit(1); } - getword_start(&gwarea,Require); - if (getword(buf,sizeof(buf),&gwarea,'%')<0) { - printf("SARG: The \"Require\" entry of your sarg.conf file is too long for your %s file.\n",htname); - exit(1); - } fprintf(fp_auth,"AuthUserFile %s\n",AuthUserFile); if(strchr(AuthName,'\"') == 0) fprintf(fp_auth,"AuthName \"%s\"\n",AuthName); @@ -53,8 +48,13 @@ void htaccess(const char *name) 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); + for (i=0 ; Require[i] ; i++) + if (Require[i]=='%' && Require[i+1]=='u') { + fputs(name,fp_auth); + i++; + } else { + fputc(Require[i],fp_auth); + } fputs("\n\n",fp_auth); fclose(fp_auth);