From b58ca7214246e9f719ea5ca1f0edfbdf27e99ddd Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Sat, 19 Sep 2015 15:49:12 +0200 Subject: [PATCH] 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. --- userinfo.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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); -- 2.47.2