We had to modify smb auth to get it to work.

I do not remember the changes.

Can you compare to find out what makes it work ?


On Tue, 2004-09-28 at 00:06, Erick Okasaki wrote:
> Hello,
> 
> Someone could help me to install smb_auth + squid??? I want make 
> authentication with smb_auth (samba)!!!
> 
> I try put...
> 
> auth_param program /usr/local/smb_auth/smb_auth -W DOM�NIO -U IP-DO-SERVIDOR
> 
> but not sucess! :-( (obvius, I put the rules "proxy auth" to try 
> authentication on windows)
> 
> Or... I need a tutorial of smb_auth + squid!!!
> 
> thanks,
> Erick Okasaki
-- 
Khawar Nehal

CEO
Applied Technology Research Center (ATRC)
The first and best Linux and OpenSource support company in Pakistan.
C-55 Block A KDA Officers, Karachi 75260, Pakistan
Voice : 92-21-4980523 Mobile : 92-300-9284698
Email : [EMAIL PROTECTED] Coordination : 92-333-2335380 
Fax : 1-734-298-6555 Web : atrc.net.pk
BCS, MCS, LPI, CCNA, CCAI 

Acting Registrar 
Preston Institute of Management, Science and Technology (PIMSAT)
For an education that really helps you.
177/2 IEP Building, Opposite Regent Plaza (Formerly Taj Mahal Hotel) 
Shahrah-a-Faisal, Karachi, Pakistan
Voice : 92-21-7789888 to 90 Fax : 92-21-7789891 
Email : [EMAIL PROTECTED] General Inqiries :
[EMAIL PROTECTED]
Web : pimsat-khi.edu.pk
#!/bin/sh
#
# smb_auth - SMB proxy authentication module
# Copyright (C) 1998  Richard Huveneers <[EMAIL PROTECTED]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

read DOMAINNAME
read PASSTHROUGH
read NMBADDR
read NMBCAST
read AUTHSHARE
read AUTHFILE
read SMBUSER
read SMBPASS

logger smbauth DOMAINNAME $DOMAINNAME
logger smbauth PASSTHROUGH $PASSTHROUGH
logger smbauth NMBADDR $NMBADDR
logger smbauth NMBCAST $NMBCAST
logger smbauth AUTHSHARE $AUTHSHARE
logger smbauth AUTHFILE $AUTHFILE 
logger smbauth smbuseR $SMBUSER
logger smbauth smbPASS $SMBPASS


SAMBAPREFIX=/usr

# Find domain controller
echo "Domain name: $DOMAINNAME"
if [ -n "$PASSTHROUGH" ]
then
  echo "Pass-through authentication: yes: $PASSTHROUGH"
else
  echo "Pass-through authentication: no"
  PASSTHROUGH="$DOMAINNAME"
fi
if [ -n "$NMBADDR" ]
then
  if [ "$NMBCAST" = "1" ]
  then
    addropt="-U $NMBADDR -R"
  else
    addropt="-B $NMBADDR"
  fi
else
  addropt=""
fi
echo "Query address options: $addropt"
dcip=`$SAMBAPREFIX/bin/nmblookup $addropt "$PASSTHROUGH#1c" | awk '/^[0-9.]+ / { print $1 ; exit }'`
echo "Domain controller IP address: $dcip"
[ -n "$dcip" ] || exit 1

# All right, we have the IP address of a domain controller,
# but we need its name too
dcname=`$SAMBAPREFIX/bin/nmblookup -A $dcip | awk '$2 == "<00>" { print $1 ; exit }'`
echo "Domain controller NETBIOS name: $dcname"
[ -n "$dcname" ] || exit 1

# Pass password to smbclient through environment. Not really safe.
USER="$SMBUSER%$SMBPASS"
export USER

# Read the contents of the file $AUTHFILE on the $AUTHSHARE share
authfilebs=`echo "$AUTHFILE" | tr / '\\\\'`
authinfo=`$SAMBAPREFIX/bin/smbclient "//$dcname/$AUTHSHARE" -I $dcip -d 0 -E -W "$DOMAINNAME" -c "get $authfilebs -" 2>/dev/null`
echo "Contents of //$dcname/$AUTHSHARE/$AUTHFILE: $authinfo"

# Allow for both \n and \r\n end-of-line termination
if [ "$authinfo" = "allow" -o "$authinfo" = "allow
" ] 
then
  logger smb_auth exit 0
  exit 0
else
  logger smb_auth exit 1
 exit 1
fi

Reply via email to