]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Allow backslash as the domain/user separator
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 14 Jun 2012 08:04:25 +0000 (10:04 +0200)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 14 Jun 2012 08:04:25 +0000 (10:04 +0200)
For NTLM users, the domain and user names may be separated by a + or a \\
as pointed out by mrac33:
(http://sourceforge.net/tracker/index.php?func=detail&aid=3532108&group_id=68910&atid=522791)

For compatibility reasons, the _ separator is still retained.

Thanks to mrac33 for reporting and fixing this bug.

log.c

diff --git a/log.c b/log.c
index bcc1aedbac592006e43600792847fcb108da2b31..6bc1b68e356af0b48b60142e9908cdf99a03a9f0 100644 (file)
--- a/log.c
+++ b/log.c
@@ -1378,11 +1378,7 @@ int main(int argc,char *argv[])
                                } else {
                                        strlow(user);
                                        if(NtlmUserFormat == NTLMUSERFORMAT_USER) {
-                                               if((str = strchr(user,'_')) != 0) {
-                                                       strcpy(warea,str+1);
-                                                       strcpy(user,warea);
-                                               }
-                                               if((str = strchr(user,'+')) != 0) {
+                                               if ((str=strchr(user,'+'))!=NULL || (str=strchr(user,'\\'))!=NULL || (str=strchr(user,'_'))!=NULL) {
                                                        strcpy(warea,str+1);
                                                        strcpy(user,warea);
                                                }