This is a external authentication module for the Squid External ACL scheme.
It works by reading an user name in the STDIN and matching it against a list of command line specified groups. It accepts up to 10 groups to be specified, this number may be increased by changing the MAX_GROUP define in the source code.
The syntax of the command is as follows:
check_group -g foo [-g bar -g test ...] [-p]
The `-p' options tells the program to verify the primary user group as listed in the /etc/passwd file as well as the groups listed in /etc/group, the default behavior is to match only agains the groups file.
To compile the module, use:
gcc -o check_group check_group.c
Get the source code here: Download
News 29-July-2002:
It's now possible to specify the groups in the acl, so you don't really need to use the -g parameter, allowing you to do things like:
acl ckgroup external ckgroup_helper %LOGIN group1 group2 group3...
The helper will read the first token as the user name and will try to validate it against any other tokens it finds (space delimited).