From: Frederic Marchal Date: Sat, 19 Sep 2015 13:49:12 +0000 (+0200) Subject: The list of users to include in the report is processed after every aliasing mechanism X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b58ca7214246e9f719ea5ca1f0edfbdf27e99ddd;p=thirdparty%2Fsarg.git The list of users to include in the report is processed after every aliasing mechanism It is more logical to filter the users to include in the report after they have been aliased to the final name. It makes it possible to identify the final user irrespective of the name she happens to have when connecting to the proxy. --- diff --git a/userinfo.c b/userinfo.c index 45d92a8..c502d89 100644 --- a/userinfo.c +++ b/userinfo.c @@ -400,18 +400,6 @@ enum UserProcessError process_user(const char **UserPtr,const char *IpAddress,bo if (strlen(user)>MAX_USER_LEN) return(USERERR_NameTooLong); - // include_users - if (IncludeUsers[0] != '\0') { - char wuser[MAX_USER_LEN+2]=":"; - char *str; - - strcat(wuser,user); - strcat(wuser,":"); - str=strstr(IncludeUsers,wuser); - if (!str) - return(USERERR_Excluded); - } - if (testvaliduserchar(user)) return(USERERR_InvalidChar); @@ -460,6 +448,18 @@ enum UserProcessError process_user(const char **UserPtr,const char *IpAddress,bo *IsIp=false; } + // include_users + if (IncludeUsers[0] != '\0') { + char wuser[MAX_USER_LEN+2]=":"; + char *str; + + strcat(wuser,user); + strcat(wuser,":"); + str=strstr(IncludeUsers,wuser); + if (!str) + return(USERERR_Excluded); + } + if (user[0]=='\0' || (user[1]=='\0' && (user[0]=='-' || user[0]==' ' || user[0]==':'))) return(USERERR_EmptyUser);