From nobody@FreeBSD.org  Mon Oct  3 02:15:41 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 12A3316A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Oct 2005 02:15:41 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id B54B743D45
	for <freebsd-gnats-submit@FreeBSD.org>; Mon,  3 Oct 2005 02:15:40 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j932FeUK021473
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 3 Oct 2005 02:15:40 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j932Fer4021472;
	Mon, 3 Oct 2005 02:15:40 GMT
	(envelope-from nobody)
Message-Id: <200510030215.j932Fer4021472@www.freebsd.org>
Date: Mon, 3 Oct 2005 02:15:40 GMT
From: "Dean M. Phillips" <dmphilli@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] port www/squid builds smb_auth with the wrong path to samba
X-Send-Pr-Version: www-2.3

>Number:         86850
>Category:       ports
>Synopsis:       [patch] port www/squid builds smb_auth with the wrong path to samba
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    mnag
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 03 02:20:14 GMT 2005
>Closed-Date:    Thu Oct 06 18:48:43 GMT 2005
>Last-Modified:  Thu Oct 06 18:48:43 GMT 2005
>Originator:     Dean M. Phillips
>Release:        FreeBSD 5.4-STABLE #2: Tue Aug  2 19:52:40 CDT 2005
>Organization:
None Whatsoever!
>Environment:
FreeBSD deanstoy 5.4-STABLE FreeBSD 5.4-STABLE #2: Tue Aug  2 19:52:40 CDT 2005     netadmin@deanstoy:/usr/obj/usr/src/sys/DEANSTOY  i386

Port version: squid-2.5.11_1

>Description:
The www/squid autoconfig program does not test for the actual configuration of the net/samba smbclient program.  Instead it hardcodes it to /usr/local/samba, while net/samba installs in /usr/local by default.  Since smb_auth can not execute smbclient, it returns a failure every time denying all users access to the cache.
>How-To-Repeat:
Set up proxy auth using smb_auth as instructed in the port documentation.

>Fix:
This 'fix' is really a bandaid, but it worked for me :)

Replace patch-helpers-basic_auth-SMB-smb_auth.sh with:

*** helpers/basic_auth/SMB/smb_auth.sh.orig	Sun Jan  7 17:36:46 2001
--- helpers/basic_auth/SMB/smb_auth.sh	Sun Oct  2 20:55:30 2005
***************
*** 17,22 ****
--- 17,24 ----
  # along with this program; if not, write to the Free Software
  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  
+ SAMBAPREFIX=${SAMBAPREFIX:-/usr/local}
+ 
  read DOMAINNAME
  read PASSTHROUGH
  read NMBADDR

Add patch-helpers-basic_auth-SMB-Makefile.am:
*** helpers/basic_auth/SMB/Makefile.am.orig	Sun Oct  2 20:43:34 2005
--- helpers/basic_auth/SMB/Makefile.am	Sun Oct  2 20:44:22 2005
***************
*** 14,20 ****
  ## FIXME: autoconf should test for the samba path.
  
  SMB_AUTH_HELPER	= smb_auth.sh
! SAMBAPREFIX=/usr/local/samba
  SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
  
  libexec_SCRIPTS	= $(SMB_AUTH_HELPER)
--- 14,20 ----
  ## FIXME: autoconf should test for the samba path.
  
  SMB_AUTH_HELPER	= smb_auth.sh
! SAMBAPREFIX=/usr/local
  SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
  
  libexec_SCRIPTS	= $(SMB_AUTH_HELPER)

Add patch-helpers-basic_auth-SMB-Makefile.in:
*** helpers/basic_auth/SMB/Makefile.in.orig	Sun Oct  2 20:43:47 2005
--- helpers/basic_auth/SMB/Makefile.in	Sun Oct  2 20:44:44 2005
***************
*** 129,135 ****
  makesnmplib = @makesnmplib@
  
  SMB_AUTH_HELPER = smb_auth.sh
! SAMBAPREFIX = /usr/local/samba
  SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
  
  libexec_SCRIPTS = $(SMB_AUTH_HELPER)
--- 129,135 ----
  makesnmplib = @makesnmplib@
  
  SMB_AUTH_HELPER = smb_auth.sh
! SAMBAPREFIX = /usr/local
  SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
  
  libexec_SCRIPTS = $(SMB_AUTH_HELPER)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: mnag 
State-Changed-When: Mon Oct 3 03:19:18 GMT 2005 
State-Changed-Why:  
Ask for maintainer approval. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86850 

From: Marcus Alves Grando <mnag@FreeBSD.org>
To: bug-followup@FreeBSD.org,  tmseck@netcologne.de
Cc:  
Subject: Re: ports/86850: [patch] port www/squid builds smb_auth with the
 wrong path to samba
Date: Mon, 03 Oct 2005 00:19:11 -0300

 Dear maintainer,
 
 Do you approve this update?
 
 http://www.freebsd.org/cgi/query-pr.cgi?pr=86850
 
 Thanks
 
 -- 
 Marcus Alves Grando
 marcus(at)corp.grupos.com.br  |  Grupos Internet S/A
   mnag(at)FreeBSD.org         |  FreeBSD.org

From: Thomas-Martin Seck <tmseck@netcologne.de>
To: bug-followup@freebsd.org, mnag@freebsd.org, dmphilli@gmail.com
Cc:  
Subject: Re: ports/86850: [patch] port www/squid builds smb_auth with the wrong path to samba
Date: Mon, 3 Oct 2005 15:59:47 +0200

 (Somehow the feedback request mail did not reach me yet; I've noticed
 the PR while checking portsmon.)
 
 Hi,
 
 thanks for pointing this out; I do not use smb_auth myself and
 appreciate your report.
 
 However, I prefer the patch below (we do not need to mess around
 with the .in an .am files when we can fix the script directly).
 
 I also removed the hardcoded /usr/local assumption for ${LOCALBASE}
 while at it.
 
 Dean, could you try the patch below and see whether it works for you?
 
 If it does, this patch should be committed.
 
 Index: files/patch-helpers-basic_auth-SMB-smb_auth.sh
 ===================================================================
 --- files/patch-helpers-basic_auth-SMB-smb_auth.sh	(revision 587)
 +++ files/patch-helpers-basic_auth-SMB-smb_auth.sh	(revision 588)
 @@ -6,7 +6,7 @@
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    
 -+ SAMBAPREFIX=${SAMBAPREFIX:-/usr/local/bin}
 ++ SAMBAPREFIX=${SAMBAPREFIX:-%%LOCALBASE%%}
  + 
    read DOMAINNAME
    read PASSTHROUGH
 Index: Makefile
 ===================================================================
 --- Makefile	(revision 587)
 +++ Makefile	(revision 588)
 @@ -70,7 +70,7 @@
  
  PORTNAME=	squid
  PORTVERSION=	2.5.11
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	www
  MASTER_SITES=	\
  		ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
 @@ -348,6 +348,8 @@
  	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
  	@${REINPLACE_CMD} -e 's|%%SQUID_UID%%|${SQUID_UID}|g' \
  	    -e 's|%%SQUID_GID%%|${SQUID_GID}|g' ${WRKSRC}/src/cf.data.pre
 +	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 +	    ${WRKSRC}/helpers/basic_auth/SMB/smb_auth.sh
  
  pre-install:
  # Prevent installation of .orig files by deleting them.
Responsible-Changed-From-To: freebsd-ports-bugs->mnag 
Responsible-Changed-By: mnag 
Responsible-Changed-When: Mon Oct 3 15:36:06 GMT 2005 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86850 
State-Changed-From-To: feedback->open 
State-Changed-By: mnag 
State-Changed-When: Mon Oct 3 15:36:25 GMT 2005 
State-Changed-Why:  
Feedback received. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86850 

From: Thomas-Martin Seck <tmseck@netcologne.de>
To: bug-followup@freebsd.org
Cc: dmphilli@gmail.com
Subject: Re: ports/86850: [patch] port www/squid builds smb_auth with the wrong path to samba
Date: Thu, 6 Oct 2005 19:21:02 +0200

 As Glen pointed out to me offline, the previous patch is not enough
 because SAMBAPREFIX is hardcoded at compile time into ${PREFIX}/libexec/
 smb_auth which calls smb_auth.sh with SAMBAPREFIX defined.
 
 Setting a sane default for SAMBAPREFIX is in my opinion a good thing
 nonetheless so I decided to keep
 files/patch-helpers-basic_auth-SMB-smb_auth.sh and correct an obvious
 bug no one seems to have noticed :)
 
 Added file:
 files/patch-helpers-basic_auth-SMB-Makefile.in
 
 This patchset was tested by Glen and confirmed to work ok:
 
 Index: files/patch-helpers-basic_auth-SMB-smb_auth.sh
 ===================================================================
 --- files/patch-helpers-basic_auth-SMB-smb_auth.sh	(.../www/squid)	(revision 589)
 +++ files/patch-helpers-basic_auth-SMB-smb_auth.sh	(.../local/squid)	(revision 589)
 @@ -6,7 +6,7 @@
    # along with this program; if not, write to the Free Software
    # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
    
 -+ SAMBAPREFIX=${SAMBAPREFIX:-/usr/local/bin}
 ++ SAMBAPREFIX=${SAMBAPREFIX:-%%LOCALBASE%%}
  + 
    read DOMAINNAME
    read PASSTHROUGH
 Index: files/patch-helpers-basic_auth-SMB-Makefile.in
 ===================================================================
 --- files/patch-helpers-basic_auth-SMB-Makefile.in	(.../www/squid)	(revision 0)
 +++ files/patch-helpers-basic_auth-SMB-Makefile.in	(.../local/squid)	(revision 589)
 @@ -0,0 +1,11 @@
 +--- helpers/basic_auth/SMB/Makefile.in.orig	Tue Oct  4 07:29:26 2005
 ++++ helpers/basic_auth/SMB/Makefile.in	Tue Oct  4 07:29:49 2005
 +@@ -129,7 +129,7 @@
 + makesnmplib = @makesnmplib@
 + 
 + SMB_AUTH_HELPER = smb_auth.sh
 +-SAMBAPREFIX = /usr/local/samba
 ++SAMBAPREFIX = %%LOCALBASE%%
 + SMB_AUTH_HELPER_PATH = $(libexecdir)/$(SMB_AUTH_HELPER)
 + 
 + libexec_SCRIPTS = $(SMB_AUTH_HELPER)
 Index: Makefile
 ===================================================================
 --- Makefile	(.../www/squid)	(revision 589)
 +++ Makefile	(.../local/squid)	(revision 589)
 @@ -70,7 +70,7 @@
  
  PORTNAME=	squid
  PORTVERSION=	2.5.11
 -PORTREVISION=	1
 +PORTREVISION=	2
  CATEGORIES=	www
  MASTER_SITES=	\
  		ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \
 @@ -348,6 +348,9 @@
  	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
  	@${REINPLACE_CMD} -e 's|%%SQUID_UID%%|${SQUID_UID}|g' \
  	    -e 's|%%SQUID_GID%%|${SQUID_GID}|g' ${WRKSRC}/src/cf.data.pre
 +	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
 +	    ${WRKSRC}/helpers/basic_auth/SMB/Makefile.in \
 +	    ${WRKSRC}/helpers/basic_auth/SMB/smb_auth.sh
  
  pre-install:
  # Prevent installation of .orig files by deleting them.

From: Thomas-Martin Seck <tmseck@netcologne.de>
To: bug-followup@freebsd.org
Cc: dmphilli@gmail.com
Subject: Re: ports/86850: [patch] port www/squid builds smb_auth with the wrong path to samba
Date: Thu, 6 Oct 2005 19:27:38 +0200

 > As Glen pointed out to me offline, the previous patch is not enough
 > because SAMBAPREFIX is hardcoded at compile time into ${PREFIX}/libexec/
 > smb_auth which calls smb_auth.sh with SAMBAPREFIX defined.
 
 Doh, the submitter's first name is *Dean*. No cookie for me.
 
 Sorry Dean and thanks for helping me fixing this!
State-Changed-From-To: open->closed 
State-Changed-By: mnag 
State-Changed-When: Thu Oct 6 18:48:42 GMT 2005 
State-Changed-Why:  
Fixed. Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=86850 
>Unformatted:
