---------------------
PatchSet 6617 
Date: 2005/04/25 13:28:29
Author: serassio
Branch: nt-2_5
Tag: (none) 
Log:
Updated win32_check_group to version 1.21

Members: 
	helpers/external_acl/win32_group/readme.txt:1.1.8.9->1.1.8.10 
	helpers/external_acl/win32_group/win32_check_group.c:1.1.8.17->1.1.8.18 
	helpers/external_acl/win32_group/win32_check_group.h:1.1.6.3->1.1.6.4 

Index: squid/helpers/external_acl/win32_group/readme.txt
===================================================================
RCS file: /cvsroot/squid-sf//squid/helpers/external_acl/win32_group/Attic/readme.txt,v
retrieving revision 1.1.8.9
retrieving revision 1.1.8.10
diff -u -r1.1.8.9 -r1.1.8.10
--- squid/helpers/external_acl/win32_group/readme.txt	12 Jun 2004 19:49:26 -0000	1.1.8.9
+++ squid/helpers/external_acl/win32_group/readme.txt	25 Apr 2005 13:28:29 -0000	1.1.8.10
@@ -14,12 +14,13 @@
 Program Syntax
 ==============
 
-win32_check_group [-G][-c][-d][-h]
+win32_check_group [-G][-D domain][-c][-d][-h]
 
--G start helper in Global Group mode
--c use case insensitive compare
--d enable debugging
--h this message
+-G        start helper in Global Group mode
+-D domain specify the default user's domain
+-c        use case insensitive compare
+-d        enable debugging
+-h        this message
 
 
 ================
Index: squid/helpers/external_acl/win32_group/win32_check_group.c
===================================================================
RCS file: /cvsroot/squid-sf//squid/helpers/external_acl/win32_group/Attic/win32_check_group.c,v
retrieving revision 1.1.8.17
retrieving revision 1.1.8.18
diff -u -r1.1.8.17 -r1.1.8.18
--- squid/helpers/external_acl/win32_group/win32_check_group.c	3 Oct 2004 12:49:05 -0000	1.1.8.17
+++ squid/helpers/external_acl/win32_group/win32_check_group.c	25 Apr 2005 13:28:30 -0000	1.1.8.18
@@ -1,7 +1,7 @@
 /*
  * win32_group: lookup group membership in a Windows NT/2000 domain
  *
- * (C)2002,2003 Guido Serassio - Acme Consulting S.r.l.
+ * (C)2002,2005 Guido Serassio - Acme Consulting S.r.l.
  *
  * Authors:
  *  Guido Serassio <guido.serassio@acmeconsulting.it>
@@ -30,6 +30,9 @@
  *
  * History:
  *
+ * Version 1.21
+ * 23-04-2005 Guido Serassio
+ *              Added -D option for specify default user's domain.
  * Version 1.20
  * 13-06-2004 Guido Serassio
  *              Added support for running on a Domain Controller.
@@ -86,7 +89,9 @@
 char *myname;
 pid_t mypid;
 char * machinedomain;
-int use_case_insensitive_compare=0;
+int use_case_insensitive_compare = 0;
+char * DefaultDomain = NULL;
+
 
 #include "win32_check_group.h"
 
@@ -360,7 +365,8 @@
 
     strcpy(NTDomain, UserName);
     if ((domain_qualify = strchr(NTDomain, '\\')) == NULL) {
-	return result;
+	strcpy(User, UserName);
+        strcpy(NTDomain, DefaultDomain);
     } else {
 	strcpy(User, domain_qualify + 1);
 	domain_qualify[0] = '\0';
@@ -479,7 +485,8 @@
 static void
 usage(char *program)
 {
-    fprintf(stderr,"Usage: %s [-G][-c][-d][-h]\n"
+    fprintf(stderr,"Usage: %s [-G][-D domain][-c][-d][-h]\n"
+	    	" -D    default user Domain\n"
 	    	" -G    enable Domain Global group mode\n"
 	    	" -c    use case insensitive compare\n"
 	    	" -d    enable debugging\n"
@@ -493,8 +500,12 @@
     int opt;
 
     opterr = 0;
-    while (-1 != (opt = getopt(argc, argv, "Gcdh"))) {
+    while (-1 != (opt = getopt(argc, argv, "D:Gcdh"))) {
 	switch (opt) {
+	case 'D':
+	    DefaultDomain = xstrndup(optarg, DNLEN);
+            strlwr(DefaultDomain);
+	    break;
 	case 'G':
 	    use_global = 1;
 	    break;
@@ -553,12 +564,14 @@
 	    exit(1);
 	}
 	strlwr(machinedomain);
+        if (!DefaultDomain)
+            DefaultDomain = xstrdup(machinedomain);
     }
 
     debug("External ACL win32 group helper build " __DATE__ ", " __TIME__
     " starting up...\n");
     if (use_global)
-        debug("Domain Global group mode enabled.\n");
+        debug("Domain Global group mode enabled using '%s' as default domain.\n", DefaultDomain);
     if (use_case_insensitive_compare)
         debug("Warning: running in case insensitive mode !!!\n");
 
Index: squid/helpers/external_acl/win32_group/win32_check_group.h
===================================================================
RCS file: /cvsroot/squid-sf//squid/helpers/external_acl/win32_group/Attic/win32_check_group.h,v
retrieving revision 1.1.6.3
retrieving revision 1.1.6.4
diff -u -r1.1.6.3 -r1.1.6.4
--- squid/helpers/external_acl/win32_group/win32_check_group.h	2 May 2003 14:46:50 -0000	1.1.6.3
+++ squid/helpers/external_acl/win32_group/win32_check_group.h	25 Apr 2005 13:28:30 -0000	1.1.6.4
@@ -1,5 +1,5 @@
 /*
- * (C) 2002 Guido Serassio <guido.serassio@acmeconsulting.it>
+ * (C) 2002, 2005 Guido Serassio <guido.serassio@acmeconsulting.it>
  * Based on previous work of Francesco Chemolli, Robert Collins and Andrew Doran
  *
  * Distributed freely under the terms of the GNU General Public License,
